# Interface CSSStylableElement

All Superinterfaces:
  `Element, Node`

All Known Implementing Classes:
  `ButtonElement, ColorDefinitionElement, CompositeElement, ControlElement, CTabFolderElement, CTabItemElement, EclipsePreferencesElement, ElementAdapter, FontDefinitionElement, ItemElement, LinkElement, ScaleElement, ShellElement, SWTHTMLElement, TableElement, TableItemElement, TextElement, ThemeDefinitionElement, ThemesExtensionElement, ToolBarElement, ToolItemElement, TreeElement, WidgetElement`

public interface CSSStylableElement extends Element
CSS stylable element interface to wrap native widget.

## Field Summary

### Fields inherited from interface 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`

## Method Summary

Modifier and Type
Method
Description
`void`
`copyDefaultStyleDeclarations(CSSStylableElement stylableElement)`
Copy all default style declarations defined into `stylableElement`.
`void`
`dispose()`
Method called when `CSSEngine.dispose()` is called.
`String`
`getCSSClass()`
Return the class of the native widget.
`String`
`getCSSId()`
Return the id of the native widget.
`String`
`getCSSStyle()`
Return the inline style of the native widget.
`CSSStyleDeclaration`
`getDefaultStyleDeclaration(String pseudoE)`
Return the default `CSSStyleDeclaration` of the native widget.
`Object`
`getNativeWidget()`
Return the native widget wrapped (SWT widget, Swing Component...)
`String[]`
`getStaticPseudoInstances()`
Return all static pseudo instances.
`CSSExtendedProperties`
`getStyle()`
Return the `CSSExtendedProperties` of the native widget.
`void`
`initialize()`
Method called after the `CSSStylableElement` was linked to the native widget.
`boolean`
`isPseudoInstanceOf(String s)`
Return true if `s` is pseudo instance (ex :focus) and false otherwise.
`boolean`
`isStaticPseudoInstance(String s)`
Return true if `s` is static pseudo instance (ex :CTabFolder:selected) and false otherwise.
`void`
`onStylesApplied(NodeList nodes)`
Call-back method called when styles are applied to the all children nodes of the native widget
`void`
`setDefaultStyleDeclaration(String pseudoE, CSSStyleDeclaration defaultStyleDeclaration)`
Set the default `CSSStyleDeclaration` of the native widget.

### Methods inherited from interface Element

`getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS`

### Methods inherited from interface Node

`appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData`

## Method Details

### getNativeWidget

Object getNativeWidget()
Return the native widget wrapped (SWT widget, Swing Component...)

### getCSSId

String getCSSId()
Return the id of the native widget. This method is used to manage CSS style like this input#MyId{....}.

### getCSSClass

String getCSSClass()
Return the class of the native widget. This method is used to manage CSS style like this .blueClass {...}.

### getCSSStyle

String getCSSStyle()
Return the inline style of the native widget.

### getDefaultStyleDeclaration

CSSStyleDeclaration getDefaultStyleDeclaration(String pseudoE)
Return the default `CSSStyleDeclaration` of the native widget.

### copyDefaultStyleDeclarations

void copyDefaultStyleDeclarations(CSSStylableElement stylableElement)
Copy all default style declarations defined into `stylableElement`.

### setDefaultStyleDeclaration

void setDefaultStyleDeclaration(String pseudoE, CSSStyleDeclaration defaultStyleDeclaration)
Set the default `CSSStyleDeclaration` of the native widget.

### isPseudoInstanceOf

boolean isPseudoInstanceOf(String s)
Return true if `s` is pseudo instance (ex :focus) and false otherwise.

### getStaticPseudoInstances

String[] getStaticPseudoInstances()
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.

### isStaticPseudoInstance

boolean isStaticPseudoInstance(String s)
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.

### onStylesApplied

void onStylesApplied(NodeList nodes)
Call-back method called when styles are applied to the all children nodes of the native widget

### getStyle

CSSExtendedProperties getStyle()
Return the `CSSExtendedProperties` of the native widget.

### initialize

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

### dispose

void dispose()
Method called when `CSSEngine.dispose()` is called. You can remove UI listener into this method.