The visual editor for Java™ is a code-centric Java editor that helps you design applications that have a graphical user interface (GUI). The visual editor is based on the JavaBeans™ component model and supports visual construction using the Standard Widget Toolkit (SWT), the Abstract Window Toolkit (AWT), or Swing.
The visual editor is designed to work with .java source files, allowing you to edit the source and work on the visual design simultaneously. The visual editor does not have its own perspective. If you use the visual editor in the Java perspective of RAD, the visual editor for Java uses any customization that you have made to the position of the Tasks view, the Console view, and the Outline view.
You can use the visual editor for Java to create a visual class using a wizard, and then design the class using visual components, or Java Beans, from a design palette. This class can be an executable application (a class with a main method) or it can be a Java bean that you intend to include in another class.
The visual editor helps you develop applications using Standard Widgets Toolkit (SWT).
When you use the visual editor to create a new visual class based on an SWT composite or shell, the SWT library is added to the project's Java build path, and the visual editor palette will include the supported SWT controls and containers. You can also manually add the library on the Java Build Path page of the project properties (right-click the project and select Properties. SWT controls and containers can only be used with SWT applications.
The Standard Widget Toolkit provides a set of beans that facilitate the development of the transaction panel. These beans are the subclasses of SWT beans. You can extend the behavior of visual beans developed in the Visual Editor with new behavior that is frequently needed in teller applications.
Following is the architectural diagram for Visual Beans Editor:
Following is screen capture showing the SWT Visual Beans enhanced Visual Editor:
You can drag the visual beans from the palette and drop them to the graphical editors. Then you can generate code in the code editor.
You can modify the position, width and height of each SWT widget. The code in the code editor will be changed correspondingly.
The content of this editor is the Java code related to your transactional panel. Most of the code is generated by this tool. You can also modify the code, and when you modify the code, the Graphical editor may refresh its view.
You can modify the properties of the widgets in the property view, then the code editor will generate the new code, and if your changes are related to UI, then the Graphical editor will also refresh its view. The values of each property are initialized from the code.
Property editor is invoked by the property view. The value of simple properties, such as String and Integer, can be easily changed by editing the property fields, but the value of complex properties, such as color and font, can only be changed by the property editor.
The initial value of property editor comes from the Java code. According to the analysis of Java code, the initial values can be set in the property editor. When you modify the values in property editor, the code editor will generate new code at the same time.
For more information about the visual editor, see the Rational® Application Developer documentation about visual editor.