fi.hut.tml.xsmiles.mlfc.xforms.dom
Class XFormsControl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.apache.xerces.dom.ElementNSImpl
                      extended byfi.hut.tml.xsmiles.dom.XSmilesElementImpl
                          extended byfi.hut.tml.xsmiles.dom.VisualElementImpl
                              extended byfi.hut.tml.xsmiles.mlfc.xforms.dom.XFormsElementImpl
                                  extended byfi.hut.tml.xsmiles.mlfc.xforms.dom.DynBoundElementImpl
                                      extended byfi.hut.tml.xsmiles.mlfc.xforms.dom.XFormsControl
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, CompoundService, CSSStyleChangeListener, DynamicDependencyListener, org.w3c.dom.Element, ElementWithContext, java.util.EventListener, org.w3c.dom.events.EventListener, org.w3c.dom.events.EventTarget, ExpressionContainer, FlowLayoutElement, java.awt.event.FocusListener, InitializableElement, InstanceItemListener, LabeledElement, java.awt.event.MouseListener, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, PseudoElementContainerService, ResourceFetcher, java.io.Serializable, StylableElement, org.w3c.dom.TypeInfo, VisualElement, XFormsConstants, XFormsElement, XSmilesLayoutReference
Direct Known Subclasses:
AdaptiveControl, ButtonElementImpl, CustomControl, SelectBooleanElementImpl, SelectElementImpl, TextControl, TreeElementImpl

public abstract class XFormsControl
extends DynBoundElementImpl
implements InstanceItemListener, java.awt.event.MouseListener, java.awt.event.FocusListener, java.awt.event.ActionListener, FlowLayoutElement, CompoundService, PseudoElementContainerService, LabeledElement, org.w3c.dom.events.EventListener

The base class for the XForm controls, such as buttons and textboxes. It uses the abstract component model of X-SMiles in the package fi.hut.tml.xsmiles.gui.components

Author:
Mikko Honkala
See Also:
Serialized Form

Nested Class Summary
 class XFormsControl.ValuePseudoElement
           
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
protected  XCaption captionComp
          the label (caption) component
protected  XComponent component
          the abstract component for this control
protected  boolean componentInited
           
protected  CompoundServiceImpl compoundService
          this is a kludge that is used to create a compound component if used with a host document that does not support CSS, such as SMIL and SVG
protected  boolean incremental
          is this control incremental
protected  java.lang.String inputMode
          the current value of input mode
protected  boolean insideUpdateEvent
          this flag ensures, that updates are not done many times, and that we dont get into a loop
protected  boolean isInputComponent
           
protected  boolean isOutput
          Am I a xforms:output element
protected  boolean outOfRange
          am I in-range or out-of-range, default is in-range.
protected  java.util.Vector pseudoElements
          get the vector containing all pseudoelements of this element.
protected  VisualElementImpl valuePseudoElement
           
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.xforms.dom.DynBoundElementImpl
bind, BINDING_ATTRIBUTES_NOT_FOUND, BINDING_FAILED, BINDING_OK, binding_state, bindingAttributesRequired, BOUND_NODE_NOT_FOUND, contextNode, init, myModel, refExpr, UNINITIALIZED
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.xforms.dom.XFormsElementImpl
debugEvents, EVENTS_NS, handler, inited, ownerDoc
 
Fields inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
views
 
Fields inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
DESTROYED, elementStatus, INITIALIZED, INITIALIZING, setPseudoClasses, style, xblpropname
 
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, UNNORMALIZED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface fi.hut.tml.xsmiles.mlfc.xforms.XFormsConstants
ACCESSKEY, ACTION_ATTRIBUTE, ACTION_ELEMENT, ACTIVATE_EVENT, ACTIVE_CASE_PSEUDOCLASS, ALERT_ELEMENT, ALERT_EVENT, APPEARANCE_ATTRIBUTE, AT_ATTRIBUTE, BasicDataFactoryClassName, BEFORE_ATTRIBUTE, BIND_ATTRIBUTE, BIND_ELEMENT, BINDING_EXCEPTION, BLUR_EVENT, BUBBLES_ATTRIBUTE, BUTTON_ELEMENT, CALCULATE_ATTRIBUTE, CANCELABLE_ATTRIBUTE, CAPTION_CHANGED, CAPTION_ELEMENT, CASE_ATTRIBUTE, CASE_ELEMENT, CDATA_SECTION_ELEMENTS_ATTRIBUTE, CHOICES_ELEMENT, COMPUTE_EXCEPTION, CONSTRAINT_ATTRIBUTE, CONTROL_ATTRIBUTE, COPY_ELEMENT, DELETE_ELEMENT, DELETE_EVENT, DESELECT_EVENT, DESTROY_ELEMENT, DESTROY_EVENT, DISABLED_EVENT, DISABLED_PSEUDOCLASS, DISPATCH_ELEMENT, DUPLICATE_ELEMENT, DUPLICATE_EVENT, ENABLED_EVENT, ENABLED_PSEUDOCLASS, ENCODING_ATTRIBUTE, END_ATTRIBUTE, EXTENSION, EXTERNAL_LINKING_ATTR, FILENAME, FILENAME_ELEMENT, FOCUS_EVENT, FOCUSIN_NOTIFICATION_EVENT, FOCUSOUT_NOTIFICATION_EVENT, FUNC_INDEX, FUNC_NODEINDEX, FUNCTIONS_ATTRIBUTE, GROUP, GROUP_ELEMENT, HELP, HELP_ELEMENT, HELP_EVENT, HINT, HINT_ELEMENT, HINT_EVENT, INACTIVE_CASE_PSEUDOCLASS, INCLUDENAMESPACEPREFIXES_ATTRIBUTE, INCREMENTAL_ATTRIBUTE, INDENT_ATTRIBUTE, INDEX_ATTRIBUTE, INPUT, INPUT_ELEMENT, INPUTMODE_ATTRIBUTE, INRANGE_EVENT, INRANGE_PSEUDOCLASS, INSERT, INSERT_ELEMENT, INSERT_EVENT, INSTANCE, INSTANCE_ELEMENT, InstanceDocumentClassname, INVALID_DATATYPE_ERROR, INVALID_EVENT, INVALID_PSEUDOCLASS, ISVALID_ATTRIBUTE, ITEM, ITEM_ELEMENT, ITEMSET, ITEMSET_ELEMENT, LABEL, LEVEL_ATTRIBUTE, LINK_ERROR, LINK_EXCEPTION, LOAD, LOADURI_ELEMENT, MAXOCCURS_ATTRIBUTE, MEDIA_TYPE_ELEMENT, MEDIARENDERING_PSEUDOCLASS, MEDIATYPE, MEDIATYPE_ATTRIBUTE, MESSAGE, MESSAGE_ELEMENT, METHOD_ATTRIBUTE, MINOCCURS_ATTRIBUTE, MODEL_ATTRIBUTE, MODEL_CONSTRUCT_DONE_EVENT, MODEL_CONSTRUCT_EVENT, MODEL_DESTRUCT_EVENT, MODEL_ELEMENT, MODEL_ID_ATTRIBUTE, NAME_ATTRIBUTE, NAVINDEX_ATTRIBUTE, NEXT_EVENT, NODESET_ATTRIBUTE, NUMBER_ATTRIBUTE, OMIT_XML_DECLARATION_ATTRIBUTE, OPTIONAL_EVENT, ORIGIN_ATTRIBUTE, OUTOFRANGE_EVENT, OUTOFRANGE_PSEUDOCLASS, OUTPUT_ELEMENT, P3PTYPE_ATTRIBUTE, POSITION_ATTRIBUTE, PREVIOUS_EVENT, PSVIDocumentClassname, PSVISchemaPoolClassName, RANGE, RANGE_ELEMENT, READONLY_ATTRIBUTE, READONLY_EVENT, READONLY_PSEUDOCLASS, READWRITE_EVENT, READWRITE_PSEUDOCLASS, READY_EVENT, REBUILD_ELEMENT, REBUILD_EVENT, RECALCULATE_ELEMENT, RECALCULATE_EVENT, REF_ATTRIBUTE, REFRESH_ELEMENT, REFRESH_EVENT, RELEVANT_ATTRIBUTE, REPEAT, REPEAT_ATTRIBUTE, REPEAT_BIND_ATTRIBUTE, REPEAT_ELEMENT, REPEAT_ID_ATTRIBUTE, REPEAT_MODEL_ATTRIBUTE, REPEAT_NODESET_ATTRIBUTE, REPEAT_NUMBER_ATTRIBUTE, REPEAT_STARTINDEX_ATTRIBUTE, REPLACE_ALL, REPLACE_ATTRIBUTE, REPLACE_INSTANCE, REPLACE_NEW, REPLACE_NONE, REQUIRED_ATTRIBUTE, REQUIRED_EVENT, RESET, RESET_ELEMENT, RESET_EVENT, RESOURCE_ATTRIBUTE, RESOURCE_LINKING_ATTR, REVALIDATE, REVALIDATE_ELEMENT, REVALIDATE_EVENT, SCHEMA_ATTRIBUTE, SCHEMA_CONSTRAINTS_ERROR, SCHEMA_ELEMENT, SCROLL_FIRST_EVENT, SCROLL_LAST_EVENT, SECRET, SECRET_ELEMENT, SELECT, SELECT_BOOLEAN_ELEMENT, SELECT_EVENT, SELECT_MANY_ELEMENT, SELECT_ONE_ELEMENT, SELECT1, SELECTED_ATTRIBUTE, SELECTION_ATTRIBUTE, SEND, SEPARATOR_ATTRIBUTE, SET_FOCUS_ELEMENT, SET_INDEX_ELEMENT, SETFOCUS, SETINDEX, SETVALUE, SETVALUE_ELEMENT, SHOW_ATTR, SHOW_ATTRIBUTE, SHOW_NEW, SHOW_REPLACE, SRC_ATTRIBUTE, STANDALONE_ATTRIBUTE, START_ATTRIBUTE, STARTINDEX_ATTRIBUTE, STEP_ATTRIBUTE, SUBMISSION, SUBMISSION_ATTRIBUTE, SUBMIT, SUBMIT_DONE_EVENT, SUBMIT_ELEMENT, SUBMIT_ERROR, SUBMIT_EVENT, SUBMIT_INFO_ATTRIBUTE, SUBMIT_INFO_ELEMENT, SUBMIT_INSTANCE_ELEMENT, SUBMIT_STARTED_EVENT, SUBTREE_MODIFY_END, SUBTREE_MODIFY_START, SWITCH, SWITCH_ELEMENT, TARGET_ATTRIBUTE, TEXTAREA, TEXTAREA_ELEMENT, TOGGLE, TOGGLE_ELEMENT, TRAVERSAL_ERROR, TREE_ELEMENT, TRIGGER, TYPE_ATTRIBUTE, UI_INITIALIZE_EVENT, UPLOAD, UPLOAD_ELEMENT, VALID_EVENT, VALID_PSEUDOCLASS, VALUE, VALUE_ATTRIBUTE, VALUE_CHANGED_EVENT, VALUE_CHANGING_EVENT, VALUE_ELEMENT, VERSION_ATTRIBUTE, XercesPSVIClassName, XFORMS_NS, XFormsConfigurationPSVI, XHTML_NS, XSMILES_MESSAGE_SHOWN_EVENT
 
Constructor Summary
XFormsControl(XFormsElementHandler owner, java.lang.String ns, java.lang.String name)
          Constructs a new XFormsControl (AnyControl in XForms spec).
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          JButton clicks are handled by actionPerformed
 void addCaption()
           
protected abstract  void changeComponentValue(java.lang.String newValue)
           
protected  void checkBindingState()
          this is called in init, so that button can override the default behaviour
protected  CaptionElementImpl checkCaption()
           
protected  void checkInitialMIPState()
           
 void checkStyling()
          the modelelementimpl notifies this after calling setReadonly et al.
 void checkValidity(InstanceItem item)
          An instance item instructs the control to check its validity, when the status changes
 void checkVisibility()
          This is called when a binding goes to zero nodes
 void checkVisibility(InstanceItem item)
          An instance item instructs the control to check its visibility, when the status changes
 java.lang.Object clone()
           
 void clonePseudoElements(PseudoElementContainerService from, PseudoElementContainerService to)
          overridden, because there is always just one pseudoelement
protected  void componentInit()
          this is only called on-demand, when getComponent is called for the valuepseudoelement
abstract  XComponent createComponent()
          Creates the visible containing component of this control
protected  void createValuePseudoElement()
           
 void destroy()
          Destroy this element and its descendants recursively.
 boolean dispatchEvent(org.w3c.dom.events.Event event)
          this method is overridden so that default actions for certain events can be processed
protected  void doHelp(java.awt.event.ActionEvent event)
           
 void focusGained(java.awt.event.FocusEvent ae)
           
 void focusLost(java.awt.event.FocusEvent ae)
           
protected  void formatCaption()
           
protected  void formatComponent()
          Formats the content according to the CSS style attribute, this can be overridden by the extending classes
 java.lang.String getAppearance()
           
 CaptionElementImpl getCaption()
           
static CaptionElementImpl getCaption(org.w3c.dom.Element e)
           
protected  java.lang.String getCaptionSide()
          Returns the string value of the caption-side CSS property, used as a hack when the host language does not support CSS flow layout to position the label
protected  java.lang.String getCaptionText()
           
protected  int getDatatypeId()
           
 ECMAScripter getECMAScripter()
           
 boolean getIncremental()
           
 InstanceItemListener getInstanceItemListener()
           
 java.lang.String getLabelAsText()
           
 java.lang.String getOutputValue()
           
 org.w3c.dom.css.CSSStyleDeclaration getOwnerStyle()
           
 org.w3c.dom.Node getParentNodeForPseudoElement()
           
protected  org.w3c.dom.Document getParentOwnerDocument()
           
 java.util.Vector getPseudoElements()
          get the vector containing all pseudoelements of this element.
 VisualComponentService getVisualComponent()
          Return the visual component for this extension element This would return e.g.
 void handleEvent(org.w3c.dom.events.Event evt)
           
 void init()
          Initialize this element.
 boolean isPseudoClass(java.lang.String pseudoclass)
          ask whether this element belongs to a certain CSS pseudoclass
 boolean isVisible()
          should this be visible.
 void mouseClicked(java.awt.event.MouseEvent evt)
          Mouse events.
 void mouseEntered(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
 void notifyBindingChanged(org.w3c.dom.NodeList newBinding)
          notifies the listener that the binding and the value changed
 void notifyError(java.lang.Exception e, boolean atSubmission)
          notify this listener that there was an error in the value of the instance item.
 void notifyPseudoRemoved(org.w3c.dom.Element elem)
          since the pseudoelement removals are not catched by the xsmilesvisualelement, this method can be used to notify a remove
protected  void registerListener()
           
 void setAttribute(java.lang.String name, java.lang.String value)
          interactive attributes
 org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
           
protected  void setAttributeValue(java.lang.String name, java.lang.String value)
           
 void setHint(HintElementImpl h)
          Sets the components Tooltip (Hint) text
protected  void setInputMode(java.lang.String im)
           
 void setOutOfRange(boolean range)
           
 void setReadonly(boolean ro)
           
protected  void setRefNodeValue(java.lang.Object value, boolean valueChanging)
          Sets the reference instance node value
 void setRequired(boolean ro)
           
 void styleChanged()
          marks the component that is has failed the schema test
 void valueChanged(java.lang.String newValue)
          The value of this instanceItem has changed
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.xforms.dom.DynBoundElementImpl
bindingMaybeDirty, checkBindAttribute, checkBinding, checkModelAttribute, destroyBinding, evaluateRefNode, getBind, getBindingState, getBindingType, getBoundNodeset, getChildText, getContextForDescendant, getContextNode, getContextNodeList, getModel, getModelContext, getNamespaceContextNode, getParentBoundElement, getRef, getRefNode, getRefNodeValue, getRefXPathExpr, getTextWithPrecedence, getXPath, getXPathEngine, hasBindingAttributes, isSameModel, isSingleNodeBinding, notifyBindingChangedRecursively, notifyParentBindingChanged, renewBinding, resetContextNode, setContextNode
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.xforms.dom.XFormsElementImpl
debugNode, dispatch, dispatch, dispatchActivateEvent, dispatchClickEvent, findFirstRelevantControl, getBrowser, getClassName, getComponentFactory, getId, getModel, getModelId, getModelInScope, getSrc, getStyleAttrValue, getXMLDocument, handleXFormsException, initializeXMLEvents, isCSSLayoutDoc, moveNodes, printEvent, removeAllChildren, retrieveInstanceItem, retrieveResourceAsString, serializeNode, setClassName, setHandler, setId, setOwnerDoc
 
Methods inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
addView, belongsToTree, getViews, insertBefore, isCurrentlyVisible, isFocusPoint, isVisibleByCSSProperties, removeAllViews, removeAttribute, removeChild, replaceChild, setStatus, updateViews
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, cloneSubtree, debugNode, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, initFinalFlattenedTree, initStyle, isInitedForReset, removeBinding, removeUndistributedChild, replaceNode, resetFinalFlattenedTree, resolveURI, searchElementWithId, searchElementWithId, setApplyBindingSheets, setAuthorSheets, setPseudoClass, setRuleNode, setStyle, updateStyle
 
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, setPrefix, setType, setValues
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttributeNode, removeAttributeNS, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.StylableElement
getRuleNode, getStyle, getStyleAttrValue, hasStyle, setRuleNode, setStyle
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.VisualElement
getStyle
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.PseudoClassController
getPseudoClass, setPseudoClass
 

Field Detail

incremental

protected boolean incremental
is this control incremental


inputMode

protected java.lang.String inputMode
the current value of input mode


isInputComponent

protected boolean isInputComponent

componentInited

protected boolean componentInited

insideUpdateEvent

protected boolean insideUpdateEvent
this flag ensures, that updates are not done many times, and that we dont get into a loop


component

protected XComponent component
the abstract component for this control


captionComp

protected XCaption captionComp
the label (caption) component


isOutput

protected boolean isOutput
Am I a xforms:output element


outOfRange

protected boolean outOfRange
am I in-range or out-of-range, default is in-range. used by range and selects


compoundService

protected CompoundServiceImpl compoundService
this is a kludge that is used to create a compound component if used with a host document that does not support CSS, such as SMIL and SVG


pseudoElements

protected java.util.Vector pseudoElements
get the vector containing all pseudoelements of this element. null or empty vector means that there are no pseudoelements


valuePseudoElement

protected VisualElementImpl valuePseudoElement
Constructor Detail

XFormsControl

public XFormsControl(XFormsElementHandler owner,
                     java.lang.String ns,
                     java.lang.String name)
Constructs a new XFormsControl (AnyControl in XForms spec).

Method Detail

notifyPseudoRemoved

public void notifyPseudoRemoved(org.w3c.dom.Element elem)
since the pseudoelement removals are not catched by the xsmilesvisualelement, this method can be used to notify a remove

Specified by:
notifyPseudoRemoved in interface PseudoElementContainerService
Overrides:
notifyPseudoRemoved in class VisualElementImpl
Parameters:
elem -

init

public void init()
Description copied from class: XSmilesElementImpl
Initialize this element.

Specified by:
init in interface XFormsElement
Overrides:
init in class XFormsElementImpl

componentInit

protected void componentInit()
this is only called on-demand, when getComponent is called for the valuepseudoelement


getAppearance

public java.lang.String getAppearance()
Specified by:
getAppearance in interface LabeledElement

getVisualComponent

public VisualComponentService getVisualComponent()
Return the visual component for this extension element This would return e.g. an XForms input element which contains an container that has both the label and the ::value (the widget). Note: this is a kludge.

Specified by:
getVisualComponent in interface CompoundService

getCaptionSide

protected java.lang.String getCaptionSide()
Returns the string value of the caption-side CSS property, used as a hack when the host language does not support CSS flow layout to position the label


checkBindingState

protected void checkBindingState()
this is called in init, so that button can override the default behaviour


checkInitialMIPState

protected void checkInitialMIPState()

getOutputValue

public java.lang.String getOutputValue()

destroy

public void destroy()
Description copied from class: XSmilesElementImpl
Destroy this element and its descendants recursively. NOTE: When overriding this method, please be sure to call super.destroy(), otherwise the destroy call will not propagate. NOTE: Actually, the recursion, which destroys the elements should be here, because usually everybody forgets to call super.destroy when overriding, thus causing the destroy sceme to break down.

Specified by:
destroy in interface XFormsElement
Overrides:
destroy in class DynBoundElementImpl

checkCaption

protected CaptionElementImpl checkCaption()

getCaption

public CaptionElementImpl getCaption()

getCaption

public static CaptionElementImpl getCaption(org.w3c.dom.Element e)

addCaption

public void addCaption()

createComponent

public abstract XComponent createComponent()
Creates the visible containing component of this control


formatComponent

protected void formatComponent()
Formats the content according to the CSS style attribute, this can be overridden by the extending classes


formatCaption

protected void formatCaption()

changeComponentValue

protected abstract void changeComponentValue(java.lang.String newValue)

styleChanged

public void styleChanged()
marks the component that is has failed the schema test

Specified by:
styleChanged in interface CSSStyleChangeListener
Overrides:
styleChanged in class VisualElementImpl

setHint

public void setHint(HintElementImpl h)
Sets the components Tooltip (Hint) text


getCaptionText

protected java.lang.String getCaptionText()

getLabelAsText

public java.lang.String getLabelAsText()
Specified by:
getLabelAsText in interface LabeledElement

setReadonly

public void setReadonly(boolean ro)
Specified by:
setReadonly in interface InstanceItemListener

setRequired

public void setRequired(boolean ro)
Specified by:
setRequired in interface InstanceItemListener

setOutOfRange

public void setOutOfRange(boolean range)

checkVisibility

public void checkVisibility(InstanceItem item)
An instance item instructs the control to check its visibility, when the status changes

Specified by:
checkVisibility in interface InstanceItemListener

checkValidity

public void checkValidity(InstanceItem item)
An instance item instructs the control to check its validity, when the status changes

Specified by:
checkValidity in interface InstanceItemListener

valueChanged

public void valueChanged(java.lang.String newValue)
The value of this instanceItem has changed

Specified by:
valueChanged in interface InstanceItemListener

checkStyling

public void checkStyling()
the modelelementimpl notifies this after calling setReadonly et al.

Specified by:
checkStyling in interface InstanceItemListener
Overrides:
checkStyling in class DynBoundElementImpl

setRefNodeValue

protected void setRefNodeValue(java.lang.Object value,
                               boolean valueChanging)
Description copied from class: DynBoundElementImpl
Sets the reference instance node value

Overrides:
setRefNodeValue in class DynBoundElementImpl

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Mouse events.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

focusGained

public void focusGained(java.awt.event.FocusEvent ae)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent ae)
Specified by:
focusLost in interface java.awt.event.FocusListener

registerListener

protected void registerListener()

getIncremental

public boolean getIncremental()

dispatchEvent

public boolean dispatchEvent(org.w3c.dom.events.Event event)
this method is overridden so that default actions for certain events can be processed

Specified by:
dispatchEvent in interface org.w3c.dom.events.EventTarget
Overrides:
dispatchEvent in class XFormsElementImpl

notifyError

public void notifyError(java.lang.Exception e,
                        boolean atSubmission)
notify this listener that there was an error in the value of the instance item. This can be schema validity, constraint, required etc.

Specified by:
notifyError in interface InstanceItemListener

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
interactive attributes

Specified by:
setAttribute in interface org.w3c.dom.Element
Overrides:
setAttribute in class VisualElementImpl

setAttributeNode

public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
                                  throws org.w3c.dom.DOMException
Specified by:
setAttributeNode in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

setAttributeValue

protected void setAttributeValue(java.lang.String name,
                                 java.lang.String value)

setInputMode

protected void setInputMode(java.lang.String im)

handleEvent

public void handleEvent(org.w3c.dom.events.Event evt)
Specified by:
handleEvent in interface org.w3c.dom.events.EventListener
Overrides:
handleEvent in class VisualElementImpl

getInstanceItemListener

public InstanceItemListener getInstanceItemListener()
Specified by:
getInstanceItemListener in interface DynamicDependencyListener
Overrides:
getInstanceItemListener in class DynBoundElementImpl
Returns:
the instanceItemListener for the referred nodes, for value changes without binding change

notifyBindingChanged

public void notifyBindingChanged(org.w3c.dom.NodeList newBinding)
notifies the listener that the binding and the value changed

Specified by:
notifyBindingChanged in interface DynamicDependencyListener
Overrides:
notifyBindingChanged in class DynBoundElementImpl

doHelp

protected void doHelp(java.awt.event.ActionEvent event)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
JButton clicks are handled by actionPerformed

Specified by:
actionPerformed in interface java.awt.event.ActionListener

isPseudoClass

public boolean isPseudoClass(java.lang.String pseudoclass)
ask whether this element belongs to a certain CSS pseudoclass

Specified by:
isPseudoClass in interface StylableElement
Overrides:
isPseudoClass in class VisualElementImpl

isVisible

public boolean isVisible()
should this be visible. this is based on the ref node's relevant and refnode being non-null


checkVisibility

public void checkVisibility()
This is called when a binding goes to zero nodes

Overrides:
checkVisibility in class DynBoundElementImpl

getDatatypeId

protected int getDatatypeId()

getParentOwnerDocument

protected org.w3c.dom.Document getParentOwnerDocument()

getOwnerStyle

public org.w3c.dom.css.CSSStyleDeclaration getOwnerStyle()

getParentNodeForPseudoElement

public org.w3c.dom.Node getParentNodeForPseudoElement()

createValuePseudoElement

protected void createValuePseudoElement()

getPseudoElements

public java.util.Vector getPseudoElements()
Description copied from interface: PseudoElementContainerService
get the vector containing all pseudoelements of this element. null or empty vector means that there are no pseudoelements

Specified by:
getPseudoElements in interface PseudoElementContainerService

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class DynBoundElementImpl
Throws:
java.lang.CloneNotSupportedException

clonePseudoElements

public void clonePseudoElements(PseudoElementContainerService from,
                                PseudoElementContainerService to)
overridden, because there is always just one pseudoelement

Overrides:
clonePseudoElements in class XSmilesElementImpl

getECMAScripter

public ECMAScripter getECMAScripter()


X-Smiles 1.2