Interface CSSEngine
- All Known Implementing Classes:
AbstractCSSEngine
,AbstractCSSSWTEngineImpl
,CSSEngineImpl
,CSSSWTEngineImpl
public interface CSSEngine
CSS Engine interface used to parse style sheet and apply styles to something
(UI SWT, UI Swing...).
-
Method Summary
Modifier and TypeMethodDescriptionapplyCSSProperty
(Object node, String property, CSSValue value, String pseudo) Apply CSS propertyproperty
to thenode
withvalue
.void
applyDefaultStyleDeclaration
(Object node, boolean applyStylesToChildNodes) Apply initial style of the object node.void
applyInlineStyle
(Object node, boolean applyStylesToChildNodes) Apply inline style of the object node.void
applyStyleDeclaration
(Object node, CSSStyleDeclaration style, String pseudo) Apply style declaration to the object node.void
applyStyles
(Object node, boolean applyStylesToChildNodes) Apply styles to the Object node (SWT Text,...).void
applyStyles
(Object node, boolean applyStylesToChildNodes, boolean computeDefaultStyle) Apply styles to the Object node (SWT Text,...).Convert Object type oftoType
into CSSValue String.Convert CSSValue into Object type oftoType
.void
dispose()
Call reset and dispose all resourcesString[]
getCSSCompositePropertiesNames
(String property) Return array of CSS property name of the CSSproperty
.getCSSElementContext
(Object node) Get theCSSElementContext
context of the objectnode
.getCSSProperties
(Object node) Return the set of property names applicable to the provided node.getCSSValueConverter
(Object toType) Get CSSValue converterICSSValueConverter
which is enable to converttoType
Object.getDefaultStyleDeclaration
(Object node, String pseudoE) Return theDocumentCSS
used to storeCSSStyleSheet
.getElement
(Object node) Get the w3cElement
which wrap Objectnode
.GetIElementProvider
registered used to retrieve w3cElement
which wrap native widget.ReturnCSSErrorHandler
used to handles exception error.Get theIResourcesLocatorManager
to use manage resources.Get theIResourcesRegistry
registered used to cache/dispose resources.Return theViewCSS
used to computeCSSStyleDeclaration
.void
Handle exceptions.default void
handleWidgetDisposed
(Object widget) Handle disposal of a styled widget.boolean
Check if theselector
matches the objectnode
.parseAndApplyStyleDeclaration
(Object node, InputStream stream) Parse and apply style declaration from InputStream stream.parseAndApplyStyleDeclaration
(Object node, Reader reader) Parse and apply style declaration from Reader reader.parseAndApplyStyleDeclaration
(Object node, String style) Parse and apply style declaration from String style.parseAndApplyStyleDeclaration
(Object node, org.w3c.css.sac.InputSource sourcee) Parse and apply style declaration from InputSource source.parsePropertyValue
(InputStream stream) Parse CSSValue from InputStream stream.parsePropertyValue
(Reader reader) Parse CSSValue from Reader reader.parsePropertyValue
(String value) Parse CSSValue from String value.parsePropertyValue
(org.w3c.css.sac.InputSource source) Parse CSSValue from InputSource source.org.w3c.css.sac.SelectorList
parseSelectors
(InputStream stream) Parse Selectors from InputStream.org.w3c.css.sac.SelectorList
parseSelectors
(Reader reader) Parse Selectors from String value.org.w3c.css.sac.SelectorList
parseSelectors
(String text) Parse Selectors from String value.org.w3c.css.sac.SelectorList
parseSelectors
(org.w3c.css.sac.InputSource source) Parse Selectors from InputSource value.parseStyleDeclaration
(InputStream stream) Parse style declaration from InputStream stream.parseStyleDeclaration
(Reader reader) Parse style declaration from Reader reader.parseStyleDeclaration
(String style) Parse style declaration from String style.parseStyleDeclaration
(org.w3c.css.sac.InputSource source) Parse style declaration from InputSource source.parseStyleSheet
(InputStream stream) Parse style sheet from InputStream stream.parseStyleSheet
(Reader reader) Parse style sheet from Reader reader.parseStyleSheet
(org.w3c.css.sac.InputSource source) Parse style sheet from InputSource source.void
reapply()
Reapply the styles to the objects managed by this engine.void
registerCSSValueConverter
(ICSSValueConverter converter) Register CSSValue converterICSSValueConverter
.void
reset()
Reset all style sheet registered into CSS Engine.retrieveCSSProperty
(Object node, String property, String pseudo) void
setElementProvider
(IElementProvider elementProvider) SetIElementProvider
registered used to retrieve w3cElement
which wrap native widget.void
setErrorHandler
(CSSErrorHandler errorHandler) Register theCSSErrorHandler
used to handles exception error.void
setResourcesLocatorManager
(IResourcesLocatorManager resourcesLocatorManager) Set theIResourcesLocatorManager
to use manage resources.void
setResourcesRegistry
(IResourcesRegistry resourcesRegistry) RegisterIResourcesRegistry
used to cache/dispose resources.void
unregisterCSSValueConverter
(ICSSValueConverter converter) Unregister CSSValue converterICSSValueConverter
.
-
Method Details
-
parseStyleSheet
Parse style sheet from Reader reader.- Throws:
IOException
-
parseStyleSheet
Parse style sheet from InputStream stream.- Throws:
IOException
-
parseStyleSheet
Parse style sheet from InputSource source.- Throws:
IOException
-
parseStyleDeclaration
Parse style declaration from String style.- Throws:
IOException
-
parseStyleDeclaration
Parse style declaration from Reader reader.- Throws:
IOException
-
parseStyleDeclaration
Parse style declaration from InputStream stream.- Throws:
IOException
-
parseStyleDeclaration
Parse style declaration from InputSource source.- Throws:
IOException
-
parsePropertyValue
Parse CSSValue from String value.- Throws:
IOException
-
parsePropertyValue
Parse CSSValue from InputStream stream.- Throws:
IOException
-
parsePropertyValue
Parse CSSValue from Reader reader.- Throws:
IOException
-
parsePropertyValue
Parse CSSValue from InputSource source.- Throws:
IOException
-
parseSelectors
Parse Selectors from String value.- Throws:
IOException
-
parseSelectors
Parse Selectors from InputSource value.- Throws:
IOException
-
parseSelectors
Parse Selectors from InputStream.- Throws:
IOException
-
parseSelectors
Parse Selectors from String value.- Throws:
IOException
-
matches
Check if theselector
matches the objectnode
. -
applyStyles
Apply styles to the Object node (SWT Text,...). IfapplyStylesToChildNodes
is true, apply styles to the child nodes (ex : if node is SWT Composite, styles are applied to the child controls too). -
applyStyles
Apply styles to the Object node (SWT Text,...). IfapplyStylesToChildNodes
is true, apply styles to the child nodes (ex : if node is SWT Composite, styles are applied to the child controls too). IfcomputeDefaultStyle
is true, default style is computed before apply styles. -
applyStyleDeclaration
Apply style declaration to the object node. -
parseAndApplyStyleDeclaration
Parse and apply style declaration from Reader reader.- Throws:
IOException
-
parseAndApplyStyleDeclaration
CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node, InputStream stream) throws IOException Parse and apply style declaration from InputStream stream.- Throws:
IOException
-
parseAndApplyStyleDeclaration
CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node, org.w3c.css.sac.InputSource sourcee) throws IOException Parse and apply style declaration from InputSource source.- Throws:
IOException
-
parseAndApplyStyleDeclaration
Parse and apply style declaration from String style.- Throws:
IOException
-
applyInlineStyle
Apply inline style of the object node. IfapplyStylesToChildNodes
is true, apply style inline to the child nodes (ex : if node is SWT Composite, styles are applied to the child controls too).- Throws:
IOException
-
getErrorHandler
CSSErrorHandler getErrorHandler()ReturnCSSErrorHandler
used to handles exception error. -
setErrorHandler
Register theCSSErrorHandler
used to handles exception error. -
setResourcesLocatorManager
Set theIResourcesLocatorManager
to use manage resources. -
getResourcesLocatorManager
IResourcesLocatorManager getResourcesLocatorManager()Get theIResourcesLocatorManager
to use manage resources. -
getDocumentCSS
DocumentCSS getDocumentCSS()Return theDocumentCSS
used to storeCSSStyleSheet
. -
getViewCSS
ViewCSS getViewCSS()Return theViewCSS
used to computeCSSStyleDeclaration
. -
getElementProvider
IElementProvider getElementProvider()GetIElementProvider
registered used to retrieve w3cElement
which wrap native widget. -
setElementProvider
SetIElementProvider
registered used to retrieve w3cElement
which wrap native widget. -
applyCSSProperty
ICSSPropertyHandler applyCSSProperty(Object node, String property, CSSValue value, String pseudo) throws Exception Apply CSS propertyproperty
to thenode
withvalue
.- Throws:
Exception
-
retrieveCSSProperty
-
applyDefaultStyleDeclaration
Apply initial style of the object node. IfapplyStylesToChildNodes
is true, apply style inline to the child nodes (ex : if node is SWT Composite, styles are applied to the child controls too). -
getDefaultStyleDeclaration
-
dispose
void dispose()Call reset and dispose all resources -
reset
void reset()Reset all style sheet registered into CSS Engine. This method must be called if you want parse and apply new StyleSheet and remove the old StyleSheet parsed. -
getResourcesRegistry
IResourcesRegistry getResourcesRegistry()Get theIResourcesRegistry
registered used to cache/dispose resources. -
setResourcesRegistry
RegisterIResourcesRegistry
used to cache/dispose resources. -
registerCSSValueConverter
Register CSSValue converterICSSValueConverter
. -
unregisterCSSValueConverter
Unregister CSSValue converterICSSValueConverter
. -
getCSSValueConverter
Get CSSValue converterICSSValueConverter
which is enable to converttoType
Object. -
convert
Convert CSSValue into Object type oftoType
. (ex : convert CSSValue color:red into java.awt.Color). IfIResourcesRegistry
is registered intoCSSEngine
this method search before into cache ofIResourcesRegistry
if the Object was already converted.- Parameters:
context
- can be null. For SWT context is org.eclipse.swt.widgets.Display.- Throws:
Exception
-
convert
Convert Object type oftoType
into CSSValue String.- Throws:
Exception
-
getElement
Get the w3cElement
which wrap Objectnode
. -
getCSSElementContext
Get theCSSElementContext
context of the objectnode
. -
getCSSProperties
Return the set of property names applicable to the provided node.- Parameters:
node
- the DOM node or an element- Returns:
- the property names
-
getCSSCompositePropertiesNames
Return array of CSS property name of the CSSproperty
. -
handleExceptions
Handle exceptions. -
reapply
void reapply()Reapply the styles to the objects managed by this engine. -
handleWidgetDisposed
Handle disposal of a styled widget.- Parameters:
widget
- The widget that gets disposed.
-