Extending : Widget extension : Enabling a customized widget in the XUI editor : Defining a widget
  
Defining a widget
UNICOM® Digital Transformation Toolkit (UDTT™) widgets are defined in a .xml file. The .xml file describes how a widget is displayed in the XUI editor, the properties of the widget, and how the properties can be edited. The tables in this topic provide detailed descriptions of the tags in the widget definition file.
Sample of a widget definition is a sample of a widget definition. For detailed descriptions of the tags and attributes in a widget definition file, see the following sections in this topic:
The <figure> tag
The <properties> tag
The <events> tag
Sample of a widget definition
<widget xmlns="http://btt.ibm.com/WidgetSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://btt.ibm.com/WidgetSchema WidgetSchema.xsd ">
class="com.ibm.btt.alphasample.editor.figure.ToggleButtonSWT" /> -->
<figure type="draw2d" class="org.eclipse.swt.widgets.Button" style="TOGGLE"/>


<properties>
<!-- common properties -->
<property name="id" type="String"/>
<property name="width" default="50" />
<property name="height" default="28" />
<property name="visibility" default="visible" type="Visibility"
showInAction="true" showInExpression="true" description="%desc_prop_visibility" />
<property name="icon" type="Image" showInAction="true" showInEditor="true"
showInExpression="true" description="%desc_prop_icon" />
<property name="ontext" type="String" />
<property name="offtext" type="String" />

</properties>

<events>
<event name="onClick" description="%desc_event_onclick" />
<event name="onKeyDown" description="%desc_event_onkeydown" />
<event name="onKeyPress" description="%desc_event_onkeypress" />
<event name="onKeyUp" description="%desc_event_onkeyup" />
<event name="onMouseDown" description="%desc_event_onmousedown" />
<event name="onMouseUp" description="%desc_event_onmouseup" />
<event name="onMouseEnter" description="%desc_event_onmouseenter" />
<event name="onMouseLeave" description="%desc_event_onmouseleave" />
<event name="onMouseMove" description="%desc_event_onmousemove" />
<event name="onChange" description="%desc_event_onchange" />
</events>

<functions>
<function name="isFocusable" showInAction="false"
showInExpression="true" returnType="Boolean" description="%desc_func_isfocusable" />
<function name="focus" showInAction="true" showInExpression="false"
description="%desc_func_focus" />
</functions>
</widget>
See
The <figure> tag
The <properties> tag
The <events> tag
The <function> tag
Go up to
Enabling a customized widget in the XUI editor