com.google.gwt.user.client.ui
Class CheckBox

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
          extended bycom.google.gwt.user.client.ui.FocusWidget
              extended bycom.google.gwt.user.client.ui.ButtonBase
                  extended bycom.google.gwt.user.client.ui.CheckBox
All Implemented Interfaces:
EventListener, HasFocus, HasHTML, HasText, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents
Direct Known Subclasses:
RadioButton

public class CheckBox
extends ButtonBase

A standard check box widget (also serves as a base class for RadioButton.

CSS Style Rules

Example

code


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
  CheckBox()
          Creates a check box with no label.
protected CheckBox(Element elem)
           
  CheckBox(String label)
          Creates a check box with the specified text label.
  CheckBox(String label, boolean asHTML)
          Creates a check box with the specified text label.
 
Method Summary
 String getHTML()
          Gets this object's contents as HTML.
 String getText()
          Gets this object's text.
 boolean isChecked()
          Determines whether this check box is currently checked.
 boolean isEnabled()
          Gets whether this widget is enabled.
 void setChecked(boolean checked)
          Checks or unchecks this check box.
 void setEnabled(boolean enabled)
          Sets whether this widget is enabled.
 void setHTML(String html)
          Sets this object's contents via HTML.
 void setText(String text)
          Sets this object's text.
 
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addClickListener, addFocusListener, addKeyboardListener, getTabIndex, onBrowserEvent, removeClickListener, removeFocusListener, removeKeyboardListener, setAccessKey, setFocus, setTabIndex
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onAttach, onDetach, onLoad
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode
 

Constructor Detail

CheckBox

public CheckBox()
Creates a check box with no label.


CheckBox

public CheckBox(String label)
Creates a check box with the specified text label.

Parameters:
label - the check box's label

CheckBox

public CheckBox(String label,
                boolean asHTML)
Creates a check box with the specified text label.

Parameters:
label - the check box's label

CheckBox

protected CheckBox(Element elem)
Method Detail

getHTML

public String getHTML()
Description copied from interface: HasHTML
Gets this object's contents as HTML.

Specified by:
getHTML in interface HasHTML
Overrides:
getHTML in class ButtonBase

getText

public String getText()
Description copied from interface: HasText
Gets this object's text.

Specified by:
getText in interface HasText
Overrides:
getText in class ButtonBase

isChecked

public boolean isChecked()
Determines whether this check box is currently checked.

Returns:
true if the check box is checked

isEnabled

public boolean isEnabled()
Description copied from class: FocusWidget
Gets whether this widget is enabled.

Overrides:
isEnabled in class FocusWidget
Returns:
true if the widget is enabled

setChecked

public void setChecked(boolean checked)
Checks or unchecks this check box.

Parameters:
checked - true to check the check box

setEnabled

public void setEnabled(boolean enabled)
Description copied from class: FocusWidget
Sets whether this widget is enabled.

Overrides:
setEnabled in class FocusWidget
Parameters:
enabled - true to enable the widget, false to disable it

setHTML

public void setHTML(String html)
Description copied from interface: HasHTML
Sets this object's contents via HTML. Use care when setting an object's HTML; it is an easy way to expose script-based security problems. Consider using HasText.setText(java.lang.String) whenever possible.

Specified by:
setHTML in interface HasHTML
Overrides:
setHTML in class ButtonBase

setText

public void setText(String text)
Description copied from interface: HasText
Sets this object's text.

Specified by:
setText in interface HasText
Overrides:
setText in class ButtonBase


This javadoc distribution was not produced by Google. The official documentation is here.