com.vaadin.ui
Class CheckBox

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractField<java.lang.Boolean>
              extended by com.vaadin.ui.CheckBox
All Implemented Interfaces:
Buffered, BufferedValidatable, Property<java.lang.Boolean>, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, Action.ShortcutNotifier, MethodEventSource, ClientConnector, Sizeable, com.vaadin.shared.Connector, Component, Component.Focusable, Field<java.lang.Boolean>, java.io.Serializable

public class CheckBox
extends AbstractField<java.lang.Boolean>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Field
Field.ValueChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered
Buffered.SourceException
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
Field Summary
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
CheckBox()
          Creates a new checkbox.
CheckBox(java.lang.String caption)
          Creates a new checkbox with a set caption.
CheckBox(java.lang.String caption, boolean initialState)
          Creates a new checkbox with a caption and a set initial state.
CheckBox(java.lang.String caption, Property<?> dataSource)
          Creates a new checkbox that is connected to a boolean property.
 
Method Summary
 void addBlurListener(FieldEvents.BlurListener listener)
           
 void addFocusListener(FieldEvents.FocusListener listener)
           
 void addListener(FieldEvents.BlurListener listener)
          Deprecated. As of 7.0, replaced by #addBlurListener(BlurListener)
 void addListener(FieldEvents.FocusListener listener)
          Deprecated. As of 7.0, replaced by #addFocusListener(FocusListener)
 boolean booleanValue()
          Deprecated. As of 7.0, use AbstractField.getValue() instead and, if needed, handle null values.
protected  com.vaadin.shared.ui.checkbox.CheckBoxState getState()
          Returns the shared state bean with information to be sent from the server to the client.
 java.lang.Class<java.lang.Boolean> getType()
          Returns the type of the Field.
 void removeBlurListener(FieldEvents.BlurListener listener)
           
 void removeFocusListener(FieldEvents.FocusListener listener)
           
 void removeListener(FieldEvents.BlurListener listener)
          Deprecated. As of 7.0, replaced by #removeBlurListener(BlurListener)
 void removeListener(FieldEvents.FocusListener listener)
          Deprecated. As of 7.0, replaced by #removeFocusListener(FocusListener)
protected  void setInternalValue(java.lang.Boolean newValue)
          Sets the internal field value.
 
Methods inherited from class com.vaadin.ui.AbstractField
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, attach, beforeClientResponse, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getTabIndex, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, shouldHideErrors, toString, validate, validate, valueChange
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setIcon, setId, setImmediate, setParent, setPrimaryStyleName, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier
addShortcutListener, removeShortcutListener
 

Constructor Detail

CheckBox

public CheckBox()
Creates a new checkbox.


CheckBox

public CheckBox(java.lang.String caption)
Creates a new checkbox with a set caption.

Parameters:
caption - the Checkbox caption.

CheckBox

public CheckBox(java.lang.String caption,
                boolean initialState)
Creates a new checkbox with a caption and a set initial state.

Parameters:
caption - the caption of the checkbox
initialState - the initial state of the checkbox

CheckBox

public CheckBox(java.lang.String caption,
                Property<?> dataSource)
Creates a new checkbox that is connected to a boolean property.

Parameters:
state - the Initial state of the switch-button.
dataSource -
Method Detail

getType

public java.lang.Class<java.lang.Boolean> getType()
Description copied from class: AbstractField
Returns the type of the Field. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.

Specified by:
getType in interface Property<java.lang.Boolean>
Specified by:
getType in class AbstractField<java.lang.Boolean>
Returns:
the type of the Field

getState

protected com.vaadin.shared.ui.checkbox.CheckBoxState getState()
Description copied from class: AbstractComponent
Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().

Overrides:
getState in class AbstractField<java.lang.Boolean>
Returns:
updated component shared state

setInternalValue

protected void setInternalValue(java.lang.Boolean newValue)
Description copied from class: AbstractField
Sets the internal field value. This is purely used by AbstractField to change the internal Field value. It does not trigger valuechange events. It can be overridden by the inheriting classes to update all dependent variables. Subclasses can also override AbstractField.getInternalValue() if necessary.

Overrides:
setInternalValue in class AbstractField<java.lang.Boolean>
Parameters:
newValue - the new value to be set.

addBlurListener

public void addBlurListener(FieldEvents.BlurListener listener)

addListener

@Deprecated
public void addListener(FieldEvents.BlurListener listener)
Deprecated. As of 7.0, replaced by #addBlurListener(BlurListener)


removeBlurListener

public void removeBlurListener(FieldEvents.BlurListener listener)

removeListener

@Deprecated
public void removeListener(FieldEvents.BlurListener listener)
Deprecated. As of 7.0, replaced by #removeBlurListener(BlurListener)


addFocusListener

public void addFocusListener(FieldEvents.FocusListener listener)

addListener

@Deprecated
public void addListener(FieldEvents.FocusListener listener)
Deprecated. As of 7.0, replaced by #addFocusListener(FocusListener)


removeFocusListener

public void removeFocusListener(FieldEvents.FocusListener listener)

removeListener

@Deprecated
public void removeListener(FieldEvents.FocusListener listener)
Deprecated. As of 7.0, replaced by #removeFocusListener(FocusListener)


booleanValue

@Deprecated
public boolean booleanValue()
Deprecated. As of 7.0, use AbstractField.getValue() instead and, if needed, handle null values.

Get the boolean value of the button state.

Returns:
True iff the button is pressed down or checked.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.