Package org.eclipse.e4.ui.css.core.dom

# Class ElementAdapter

java.lang.Object
org.eclipse.e4.ui.css.core.dom.ElementAdapter

All Implemented Interfaces:
  `CSSStylableElement`, `Element`, `Node`

Direct Known Subclasses:
  `EclipsePreferencesElement`, `ThemeDefinitionElement`, `ThemesExtensionElement`, `WidgetElement`

public abstract class ElementAdapter extends Object implements Element, CSSStylableElement
`Element` implementation.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected CSSEngine`
`engine`

### Fields inherited from interface org.w3c.dom.Node

`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

## Constructor Summary

Constructors
Constructor
Description
`ElementAdapter(Object nativeWidget, CSSEngine engine)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addStaticPseudoInstance(String pseudoE)`
Add static pseudo instance
`Node`
`appendChild(Node newChild)`
`Node`
`cloneNode(boolean arg0)`
`short`
`compareDocumentPosition(Node other)`
`void`
`copyDefaultStyleDeclarations(CSSStylableElement stylableElement)`
Copy all default style declarations defined into `stylableElement`.
`void`
`dispose()`
Method called when `CSSEngine.dispose()` is called.
`protected void`
`doApplyStyles()`
Apply styles for the native widget.
`abstract String`
`getAttribute(String arg0)`
`Attr`
`getAttributeNode(String arg0)`
`Attr`
`getAttributeNodeNS(String arg0, String arg1)`
`String`
`getAttributeNS(String namespace, String attr)`
`NamedNodeMap`
`getAttributes()`
`String`
`getBaseURI()`
`CSSStyleDeclaration`
`getDefaultStyleDeclaration(String pseudoE)`
Return the default `CSSStyleDeclaration` of the native widget.
`protected Element`
`getElement(Object widget)`
`NodeList`
`getElementsByTagName(String arg0)`
`NodeList`
`getElementsByTagNameNS(String arg0, String arg1)`
`Object`
`getFeature(String feature, String version)`
`Node`
`getFirstChild()`
`Node`
`getLastChild()`
`abstract String`
`getLocalName()`
`Object`
`getNativeWidget()`
Return the native widget wrapped (SWT widget, Swing Component...)
`Node`
`getNextSibling()`
`String`
`getNodeName()`
`short`
`getNodeType()`
`String`
`getNodeValue()`
`Document`
`getOwnerDocument()`
`String`
`getPrefix()`
`Node`
`getPreviousSibling()`
`TypeInfo`
`getSchemaTypeInfo()`
`String[]`
`getStaticPseudoInstances()`
Return all static pseudo instances.
`CSSExtendedProperties`
`getStyle()`
Return the `CSSExtendedProperties` of the native widget.
`String`
`getTagName()`
`String`
`getTextContent()`
`Object`
`getUserData(String key)`
`boolean`
`hasAttribute(String arg0)`
`boolean`
`hasAttributeNS(String namespace, String attr)`
`boolean`
`hasAttributes()`
`boolean`
`hasChildNodes()`
`void`
`initialize()`
Method called after the `CSSStylableElement` was linked to the native widget.
`Node`
`insertBefore(Node newChild, Node refChild)`
`boolean`
`isDefaultNamespace(String namespaceURI)`
`boolean`
`isEqualNode(Node arg)`
`boolean`
`isPseudoInstanceOf(String s)`
Return true if `s` is pseudo instance (ex :focus) and false otherwise.
`boolean`
`isSameNode(Node other)`
`boolean`
`isStaticPseudoInstance(String s)`
Return true if `s` is static pseudo instance (ex :CTabFolder:selected) and false otherwise.
`boolean`
`isSupported(String arg0, String arg1)`
`String`
`lookupNamespaceURI(String prefix)`
`String`
`lookupPrefix(String namespaceURI)`
`void`
`normalize()`
`void`
`onStylesApplied(NodeList nodes)`
Call-back method called when styles are applied to the all children nodes of the native widget
`void`
`removeAttribute(String arg0)`
`Attr`
`removeAttributeNode(Attr arg0)`
`void`
`removeAttributeNS(String arg0, String arg1)`
`Node`
`removeChild(Node arg0)`
`Node`
`replaceChild(Node arg0, Node arg1)`
`void`
`setAttribute(String arg0, String arg1)`
`Attr`
`setAttributeNode(Attr arg0)`
`Attr`
`setAttributeNodeNS(Attr arg0)`
`void`
`setAttributeNS(String arg0, String arg1, String arg2)`
`void`
`setDefaultStyleDeclaration(String pseudoE, CSSStyleDeclaration declaration)`
Set the default `CSSStyleDeclaration` of the native widget.
`void`
`setIdAttribute(String name, boolean isId)`
`void`
`setIdAttributeNode(Attr idAttr, boolean isId)`
`void`
`setIdAttributeNS(String namespaceURI, String localName, boolean isId)`
`void`
`setNodeValue(String arg0)`
`void`
`setPrefix(String arg0)`
`void`
`setTextContent(String textContent)`
`Object`
`setUserData(String key, Object data, UserDataHandler handler)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.e4.ui.css.core.dom.CSSStylableElement

`getCSSClass, getCSSId, getCSSStyle`

### Methods inherited from interface org.w3c.dom.Node

`getChildNodes, getNamespaceURI, getParentNode`

## Field Details

### engine

protected CSSEngine engine

## Constructor Details

### ElementAdapter

public ElementAdapter(Object nativeWidget, CSSEngine engine)

## Method Details

### addStaticPseudoInstance

public void addStaticPseudoInstance(String pseudoE)
Add static pseudo instance

### isStaticPseudoInstance

public boolean isStaticPseudoInstance(String s)
Description copied from interface: `CSSStylableElement`
Return true if `s` is static pseudo instance (ex :CTabFolder:selected) and false otherwise. Static pseudo instance is used for widget which define method which can update property (Color, BackgroundColor) for a special state (without manage listener like focus). For instance SWT CTabFolder#setSelectionBackground (Color color) is method which set background color when a CTabItem is selected.

Specified by:
  `isStaticPseudoInstance` in interface `CSSStylableElement`

### copyDefaultStyleDeclarations

public void copyDefaultStyleDeclarations(CSSStylableElement stylableElement)
Description copied from interface: `CSSStylableElement`
Copy all default style declarations defined into `stylableElement`.

Specified by:
  `copyDefaultStyleDeclarations` in interface `CSSStylableElement`

### getLocalName

public abstract String getLocalName()

Specified by:
  `getLocalName` in interface `Node`

### getAttribute

public abstract String getAttribute(String arg0)

Specified by:
  `getAttribute` in interface `Element`

### getAttributeNS

public String getAttributeNS(String namespace, String attr) throws DOMException

Specified by:
  `getAttributeNS` in interface `Element`
Throws:
  `DOMException`

### getAttributeNode

public Attr getAttributeNode(String arg0)

Specified by:
  `getAttributeNode` in interface `Element`

### getAttributeNodeNS

public Attr getAttributeNodeNS(String arg0, String arg1) throws DOMException

Specified by:
  `getAttributeNodeNS` in interface `Element`
Throws:
  `DOMException`

### getElementsByTagName

public NodeList getElementsByTagName(String arg0)

Specified by:
  `getElementsByTagName` in interface `Element`

### getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String arg0, String arg1) throws DOMException

Specified by:
  `getElementsByTagNameNS` in interface `Element`
Throws:
  `DOMException`

### hasAttribute

public boolean hasAttribute(String arg0)

Specified by:
  `hasAttribute` in interface `Element`

### hasAttributeNS

public boolean hasAttributeNS(String namespace, String attr) throws DOMException

Specified by:
  `hasAttributeNS` in interface `Element`
Throws:
  `DOMException`

### removeAttribute

public void removeAttribute(String arg0) throws DOMException

Specified by:
  `removeAttribute` in interface `Element`
Throws:
  `DOMException`

### removeAttributeNS

public void removeAttributeNS(String arg0, String arg1) throws DOMException

Specified by:
  `removeAttributeNS` in interface `Element`
Throws:
  `DOMException`

### removeAttributeNode

public Attr removeAttributeNode(Attr arg0) throws DOMException

Specified by:
  `removeAttributeNode` in interface `Element`
Throws:
  `DOMException`

### setAttribute

public void setAttribute(String arg0, String arg1) throws DOMException

Specified by:
  `setAttribute` in interface `Element`
Throws:
  `DOMException`

### setAttributeNS

public void setAttributeNS(String arg0, String arg1, String arg2) throws DOMException

Specified by:
  `setAttributeNS` in interface `Element`
Throws:
  `DOMException`

### setAttributeNode

public Attr setAttributeNode(Attr arg0) throws DOMException

Specified by:
  `setAttributeNode` in interface `Element`
Throws:
  `DOMException`

### setAttributeNodeNS

public Attr setAttributeNodeNS(Attr arg0) throws DOMException

Specified by:
  `setAttributeNodeNS` in interface `Element`
Throws:
  `DOMException`

### appendChild

public Node appendChild(Node newChild) throws DOMException

Specified by:
  `appendChild` in interface `Node`
Throws:
  `DOMException`

### cloneNode

public Node cloneNode(boolean arg0)

Specified by:
  `cloneNode` in interface `Node`

### getAttributes

public NamedNodeMap getAttributes()

Specified by:
  `getAttributes` in interface `Node`

### getFirstChild

public Node getFirstChild()

Specified by:
  `getFirstChild` in interface `Node`

### getLastChild

public Node getLastChild()

Specified by:
  `getLastChild` in interface `Node`

### getTagName

public String getTagName()

Specified by:
  `getTagName` in interface `Element`

### getNextSibling

public Node getNextSibling()

Specified by:
  `getNextSibling` in interface `Node`

### getNodeName

public String getNodeName()

Specified by:
  `getNodeName` in interface `Node`

### getNodeType

public short getNodeType()

Specified by:
  `getNodeType` in interface `Node`

### getNodeValue

public String getNodeValue() throws DOMException

Specified by:
  `getNodeValue` in interface `Node`
Throws:
  `DOMException`

### getOwnerDocument

public Document getOwnerDocument()

Specified by:
  `getOwnerDocument` in interface `Node`

### getPrefix

public String getPrefix()

Specified by:
  `getPrefix` in interface `Node`

### getPreviousSibling

public Node getPreviousSibling()

Specified by:
  `getPreviousSibling` in interface `Node`

### hasAttributes

public boolean hasAttributes()

Specified by:
  `hasAttributes` in interface `Node`

### hasChildNodes

public boolean hasChildNodes()

Specified by:
  `hasChildNodes` in interface `Node`

### insertBefore

public Node insertBefore(Node newChild, Node refChild) throws DOMException

Specified by:
  `insertBefore` in interface `Node`
Throws:
  `DOMException`

### isSupported

public boolean isSupported(String arg0, String arg1)

Specified by:
  `isSupported` in interface `Node`

### normalize

public void normalize()

Specified by:
  `normalize` in interface `Node`

### removeChild

public Node removeChild(Node arg0) throws DOMException

Specified by:
  `removeChild` in interface `Node`
Throws:
  `DOMException`

### replaceChild

public Node replaceChild(Node arg0, Node arg1) throws DOMException

Specified by:
  `replaceChild` in interface `Node`
Throws:
  `DOMException`

### setNodeValue

public void setNodeValue(String arg0) throws DOMException

Specified by:
  `setNodeValue` in interface `Node`
Throws:
  `DOMException`

### setPrefix

public void setPrefix(String arg0) throws DOMException

Specified by:
  `setPrefix` in interface `Node`
Throws:
  `DOMException`

### setIdAttribute

public void setIdAttribute(String name, boolean isId) throws DOMException

Specified by:
  `setIdAttribute` in interface `Element`
Throws:
  `DOMException`

### setIdAttributeNS

public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException

Specified by:
  `setIdAttributeNS` in interface `Element`
Throws:
  `DOMException`

### setIdAttributeNode

public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException

Specified by:
  `setIdAttributeNode` in interface `Element`
Throws:
  `DOMException`

### compareDocumentPosition

public short compareDocumentPosition(Node other) throws DOMException

Specified by:
  `compareDocumentPosition` in interface `Node`
Throws:
  `DOMException`

### getBaseURI

public String getBaseURI()

Specified by:
  `getBaseURI` in interface `Node`

### getFeature

public Object getFeature(String feature, String version)

Specified by:
  `getFeature` in interface `Node`

### getTextContent

public String getTextContent() throws DOMException

Specified by:
  `getTextContent` in interface `Node`
Throws:
  `DOMException`

### getUserData

public Object getUserData(String key)

Specified by:
  `getUserData` in interface `Node`

### isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)

Specified by:
  `isDefaultNamespace` in interface `Node`

### isEqualNode

public boolean isEqualNode(Node arg)

Specified by:
  `isEqualNode` in interface `Node`

### isSameNode

public boolean isSameNode(Node other)

Specified by:
  `isSameNode` in interface `Node`

### lookupNamespaceURI

public String lookupNamespaceURI(String prefix)

Specified by:
  `lookupNamespaceURI` in interface `Node`

### lookupPrefix

public String lookupPrefix(String namespaceURI)

Specified by:
  `lookupPrefix` in interface `Node`

### setTextContent

public void setTextContent(String textContent) throws DOMException

Specified by:
  `setTextContent` in interface `Node`
Throws:
  `DOMException`

### getNativeWidget

public Object getNativeWidget()
Description copied from interface: `CSSStylableElement`
Return the native widget wrapped (SWT widget, Swing Component...)

Specified by:
  `getNativeWidget` in interface `CSSStylableElement`

### setUserData

public Object setUserData(String key, Object data, UserDataHandler handler)

Specified by:
  `setUserData` in interface `Node`

### getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()

Specified by:
  `getSchemaTypeInfo` in interface `Element`

### getDefaultStyleDeclaration

public CSSStyleDeclaration getDefaultStyleDeclaration(String pseudoE)
Description copied from interface: `CSSStylableElement`
Return the default `CSSStyleDeclaration` of the native widget.

Specified by:
  `getDefaultStyleDeclaration` in interface `CSSStylableElement`

### setDefaultStyleDeclaration

public void setDefaultStyleDeclaration(String pseudoE, CSSStyleDeclaration declaration)
Description copied from interface: `CSSStylableElement`
Set the default `CSSStyleDeclaration` of the native widget.

Specified by:
  `setDefaultStyleDeclaration` in interface `CSSStylableElement`

### onStylesApplied

public void onStylesApplied(NodeList nodes)
Description copied from interface: `CSSStylableElement`
Call-back method called when styles are applied to the all children nodes of the native widget

Specified by:
  `onStylesApplied` in interface `CSSStylableElement`

### getElement

protected Element getElement(Object widget)

### getStyle

public CSSExtendedProperties getStyle()
Description copied from interface: `CSSStylableElement`
Return the `CSSExtendedProperties` of the native widget.

Specified by:
  `getStyle` in interface `CSSStylableElement`

### getStaticPseudoInstances

public String[] getStaticPseudoInstances()
Description copied from interface: `CSSStylableElement`
Return all static pseudo instances. Static pseudo instance is used for widget which define method which can update property (Color, BackgroundColor) for a special state (without manage listener like focus). For instance SWT CTabFolder#setSelectionBackground (Color color) is method which set background Color when a CTabItem is selected.

Specified by:
  `getStaticPseudoInstances` in interface `CSSStylableElement`

### isPseudoInstanceOf

public boolean isPseudoInstanceOf(String s)
Description copied from interface: `CSSStylableElement`
Return true if `s` is pseudo instance (ex :focus) and false otherwise.

Specified by:
  `isPseudoInstanceOf` in interface `CSSStylableElement`

### initialize

public void initialize()
Description copied from interface: `CSSStylableElement`
Method called after the `CSSStylableElement` was linked to the native widget. You can add UI listener into this method.

Specified by:
  `initialize` in interface `CSSStylableElement`

### dispose

public void dispose()
Description copied from interface: `CSSStylableElement`
Method called when `CSSEngine.dispose()` is called. You can remove UI listener into this method.

Specified by:
  `dispose` in interface `CSSStylableElement`

### doApplyStyles

protected void doApplyStyles()
Apply styles for the native widget.