org.gcube.portlets.widgets.switchbutton.client
Class SwitchButton

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.gcube.portlets.widgets.switchbutton.client.SwitchButton
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasValueChangeHandlers<Boolean>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.TakesValue<Boolean>, com.google.gwt.user.client.ui.HasName, com.google.gwt.user.client.ui.HasValue<Boolean>, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget

public class SwitchButton
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.user.client.ui.HasName, com.google.gwt.user.client.ui.HasValue<Boolean>


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SwitchButton()
           
SwitchButton(boolean initialValue)
           
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Boolean> handler)
           
protected  void ensureDomEventHandlers()
           
 String getName()
           
 Boolean getValue()
           
 void setName(String name)
           
 void setValue(Boolean value)
          Checks or unchecks the switch button box, firing ValueChangeEvent if appropriate.
 void setValue(Boolean value, boolean fireEvents)
          Checks or unchecks the switch button box, firing ValueChangeEvent if appropriate.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

SwitchButton

public SwitchButton()

SwitchButton

public SwitchButton(boolean initialValue)
Method Detail

addValueChangeHandler

public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Boolean> handler)
Specified by:
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<Boolean>

getValue

public Boolean getValue()
Specified by:
getValue in interface com.google.gwt.user.client.TakesValue<Boolean>
Specified by:
getValue in interface com.google.gwt.user.client.ui.HasValue<Boolean>

setValue

public void setValue(Boolean value)
Checks or unchecks the switch button box, firing ValueChangeEvent if appropriate.

Note that this does not set the value property of the checkbox input element wrapped by this widget. For access to that property, see #setFormValue(String)

Specified by:
setValue in interface com.google.gwt.user.client.TakesValue<Boolean>
Specified by:
setValue in interface com.google.gwt.user.client.ui.HasValue<Boolean>
Parameters:
value - true to set on, false to set off; null value implies false

setValue

public void setValue(Boolean value,
                     boolean fireEvents)
Checks or unchecks the switch button box, firing ValueChangeEvent if appropriate.

Specified by:
setValue in interface com.google.gwt.user.client.ui.HasValue<Boolean>
Parameters:
value - true to set on, false to set off; null value implies false
fireEvents - If true, and value has changed, fire a ValueChangeEvent

ensureDomEventHandlers

protected void ensureDomEventHandlers()

setName

public void setName(String name)
Specified by:
setName in interface com.google.gwt.user.client.ui.HasName

getName

public String getName()
Specified by:
getName in interface com.google.gwt.user.client.ui.HasName


Copyright © 2014. All Rights Reserved.