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 propertypropertyto thenodewithvalue.voidapplyDefaultStyleDeclaration(Object node, boolean applyStylesToChildNodes) Apply initial style of the object node.voidapplyInlineStyle(Object node, boolean applyStylesToChildNodes) Apply inline style of the object node.voidapplyStyleDeclaration(Object node, CSSStyleDeclaration style, String pseudo) Apply style declaration to the object node.voidapplyStyles(Object node, boolean applyStylesToChildNodes) Apply styles to the Object node (SWT Text,...).voidapplyStyles(Object node, boolean applyStylesToChildNodes, boolean computeDefaultStyle) Apply styles to the Object node (SWT Text,...).Convert Object type oftoTypeinto CSSValue String.Convert CSSValue into Object type oftoType.voiddispose()Call reset and dispose all resourcesString[]getCSSCompositePropertiesNames(String property) Return array of CSS property name of the CSSproperty.getCSSElementContext(Object node) Get theCSSElementContextcontext of the objectnode.getCSSProperties(Object node) Return the set of property names applicable to the provided node.getCSSValueConverter(Object toType) Get CSSValue converterICSSValueConverterwhich is enable to converttoTypeObject.getDefaultStyleDeclaration(Object node, String pseudoE) Return theDocumentCSSused to storeCSSStyleSheet.getElement(Object node) Get the w3cElementwhich wrap Objectnode.GetIElementProviderregistered used to retrieve w3cElementwhich wrap native widget.ReturnCSSErrorHandlerused to handles exception error.Get theIResourcesLocatorManagerto use manage resources.Get theIResourcesRegistryregistered used to cache/dispose resources.Return theViewCSSused to computeCSSStyleDeclaration.voidHandle exceptions.default voidhandleWidgetDisposed(Object widget) Handle disposal of a styled widget.booleanCheck if theselectormatches 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.SelectorListparseSelectors(InputStream stream) Parse Selectors from InputStream.org.w3c.css.sac.SelectorListparseSelectors(Reader reader) Parse Selectors from String value.org.w3c.css.sac.SelectorListparseSelectors(String text) Parse Selectors from String value.org.w3c.css.sac.SelectorListparseSelectors(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.voidreapply()Reapply the styles to the objects managed by this engine.voidregisterCSSValueConverter(ICSSValueConverter converter) Register CSSValue converterICSSValueConverter.voidreset()Reset all style sheet registered into CSS Engine.retrieveCSSProperty(Object node, String property, String pseudo) voidsetElementProvider(IElementProvider elementProvider) SetIElementProviderregistered used to retrieve w3cElementwhich wrap native widget.voidsetErrorHandler(CSSErrorHandler errorHandler) Register theCSSErrorHandlerused to handles exception error.voidsetResourcesLocatorManager(IResourcesLocatorManager resourcesLocatorManager) Set theIResourcesLocatorManagerto use manage resources.voidsetResourcesRegistry(IResourcesRegistry resourcesRegistry) RegisterIResourcesRegistryused to cache/dispose resources.voidunregisterCSSValueConverter(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 theselectormatches the objectnode. -
applyStyles
Apply styles to the Object node (SWT Text,...). IfapplyStylesToChildNodesis 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,...). IfapplyStylesToChildNodesis true, apply styles to the child nodes (ex : if node is SWT Composite, styles are applied to the child controls too). IfcomputeDefaultStyleis 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. IfapplyStylesToChildNodesis 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()ReturnCSSErrorHandlerused to handles exception error. -
setErrorHandler
Register theCSSErrorHandlerused to handles exception error. -
setResourcesLocatorManager
Set theIResourcesLocatorManagerto use manage resources. -
getResourcesLocatorManager
IResourcesLocatorManager getResourcesLocatorManager()Get theIResourcesLocatorManagerto use manage resources. -
getDocumentCSS
DocumentCSS getDocumentCSS()Return theDocumentCSSused to storeCSSStyleSheet. -
getViewCSS
ViewCSS getViewCSS()Return theViewCSSused to computeCSSStyleDeclaration. -
getElementProvider
IElementProvider getElementProvider()GetIElementProviderregistered used to retrieve w3cElementwhich wrap native widget. -
setElementProvider
SetIElementProviderregistered used to retrieve w3cElementwhich wrap native widget. -
applyCSSProperty
ICSSPropertyHandler applyCSSProperty(Object node, String property, CSSValue value, String pseudo) throws Exception Apply CSS propertypropertyto thenodewithvalue.- Throws:
Exception
-
retrieveCSSProperty
-
applyDefaultStyleDeclaration
Apply initial style of the object node. IfapplyStylesToChildNodesis 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 theIResourcesRegistryregistered used to cache/dispose resources. -
setResourcesRegistry
RegisterIResourcesRegistryused to cache/dispose resources. -
registerCSSValueConverter
Register CSSValue converterICSSValueConverter. -
unregisterCSSValueConverter
Unregister CSSValue converterICSSValueConverter. -
getCSSValueConverter
Get CSSValue converterICSSValueConverterwhich is enable to converttoTypeObject. -
convert
Convert CSSValue into Object type oftoType. (ex : convert CSSValue color:red into java.awt.Color). IfIResourcesRegistryis registered intoCSSEnginethis method search before into cache ofIResourcesRegistryif 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 oftoTypeinto CSSValue String.- Throws:
Exception
-
getElement
Get the w3cElementwhich wrap Objectnode. -
getCSSElementContext
Get theCSSElementContextcontext 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.
-