Package org.patternfly.component.switch_
Class Switch
- java.lang.Object
-
- org.patternfly.component.BaseComponentFlat<HTMLLabelElement,Switch>
-
- org.patternfly.component.switch_.Switch
-
- All Implemented Interfaces:
Attachable,Finder<HTMLLabelElement>,HasElement<HTMLLabelElement,Switch>,HasHTMLElement<HTMLLabelElement,Switch>,IsElement<HTMLLabelElement>,TypedBuilder<HTMLLabelElement,Switch>,Component,HasValue<Boolean>,Modifiers.Disabled<HTMLLabelElement,Switch>
public class Switch extends BaseComponentFlat<HTMLLabelElement,Switch> implements HasValue<Boolean>, Modifiers.Disabled<HTMLLabelElement,Switch>, Attachable
A switch toggles the state of a setting (between on and off). Switches and checkboxes can often be used interchangeably, but the switch provides a more explicit, visible representation on a setting.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SwitchapplyTo(Consumer<InputElementBuilder<HTMLInputElement>> consumer)Provides access to the underlying checkbox element using a fluent API styleSwitchariaLabel(String label)voidattach(MutationRecord mutationRecord)SwitchcheckIcon()Same as checkIcon(boolean) checkIcon(true)}SwitchcheckIcon(boolean checkIcon)Switchdisabled(boolean disabled)InputElementBuilder<HTMLInputElement>inputElement()Switchlabel(String label)Switchlabel(String labelOn, String labelOff)SwitchonChange(ChangeHandler<Switch,Boolean> changeHandler)Switchreversed()Same as reversed(true)Switchreversed(boolean reversed)static Switchswitch_(String id, String name)static Switchswitch_(String id, String name, boolean checked)Switchthat()Booleanvalue()Switchvalue(boolean checked)Same as value(checked, false)Switchvalue(boolean checked, boolean fireEvent)Sets thecheckedattribute of the input element.-
Methods inherited from class org.patternfly.component.BaseComponentFlat
componentType, element
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.elemento.Attachable
detach
-
Methods inherited from interface org.jboss.elemento.HasElement
add, apply, aria, aria, aria, attr, attr, attr, classList, classList, css, id, id, innerHtml, on, run, textContent, textNode, toggle, toggle, toggle, uniqueId
-
Methods inherited from interface org.jboss.elemento.HasHTMLElement
data, hidden, style, style, style, style, style, style, title
-
Methods inherited from interface org.patternfly.style.Modifiers.Disabled
disabled, isDisabled
-
-
-
-
Method Detail
-
attach
public void attach(MutationRecord mutationRecord)
- Specified by:
attachin interfaceAttachable
-
disabled
public Switch disabled(boolean disabled)
- Specified by:
disabledin interfaceModifiers.Disabled<HTMLLabelElement,Switch>
-
checkIcon
public Switch checkIcon()
Same as checkIcon(boolean) checkIcon(true)}
-
checkIcon
public Switch checkIcon(boolean checkIcon)
-
reversed
public Switch reversed()
Same as reversed(true)
-
reversed
public Switch reversed(boolean reversed)
-
value
public Switch value(boolean checked)
Same as value(checked, false)
-
value
public Switch value(boolean checked, boolean fireEvent)
Sets thecheckedattribute of the input element.
-
applyTo
public Switch applyTo(Consumer<InputElementBuilder<HTMLInputElement>> consumer)
Provides access to the underlying checkbox element using a fluent API style
-
that
public Switch that()
- Specified by:
thatin interfaceTypedBuilder<HTMLLabelElement,Switch>
-
onChange
public Switch onChange(ChangeHandler<Switch,Boolean> changeHandler)
-
inputElement
public InputElementBuilder<HTMLInputElement> inputElement()
-
-