Package io.jmix.ui.component.impl
Class HtmlAttributesImpl
java.lang.Object
io.jmix.ui.component.impl.HtmlAttributesImpl
- All Implemented Interfaces:
HtmlAttributes
@Component("ui_HtmlAttributes")
public class HtmlAttributesImpl
extends Object
implements HtmlAttributes
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.HtmlAttributes
HtmlAttributes.CSS, HtmlAttributes.DOM
-
Field Summary
Fields inherited from interface io.jmix.ui.component.HtmlAttributes
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply CSS properties from CSS string;void
Apply CSS properties from CSS string;getCssProperty
(Component component, String propertyName) Gets CSS property value assigned usingHtmlAttributes
.getCssProperty
(Component component, String querySelector, String propertyName) Gets CSS property value assigned usingHtmlAttributes
.getDomAttribute
(Component component, String attributeName) Gets DOM attribute value assigned usingHtmlAttributes
.getDomAttribute
(Component component, String querySelector, String attributeName) Gets DOM attribute value assigned usingHtmlAttributes
.void
removeCssProperty
(Component component, String propertyName) Clears CSS property value from the top most element of UI component.void
removeCssProperty
(Component component, String querySelector, String propertyName) Clears CSS property value for all nested elements of UI component corresponding to the given query selector.void
removeDomAttribute
(Component component, String attributeName) Removes DOM attribute from the top most element of UI component.void
removeDomAttribute
(Component component, String querySelector, String attributeName) Removes DOM attribute for all nested elements of UI component corresponding to the given query selector.void
setCssProperty
(Component component, String propertyName, String value) Sets CSS property value on the top most element of UI component.void
setCssProperty
(Component component, String querySelector, String propertyName, String value) Sets CSS property value for all nested elements of UI component corresponding to the given query selector.void
setDomAttribute
(Component component, String attributeName, String value) Sets DOM attribute on the top most element of UI component.void
setDomAttribute
(Component component, String querySelector, String attributeName, String value) Sets DOM attribute for all nested elements of UI component corresponding to the given query selector.
-
Constructor Details
-
HtmlAttributesImpl
public HtmlAttributesImpl()
-
-
Method Details
-
setDomAttribute
Description copied from interface:HtmlAttributes
Sets DOM attribute on the top most element of UI component.- Specified by:
setDomAttribute
in interfaceHtmlAttributes
- Parameters:
component
- UI componentattributeName
- DOM attribute name, e.g. "title"value
- attribute value- See Also:
-
setDomAttribute
public void setDomAttribute(Component component, String querySelector, String attributeName, String value) Description copied from interface:HtmlAttributes
Sets DOM attribute for all nested elements of UI component corresponding to the given query selector.- Specified by:
setDomAttribute
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringattributeName
- DOM attribute name, e.g. "title"value
- attribute value- See Also:
-
getDomAttribute
Description copied from interface:HtmlAttributes
Gets DOM attribute value assigned usingHtmlAttributes
. Does not reflect a real value from DOM.- Specified by:
getDomAttribute
in interfaceHtmlAttributes
- Parameters:
component
- UI componentattributeName
- DOM attribute name- Returns:
- previously assigned DOM attribute value
- See Also:
-
getDomAttribute
@Nullable public String getDomAttribute(Component component, String querySelector, String attributeName) Description copied from interface:HtmlAttributes
Gets DOM attribute value assigned usingHtmlAttributes
. Does not reflect a real value from DOM.- Specified by:
getDomAttribute
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringattributeName
- DOM attribute name- Returns:
- previously assigned DOM attribute value
- See Also:
-
removeDomAttribute
Description copied from interface:HtmlAttributes
Removes DOM attribute from the top most element of UI component.- Specified by:
removeDomAttribute
in interfaceHtmlAttributes
- Parameters:
component
- UI componentattributeName
- DOM attribute name- See Also:
-
removeDomAttribute
Description copied from interface:HtmlAttributes
Removes DOM attribute for all nested elements of UI component corresponding to the given query selector.- Specified by:
removeDomAttribute
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringattributeName
- DOM attribute name- See Also:
-
setCssProperty
Description copied from interface:HtmlAttributes
Sets CSS property value on the top most element of UI component.- Specified by:
setCssProperty
in interfaceHtmlAttributes
- Parameters:
component
- UI componentpropertyName
- CSS property name, e.g. "border-color"value
- property value- See Also:
-
setCssProperty
public void setCssProperty(Component component, String querySelector, String propertyName, String value) Description copied from interface:HtmlAttributes
Sets CSS property value for all nested elements of UI component corresponding to the given query selector.- Specified by:
setCssProperty
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringpropertyName
- CSS property name, e.g. "border-color"value
- property value- See Also:
-
getCssProperty
Description copied from interface:HtmlAttributes
Gets CSS property value assigned usingHtmlAttributes
. Does not reflect a real value from DOM.- Specified by:
getCssProperty
in interfaceHtmlAttributes
- Parameters:
component
- UI componentpropertyName
- CSS property name- Returns:
- previously assigned CSS property value
- See Also:
-
getCssProperty
@Nullable public String getCssProperty(Component component, String querySelector, String propertyName) Description copied from interface:HtmlAttributes
Gets CSS property value assigned usingHtmlAttributes
. Does not reflect a real value from DOM.- Specified by:
getCssProperty
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringpropertyName
- CSS property name- Returns:
- previously assigned CSS property value
- See Also:
-
removeCssProperty
Description copied from interface:HtmlAttributes
Clears CSS property value from the top most element of UI component.- Specified by:
removeCssProperty
in interfaceHtmlAttributes
- Parameters:
component
- UI componentpropertyName
- CSS property name- See Also:
-
removeCssProperty
Description copied from interface:HtmlAttributes
Clears CSS property value for all nested elements of UI component corresponding to the given query selector.- Specified by:
removeCssProperty
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringpropertyName
- CSS property name- See Also:
-
applyCss
Description copied from interface:HtmlAttributes
Apply CSS properties from CSS string;- Specified by:
applyCss
in interfaceHtmlAttributes
- Parameters:
component
- UI componentcss
- CSS string- See Also:
-
applyCss
Description copied from interface:HtmlAttributes
Apply CSS properties from CSS string;- Specified by:
applyCss
in interfaceHtmlAttributes
- Parameters:
component
- UI componentquerySelector
- a string containing one or more selectors to match. This string must be a valid CSS selector stringcss
- CSS string- See Also:
-