Class DefaultXBLManager
java.lang.Object
org.apache.batik.bridge.svg12.DefaultXBLManager
- All Implemented Interfaces:
XBLManager, XBLConstants
A full featured sXBL manager.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classDOM attribute mutation listener for definition elements.protected static classRecord class for storing information about an XBL definition.protected classDOM node inserted listener for definition elements.protected classDOM node removed listener for definition elements.protected classDOM node inserted listener for the document.protected classDOM node removed listener for the document.protected classDOM subtree mutation listener for the document.protected classDOM attribute mutation listener for import elements.protected classDOM node inserted listener for imported XBL trees.protected classRecord class for storing information about an XBL import.protected static classDOM node removed listener for imported XBL trees.protected classDOM subtree listener for imported XBL trees.protected classDOM attribute mutation listener for referencing definition elements.protected classDOM mutation listener for template elements.protected classTo iterate over the XBL child nodes.protected classXBL record.protected classTo iterate over the scoped XBL child nodes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EventListenerListGlobal event listener list for XBL binding related events.protected MapMap of shadow trees to content managers.protected EventListenerListGlobal event listener list for ContentSelectionChanged events.protected BridgeContextThe BridgeContext.protected DoublyIndexedTableMap of namespace URI/local name pairs to ordered sets of definition records.protected DoublyIndexedTableMap of definition element/import element pairs to definition records.protected DefaultXBLManager.DocInsertedListenerDOM node inserted listener for the document.protected DefaultXBLManager.DocRemovedListenerDOM node removed listener for the document.protected DefaultXBLManager.DocSubtreeListenerDOM subtree mutation listener for the document.protected DocumentThe document.protected DefaultXBLManager.ImportAttrListenerDOM attribute listener for import elements.protected MapMap of import elements to import records.protected booleanWhether XBL processing is currently taking place.protected DefaultXBLManager.RefAttrListenerDOM attribute listener for referencing definition elements.Fields inherited from interface XBLConstants
XBL_BINDINGS_ATTRIBUTE, XBL_BOUND_EVENT_TYPE, XBL_CONTENT_TAG, XBL_DEFINITION_TAG, XBL_ELEMENT_ATTRIBUTE, XBL_HANDLER_GROUP_TAG, XBL_IMPORT_TAG, XBL_INCLUDES_ATTRIBUTE, XBL_NAMESPACE_URI, XBL_ONBOUND_ATTRIBUTE, XBL_ONPREBIND_ATTRIBUTE, XBL_ONUNBINDING_ATTRIBUTE, XBL_PREBIND_EVENT_TYPE, XBL_REF_ATTRIBUTE, XBL_SHADOW_TREE_TAG, XBL_TEMPLATE_TAG, XBL_UNBINDING_EVENT_TYPE, XBL_XBL_TAG -
Constructor Summary
ConstructorsConstructorDescriptionDefaultXBLManager(Document doc, BridgeContext ctx) Creates a new DefaultXBLManager for the given document. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified BindingListener to the global listener list.voidAdds the specified ContentSelectionChangedListener to the global listener list.protected voidaddDefinition(String namespaceURI, String localName, XBLOMDefinitionElement def, Element imp) Adds an xbl:definition element to the list of definitions that could possibly affect elements with the specified QName.protected voidAdds DOM mutation listeners to the given definition element.protected voidaddDefinitionRef(Element defRef) Adds a definition through its referring definition element (one with a 'ref' attribute).protected voidImports bindings from another document.protected voidaddImportedDefinitions(Element imp, Node n) Adds the definitions in the given imported subtree.protected voidAdds DOM mutation listeners to the given template element.protected voidBinds each bindable element in the given element's subtree.protected XBLOMShadowTreeElementcloneTemplate(XBLOMTemplateElement template) Clones a template element for use as a shadow tree.static intcomputeBubbleLimit(Node from, Node to) Determines the number of nodes events should bubble if the mouse pointer has moved from one element to another.protected voiddispatchBindingChangedEvent(Element bindableElement, Element shadowTree) Dispatches a BindingEvent the registered listeners.protected voidfireShadowTreeEvent(BindableElement elt, String type, XBLShadowTreeElement e) Fires a ShadowTreeEvent of the given type on this element.protected DefaultXBLManager.DefinitionRecordgetActiveDefinition(String namespaceURI, String localName) Returns the definition record of the active definition for namespace URI/local name pair.Returns the ContentManager that handles the shadow tree the given node resides in.protected Object[]Returns an array of the gloabl ContentSelectionChangedListeners.protected DefaultXBLManager.XBLRecordReturns the XBL record for the given node.Get the bound element whose shadow tree a node resides in.Get the list of child nodes of a node in the fully flattened tree.Returns the content element that caused the given node to be present in the flattened tree.Get the xbl:definition elements currently binding an element.Get the first child node of a node in the fully flattened tree.Get the first element child of a node in the fully flattened tree.Get the last child node of a node in the fully flattened tree.Get the last element child of a node in the fully flattened tree.Get the first element that follows a node in the xblParentNode's xblChildNodes list.Get the node which directly follows a node in the xblParentNode's xblChildNodes list.Get the parent of a node in the fully flattened tree.Get the first element that precedes the a node in the xblParentNode's xblChildNodes list.Get the node which directly precedes a node in the xblParentNode's xblChildNodes list.Get the list of child nodes of a node in the fully flattened tree that are within the same shadow scope.Get the shadow tree of a node.voidMark the xblChildNodes and xblScopedChildNodes variables as invalid.protected booleanisActiveDefinition(XBLOMDefinitionElement def, Element imp) Returns whether the given definition element is the active one for its element name.booleanReturns whether XBL processing is currently enabled.protected voidRebinds each bindable element of the given name in the given element's subtree.voidRemoves the specified BindingListener from the global listener list.voidRemoves the specified ContentSelectionChangedListener from the global listener list.protected voidRemoves an xbl:definition element from the list of definitions that could possibly affect elements with the specified QName.protected voidRemoves DOM mutation listeners from the given definition element.protected voidremoveDefinitionRef(Element defRef) Removes a definition through its referring definition element (one with a 'ref' attribute).protected voidremoveImport(Element imp) Removes an import.protected voidRemoves DOM mutation listeners from the given template element.protected voidSets the given definition as the active one for a particular bindable element.protected voidsetXblShadowTree(BindableElement elt, XBLOMShadowTreeElement newShadow) Sets the shadow tree for the given bindable element.voidStarts XBL processing on the document.voidStops XBL processing on the document.protected voidUnbinds each bindable element in the given element's subtree.protected voidupdateLinks(Node n) Updates the xblPreviousSibling and xblNextSibling properties of the given XBL node.
-
Field Details
-
isProcessing
protected boolean isProcessingWhether XBL processing is currently taking place. -
document
The document. -
ctx
The BridgeContext. -
definitionLists
Map of namespace URI/local name pairs to ordered sets of definition records. -
definitions
Map of definition element/import element pairs to definition records. -
contentManagers
Map of shadow trees to content managers. -
imports
Map of import elements to import records. -
docInsertedListener
DOM node inserted listener for the document. -
docRemovedListener
DOM node removed listener for the document. -
docSubtreeListener
DOM subtree mutation listener for the document. -
importAttrListener
DOM attribute listener for import elements. -
refAttrListener
DOM attribute listener for referencing definition elements. -
bindingListenerList
Global event listener list for XBL binding related events. -
contentSelectionChangedListenerList
Global event listener list for ContentSelectionChanged events.
-
-
Constructor Details
-
DefaultXBLManager
Creates a new DefaultXBLManager for the given document.
-
-
Method Details
-
startProcessing
public void startProcessing()Starts XBL processing on the document.- Specified by:
startProcessingin interfaceXBLManager
-
stopProcessing
public void stopProcessing()Stops XBL processing on the document.- Specified by:
stopProcessingin interfaceXBLManager
-
isProcessing
public boolean isProcessing()Returns whether XBL processing is currently enabled.- Specified by:
isProcessingin interfaceXBLManager
-
addDefinitionRef
Adds a definition through its referring definition element (one with a 'ref' attribute). -
removeDefinitionRef
Removes a definition through its referring definition element (one with a 'ref' attribute). -
addImport
Imports bindings from another document. -
addImportedDefinitions
-
removeImport
Removes an import. -
addDefinition
protected void addDefinition(String namespaceURI, String localName, XBLOMDefinitionElement def, Element imp) Adds an xbl:definition element to the list of definitions that could possibly affect elements with the specified QName. This may or may not actually cause a new binding to come in to effect, as this new definition element may be added earlier in the document than another already in effect.- Parameters:
namespaceURI- the namespace URI of the bound elementslocalName- the local name of the bound elementsdef- the xbl:definition elementimp- the xbl:import or xbl;definition element through which this definition is being added, or null if the binding is in the original document
-
addDefinitionElementListeners
protected void addDefinitionElementListeners(XBLOMDefinitionElement def, DefaultXBLManager.ImportRecord ir) Adds DOM mutation listeners to the given definition element. -
addTemplateElementListeners
protected void addTemplateElementListeners(XBLOMTemplateElement template, DefaultXBLManager.ImportRecord ir) Adds DOM mutation listeners to the given template element. -
removeDefinition
Removes an xbl:definition element from the list of definitions that could possibly affect elements with the specified QName. This will only cause a new binding to come in to effect if it is currently active. -
removeDefinitionElementListeners
protected void removeDefinitionElementListeners(XBLOMDefinitionElement def, DefaultXBLManager.ImportRecord ir) Removes DOM mutation listeners from the given definition element. -
removeTemplateElementListeners
protected void removeTemplateElementListeners(XBLOMTemplateElement template, DefaultXBLManager.ImportRecord ir) Removes DOM mutation listeners from the given template element. -
getActiveDefinition
protected DefaultXBLManager.DefinitionRecord getActiveDefinition(String namespaceURI, String localName) Returns the definition record of the active definition for namespace URI/local name pair. -
unbind
Unbinds each bindable element in the given element's subtree. -
bind
Binds each bindable element in the given element's subtree. -
rebind
-
setActiveDefinition
Sets the given definition as the active one for a particular bindable element. -
setXblShadowTree
Sets the shadow tree for the given bindable element. -
fireShadowTreeEvent
Fires a ShadowTreeEvent of the given type on this element. -
cloneTemplate
Clones a template element for use as a shadow tree. -
getXblParentNode
Get the parent of a node in the fully flattened tree.- Specified by:
getXblParentNodein interfaceXBLManager
-
getXblChildNodes
Get the list of child nodes of a node in the fully flattened tree.- Specified by:
getXblChildNodesin interfaceXBLManager
-
getXblScopedChildNodes
Get the list of child nodes of a node in the fully flattened tree that are within the same shadow scope.- Specified by:
getXblScopedChildNodesin interfaceXBLManager
-
getXblFirstChild
Get the first child node of a node in the fully flattened tree.- Specified by:
getXblFirstChildin interfaceXBLManager
-
getXblLastChild
Get the last child node of a node in the fully flattened tree.- Specified by:
getXblLastChildin interfaceXBLManager
-
getXblPreviousSibling
Get the node which directly precedes a node in the xblParentNode's xblChildNodes list.- Specified by:
getXblPreviousSiblingin interfaceXBLManager
-
getXblNextSibling
Get the node which directly follows a node in the xblParentNode's xblChildNodes list.- Specified by:
getXblNextSiblingin interfaceXBLManager
-
getXblFirstElementChild
Get the first element child of a node in the fully flattened tree.- Specified by:
getXblFirstElementChildin interfaceXBLManager
-
getXblLastElementChild
Get the last element child of a node in the fully flattened tree.- Specified by:
getXblLastElementChildin interfaceXBLManager
-
getXblPreviousElementSibling
Get the first element that precedes the a node in the xblParentNode's xblChildNodes list.- Specified by:
getXblPreviousElementSiblingin interfaceXBLManager
-
getXblNextElementSibling
Get the first element that follows a node in the xblParentNode's xblChildNodes list.- Specified by:
getXblNextElementSiblingin interfaceXBLManager
-
getXblBoundElement
Get the bound element whose shadow tree a node resides in.- Specified by:
getXblBoundElementin interfaceXBLManager
-
getXblShadowTree
Get the shadow tree of a node.- Specified by:
getXblShadowTreein interfaceXBLManager
-
getXblDefinitions
Get the xbl:definition elements currently binding an element.- Specified by:
getXblDefinitionsin interfaceXBLManager
-
getRecord
Returns the XBL record for the given node. -
updateLinks
Updates the xblPreviousSibling and xblNextSibling properties of the given XBL node. -
getXblContentElement
Returns the content element that caused the given node to be present in the flattened tree. -
computeBubbleLimit
-
getContentManager
Returns the ContentManager that handles the shadow tree the given node resides in. -
invalidateChildNodes
Mark the xblChildNodes and xblScopedChildNodes variables as invalid. -
addContentSelectionChangedListener
Adds the specified ContentSelectionChangedListener to the global listener list. -
removeContentSelectionChangedListener
Removes the specified ContentSelectionChangedListener from the global listener list. -
getContentSelectionChangedListeners
Returns an array of the gloabl ContentSelectionChangedListeners. -
addBindingListener
Adds the specified BindingListener to the global listener list. -
removeBindingListener
Removes the specified BindingListener from the global listener list. -
dispatchBindingChangedEvent
-
isActiveDefinition
Returns whether the given definition element is the active one for its element name.
-