java.lang.Object
org.jhotdraw8.css.model.AbstractSelectorModel<javafx.css.Styleable>
org.jhotdraw8.css.model.StyleableSelectorModel
- All Implemented Interfaces:
SelectorModel<javafx.css.Styleable>
A
SelectorModel for objects that implement the Styleable
interface.- Author:
- Werner Randelshofer
-
Property Summary
Properties inherited from class org.jhotdraw8.css.model.AbstractSelectorModel
additionalPseudoClassStates -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanattributeValueContainsWord(javafx.css.Styleable element, @Nullable String namespacePattern, String attributeName, String word) Returns true if the element has an attribute with the specified name and the value is a list of words which contains the specified word.getAttribute(javafx.css.Styleable element, javafx.css.StyleOrigin origin, @Nullable String namespacePattern, String attributeName) Returns the attribute value with the given name from the specified style origin.@Nullable StringgetAttributeAsString(javafx.css.Styleable element, javafx.css.StyleOrigin origin, @Nullable String namespacePattern, String name) Returns the attribute value with the given name from the specified style origin.getAttributeNames(javafx.css.Styleable element) Returns all styleable attributes of the element.getComposedAttributeNames(javafx.css.Styleable element) Returns all non-decomposed styleable attributes of the element.getDecomposedAttributeNames(javafx.css.Styleable element) Returns all decomposed styleable attributes of the element.getId(javafx.css.Styleable element) Returns the id of the element.javafx.css.StyleablegetParent(javafx.css.Styleable element) Gets the parent of the element.@Nullable javafx.css.StyleablegetPreviousSibling(javafx.css.Styleable element) Gets the previous sibling of the element.getPseudoClasses(javafx.css.Styleable element) Returns the pseudo classes of the element.getStyleClasses(javafx.css.Styleable element) Returns the style classes of the element.@Nullable QualifiedNamegetType(javafx.css.Styleable element) Returns the style type of the element.booleanhasAttribute(javafx.css.Styleable element, @Nullable String namespace, String attributeName) Returns true if the element has the specified attribute.booleanReturns true if the element has the specified id.booleanhasPseudoClass(javafx.css.Styleable element, String pseudoClass) Returns true if the element has the specified pseudo class.booleanhasStyleClass(javafx.css.Styleable element, String clazz) Returns true if the element has the specified style class.booleanReturns true if the element has the specified type.voidreset(javafx.css.Styleable elem) Resets all values with non-StyleOrigin.USERorigin.voidsetAttribute(javafx.css.Styleable elem, javafx.css.StyleOrigin origin, @Nullable String namespace, String name, @Nullable ReadOnlyList<CssToken> valueAsTokens) Sets an attribute value.Methods inherited from class org.jhotdraw8.css.model.AbstractSelectorModel
additionalPseudoClassStatesPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.css.model.SelectorModel
attributeValueContains, attributeValueEndsWith, attributeValueEquals, attributeValueStartsWith, getAttributeAsString
-
Constructor Details
-
StyleableSelectorModel
public StyleableSelectorModel()
-
-
Method Details
-
getAttributeAsString
public @Nullable String getAttributeAsString(javafx.css.Styleable element, javafx.css.StyleOrigin origin, @Nullable String namespacePattern, String name) Description copied from interface:SelectorModelReturns the attribute value with the given name from the specified style origin.- Parameters:
element- The elementorigin- The style originnamespacePattern- an optional namespace ("*" means any namespace, null means no namespace)name- The attribute name- Returns:
- The attribute value. Returns "initial" if the element does not have an attribute with this name.
-
hasId
Description copied from interface:SelectorModelReturns true if the element has the specified id.- Parameters:
element- An element of the documentid- an id- Returns:
- true if the element has the id
-
getId
Description copied from interface:SelectorModelReturns the id of the element.- Parameters:
element- the element- Returns:
- the id or null if the element does not have an id.
-
hasType
public boolean hasType(javafx.css.Styleable element, @Nullable String namespacePattern, String type) Description copied from interface:SelectorModelReturns true if the element has the specified type.- Parameters:
element- An element of the documentnamespacePattern- a namespace pattern ("*" means any namespace, null means no namespace)type- an id- Returns:
- true if the element has the id
-
reset
public void reset(javafx.css.Styleable elem) Description copied from interface:SelectorModelResets all values with non-StyleOrigin.USERorigin. -
getType
Description copied from interface:SelectorModelReturns the style type of the element.- Parameters:
element- the element- Returns:
- the style type of the element, return null if the element is not styleable by type.
-
hasStyleClass
Description copied from interface:SelectorModelReturns true if the element has the specified style class.- Parameters:
element- An element of the documentclazz- a style class- Returns:
- true if the element has the id
-
getStyleClasses
Description copied from interface:SelectorModelReturns the style classes of the element.- Parameters:
element- the element- Returns:
- the style classes or an empty set.
-
getPseudoClasses
Description copied from interface:SelectorModelReturns the pseudo classes of the element.- Parameters:
element- the element- Returns:
- the pseudo classes or an empty set.
-
hasPseudoClass
Description copied from interface:SelectorModelReturns true if the element has the specified pseudo class.- Parameters:
element- An element of the documentpseudoClass- a pseudo class- Returns:
- true if the element has the id
-
getParent
public javafx.css.Styleable getParent(javafx.css.Styleable element) Description copied from interface:SelectorModelGets the parent of the element.- Parameters:
element- An element of the document- Returns:
- The parent element. Returns null if the element has no parent.
-
getPreviousSibling
public @Nullable javafx.css.Styleable getPreviousSibling(javafx.css.Styleable element) Description copied from interface:SelectorModelGets the previous sibling of the element.- Parameters:
element- An element of the document- Returns:
- The previous sibling. Returns null if the element has no previous sibling.
-
hasAttribute
public boolean hasAttribute(javafx.css.Styleable element, @Nullable String namespace, String attributeName) Description copied from interface:SelectorModelReturns true if the element has the specified attribute.- Parameters:
element- An element of the documentnamespace- an optional namespace (null means any namespace , an empty String means no namespace)attributeName- an attribute name- Returns:
- true if the element has an attribute with the specified name
-
getAttribute
public @Nullable List<CssToken> getAttribute(javafx.css.Styleable element, javafx.css.StyleOrigin origin, @Nullable String namespacePattern, String attributeName) Description copied from interface:SelectorModelReturns the attribute value with the given name from the specified style origin.- Parameters:
element- The elementorigin- The style originnamespacePattern- an optional namespace ("*" means any namespace, null means no namespace)attributeName- The attribute name- Returns:
- The attribute value as a list of
CssTokens.
-
attributeValueContainsWord
public boolean attributeValueContainsWord(javafx.css.Styleable element, @Nullable String namespacePattern, String attributeName, String word) Description copied from interface:SelectorModelReturns true if the element has an attribute with the specified name and the value is a list of words which contains the specified word.- Parameters:
element- An element of the documentnamespacePattern- an optional namespace ("*" means any namespace, null means no namespace)attributeName- an attribute nameword- the word- Returns:
- true if the element has an attribute with the specified name and the value contains the specified word.
-
getAttributeNames
Description copied from interface:SelectorModelReturns all styleable attributes of the element.- Parameters:
element- An element of the document- Returns:
- a set of styleable attributes.
-
getComposedAttributeNames
Description copied from interface:SelectorModelReturns all non-decomposed styleable attributes of the element.If an attribute can be decomposed, only the composite attribute is returned.
- Parameters:
element- An element of the document- Returns:
- a set of styleable attributes.
-
getDecomposedAttributeNames
Description copied from interface:SelectorModelReturns all decomposed styleable attributes of the element.If an attribute can be composed, only the decomposed attributes are returned.
- Parameters:
element- An element of the document- Returns:
- a set of styleable attributes.
-
setAttribute
public void setAttribute(javafx.css.Styleable elem, javafx.css.StyleOrigin origin, @Nullable String namespace, String name, @Nullable ReadOnlyList<CssToken> valueAsTokens) Description copied from interface:SelectorModelSets an attribute value.- Parameters:
elem- The elementorigin- The style originnamespace- an optional namespace ("*" means any namespace, null means no namespace)name- The attribute namevalueAsTokens- The attribute value.nullremoves the attribute from the element. That is,nullhas the same effect like the keyword "unset".
-