Defining Legal Events and Listeners for Part Classes Via <d-class> HTML Case The UIML document extends our previous example to provide a behavior for an event called onClick for our HTML button. <uiml> <interface> ... <part class="Button"> ... <behavior> <rule> <condition><event class="onClick"/></condition> <action>...</action> </rule> </behavior> </part> ... </interface> <peers> <presentation base="HTML_3.2_Harmonia_1.0"/> </peers> </uiml> The <behavior> element in the box above causes the <action> element to be executed whenever an onClick event occurs for the button. The meaning of onClick is defined by additional lines in the <presentation> element: <uiml> <template .../> <presentation .../> <d-class id="onClick" used-in-tag="event" maps-type="attribute" maps-to="onClick"/> <d-class id="Button" used-in-tag="part" maps-type="tag" maps-to="html:INPUT"> ... <event class="onClick"/> </presentation> </template> </uiml> The above UIML says that one of the events in HTML is OnClick, and that a <part> whose class is Button can receive an OnClick event. To summarize, when writing rules, the class attribute of an event element in a condition can be any of the names listed in an <event> element that is associated with the <part> in the <presentation> section. In the UIML example above, a Button's events include OnClick, and therefore the following line was used in the UIML document given earlier: <condition><event name="onClick"/></condition> Java Case Java provides a much richer UI toolkit than HTML, and so the information required in the <presentation> element is more complex.
Defining Legal Events and Listeners for Part Classes Via <d-class> HTML Case The UIML document extends our previous example to provide a behavior for an event called onClick for our HTML button. <uiml> <interface> ... <part class="Button"> ... <behavior> <rule> <condition><event class="onClick"/></condition> <action>...</action> </rule> </behavior> </part> ... </interface> <peers> <presentation base="HTML_3.2_Harmonia_1.0"/> </peers> </uiml> The <behavior> element in the box above causes the <action> element to be executed whenever an onClick event occurs for the button. The meaning of onClick is defined by additional lines in the <presentation> element: <uiml> <template .../> <presentation .../> <d-class id="onClick" used-in-tag="event" maps-type="attribute" maps-to="onClick"/> <d-class id="Button" used-in-tag="part" maps-type="tag" maps-to="html:INPUT"> ... <event class="onClick"/> </presentation> </template> </uiml> The above UIML says that one of the events in HTML is OnClick, and that a <part> whose class is Button can receive an OnClick event. To summarize, when writing rules, the class attribute of an event element in a condition can be any of the names listed in an <event> element that is associated with the <part> in the <presentation> section. In the UIML example above, a Button's events include OnClick, and therefore the following line was used in the UIML document given earlier: <condition><event name="onClick"/></condition> Java Case Java provides a much richer UI toolkit than HTML, and so the information required in the <presentation> element is more complex.
uiml-core-4.0-draft_JWH01232008nc.docx