net.sf.wcfart.wcf.ui.package.html Maven / Gradle / Ivy
Show all versions of wcf-art Show documentation
Provides an API to create and manipulate a DOM tree that conforms to the xoplon DTD.
Xoplon supports a set of controls like text input, button, listbox etc.
which can be used for creating user interfaces by instantiating controls per API functions
or by configuring UIs using an XML configuration file. The Xoplon controls are
converted to HTML Controls using the xoplon.xsl
stylesheet. Formatting
and validation of Xoplon controls content are automized using the
xoplon.format validator classes.
Supported controls
Xoplon supports now the following controls:
Simple Xoplon controls, access via configuration file and API
Xoplon Control Meaning HTML equivalent
textField text input field input, type=text
password password input input, type=password
textArea text input ctrl, multiple rows textarea
listBox listbox supporting single or multiple selection select
listItem listbox item option
checkBoxes container for check boxes n/a
checkBox checkbox input, type=checkbox
radioButtons container for radio buttons n/a
radioButton radio button input, type=radio
button button input, type=submit
Supported data types
Xoplon supports the following simple data types for text controls:
- string: string type
- int: integer type
- double: float type
- date: date type
Xoplon implements formatters and parsers for the descriped types which automize
formatting and validation of user input. See packages
xoplon.format and xoplon.convert.
Configuring Xoplon Controls via configuration file
Xoplon Controls can be configured using an XML configuration file:
<!-- Text control -->
<textField type="string" label="Text:" value="hello world"/>
<textField type="int" label="Integer:" value="123"/>
<textField type="double" label="Double:" value="1,23"/>
<!-- Password control -->
<password type="string" label="Password:" value=""/>
The type
attribute specifies the data type used for formatting and
validation, see above "Supported data types".
Accessing Controls via API
As an alternative to configuring Xoplon controls, they can be instantiated
programmatically by using the control's static factory functions. Attributes like
label, value
etc. can be accessed/changed using the appropriate
static getters/setters.
Document factory;
Formatter formatter; // see package xoplon.format for this one
TextField textField1 = TextField.createTextField(factory, TextField.STRING_TYPE);
TextField.setLabel(textField1, "Text:");
TextField.setValue(formatter, textField1, "hello world");
TextField textField2 = TextField.createTextField(factory, TextField.INT_TYPE);
TextField.setLabel(textField2, "Integer:");
TextField.setValue(formatter, textField2, new Integer(123));
etc.
The formatter for the setValue
function supports type conform,
locale specific and format string specific formatting/parsing of the value.
See package xoplon.format.