Package tripleplay.ui
Class Styles
java.lang.Object
tripleplay.ui.Styles
An immutable collection of styles. Used in builder-style to add, replace or remove styles.
Configure a group of styles and then apply them to an element via
Element.setStyles(tripleplay.ui.Styles)
or
Element.addStyles(tripleplay.ui.Styles)
.-
Method Summary
Modifier and TypeMethodDescriptionadd
(Style.Binding<?>... bindings) Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the default mode.add
(Style.Mode mode, Style.Binding<?>... bindings) Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles (in the specified mode).addDisabled
(Style.Binding<?>... bindings) Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the disabled mode.addDisabledSelected
(Style.Binding<?>... bindings) Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the disabled selected mode.addSelected
(Style.Binding<?>... bindings) Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the selected mode.<V> Styles
clear
(Style.Mode mode, Style<V> style) Returns a new instance where no binding exists for the specified style in the specified state.static Styles
make
(Style.Binding<?>... bindings) Creates a styles instance with the supplied style bindings in the DEFAULT mode.Returns a new styles instance which merges these styles with the supplied styles.static Styles
none()
Returns the empty styles instance.static <V> V
resolveStyle
(Element<?> element, Style<V> style) Resolves the current value ofstyle
onelement
.
-
Method Details
-
none
Returns the empty styles instance. -
make
Creates a styles instance with the supplied style bindings in the DEFAULT mode. -
resolveStyle
Resolves the current value ofstyle
onelement
. -
add
Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the default mode. The receiver is not modified. -
addDisabled
Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the disabled mode. The receiver is not modified. -
addSelected
Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the selected mode. The receiver is not modified. -
addDisabledSelected
Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles in the disabled selected mode. The receiver is not modified. -
add
Returns a new instance where the supplied bindings overwrite any previous bindings for the specified styles (in the specified mode). The receiver is not modified. -
clear
Returns a new instance where no binding exists for the specified style in the specified state. The receiver is not modified. -
merge
Returns a new styles instance which merges these styles with the supplied styles. Where both instances define a particular style, the suppliedstyles
will take precedence.
-