java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.primefaces.extensions.component.lightswitch.LightSwitch
All Implemented Interfaces:
EventListener, javax.faces.component.behavior.ClientBehaviorHolder, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, org.primefaces.component.api.MixedClientBehaviorHolder, org.primefaces.component.api.Widget

public class LightSwitch extends javax.faces.component.UIComponentBase implements org.primefaces.component.api.Widget, javax.faces.component.behavior.ClientBehaviorHolder, org.primefaces.component.api.MixedClientBehaviorHolder
LightSwitch component. Automatically switches to defined dark mode theme based on OS settings.
Since:
10.0
Author:
Jasper de Vries <jepsar@gmail.com>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class javax.faces.component.UIComponent

    ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY

    Fields inherited from interface org.primefaces.component.api.Widget

    ATTR_WIDGET_VAR_PATTERN, CALLBACK_POST_CONSTRUCT, CALLBACK_POST_REFRESH, CALLBACK_PRE_DESTROY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
     
     
     
     
    boolean
     
    void
    queueEvent(javax.faces.event.FacesEvent event)
     
    void
    setAutomatic(boolean automatic)
     
    void
     
    void
     
    void
    setSelected(String selected)
     
    void
    setSelectedByValueExpression(javax.faces.context.FacesContext context, String selected)
     
    void
    setWidgetVar(String widgetVar)
     

    Methods inherited from class javax.faces.component.UIComponentBase

    addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent

    Methods inherited from class javax.faces.component.UIComponent

    encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax.faces.component.behavior.ClientBehaviorHolder

    addClientBehavior, getClientBehaviors

    Methods inherited from interface org.primefaces.component.api.Widget

    resolveWidgetVar, resolveWidgetVar
  • Field Details

  • Constructor Details

    • LightSwitch

      public LightSwitch()
      Default constructor
  • Method Details

    • getFamily

      public String getFamily()
      Specified by:
      getFamily in class javax.faces.component.UIComponent
    • getDefaultEventName

      public String getDefaultEventName()
      Specified by:
      getDefaultEventName in interface javax.faces.component.behavior.ClientBehaviorHolder
      Overrides:
      getDefaultEventName in class javax.faces.component.UIComponentBase
    • getWidgetVar

      public String getWidgetVar()
    • setWidgetVar

      public void setWidgetVar(String widgetVar)
    • getSelected

      public String getSelected()
    • setSelected

      public void setSelected(String selected)
    • setSelectedByValueExpression

      public void setSelectedByValueExpression(javax.faces.context.FacesContext context, String selected)
    • getLight

      public String getLight()
    • setLight

      public void setLight(String light)
    • getDark

      public String getDark()
    • setDark

      public void setDark(String dark)
    • isAutomatic

      public boolean isAutomatic()
    • setAutomatic

      public void setAutomatic(boolean automatic)
    • getEventNames

      public Collection<String> getEventNames()
      Specified by:
      getEventNames in interface javax.faces.component.behavior.ClientBehaviorHolder
      Overrides:
      getEventNames in class javax.faces.component.UIComponentBase
    • getUnobstrusiveEventNames

      public Collection<String> getUnobstrusiveEventNames()
      Specified by:
      getUnobstrusiveEventNames in interface org.primefaces.component.api.MixedClientBehaviorHolder
    • queueEvent

      public void queueEvent(javax.faces.event.FacesEvent event)
      Overrides:
      queueEvent in class javax.faces.component.UIComponentBase