|
@@ -2,6 +2,9 @@
|
|
|
<!-- FIXED: Simple UI Layout Definition Example v1.3 -->
|
|
<!-- FIXED: Simple UI Layout Definition Example v1.3 -->
|
|
|
<ui-layout-def xmlns="http://quadarax.com/ui-layout-definition"
|
|
<ui-layout-def xmlns="http://quadarax.com/ui-layout-definition"
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
|
+ xmlns:patterns="http://quadarax.com/ui-layout-patterns"
|
|
|
|
|
+ xmlns:validation="http://quadarax.com/ui-layout-validation"
|
|
|
|
|
+ xmlns:views="http://quadarax.com/ui-layout-views"
|
|
|
xsi:schemaLocation="http://quadarax.com/ui-layout-definition ui-layout-def.xsd"
|
|
xsi:schemaLocation="http://quadarax.com/ui-layout-definition ui-layout-def.xsd"
|
|
|
version="1.3"
|
|
version="1.3"
|
|
|
schema-version="1.3"
|
|
schema-version="1.3"
|
|
@@ -11,19 +14,19 @@
|
|
|
<!-- Simple validation rules -->
|
|
<!-- Simple validation rules -->
|
|
|
<validation-rules>
|
|
<validation-rules>
|
|
|
<custom-validator name="RequiredFieldValidator" version="1.0" category="structural">
|
|
<custom-validator name="RequiredFieldValidator" version="1.0" category="structural">
|
|
|
- <description>Validates that required fields have content</description>
|
|
|
|
|
- <implementation>
|
|
|
|
|
- <rule-expression expression="string-length(@text) > 0 or @required != 'true'" language="xpath" />
|
|
|
|
|
- </implementation>
|
|
|
|
|
- <test-case name="required-field-with-content">
|
|
|
|
|
- <input><TextBox text="Hello World" required="true" /></input>
|
|
|
|
|
- <expected-result>pass</expected-result>
|
|
|
|
|
- </test-case>
|
|
|
|
|
- <test-case name="required-field-empty">
|
|
|
|
|
- <input><TextBox text="" required="true" /></input>
|
|
|
|
|
- <expected-result>fail</expected-result>
|
|
|
|
|
- <expected-message>This field is required</expected-message>
|
|
|
|
|
- </test-case>
|
|
|
|
|
|
|
+ <validation:description>Validates that required fields have content</validation:description>
|
|
|
|
|
+ <validation:implementation>
|
|
|
|
|
+ <validation:rule-expression expression="string-length(@text) > 0 or @required != 'true'" language="xpath" />
|
|
|
|
|
+ </validation:implementation>
|
|
|
|
|
+ <validation:test-case name="required-field-with-content">
|
|
|
|
|
+ <validation:input>Hello World</validation:input>
|
|
|
|
|
+ <validation:expected-result>pass</validation:expected-result>
|
|
|
|
|
+ </validation:test-case>
|
|
|
|
|
+ <validation:test-case name="required-field-empty">
|
|
|
|
|
+ <validation:input></validation:input>
|
|
|
|
|
+ <validation:expected-result>fail</validation:expected-result>
|
|
|
|
|
+ <validation:expected-message>This field is required</validation:expected-message>
|
|
|
|
|
+ </validation:test-case>
|
|
|
</custom-validator>
|
|
</custom-validator>
|
|
|
</validation-rules>
|
|
</validation-rules>
|
|
|
|
|
|
|
@@ -31,72 +34,72 @@
|
|
|
<patterns>
|
|
<patterns>
|
|
|
<!-- Define basic controls used in windows -->
|
|
<!-- Define basic controls used in windows -->
|
|
|
<control name="Label" type="display" category="basic">
|
|
<control name="Label" type="display" category="basic">
|
|
|
- <description>Simple text display control</description>
|
|
|
|
|
- <attributes>
|
|
|
|
|
- <attribute name="text" type="string" default="" />
|
|
|
|
|
- <attribute name="font" type="font" default="Default" />
|
|
|
|
|
- <attribute name="color" type="color" default="Black" />
|
|
|
|
|
- </attributes>
|
|
|
|
|
- <behavior>
|
|
|
|
|
- <event name="click" />
|
|
|
|
|
- </behavior>
|
|
|
|
|
|
|
+ <patterns:description>Simple text display control</patterns:description>
|
|
|
|
|
+ <patterns:attributes>
|
|
|
|
|
+ <patterns:attribute name="text" type="string" default="" />
|
|
|
|
|
+ <patterns:attribute name="font" type="font" default="Default" />
|
|
|
|
|
+ <patterns:attribute name="color" type="color" default="Black" />
|
|
|
|
|
+ </patterns:attributes>
|
|
|
|
|
+ <patterns:behavior>
|
|
|
|
|
+ <patterns:event name="click" />
|
|
|
|
|
+ </patterns:behavior>
|
|
|
</control>
|
|
</control>
|
|
|
|
|
|
|
|
<control name="TextBox" type="input" category="basic">
|
|
<control name="TextBox" type="input" category="basic">
|
|
|
- <description>Text input control</description>
|
|
|
|
|
- <attributes>
|
|
|
|
|
- <attribute name="text" type="string" default="" />
|
|
|
|
|
- <attribute name="placeholder" type="string" default="" />
|
|
|
|
|
- <attribute name="required" type="bool" default="false" />
|
|
|
|
|
- <attribute name="maxlength" type="int" default="255" />
|
|
|
|
|
- </attributes>
|
|
|
|
|
- <behavior>
|
|
|
|
|
- <event name="textchanged" />
|
|
|
|
|
- <event name="focus" />
|
|
|
|
|
- <event name="blur" />
|
|
|
|
|
- </behavior>
|
|
|
|
|
- <validation>
|
|
|
|
|
- <rule name="required-validation" type="required" message="This field is required" severity="error" />
|
|
|
|
|
- </validation>
|
|
|
|
|
|
|
+ <patterns:description>Text input control</patterns:description>
|
|
|
|
|
+ <patterns:attributes>
|
|
|
|
|
+ <patterns:attribute name="text" type="string" default="" />
|
|
|
|
|
+ <patterns:attribute name="placeholder" type="string" default="" />
|
|
|
|
|
+ <patterns:attribute name="required" type="bool" default="false" />
|
|
|
|
|
+ <patterns:attribute name="maxlength" type="int" default="255" />
|
|
|
|
|
+ </patterns:attributes>
|
|
|
|
|
+ <patterns:behavior>
|
|
|
|
|
+ <patterns:event name="textchanged" />
|
|
|
|
|
+ <patterns:event name="focus" />
|
|
|
|
|
+ <patterns:event name="blur" />
|
|
|
|
|
+ </patterns:behavior>
|
|
|
|
|
+ <patterns:validation>
|
|
|
|
|
+ <patterns:rule name="required-validation" type="required" message="This field is required" severity="error" />
|
|
|
|
|
+ </patterns:validation>
|
|
|
</control>
|
|
</control>
|
|
|
|
|
|
|
|
<control name="Button" type="button" category="basic">
|
|
<control name="Button" type="button" category="basic">
|
|
|
- <description>Clickable button control</description>
|
|
|
|
|
- <attributes>
|
|
|
|
|
- <attribute name="text" type="string" default="Button" />
|
|
|
|
|
- <attribute name="enabled" type="bool" default="true" />
|
|
|
|
|
- </attributes>
|
|
|
|
|
- <behavior>
|
|
|
|
|
- <event name="click" />
|
|
|
|
|
- </behavior>
|
|
|
|
|
|
|
+ <patterns:description>Clickable button control</patterns:description>
|
|
|
|
|
+ <patterns:attributes>
|
|
|
|
|
+ <patterns:attribute name="text" type="string" default="Button" />
|
|
|
|
|
+ <patterns:attribute name="enabled" type="bool" default="true" />
|
|
|
|
|
+ </patterns:attributes>
|
|
|
|
|
+ <patterns:behavior>
|
|
|
|
|
+ <patterns:event name="click" />
|
|
|
|
|
+ </patterns:behavior>
|
|
|
</control>
|
|
</control>
|
|
|
|
|
|
|
|
<control name="Panel" type="container" category="basic">
|
|
<control name="Panel" type="container" category="basic">
|
|
|
- <description>Container for other controls</description>
|
|
|
|
|
- <attributes>
|
|
|
|
|
- <attribute name="width" type="int" default="200" />
|
|
|
|
|
- <attribute name="height" type="int" default="100" />
|
|
|
|
|
- <attribute name="background" type="color" default="Transparent" />
|
|
|
|
|
- </attributes>
|
|
|
|
|
- <behavior>
|
|
|
|
|
- <event name="resize" />
|
|
|
|
|
- </behavior>
|
|
|
|
|
|
|
+ <patterns:description>Container for other controls</patterns:description>
|
|
|
|
|
+ <patterns:attributes>
|
|
|
|
|
+ <patterns:attribute name="width" type="int" default="200" />
|
|
|
|
|
+ <patterns:attribute name="height" type="int" default="100" />
|
|
|
|
|
+ <patterns:attribute name="background" type="color" default="Transparent" />
|
|
|
|
|
+ </patterns:attributes>
|
|
|
|
|
+ <patterns:behavior>
|
|
|
|
|
+ <patterns:event name="resize" />
|
|
|
|
|
+ </patterns:behavior>
|
|
|
</control>
|
|
</control>
|
|
|
|
|
|
|
|
<!-- Simple layout structure -->
|
|
<!-- Simple layout structure -->
|
|
|
<structure name="SimpleForm" type="layout" category="layout">
|
|
<structure name="SimpleForm" type="layout" category="layout">
|
|
|
- <description>Basic form layout with label and input pairs</description>
|
|
|
|
|
- <attributes>
|
|
|
|
|
- <attribute name="title" type="string" default="Form" />
|
|
|
|
|
- <attribute name="width" type="int" default="300" />
|
|
|
|
|
- <attribute name="height" type="int" default="200" />
|
|
|
|
|
- </attributes>
|
|
|
|
|
- <template>
|
|
|
|
|
|
|
+ <patterns:description>Basic form layout with label and input pairs</patterns:description>
|
|
|
|
|
+ <patterns:attributes>
|
|
|
|
|
+ <patterns:attribute name="title" type="string" default="Form" />
|
|
|
|
|
+ <patterns:attribute name="width" type="int" default="300" />
|
|
|
|
|
+ <patterns:attribute name="height" type="int" default="200" />
|
|
|
|
|
+ </patterns:attributes>
|
|
|
|
|
+ <patterns:template>
|
|
|
<Panel name="formContainer" width="{width}" height="{height}" background="White">
|
|
<Panel name="formContainer" width="{width}" height="{height}" background="White">
|
|
|
<Label name="titleLabel" text="{title}" font="Bold,14" />
|
|
<Label name="titleLabel" text="{title}" font="Bold,14" />
|
|
|
<!-- Content will be inserted here -->
|
|
<!-- Content will be inserted here -->
|
|
|
</Panel>
|
|
</Panel>
|
|
|
- </template>
|
|
|
|
|
|
|
+ </patterns:template>
|
|
|
</structure>
|
|
</structure>
|
|
|
</patterns>
|
|
</patterns>
|
|
|
|
|
|