About this task
This section mainly describes the structure of UI description file.
It uses Element Factory as its explication engine. It is highly recommended
you to create and modify XUI file using XUI editor instead of XML editor.
Sample
UI description file:
<XUI>
<Composite bounds="74,61,590,366" id="errorComposite">
<Label bounds="38,33,492,29" text="Cancel Confirmation"
font="arial,15,NORMAL" background="0,128,192"
foreground="255,255,255" alignment="CENTER">
</Label>
<Label bounds="70,121,439,29"
text="Are you sure to cancel your request?">
</Label>
<Button bounds="107,214,80,25" text="Yes">
<list Injection="actions">
<com.ibm.btt.rcp.xui.action.StateChangeAction
state="ok">
</com.ibm.btt.rcp.xui.action.StateChangeAction>
</list>
</Button>
<Button bounds="281,214,80,25" text="No">
<list Injection="actions">
<com.ibm.btt.rcp.xui.action.StateChangeAction
state="cancel">
</com.ibm.btt.rcp.xui.action.StateChangeAction>
</list>
</Button>
</Composite>
</XUI>
- Tags: Tag Composite, Label are all widgets, their corresponding class
are specified in XUI global setting file. XUI engine will instance the widgets
when analyze these tags.
- Attributes:
<Label bounds="38,33,492,29" text="Cancel Confirmation"
font="arial,15,NORMAL" background="0,128,192"
foreground="255,255,255" alignment="CENTER">
</Label>
Bounds, text, font, background, foreground, and alignment are
all properties. It will inject these properties to the widget instance.
- Compose: All widgets which implements IXUIComposite interface can includes
sub-Tags, that means it can instance sub-widgets as its children. The relationship
between IXUIComposite and IXUIWidget are defined in “com.ibm.btt.rcp.xui.XUIFactoryPlugin”,
it can be changed in XUI global setting file for advance user.
- Injections:
<list Injection="actions">
<com.ibm.btt.rcp.xui.action.StateChangeAction state="ok"/>
</list>
Injections can be installed to widgets. There are
many types of injections. For more injections info, please refer to “Injecting
extensions to widgets” section. If you want to know more injection file logic
and technique, you can refer to element factory document.