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

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.PrologElement
                                      extended byfi.hut.tml.xsmiles.mlfc.xforms.dom.ModelElementImpl
All Implemented Interfaces:
java.lang.Cloneable, CSSStyleChangeListener, org.w3c.dom.Element, org.w3c.dom.events.EventListener, org.w3c.dom.events.EventTarget, FunctionChangeListener, InitializableElement, ModelContext, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, StylableElement, org.w3c.dom.TypeInfo, VisualElement, XFormsConstants, XFormsElement, XFormsModelElement, XSmilesLayoutReference

public class ModelElementImpl
extends PrologElement
implements org.w3c.dom.events.EventListener, ModelContext, XFormsModelElement, FunctionChangeListener

The model element implementation - ties together instance and schema - Listens for mutation events from the instance and initiates recalculate and revalidate

Author:
Mikko Honkala, Ronald Tschal?r (patches)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
protected  java.util.Vector changedNodes
          the changed nodes
protected  InstanceElementImpl defaultInstance
          the cached default instance
protected  DynamicDependencyHandler dynDependencyHandler
          the dynamic dependency handler
protected  java.util.Hashtable instances
          all instances with an id are stored in a hashtable
protected  java.util.Vector invalidNodes
          currently invalid nodes
protected  InstanceElementImpl lazyBastardInstance
          for lazy bastard mode, only one generated instance can be found per model.
protected  MainDependencyGraph maindep
           
protected  SchemaElementImpl model
           
static short MODEL_CALCULATING
           
static short MODEL_CONSTRUCTING
           
static short MODEL_NOTCONSTRUCTED
           
static short MODEL_READY
           
static short MODEL_REFRESHING
           
static short MODEL_VALIDATING
           
protected  short modelStatus
           
protected  boolean needsRebuild
          for deferred updates
protected  boolean needsRecalculate
          for deferred updates
protected  boolean needsRefresh
          for deferred updates
protected  boolean needsRevalidate
          for deferred updates
static java.lang.String SCHEMA_URI
           
protected  org.w3c.dom.Element schemaElement
           
protected  SchemaPool schemaPool
          my schema pool
protected  XPathEngine xpathAPI
          the cached XPath api context
 
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, UNINITIALIZED, 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
ModelElementImpl(XFormsElementHandler owner, java.lang.String ns, java.lang.String name)
           
 
Method Summary
protected  void addSchemaFromElement(org.w3c.dom.Element schema, SchemaPool pool, java.lang.String schemaurl)
           
 void checkFunctions()
           
protected static void copyNamespaceDeclarations(org.w3c.dom.Element to, org.w3c.dom.Element from, boolean recursive, java.lang.String elementPrefix)
          this mehod copies xmlns:xxx attributes from an element to another.
protected  InstanceElementImpl createLazyBastardInstance()
          this method generates the lazy bastard instance by adding a new 'instance' element as a child of 'model' and adds an 'instanceData' element to it.
protected  void createSchemaPool()
           
 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  InstanceElementImpl findFirstInstance()
           
 void functionValueChanged(java.lang.String function)
           
 org.w3c.dom.NodeList getBinds()
          return all binds in DOCUMENT ORDER (important for initialization)
 DynamicDependencyHandler getDynamicDependencyHandler()
           
 java.lang.String getId()
          The unique id.
 InstanceElementImpl getInstance()
           
 InstanceElementImpl getInstance(java.lang.String id)
           
 org.w3c.dom.Document getInstanceDocument()
           
 org.w3c.dom.Document getInstanceDocument(java.lang.String id)
           
 java.util.Enumeration getInstanceDocuments()
           
 org.w3c.dom.Node getInstanceRoot()
          public method for ECMAScripts to get the root of the instance document
 InstanceElementImpl getLazyBastardInstance()
           
 ModelElementImpl getModel()
          Gets the default XForm element
 short getModelStatus()
           
 SchemaElementImpl getSchema()
           
 SchemaPool getSchemaPool()
           
 org.w3c.dom.Element getSchemaRoot()
           
 SubmissionElementImpl getSubmitInfo(java.lang.String id)
          Goes dynamically thru children and returns the submitinfo, with the id = id;
 XPathEngine getXPathEngine()
           
 void handleEvent(org.w3c.dom.events.Event evt)
          The DOM event handler This method gets all changes to the instance data, and dispatches correct events NOTE: maybe this should be moved to the InstanceDocument, the only problem is that actually they both need the information: instance does internal changes and model dispatches events etc.
 void init()
          Initialize this element.
 void instanceAdded(InstanceElementImpl newChild)
          the instance element registers itself using this method
 void internalRecalculate()
           
protected  void internalRefresh()
          This method does the refresh processing.
protected  void internalRemove(org.w3c.dom.Node newChild)
           
 boolean internalRevalidate()
          Revalidate the instance
protected  void listenAllMutations()
           
 void outermostActionExited()
           
 void rebuild(boolean canBeDeferred)
          rebuild the calculation engine
 void recalculate()
          recalculate this model
 void recreateUIBindings()
          this method goes thru all UI elements which bind to this model and recreates their bindings
protected  void recreateUIBindingsRecursively(org.w3c.dom.Element elem)
          this method recreates all UI bindings recursively when e.g.
 void reevaluateUIBindings()
          re-evaluate all UI bindings
 void refresh()
          recalculate this model
protected  void removeAllMutationListeners()
           
protected  void removeAllMutationListeners(org.w3c.dom.Node n)
           
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
          Do all stuff when a node is removed.
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
          this method tries to propagate DOM changes to the layout element, if such is found
 void reset()
          reset all instances and the model
protected  void resetInstances()
           
 void resetModel(boolean reAddEventListeners)
          reset the model without resetting the instances
static InstanceItem retrieveInstanceItem(org.w3c.dom.Node n)
           
 void revalidate()
          revalidate this model
protected  void rewire()
          This re-evaluates all dirty UI bindings.
protected  void runEventsAfterChanges()
           
 void schemaAdded(SchemaElementImpl newChild)
          the instance element registers itself using this method
protected  void setModelStatus(short status)
           
 void uiValueChange(org.w3c.dom.Node n, java.lang.String text)
          the ui should always change values through this method.
 boolean validation()
           
protected  boolean validationAttribute()
           
protected  boolean validationElement()
           
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.xforms.dom.XFormsElementImpl
debugNode, dispatch, dispatch, dispatchActivateEvent, dispatchClickEvent, findFirstRelevantControl, getBrowser, getClassName, getComponentFactory, getModel, getModelId, getModelInScope, getSrc, getStyleAttrValue, getXMLDocument, handleXFormsException, initializeXMLEvents, isCSSLayoutDoc, moveNodes, printEvent, removeAllChildren, retrieveResourceAsString, serializeNode, setClassName, setHandler, setId, setOwnerDoc
 
Methods inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
addView, belongsToTree, getViews, insertBefore, isCurrentlyVisible, isFocusPoint, isPseudoClass, isVisibleByCSSProperties, notifyPseudoRemoved, removeAllViews, removeAttribute, setAttribute, setStatus, styleChanged, updateViews
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, 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, setAttributeNode, 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, hasStyle, isPseudoClass, setRuleNode, setStyle
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, 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, 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

instances

protected java.util.Hashtable instances
all instances with an id are stored in a hashtable


model

protected SchemaElementImpl model

maindep

protected MainDependencyGraph maindep

MODEL_NOTCONSTRUCTED

public static final short MODEL_NOTCONSTRUCTED
See Also:
Constant Field Values

MODEL_CONSTRUCTING

public static final short MODEL_CONSTRUCTING
See Also:
Constant Field Values

MODEL_READY

public static final short MODEL_READY
See Also:
Constant Field Values

MODEL_REFRESHING

public static final short MODEL_REFRESHING
See Also:
Constant Field Values

MODEL_CALCULATING

public static final short MODEL_CALCULATING
See Also:
Constant Field Values

MODEL_VALIDATING

public static final short MODEL_VALIDATING
See Also:
Constant Field Values

modelStatus

protected short modelStatus

invalidNodes

protected java.util.Vector invalidNodes
currently invalid nodes


changedNodes

protected java.util.Vector changedNodes
the changed nodes


dynDependencyHandler

protected DynamicDependencyHandler dynDependencyHandler
the dynamic dependency handler


schemaPool

protected SchemaPool schemaPool
my schema pool


xpathAPI

protected XPathEngine xpathAPI
the cached XPath api context


defaultInstance

protected InstanceElementImpl defaultInstance
the cached default instance


needsRecalculate

protected boolean needsRecalculate
for deferred updates


needsRefresh

protected boolean needsRefresh
for deferred updates


needsRevalidate

protected boolean needsRevalidate
for deferred updates


needsRebuild

protected boolean needsRebuild
for deferred updates


lazyBastardInstance

protected InstanceElementImpl lazyBastardInstance
for lazy bastard mode, only one generated instance can be found per model. Note that there can only be one instance per model if the lazy bastard instance exists


SCHEMA_URI

public static final java.lang.String SCHEMA_URI
See Also:
Constant Field Values

schemaElement

protected org.w3c.dom.Element schemaElement
Constructor Detail

ModelElementImpl

public ModelElementImpl(XFormsElementHandler owner,
                        java.lang.String ns,
                        java.lang.String name)
Method Detail

instanceAdded

public void instanceAdded(InstanceElementImpl newChild)
the instance element registers itself using this method


schemaAdded

public void schemaAdded(SchemaElementImpl newChild)
the instance element registers itself using this method


removeChild

public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
                             throws org.w3c.dom.DOMException
Description copied from class: VisualElementImpl
Do all stuff when a node is removed. One thing is to remove all components from view

Specified by:
removeChild in interface org.w3c.dom.Node
Overrides:
removeChild in class VisualElementImpl
Throws:
org.w3c.dom.DOMException

replaceChild

public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node oldChild)
                              throws org.w3c.dom.DOMException
Description copied from class: VisualElementImpl
this method tries to propagate DOM changes to the layout element, if such is found

Specified by:
replaceChild in interface org.w3c.dom.Node
Overrides:
replaceChild in class VisualElementImpl
Throws:
org.w3c.dom.DOMException

internalRemove

protected void internalRemove(org.w3c.dom.Node newChild)

setModelStatus

protected void setModelStatus(short status)

getModelStatus

public short getModelStatus()

init

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

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

checkFunctions

public void checkFunctions()
                    throws XFormsException
Throws:
XFormsException

getSubmitInfo

public SubmissionElementImpl getSubmitInfo(java.lang.String id)
Goes dynamically thru children and returns the submitinfo, with the id = id;


findFirstInstance

protected InstanceElementImpl findFirstInstance()

getInstance

public InstanceElementImpl getInstance()

getSchema

public SchemaElementImpl getSchema()
Overrides:
getSchema in class PrologElement

getId

public java.lang.String getId()
Description copied from interface: XFormsElement
The unique id.

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

getDynamicDependencyHandler

public DynamicDependencyHandler getDynamicDependencyHandler()

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

validation

public boolean validation()

getSchemaRoot

public org.w3c.dom.Element getSchemaRoot()

validationAttribute

protected boolean validationAttribute()

validationElement

protected boolean validationElement()

reevaluateUIBindings

public void reevaluateUIBindings()
re-evaluate all UI bindings


internalRevalidate

public boolean internalRevalidate()
Revalidate the instance


internalRecalculate

public void internalRecalculate()

uiValueChange

public void uiValueChange(org.w3c.dom.Node n,
                          java.lang.String text)
the ui should always change values through this method. This method will do the value change and trigger recalculate etc. processing

Parameters:
n -
text -

runEventsAfterChanges

protected void runEventsAfterChanges()

handleEvent

public void handleEvent(org.w3c.dom.events.Event evt)
The DOM event handler This method gets all changes to the instance data, and dispatches correct events NOTE: maybe this should be moved to the InstanceDocument, the only problem is that actually they both need the information: instance does internal changes and model dispatches events etc.

Specified by:
handleEvent in interface org.w3c.dom.events.EventListener
Overrides:
handleEvent in class VisualElementImpl

removeAllMutationListeners

protected void removeAllMutationListeners(org.w3c.dom.Node n)

listenAllMutations

protected void listenAllMutations()

removeAllMutationListeners

protected void removeAllMutationListeners()

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 XSmilesElementImpl

getBinds

public org.w3c.dom.NodeList getBinds()
return all binds in DOCUMENT ORDER (important for initialization)


getSchemaPool

public SchemaPool getSchemaPool()
Returns:
the pool where all schemas for this model are cached

retrieveInstanceItem

public static InstanceItem retrieveInstanceItem(org.w3c.dom.Node n)

copyNamespaceDeclarations

protected static void copyNamespaceDeclarations(org.w3c.dom.Element to,
                                                org.w3c.dom.Element from,
                                                boolean recursive,
                                                java.lang.String elementPrefix)
this mehod copies xmlns:xxx attributes from an element to another. It goes towards to the root and does it for every node if recursive is true


createSchemaPool

protected void createSchemaPool()
                         throws XFormsLinkException
Throws:
XFormsLinkException

addSchemaFromElement

protected void addSchemaFromElement(org.w3c.dom.Element schema,
                                    SchemaPool pool,
                                    java.lang.String schemaurl)
                             throws XFormsLinkException
Throws:
XFormsLinkException

getInstanceRoot

public org.w3c.dom.Node getInstanceRoot()
public method for ECMAScripts to get the root of the instance document


getInstanceDocument

public org.w3c.dom.Document getInstanceDocument()

getInstanceDocument

public org.w3c.dom.Document getInstanceDocument(java.lang.String id)
Specified by:
getInstanceDocument in interface ModelContext

getInstance

public InstanceElementImpl getInstance(java.lang.String id)
Overrides:
getInstance in class PrologElement

rebuild

public void rebuild(boolean canBeDeferred)
rebuild the calculation engine


recalculate

public void recalculate()
recalculate this model


revalidate

public void revalidate()
revalidate this model


refresh

public void refresh()
recalculate this model


internalRefresh

protected void internalRefresh()
This method does the refresh processing. First, is re-evaluates (rewires) all dirty UI dependencies. Second, it refreshes all dirty MIP states and values in the UI, and throws the events.


rewire

protected void rewire()
This re-evaluates all dirty UI bindings. Called from internalRefersh


resetInstances

protected void resetInstances()

reset

public void reset()
reset all instances and the model


resetModel

public void resetModel(boolean reAddEventListeners)
reset the model without resetting the instances


recreateUIBindings

public void recreateUIBindings()
this method goes thru all UI elements which bind to this model and recreates their bindings


recreateUIBindingsRecursively

protected void recreateUIBindingsRecursively(org.w3c.dom.Element elem)
this method recreates all UI bindings recursively when e.g. reset or replace="instance" has happened


getXPathEngine

public XPathEngine getXPathEngine()
Specified by:
getXPathEngine in interface ModelContext

getModel

public ModelElementImpl getModel()
Description copied from class: XFormsElementImpl
Gets the default XForm element

Overrides:
getModel in class PrologElement

createLazyBastardInstance

protected InstanceElementImpl createLazyBastardInstance()
this method generates the lazy bastard instance by adding a new 'instance' element as a child of 'model' and adds an 'instanceData' element to it. Note that there can only be one instance if the lazy bastard instance exists


getLazyBastardInstance

public InstanceElementImpl getLazyBastardInstance()
Returns:
either null, if lazy bastard instance has not been created, or the reference to the lazy bastard instance if one exists. Note that there can only be one instance if the lazy bastard instance exists

outermostActionExited

public void outermostActionExited()

getInstanceDocuments

public java.util.Enumeration getInstanceDocuments()
Specified by:
getInstanceDocuments in interface XFormsModelElement

functionValueChanged

public void functionValueChanged(java.lang.String function)
Specified by:
functionValueChanged in interface FunctionChangeListener


X-Smiles 1.2