com.vaadin.ui
Class CheckBox

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractField
          extended by com.vaadin.ui.Button
              extended by com.vaadin.ui.CheckBox
All Implemented Interfaces:
Buffered, BufferedValidatable, Property, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, Action.ShortcutNotifier, FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, MethodEventSource, Paintable, Sizeable, VariableOwner, Component, Component.Focusable, Field, Serializable, EventListener

public class CheckBox
extends Button

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.Button
Button.ClickEvent, Button.ClickListener, Button.ClickShortcut
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler
 
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.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
 
Field Summary
 
Fields inherited from class com.vaadin.ui.Button
clickShortcut, STYLE_LINK
 
Constructor Summary
CheckBox()
          Creates a new switch button.
CheckBox(String caption)
          Creates a new push button with a set caption.
CheckBox(String caption, boolean initialState)
          Creates a new switch button with a caption and a set initial state.
CheckBox(String caption, Button.ClickListener listener)
          Creates a new switch button with a caption and a click listener.
CheckBox(String caption, Object target, String methodName)
          Convenience method for creating a new switch button with a method listening button clicks.
CheckBox(String caption, Property dataSource)
          Creates a new switch button that is connected to a boolean property.
 
Method Summary
 void setDisableOnClick(boolean disableOnClick)
          Determines if a button is automatically disabled when clicked.
 void setSwitchMode(boolean switchMode)
          Deprecated. 
 
Methods inherited from class com.vaadin.ui.Button
addListener, addListener, addListener, booleanValue, changeVariables, click, fireClick, fireClick, getType, isDisableOnClick, isHtmlContentAllowed, isSwitchMode, paintContent, removeClickShortcut, removeListener, removeListener, removeListener, setClickShortcut, setHtmlContentAllowed, setImmediate, setInternalValue
 
Methods inherited from class com.vaadin.ui.AbstractField
addListener, addListener, addShortcutListener, addValidator, attach, commit, constructField, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getActionManager, getErrorMessage, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, getValue, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isValidationVisible, isWriteThrough, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeShortcutListener, removeValidator, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, setWriteThrough, shouldHideErrors, toString, validate, valueChange
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeight, setHeight, setHeightUnits, setIcon, setLocale, setParent, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidth, setWidth, setWidthUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Field
getDescription, setCaption, setDescription
 

Constructor Detail

CheckBox

public CheckBox()
Creates a new switch button.


CheckBox

public CheckBox(String caption,
                boolean initialState)
Creates a new switch button with a caption and a set initial state.

Parameters:
caption - the caption of the switch button
initialState - the initial state of the switch button

CheckBox

public CheckBox(String caption,
                Button.ClickListener listener)
Creates a new switch button with a caption and a click listener.

Parameters:
caption - the caption of the switch button
listener - the click listener

CheckBox

public CheckBox(String caption,
                Object target,
                String methodName)
Convenience method for creating a new switch button with a method listening button clicks. Using this method is discouraged because it cannot be checked during compilation. Use AbstractComponent.addListener(Class, Object, Method) or AbstractComponent.addListener(com.vaadin.ui.Component.Listener) instead. The method must have either no parameters, or only one parameter of Button.ClickEvent type.

Parameters:
caption - the Button caption.
target - the Object having the method for listening button clicks.
methodName - the name of the method in target object, that receives button click events.

CheckBox

public CheckBox(String caption,
                Property dataSource)
Creates a new switch button that is connected to a boolean property.

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

CheckBox

public CheckBox(String caption)
Creates a new push button with a set caption. The value of the push button is always false and they are immediate by default.

Parameters:
caption - the Button caption.
Method Detail

setSwitchMode

@Deprecated
public void setSwitchMode(boolean switchMode)
                   throws UnsupportedOperationException
Deprecated. 

Description copied from class: Button
Sets the switchMode.

Overrides:
setSwitchMode in class Button
Parameters:
switchMode - The switchMode to set.
Throws:
UnsupportedOperationException

setDisableOnClick

public void setDisableOnClick(boolean disableOnClick)
Description copied from class: Button
Determines if a button is automatically disabled when clicked. If this is set to true the button will be automatically disabled when clicked, typically to prevent (accidental) extra clicks on a button.

Note that this is only used when the click comes from the user, not when calling Button.click().

Also note that click shortcuts are not supported with this feature in Vaadin 6.x.

Overrides:
setDisableOnClick in class Button
Parameters:
disableOnClick - true to disable button when it is clicked, false otherwise


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