The idea : make existing code easier to read/understand by :
- hiding/replacing by a compact placeholder what the user does not need to see (accessors, equals()..)
- using more intuitive syntax (for ..)
|
Recommendation: for optimal result, you should change IDEA's folding foreground and background colours, to match the examples illustrated below. The default colours don't work well with this plugin.
This plugin adds 21 intentions to IDEA :
Camouflage current or all the class'
- ..type cast .
- ..final keyword
- ..for statement parameters .
- ..throws exceptions list.
- ..log4j statement that follow the "isEnabled" pattern.
- ..array initializers.
Camouflage all the class'
- ..constructors .
- ..accessors
- ..canonicals (equals(), hashCode(), toString()).
- ..empty methods
Fold all the class'
- ..1-liners .
- ..for, while, if, try .
"Flattenize" current or all the class' methods
( this implements the request 14903)
Option : execute a "Flattenize all the class methods" each time you call "Collapse All"
Misc :
- ..remove 1/all the camouflages .
Experimental :
Camouflage
- ..if (condition) return value .
Note: 'camouflage' only changes the way code is displayed; it doesn't reformat nor rewrite it.
- in IDEA plugin manager, category "Intention", install the 'CamouflagePlugin', and restart
- place the caret in a class name
- press [Alt-enter]
- accept the "Camouflage All All" intention.
- in the IDE settings, check the 'Camouflage Plugin' config dialog and release notes.
The configuration ui, in IDE settings, contains the release notes, tips, warnings, bugs and current limitations.
By default, this action executes all the intentions on the entire class, in 1 go.
You can remove intentions through the configuration ui, in the IDE settings :
 |
 |
 |
| todo: add more illustrations here. |
- place the cursor in a type cast, or on a 'final' keyword.
- press [Alt-Enter]
v0.10 :
new :
- Automatic mode: each time you open a new editor, a set of folding and camouflaging intentions is automatically executed.
- Enhanced "Collapse All" ( automatically flattenize the methods, before collapsing them)
- config ui: now contains the release notes, tips, warnings, bugs and limitations.
v0.9 :
new :
v0.8 :
bug fix :
- "Kill all xxx" removed valid methods folding area.
To repair the damages : cut and repaste in place the whole class/method
[Ctrl-A]
[Ctrl-X]
[Ctrl-V]
New
- fold misc statements :
- for, while, if, try/catch/finally
v0.7 :
improved :
added folding:
- fold 1/all array initializer(s)
- ex
- String s[] = {"a","b","c"};
added camouflage:
- camouflage empty methods
- kill (remove) existing camouflage(s)
v0.6 : added
- camouflage log4j statements that follow a pattern :
- only 1 line in the then branch
- same level in the condition, and in the then statement
Example: will be camouflaged
if (aLogger.isEnabledFor(Level.<XXX>) ){
aLogger.xxx ("message", ..)
}
or
if (aLogger.isDebugEnabledFor() ){
aLogger.log(Level.XXX, "message", ..)
}
Example: will NOT be camouflaged
if (aLogger.isEnabledFor(Level.ALL) ){
aLogger.debug ("message", ..)
}
v0.5 : added
- camouflage throws exceptions lists
- configuration ui (in IDE settings)
v0.4b : recompiled for build 944
v0.4 : added
- camouflage constructors
- camouflage accessors (getters, setters)
- camouflage canonicals (equals(), hashCode(), toString)
- camouflage parameter list
- fold 1-liners
experiment
- camouflage if (condition) return some_result ;
v0.3 :
- feature : camouflage for loops parameters
v0.2 : initial version
- feature : camouflage type casts and the final keyword.
- camouflage if, collections in for
- add configuration options : class to exclude, symbol replacer, ..
-- AlainRavet - 24 Sep 2003
|
|