org.universAAL.middleware.ui.rdf
Class FormControl

Package class diagram package FormControl
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.ui.rdf.FormElement
              extended by org.universAAL.middleware.ui.rdf.FormControl
Direct Known Subclasses:
Group, Input, Output, Submit

public abstract class FormControl
extends FormElement

The structural unit of forms that may bear information to be presented to human users and / or serve as a placeholder for user input.

Author:
mtazari, Carsten Stockloew
See Also:
ftp://ftp.igd.fraunhofer.de/outgoing/mtazari/persona/dialogPackage.jpg

Field Summary
static String PROP_CONTROL_LABEL
          Form controls may have a Label.
static String PROP_HELP
          Form controls may have a help string to be presented to human users when they need more info about the role of a form control.
static String PROP_HINT
          Form controls may have a hint string as a short hint about the role of a form control.
static String PROP_PARENT_CONTROL
          Apart from the three standard groups described in Form, all other form controls are contained in a Group.
static String PROP_REFERENCED_PPATH
          If a form control is allowed to have associated data (initial value or user input) it must have a property path that is used to access related data within Form.PROP_DIALOG_DATA_ROOT.
static String PROP_VALUE_RESTRICTION
          Can be used to define local restrictions on the value of form controls in addition to restrictions possibly derivable from possibly available form data (the latter are called model-based restrictions).
 
Fields inherited from class org.universAAL.middleware.ui.rdf.FormElement
PROP_APPEARANCE
 
Fields inherited from class org.universAAL.middleware.rdf.Resource
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri
 
Constructor Summary
protected FormControl()
           
protected FormControl(String typeURI, Object parent, Label label, PropertyPath ref, MergedRestriction valueRestriction, Object initialValue)
           
 
Method Summary
 Repeat getAncestorRepeat()
          Returns the nearest Repeat control containing this control if any.
 Form getFormObject()
          Returns the form object containing this form control.
 String getHelpString()
          Returns the help text for this control.
 String getHintString()
          Returns the hint string for this control.
 Label getLabel()
          Returns the Label of this control.
 int getMaxLength()
          Tries to find out the largest number of characters in the string representation of the values associated with this control.
 Group getParentGroup()
          Returns the Group control that contains this form control as a direct child.
 Repeat getParentRepeat()
          If this control is a column in a Repeat control, that Repeat control is returned, otherwise null.
 PropertyPath getReferencedPPath()
           
 MergedRestriction getRestrictions()
          Returns possible value restrictions by merging any local or model-based (defined over available form data) restrictions.
 Group[] getSuperGroups()
          Returns the hierarchy of Groups containing this form control.
 String getTypeURI()
          Returns the URI of the type of values that are / can be associated with this control if it is decidable, null otherwise.
 Object getValue()
          Returns the value(s) currently associated with this control.
 boolean hasFocus()
          Checks if Form.PROP_DIALOG_CURRENT_FOCUSED_CONTROL has this control as value.
 boolean hasValue()
          Checks if there is any value associated with this control in the form data.
 boolean isOfBooleanType()
          Checks if the value returned by getTypeURI() is equal to xsd:boolean.
 boolean isOfPrimitiveType()
          Checks if the value returned by getTypeURI() is one of those supported by the TypeMapper.
 boolean isRepeatable()
          Checks if this control is a column in a Repeat control.
 void setHelpString(String value)
           
 void setHintString(String value)
           
 boolean setProperty(String propURI, Object value)
          For usage by de-serializers.
 String toString()
          Returns the text of the Label possibly associated with this control, null otherwise.
 
Methods inherited from class org.universAAL.middleware.ui.rdf.FormElement
addAppearanceRecommendation, getAppearanceRecommendations
 
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
 
Methods inherited from class org.universAAL.middleware.rdf.Resource
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toStringRecursive, toStringRecursive, unliteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_CONTROL_LABEL

public static final String PROP_CONTROL_LABEL
Form controls may have a Label.

See Also:
Constant Field Values

PROP_HELP

public static final String PROP_HELP
Form controls may have a help string to be presented to human users when they need more info about the role of a form control.

See Also:
Constant Field Values

PROP_HINT

public static final String PROP_HINT
Form controls may have a hint string as a short hint about the role of a form control. Confer the concept of tool-tips in graphical user interfaces.

See Also:
Constant Field Values

PROP_PARENT_CONTROL

public static final String PROP_PARENT_CONTROL
Apart from the three standard groups described in Form, all other form controls are contained in a Group.

See Also:
Constant Field Values

PROP_REFERENCED_PPATH

public static final String PROP_REFERENCED_PPATH
If a form control is allowed to have associated data (initial value or user input) it must have a property path that is used to access related data within Form.PROP_DIALOG_DATA_ROOT.

See Also:
Constant Field Values

PROP_VALUE_RESTRICTION

public static final String PROP_VALUE_RESTRICTION
Can be used to define local restrictions on the value of form controls in addition to restrictions possibly derivable from possibly available form data (the latter are called model-based restrictions).

See Also:
Constant Field Values
Constructor Detail

FormControl

protected FormControl()

FormControl

protected FormControl(String typeURI,
                      Object parent,
                      Label label,
                      PropertyPath ref,
                      MergedRestriction valueRestriction,
                      Object initialValue)
Method Detail

getAncestorRepeat

public Repeat getAncestorRepeat()
Returns the nearest Repeat control containing this control if any. Identical with getParentRepeat() if this control is a column in a Repeat control.


getFormObject

public Form getFormObject()
Returns the form object containing this form control.


getHelpString

public String getHelpString()
Returns the help text for this control.

See Also:
PROP_HELP

getHintString

public String getHintString()
Returns the hint string for this control.

See Also:
PROP_HINT

getLabel

public Label getLabel()
Returns the Label of this control.

See Also:
PROP_CONTROL_LABEL

getMaxLength

public int getMaxLength()
Tries to find out the largest number of characters in the string representation of the values associated with this control. The string representation is determined simply by calling Object.toString() on each value. The values are determined the following way: If no value can be found, -1 is returned.


getRestrictions

public MergedRestriction getRestrictions()
Returns possible value restrictions by merging any local or model-based (defined over available form data) restrictions. Returns null, if both types of restrictions were null.


getParentGroup

public Group getParentGroup()
Returns the Group control that contains this form control as a direct child.


getParentRepeat

public Repeat getParentRepeat()
If this control is a column in a Repeat control, that Repeat control is returned, otherwise null.


getReferencedPPath

public PropertyPath getReferencedPPath()
See Also:
PROP_REFERENCED_PPATH

getSuperGroups

public Group[] getSuperGroups()
Returns the hierarchy of Groups containing this form control. The first element in the returned array (index 0) will be one of the three standard groups of the form containing this control (see the documentation of class Form) and the last element will be its direct parent group.


getTypeURI

public String getTypeURI()
Returns the URI of the type of values that are / can be associated with this control if it is decidable, null otherwise.


getValue

public Object getValue()
Returns the value(s) currently associated with this control. If this control represents a column in a Repeat control, the returned value will be taken from the currently selected row in the Repeat control.


hasFocus

public boolean hasFocus()
Checks if Form.PROP_DIALOG_CURRENT_FOCUSED_CONTROL has this control as value.


hasValue

public boolean hasValue()
Checks if there is any value associated with this control in the form data.


isOfBooleanType

public boolean isOfBooleanType()
Checks if the value returned by getTypeURI() is equal to xsd:boolean.


isOfPrimitiveType

public boolean isOfPrimitiveType()
Checks if the value returned by getTypeURI() is one of those supported by the TypeMapper.


isRepeatable

public boolean isRepeatable()
Checks if this control is a column in a Repeat control.


setHelpString

public void setHelpString(String value)
See Also:
PROP_HELP

setHintString

public void setHintString(String value)
See Also:
PROP_HINT

setProperty

public boolean setProperty(String propURI,
                           Object value)
For usage by de-serializers.

Overrides:
setProperty in class Resource
Returns:
true if the property changed as a result of the call
See Also:
Resource.setProperty(String, Object)

toString

public String toString()
Returns the text of the Label possibly associated with this control, null otherwise.

Overrides:
toString in class Resource


Copyright © 2014 universAAL Consortium. All Rights Reserved.