Code Generation Styles

Designer supports a wide variety of code generation styles and can emulate most other Java GUI builders including NetBeans, JBuilder, the Eclipse Visual Editor, etc. Choose a Variable Generation style (Local, Field, Accessor or Initialized Field) and a Statement Generation style (Flat or Block) from the Code Generation preference page. Many additional options can be set via other preference pages. 

You can also specify in which method components will be created by default (in the event that a suitable method has not already be defined for the current class). If the method does not exist, it will be created and a call to it added to the constructor for the class. Various default choices are provided to match the code generation patterns of other GUI builders.

Variable generation

Designer supports several Variable Generation styles including Local, Field, Accessor or Initialized Field.

Local Variable Mode

In the Local variable generation style, each component is assigned to a unique local variable and initialized at the point of declaration. An option is provided on the Local Variables preference page to declare each variable as final. Note that component types marked as As Field on the Type Specific preference page will always be assigned to fields.

Local Variables / Flat Mode
Final Local Variables / Flat Mode
Local Variables / Block Mode
Final Local Variables / Block Mode

Field Mode

In the Field generation style, each component is assigned to a unique field and initialized at the point where it is first used. An option is provided on the Variable Names preference page to prefix each field reference with this.

Fields / Flat Mode
This Fields / Flat Mode
Fields / Block Mode
This Fields / Block Mode

Accessor Mode (Swing Only)

In the Accessor generation style, each component is created in its own unique getXXX() method. An option is provided to set the visibility modifier to private, package private, protected or public.

Accessor Private Mode
Accessor Public Mode

Initialized Field Mode (Swing Only)

In the Initialized Field generation style, each component is assigned to a unique field and initialized at the point at the point of declaration. An option is provided on the Variable Names preference page to prefix each field reference with this.

Initialized Fields / Flat Mode
Initialized This Fields / Flat Mode
Initialized Fields / Block Mode
Initialized This Fields / Block Mode

Statement generation

Designer supports flat mode and block mode generation modes.

Flat Mode

In flat mode, each component is created in the same scope at the same indentation level. An option is provided to prefix the creation of each component with either a blank line or a comment.

Block Mode

In block mode, each component is created in its own scoped code block. Child components are created in nested blocks.

Local Variables / Flat Mode
Local Variables / Block Mode
Fields / Flat Mode
Fields / Block Mode