Eclipse Visual Editor Project 1.1 M2 - New and Noteworthy


Support for Eclipse 3.1 RC1
The Visual Editor is now compatible with Eclipse 3.1 RC1, GEF 3.1 RC1 and EMF 2.1.

Enhanced RCP support
The Visual Editor now supports the creation and editing of an RCP EditorPart as well as a ViewPart in an RCP enabled plugin project.

rcp-editorpart-dialog.png


The template created has a default Composite that can be used as the EditorPart's client area

rcp-editorpart-ff.png  rcp-editorpart-tree.png

rcp-editorpart-code.png

To compose the ViewPart select SWT controls from the palette as described in Help > Contents and Using the visual editor for Java

If the ViewPart or EditorPart opened by the Visual Editor is defined in the project's plugin.xml with the appropiate Eclpse extension points then the declared name and icon declared are detected and used.

 <extension
         point="org.eclipse.ui.views">
      <view
            name="Messages"
            icon="icons/sample2.gif"
            class="mailTempate.View">
      </view>
 </extension>




If no entry exists in the plugin.xml then the title shown is the name of the class and a default graphic is used.


Cut/Copy/Paste implementation

The Visual Editor now brings the popular mechanism of cut/copy/paste to UI development. Users can cut or copy a graphical component into the clipboard, and pasting it would load the cursor with the cut/copied component for dropping. The actions are available from context-menus, toolbar and keyboard shortcuts.

If Paste is used in the graphical editor then the cursor is loaded with the clipboard object, allowing it to be ropped over the target area in the same fashion as if a new object is chosen from the palette.  If Paste is used in the JavaBeans viewer then it occurs immediately over the selected object, allowing rapid keyboard copy and paste of objects using the keyboard arrow keys and accelerators in combination.

menu-copy.png

menu-cut.png

paste-menu.png

paste-loadedcursor.png


paste-result.png


Grid layout enhancements

The Visual Editor provides improved handling of Grid layout via new feedback and customization mechanisms.


Grid layout feeback is now shown by default in both SWT and Swing containers having respective grid layouts. The feedback is shown either on selection or during the adding of a child.

ShellApp-Gridlayout.png


There is an improved customization dialog for components in SWT GridLayout. Components can now have their indentation and hints set from the dialog itself. Also its now possible to reset changes to the default values using the new dialog.

CustomizeSWTGridLayout-Component1.png


X/Y layout enhancements

The Visual Editor provides improved handling of X/Y layout via new feedback and customization mechanisms.


X/Y layout feeback is now shown by default in both SWT and Swing containers having no layout set. The feedback is shown either on selection or during the adding of a child.

nullFeedback-drop.png


The Customize Layout dialog allows the user to customize this feedback.

CustomizeLayoutDialog_null_1.png

where

null_snapToGrid.png
null_snaptogrid_feedback.png
null_widthheight.png
null_gridwidthheight.png
null_margin_dialog.png
null_margin_feedback.png


The Visual Editor's preference page also has an option to set the workspace default width and height of the grid
NullLayout_preferences.png


Prompt for name

The Visual Editor now by default prompts for a bean name when creating an instance.

beanname-dialog.png

This can be turned off either by clicking on the Do not ask again checkbox, or in the preferences of the Visual Editor

beanname-preferences.png

Turning off this prompt shows the bean name entry in the ChooseBean dialog

beanname-choosebean.png

Improved rename dialog

The Visual Editor now has an improved rename dialog which is capable of renaming multiple beans at once

rename-menu.png

rename-dialog.png


Improved SWT container support

The Visual Editor now supports various configurations for using SWT, namely
  • IDE Platform: Uses SWT jars provided in the current IDE's SWT plugins (Eclipse 3.0.x and 3.1.x only).
  • PDE Target: Uses SWT jars provided in the Plug-in development's target platform SWT plugins (Eclipse 3.0.x and 3.1.x only).
  • Custom location: Uses the SWT classes and native libraries present in the provided directory location.

swtcontainer-dialog.png

SWT Custom Controls support

The Visual Editor now supports new SWT Custom Controls which have been added to the palette.

cLabel.png
org.eclipse.swt.custom.CLabel
ccombo.png
org.eclipse.swt.custom.CCombo
cTabFolder.png
org.eclipse.swt.custom.CTabFolder
sashform.png
org.eclipse.swt.custom.SashForm
scrolledComposite.png
org.eclipse.swt.custom.ScrolledComposite
styledText.png
org.eclipse.swt.custom.StyledText



Improved editor state persistence
The Visual Editor now persists the user's customizations per editor.
Persisted are :
  • Expanded/collapsed states of palette categories
  • Push pin status of palette categories
  • Location of the sash separating UI and source in the editor
  • Property sheet column widths

persist2.png

Performance Phase-II

The Visual Editor now has improved performance in handling Swing components by implementing batching (82257) of communication with the remote VM, which reduces socket delays and increases response time significantly. Details of the current state of the performance effort can be found here.

Improved Java bean customizer support

Customizers are a way in the JavaBeansTM specification of defining a component architecture whereby tools (such as the Visual Editor) can consume a class and provide a rich edit time experience.   They are defined by creating a BeanInfo for a class and specifying the customizer class name as part of the BeanDescriptor.  The customizer should implement java.beans.Customizer and extend from java.awt.Component to provide a GUI that allows modifcation of the bean's state.  If a customizer is defined the  pop-up menu will enabled the "Customize Java Bean" option.



The customizer is launched and given the object and is responsible for updating its property values. 

By default the customizer java.awt.Component is hosted inside a frame that has OK and Cancel buttons.  If OK is pressed then the Visual Editor has to determine what properties have changed so that the correct set methods can be added to the Java source.  This is done by comparing the property values before the customizer was launched against the values present when the customizer is closed, and for any that have changed the java.beans.PropertyEditor for each is used to get a Java initialization String.  If Cancel is pressed then the bean is rolled back to its previous state by using the property values as they were when the customizer was launched.



Some customizers wish to exericse more control themselves over what represents a transaction to them and not have the Visual Editor put OK and Cancel button.  This can be achieved by specifying a value on the BeanDescriptor with a key of EXPLICIT_PROPERTY_CHANGE and a Boolean value.

public BeanDescriptor getBeanDescriptor(){
      BeanDescriptor result = new BeanDescriptor(Area.class,AreaCustomizer.class);
      result.setValue("EXPLICIT_PROPERTY_CHANGE",Boolean.TRUE);
      return result;
}

In this case the OK and Cancel buttons are not added and the Visual Editor will listen to property change events fired by the customizer.  For example, if the customizer above modifies a property called fillColor each time the list's selection changes it should call the method

firePropertyChangeEvent("fillColor", newFillColor , oldFillColor);

The Visual Editor listens for the events and will update the Java source code immediately an event is fired.