public class DefaultXBLManager extends java.lang.Object implements XBLManager, XBLConstants
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultXBLManager.DefAttrListener
DOM attribute mutation listener for definition elements.
|
protected static class |
DefaultXBLManager.DefinitionRecord
Record class for storing information about an XBL definition.
|
protected class |
DefaultXBLManager.DefNodeInsertedListener
DOM node inserted listener for definition elements.
|
protected class |
DefaultXBLManager.DefNodeRemovedListener
DOM node removed listener for definition elements.
|
protected class |
DefaultXBLManager.DocInsertedListener
DOM node inserted listener for the document.
|
protected class |
DefaultXBLManager.DocRemovedListener
DOM node removed listener for the document.
|
protected class |
DefaultXBLManager.DocSubtreeListener
DOM subtree mutation listener for the document.
|
protected class |
DefaultXBLManager.ImportAttrListener
DOM attribute mutation listener for import elements.
|
protected class |
DefaultXBLManager.ImportInsertedListener
DOM node inserted listener for imported XBL trees.
|
protected class |
DefaultXBLManager.ImportRecord
Record class for storing information about an XBL import.
|
protected static class |
DefaultXBLManager.ImportRemovedListener
DOM node removed listener for imported XBL trees.
|
protected class |
DefaultXBLManager.ImportSubtreeListener
DOM subtree listener for imported XBL trees.
|
protected class |
DefaultXBLManager.RefAttrListener
DOM attribute mutation listener for referencing definition elements.
|
protected class |
DefaultXBLManager.TemplateMutationListener
DOM mutation listener for template elements.
|
protected class |
DefaultXBLManager.XblChildNodes
To iterate over the XBL child nodes.
|
protected class |
DefaultXBLManager.XBLRecord
XBL record.
|
protected class |
DefaultXBLManager.XblScopedChildNodes
To iterate over the scoped XBL child nodes.
|
Modifier and Type | Field and Description |
---|---|
protected javax.swing.event.EventListenerList |
bindingListenerList
Global event listener list for XBL binding related events.
|
protected java.util.Map |
contentManagers
Map of shadow trees to content managers.
|
protected javax.swing.event.EventListenerList |
contentSelectionChangedListenerList
Global event listener list for ContentSelectionChanged events.
|
protected BridgeContext |
ctx
The BridgeContext.
|
protected DoublyIndexedTable |
definitionLists
Map of namespace URI/local name pairs to ordered sets of
definition records.
|
protected DoublyIndexedTable |
definitions
Map of definition element/import element pairs to definition records.
|
protected DefaultXBLManager.DocInsertedListener |
docInsertedListener
DOM node inserted listener for the document.
|
protected DefaultXBLManager.DocRemovedListener |
docRemovedListener
DOM node removed listener for the document.
|
protected DefaultXBLManager.DocSubtreeListener |
docSubtreeListener
DOM subtree mutation listener for the document.
|
protected Document |
document
The document.
|
protected DefaultXBLManager.ImportAttrListener |
importAttrListener
DOM attribute listener for import elements.
|
protected java.util.Map |
imports
Map of import elements to import records.
|
protected boolean |
isProcessing
Whether XBL processing is currently taking place.
|
protected DefaultXBLManager.RefAttrListener |
refAttrListener
DOM attribute listener for referencing definition elements.
|
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 and Description |
---|
DefaultXBLManager(Document doc,
BridgeContext ctx)
Creates a new DefaultXBLManager for the given document.
|
Modifier and Type | Method and Description |
---|---|
void |
addBindingListener(BindingListener l)
Adds the specified BindingListener to the global listener list.
|
void |
addContentSelectionChangedListener(ContentSelectionChangedListener l)
Adds the specified ContentSelectionChangedListener to the
global listener list.
|
protected void |
addDefinition(java.lang.String namespaceURI,
java.lang.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 void |
addDefinitionElementListeners(XBLOMDefinitionElement def,
DefaultXBLManager.ImportRecord ir)
Adds DOM mutation listeners to the given definition element.
|
protected void |
addDefinitionRef(Element defRef)
Adds a definition through its referring definition element (one
with a 'ref' attribute).
|
protected void |
addImport(Element imp)
Imports bindings from another document.
|
protected void |
addImportedDefinitions(Element imp,
Node n)
Adds the definitions in the given imported subtree.
|
protected void |
addTemplateElementListeners(XBLOMTemplateElement template,
DefaultXBLManager.ImportRecord ir)
Adds DOM mutation listeners to the given template element.
|
protected void |
bind(Element e)
Binds each bindable element in the given element's subtree.
|
protected XBLOMShadowTreeElement |
cloneTemplate(XBLOMTemplateElement template)
Clones a template element for use as a shadow tree.
|
static int |
computeBubbleLimit(Node from,
Node to)
Determines the number of nodes events should bubble if the
mouse pointer has moved from one element to another.
|
protected void |
dispatchBindingChangedEvent(Element bindableElement,
Element shadowTree)
Dispatches a BindingEvent the registered listeners.
|
protected void |
fireShadowTreeEvent(BindableElement elt,
java.lang.String type,
XBLShadowTreeElement e)
Fires a ShadowTreeEvent of the given type on this element.
|
protected DefaultXBLManager.DefinitionRecord |
getActiveDefinition(java.lang.String namespaceURI,
java.lang.String localName)
Returns the definition record of the active definition for namespace
URI/local name pair.
|
ContentManager |
getContentManager(Node n)
Returns the ContentManager that handles the shadow tree the given
node resides in.
|
protected java.lang.Object[] |
getContentSelectionChangedListeners()
Returns an array of the gloabl ContentSelectionChangedListeners.
|
protected DefaultXBLManager.XBLRecord |
getRecord(Node n)
Returns the XBL record for the given node.
|
Element |
getXblBoundElement(Node n)
Get the bound element whose shadow tree a node resides in.
|
NodeList |
getXblChildNodes(Node n)
Get the list of child nodes of a node in the fully flattened tree.
|
XBLOMContentElement |
getXblContentElement(Node n)
Returns the content element that caused the given node to be
present in the flattened tree.
|
NodeList |
getXblDefinitions(Node n)
Get the xbl:definition elements currently binding an element.
|
Node |
getXblFirstChild(Node n)
Get the first child node of a node in the fully flattened tree.
|
Element |
getXblFirstElementChild(Node n)
Get the first element child of a node in the fully flattened tree.
|
Node |
getXblLastChild(Node n)
Get the last child node of a node in the fully flattened tree.
|
Element |
getXblLastElementChild(Node n)
Get the last element child of a node in the fully flattened tree.
|
Element |
getXblNextElementSibling(Node n)
Get the first element that follows a node in the
xblParentNode's xblChildNodes list.
|
Node |
getXblNextSibling(Node n)
Get the node which directly follows a node in the xblParentNode's
xblChildNodes list.
|
Node |
getXblParentNode(Node n)
Get the parent of a node in the fully flattened tree.
|
Element |
getXblPreviousElementSibling(Node n)
Get the first element that precedes the a node in the
xblParentNode's xblChildNodes list.
|
Node |
getXblPreviousSibling(Node n)
Get the node which directly precedes a node in the xblParentNode's
xblChildNodes list.
|
NodeList |
getXblScopedChildNodes(Node n)
Get the list of child nodes of a node in the fully flattened tree
that are within the same shadow scope.
|
Element |
getXblShadowTree(Node n)
Get the shadow tree of a node.
|
void |
invalidateChildNodes(Node n)
Mark the xblChildNodes and xblScopedChildNodes variables
as invalid.
|
protected boolean |
isActiveDefinition(XBLOMDefinitionElement def,
Element imp)
Returns whether the given definition element is the active one
for its element name.
|
boolean |
isProcessing()
Returns whether XBL processing is currently enabled.
|
protected void |
rebind(java.lang.String namespaceURI,
java.lang.String localName,
Element e)
Rebinds each bindable element of the given name in the given element's
subtree.
|
void |
removeBindingListener(BindingListener l)
Removes the specified BindingListener from the global listener list.
|
void |
removeContentSelectionChangedListener(ContentSelectionChangedListener l)
Removes the specified ContentSelectionChangedListener from the
global listener list.
|
protected void |
removeDefinition(DefaultXBLManager.DefinitionRecord defRec)
Removes an xbl:definition element from the list of definitions that
could possibly affect elements with the specified QName.
|
protected void |
removeDefinitionElementListeners(XBLOMDefinitionElement def,
DefaultXBLManager.ImportRecord ir)
Removes DOM mutation listeners from the given definition element.
|
protected void |
removeDefinitionRef(Element defRef)
Removes a definition through its referring definition element (one
with a 'ref' attribute).
|
protected void |
removeImport(Element imp)
Removes an import.
|
protected void |
removeTemplateElementListeners(XBLOMTemplateElement template,
DefaultXBLManager.ImportRecord ir)
Removes DOM mutation listeners from the given template element.
|
protected void |
setActiveDefinition(BindableElement elt,
DefaultXBLManager.DefinitionRecord defRec)
Sets the given definition as the active one for a particular
bindable element.
|
protected void |
setXblShadowTree(BindableElement elt,
XBLOMShadowTreeElement newShadow)
Sets the shadow tree for the given bindable element.
|
void |
startProcessing()
Starts XBL processing on the document.
|
void |
stopProcessing()
Stops XBL processing on the document.
|
protected void |
unbind(Element e)
Unbinds each bindable element in the given element's subtree.
|
protected void |
updateLinks(Node n)
Updates the xblPreviousSibling and xblNextSibling properties of the
given XBL node.
|
protected boolean isProcessing
protected Document document
protected BridgeContext ctx
protected DoublyIndexedTable definitionLists
protected DoublyIndexedTable definitions
protected java.util.Map contentManagers
protected java.util.Map imports
protected DefaultXBLManager.DocInsertedListener docInsertedListener
protected DefaultXBLManager.DocRemovedListener docRemovedListener
protected DefaultXBLManager.DocSubtreeListener docSubtreeListener
protected DefaultXBLManager.ImportAttrListener importAttrListener
protected DefaultXBLManager.RefAttrListener refAttrListener
protected javax.swing.event.EventListenerList bindingListenerList
protected javax.swing.event.EventListenerList contentSelectionChangedListenerList
public DefaultXBLManager(Document doc, BridgeContext ctx)
public void startProcessing()
startProcessing
in interface XBLManager
public void stopProcessing()
stopProcessing
in interface XBLManager
public boolean isProcessing()
isProcessing
in interface XBLManager
protected void addDefinitionRef(Element defRef)
protected void removeDefinitionRef(Element defRef)
protected void addImport(Element imp)
protected void addImportedDefinitions(Element imp, Node n)
protected void removeImport(Element imp)
protected void addDefinition(java.lang.String namespaceURI, java.lang.String localName, XBLOMDefinitionElement def, Element imp)
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 documentprotected void addDefinitionElementListeners(XBLOMDefinitionElement def, DefaultXBLManager.ImportRecord ir)
protected void addTemplateElementListeners(XBLOMTemplateElement template, DefaultXBLManager.ImportRecord ir)
protected void removeDefinition(DefaultXBLManager.DefinitionRecord defRec)
protected void removeDefinitionElementListeners(XBLOMDefinitionElement def, DefaultXBLManager.ImportRecord ir)
protected void removeTemplateElementListeners(XBLOMTemplateElement template, DefaultXBLManager.ImportRecord ir)
protected DefaultXBLManager.DefinitionRecord getActiveDefinition(java.lang.String namespaceURI, java.lang.String localName)
protected void unbind(Element e)
protected void bind(Element e)
protected void rebind(java.lang.String namespaceURI, java.lang.String localName, Element e)
protected void setActiveDefinition(BindableElement elt, DefaultXBLManager.DefinitionRecord defRec)
protected void setXblShadowTree(BindableElement elt, XBLOMShadowTreeElement newShadow)
protected void fireShadowTreeEvent(BindableElement elt, java.lang.String type, XBLShadowTreeElement e)
protected XBLOMShadowTreeElement cloneTemplate(XBLOMTemplateElement template)
public Node getXblParentNode(Node n)
getXblParentNode
in interface XBLManager
public NodeList getXblChildNodes(Node n)
getXblChildNodes
in interface XBLManager
public NodeList getXblScopedChildNodes(Node n)
getXblScopedChildNodes
in interface XBLManager
public Node getXblFirstChild(Node n)
getXblFirstChild
in interface XBLManager
public Node getXblLastChild(Node n)
getXblLastChild
in interface XBLManager
public Node getXblPreviousSibling(Node n)
getXblPreviousSibling
in interface XBLManager
public Node getXblNextSibling(Node n)
getXblNextSibling
in interface XBLManager
public Element getXblFirstElementChild(Node n)
getXblFirstElementChild
in interface XBLManager
public Element getXblLastElementChild(Node n)
getXblLastElementChild
in interface XBLManager
public Element getXblPreviousElementSibling(Node n)
getXblPreviousElementSibling
in interface XBLManager
public Element getXblNextElementSibling(Node n)
getXblNextElementSibling
in interface XBLManager
public Element getXblBoundElement(Node n)
getXblBoundElement
in interface XBLManager
public Element getXblShadowTree(Node n)
getXblShadowTree
in interface XBLManager
public NodeList getXblDefinitions(Node n)
getXblDefinitions
in interface XBLManager
protected DefaultXBLManager.XBLRecord getRecord(Node n)
protected void updateLinks(Node n)
public XBLOMContentElement getXblContentElement(Node n)
public static int computeBubbleLimit(Node from, Node to)
from
- the element from which the mouse pointer movedto
- the element to which the mouse pointer movedpublic ContentManager getContentManager(Node n)
public void invalidateChildNodes(Node n)
public void addContentSelectionChangedListener(ContentSelectionChangedListener l)
public void removeContentSelectionChangedListener(ContentSelectionChangedListener l)
protected java.lang.Object[] getContentSelectionChangedListeners()
public void addBindingListener(BindingListener l)
public void removeBindingListener(BindingListener l)
protected void dispatchBindingChangedEvent(Element bindableElement, Element shadowTree)
bindableElement
- the bindable element whose binding has changedshadowTree
- the new shadow tree of the bindable elementprotected boolean isActiveDefinition(XBLOMDefinitionElement def, Element imp)
Copyright © 2022 Apache Software Foundation. All Rights Reserved.