IntelliJ Community . CamouflagePlugin

 
CamouflagePlugin 

HOME INDEX SEARCH CHANGES GO  
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.


Quickstart :

  1. in IDEA plugin manager, category "Intention", install the 'CamouflagePlugin', and restart
  2. place the caret in a class name
  3. press [Alt-enter]
  4. accept the "Camouflage All All" intention.
  5. 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 :


Example :

todo: add more illustrations here.


How to install :

How to use :

  • place the cursor in a type cast, or on a 'final' keyword.
  • press [Alt-Enter]


Version :

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 :

  • more ui configs
  • bugfixes

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.

To Do

  • camouflage if, collections in for
  • add configuration options : class to exclude, symbol replacer, ..

Bugs


-- AlainRavet - 24 Sep 2003

IntelliJPluginWebForm
IntelliJPluginName: CamouflagePlugin
IntelliJPluginVersion: 0.10
IntelliJPluginVendor: Alain Ravet
IntelliJPluginBinary:
IntelliJPluginSource:
IntelliJPluginClassification: CodeHelper?
TopicClassification: IntelliJPluginPackage
TopicShortDescription: Adds camouflage, folding and flattenizing intentions to IDEA. Enhances 'Collapse All'
TestedOnOS: OsWinXP
ShouldRunOnOS: AnyOS

Attachment: sort Action: Size: Date: Who: Comment:
CamouflageIntentions.jar action 159992 01 Nov 2003 - 20:32 AlainRavet jar v0.10b, for build 957 (?944)

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.