
<?xml version="1.0" encoding="utf-8"?>
<Shell name="AttributeSelfDefineExample" descriptors="xworker.swt.widgets.Shell" text="自定义属性编辑控件" RESIZE="true" width="600" height="400">
<FillLayout name="shellFillLayout"></FillLayout>
<DataObjectForm name="form">
<dataObjects>
<AbstractDataObject name="exampleDataObject" editCols="1" storeSortDir="ASC" autoInitAction="autoInit">
<attribute name="selfDefineControl" label="自定义控件" inputtype="inputAttrDefined" inputattrs="xworker.swt.xworker.attributeEditor.DateTimeEditor"></attribute>
<attribute name="addListener" label="增加焦点离开事件">
<SwtObject>
<inputExtend>
<listeners>
<Listener type="FocusOut">
<MessageBox name="tip" descriptors="xworker.swt.actions.MessageBoxActions/@MessageBox" icon="ICON_INFORMATION" buttons="OK" title="提示" message="焦点离开了。"></MessageBox>
</Listener>
</listeners>
</inputExtend>
</SwtObject>
</attribute>
<attribute name="desc" label="说明" inputtype="textarea" inputattrs="codeName= codeType= wrap=true fillBoth=true cols= rows=">
<default><![CDATA[在没有已知控件的情况下可以自定义控件。
1. 可以对编辑控件增加事件监听等。
2. 选择输入方式为‘输入扩展属性指定的’,在输入扩展属性中输入自定义的控件的路径。
自定义控件的方法:
1. 通过create方法创建自定义控件,布局数据会有gridData或layoutData参数,注意不要覆盖了。
2. 对于简单的编辑控件,可以直接返回text,styleText,combo等。
3. 对于复杂的组合型编辑控件,最好的方法是返回ActionContext,同时定义setValue、getValue、getRootControl和getControl等方法。]]></default>
</attribute>
</AbstractDataObject>
</dataObjects>
</DataObjectForm>
</Shell>