Before you use the XMA Guidesigner be sure, that all the stuff - especially the plugin installation - descriped in the Install topic has been done properly.
The next step is open an existing XMA project or to create a new one with the XMA Project Creation Wizard (see also Project Creation). Now we are ready to create a XMA component.
To create a new XMA component you have to
select some project resource in your eclipse navigator - or package explorer view
select menu File.New.Other
select the XMA wizard category on the left side of the new wizard
select the XMA component creation wizard on the right side of the new wizard and go to next wizard page
Now you see the following wizard page:
Insert the package name and class name of your XMA component. It is only possible to have one XMA component per package. If you have inserted the names press finish.
Eclipse creates an XMA file and open it with the Guidesigner.
With the property Language of the Component object you can assign what default resource bundle will be generated. If the 'FALLBACK' value is selected, the fallback resource bundle without language and country extensions will be generated. Detailed information about components you can find in the Component Description(XMA Component).
Once you have opened the XMAa file with Guidesigner you will probably see the following eclipse editor and views:
Don't panic if you can't see some of the views. You only have to define the correspondent views within the Window.ShowView menu and ajust the viewers according your needs. To learn more about the workbench components used with the Guidesigner see theGuidesigner Overview(Guidesigner Overview).
Now it is time to fill the component with content. As mentioned above the most important view to create components content is the Ouline view. Select the component item in the Outline and open the context menu with the right mouse button. Now select the 'New Child' menu and in this menu select the XMA page type that you want to insert. At this time we select a dialog page. Detailed information about page types you can find in the Guidesigner Model Topic(Reference A: Guidesigner Model).
Now the 'New Page' Dialog appears. In this Dialog it is possible to edit all name attributes that are associated with a Page. As default names 'Unnamed' is stated.
For simpler handling it is assumed, that all other names are derivable from the Class Name. Therefore if you change the Class Name and press the tabulator key, all other names will be automatically adapted.
This feature exists for all other 'New' dialogs and Wizards.
After pressing the 'OK' button a new XMA dialog page with a corresponding XMA composite is created. Let's have a look what we see in the Guidesigner.
In the Outline view the newly created dialog page is selected. In our example it is called 'MyDialog'. But let's take a look to the Property view. It shows us the actual attribute settings of 'MyDialog' in a table in alphabetical order. The first column of the table contains the attribute names. The second column of the table contains the attribute values.
In our example we want to change the height attribute of the dialog. Select the appropriate attribute value in the Property View with the mouse. Now we can change the value.
You can find a detailed description about the meaning of the properties in theXMA Dialogpage description(XMA Dialog Page).
As next step in our example we want to create a tree widget in the Guidesigner. For this purpose we select the 'MyDialogComp' XMA composite, which was created automatically on dialog page creation. The XMA composite is necessary as container for all further created widget in the dialog page.
Open the context menu of 'MyDialogComp' (right mouse click) and select the 'New Child' entry. Now you will see all widget types, that may be inserted in a XMA composite. Detailed information about this types you can find in theGuidesigner Model Topic(Reference A: Guidesigner Model).
Select the tree menu entry and the 'New Widget Wizard' appears. The first wizard page is similar to the 'New Page' Dialog. It holds the name attribute information. Input 'tree' as the Instance Name of our tree widget.
Press the 'Next' button. Now the second wizard page appears, where we have to input the layout information of the tree widget. For our simple example, we want to attach the tree widget on the left and upper side of it's parent the MyDialogComp. This is done like in the picture below:
Learn more about layouting widgets with the XMA Guidesigner in topicLayouting with the Guidesigner(Layouting with the Guidesigner).
Press 'Finish' to complete the wizard. If you take a look at the Previewer you'll see the following content:
Now the Previewer contains the with the 'highlighted' tree widget. Now it is time to save the work that was done so far. Simple save our modification with the save button of eclipse.
At this time we have build a simple dialog with one widget and saved it in a xml file. To produce runnable code we have to generate it. First select the content in the Previewer and than select the GUIDesigner.Generate.Generate Component menu entry.
Get more information about the generated code in Generation Overview(Generated Base Classes of the Page)
At generation of a Component
two Java packets are generated, one for the client side (which is
transferred to the client) and one for the server side (which is
deployed at the server). The basis packet in which the component is
created can be freely chosen. As in one packet only one XMA-component
can exist it its a good idea to name the basis packet like the component
(for example at.spardat.sample.mycomponent). In the following example
the generated classes are described, assuming that an XMA-component
MyComponent with one page MyDialogPage was
declared in the GUI designer:
at.spardat.sample.mycomponent.client
IMyComponent
This interface is always regenerated at XMA-component
generation. It defines the XMA-component's public getter and setter
and a String attribute COMPONENT_NAME which can be used
to create the component.
MyComponent
The XMA-component itself. This class is only changed by the developer and not regenerated at XMA-component generation. The generated first cut calls the XMA-Page first declared in the GUI designer and can be changed to own needs.
MyComponentGen
The super class of MyComponentGen. It is always
regenerated at XMA-component generation and hosts XMA methods like
XMA-component's getter and setter.
MyDialogPage
Here the application specific code (like RPC calls, grey logic) is programmed. This class is only changed by the developer and not regenerated at XMA-component generation.
MyDialogPageGen
The super class of MyDialogPage. This calls hosts
the SWT widgets and controls as well as the XMA client widget models
defined in the GUI designer.
at.spardat.sample.mycomponent.server
MyComponent
The XMA-component itself. This class is only changed by the developer and not regenerated at XMA-component generation. The generated first cut only implements a constructor. This is the place to define variables common for several pages or to declare RPC methods implementations.Often this class remains empty.
MyComponentGen
The super class of MyComponentGen. It is always
regenerated at XMA-component generation and hosts XMA methods like
XMA-component's getter and setter.
MyDialogPage
Here the RPC implementation methods calling the application specific code are programmed. This class is only changed by the developer and not regenerated at XMA-component generation.
MyDialogPageGen
The super class of MyDialogPage. This calls
hosts XMA server widget models defined in the GUI designer.