com.vaadin.ui
Class CheckBox
java.lang.Object
com.vaadin.terminal.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<Boolean>
com.vaadin.ui.CheckBox
- All Implemented Interfaces:
- Buffered, BufferedValidatable, Property<Boolean>, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, Action.ShortcutNotifier, MethodEventSource, Connector, ClientConnector, RpcTarget, Sizeable, Component, Component.Focusable, Field<Boolean>, Serializable
public class CheckBox
- extends AbstractField<Boolean>
- See Also:
- Serialized Form
Constructor Summary |
CheckBox()
Creates a new checkbox. |
CheckBox(String caption)
Creates a new checkbox with a set caption. |
CheckBox(String caption,
boolean initialState)
Creates a new checkbox with a caption and a set initial state. |
CheckBox(String caption,
Property<?> dataSource)
Creates a new checkbox that is connected to a boolean property. |
Methods inherited from class com.vaadin.ui.AbstractField |
addListener, addListener, addValidator, attach, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isValidationVisible, isWriteThrough, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeValidator, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, setWriteThrough, shouldHideErrors, toString, updateState, validate, validate, valueChange |
Methods inherited from class com.vaadin.ui.AbstractComponent |
addListener, addListener, addListener, addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, fireEvent, getActionManager, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getRoot, getStyle, getStyleName, getWidth, getWidthUnits, handleError, hasListeners, isConnectorEnabled, isEnabled, isImmediate, isVisible, removeListener, removeListener, removeListener, removeListener, removeListener, removeShortcutListener, removeStyleName, requestRepaint, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeight, setIcon, setImmediate, setLocale, setParent, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidth |
Methods inherited from class com.vaadin.terminal.AbstractClientConnector |
addExtension, addMethodInvocationToQueue, createState, getAllChildrenIterable, getConnectorId, getExtensions, getRpcManager, getRpcProxy, getStateType, registerRpc, registerRpc, removeExtension, requestRepaintAll, retrievePendingRpcCalls |
Methods inherited from interface com.vaadin.ui.Component |
addListener, addStyleName, getApplication, getCaption, getDebugId, getIcon, getLocale, getParent, getRoot, getStyleName, isEnabled, isVisible, removeListener, removeStyleName, setCaption, setDebugId, setEnabled, setIcon, setStyleName, setVisible |
CheckBox
public CheckBox()
- Creates a new checkbox.
CheckBox
public CheckBox(String caption)
- Creates a new checkbox with a set caption.
- Parameters:
caption
- the Checkbox caption.
CheckBox
public CheckBox(String caption,
boolean initialState)
- Creates a new checkbox with a caption and a set initial state.
- Parameters:
caption
- the caption of the checkboxinitialState
- the initial state of the checkbox
CheckBox
public CheckBox(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
-
getType
public Class<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<Boolean>
- Specified by:
getType
in class AbstractField<Boolean>
- Returns:
- the type of the Field
getState
public 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().
- Specified by:
getState
in interface Connector
- Specified by:
getState
in interface Component
- Overrides:
getState
in class AbstractField<Boolean>
- Returns:
- updated component shared state
setInternalValue
protected void setInternalValue(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<Boolean>
- Parameters:
newValue
- the new value to be set.
addListener
public void addListener(FieldEvents.BlurListener listener)
removeListener
public void removeListener(FieldEvents.BlurListener listener)
addListener
public void addListener(FieldEvents.FocusListener listener)
removeListener
public void removeListener(FieldEvents.FocusListener listener)
booleanValue
@Deprecated
public boolean booleanValue()
- Deprecated. 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-2011 Vaadin Ltd. All Rights Reserved.