Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.user.client.ui
Class SimpleCheckBox

    java.lang.Object
      com.google.gwt.user.client.ui.UIObject
          com.google.gwt.user.client.ui.Widget
              com.google.gwt.user.client.ui.FocusWidget
                  com.google.gwt.user.client.ui.SimpleCheckBox

All Implemented Interfaces:
  EventListener, HasFocus, HasName, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents

Direct Known Subclasses:
  SimpleRadioButton

    public class SimpleCheckBox

extends FocusWidget
implements HasName

A simple checkbox widget, with no label.

### CSS Style Rules

- .gwt-SimpleCheckBox { }
- .gwt-SimpleCheckBox-disabled { Applied when checkbox is disabled }

Nested Class Summary

Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
`UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled`

Field Summary

Fields inherited from class com.google.gwt.user.client.ui.UIObject
`DEBUG_ID_PREFIX`

Constructor Summary
`` | `SimpleCheckBox()` Creates a new simple checkbox.
`protected` | `SimpleCheckBox(Element element)` This constructor may be used by subclasses to explicitly use an existing element.

Method Summary
`java.lang.String` | `getName()` Gets the widget's name.
`boolean` | `isChecked()` Determines whether this check box is currently checked.
`protected void` | `onUnload()` This method is called when a widget is detached from the browser's document.
`void` | `setChecked(boolean checked)` Checks or unchecks this check box.
`void` | `setEnabled(boolean enabled)` Sets whether this widget is enabled.
`void` | `setName(java.lang.String name)` Sets the widget's name.
`static SimpleCheckBox` | `wrap(Element element)` Creates a SimpleCheckBox widget that wraps an existing <input type='checkbox'> element.

Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
`addClickListener, addFocusListener, addKeyboardListener, getFocusImpl, getTabIndex, isEnabled, onBrowserEvent, removeClickListener, removeFocusListener, removeKeyboardListener, setAccessKey, setElement, setFocus, setTabIndex`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onDetach, onLoad, removeFromParent`

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, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SimpleCheckBox

    public SimpleCheckBox()

  Creates a new simple checkbox.

### SimpleCheckBox

    protected SimpleCheckBox(Element element)

  This constructor may be used by subclasses to explicitly use an existing element. This element must be an <input> element whose type is either 'checkbox'.

  Parameters:
    `element` - the element to be used

Method Detail

### wrap

    public static SimpleCheckBox wrap(Element element)

  Creates a SimpleCheckBox widget that wraps an existing <input type='checkbox'> element. This element must already be attached to the document. If the element is removed from the document, you must call `RootPanel.detachNow(Widget)`.

  Parameters:
    `element` - the element to be wrapped

### getName

    public java.lang.String getName()

  Description copied from interface: `HasName`
  Gets the widget's name.

  Specified by:
    `getName` in interface `HasName`
  Returns:
    the widget's name

### isChecked

    public boolean isChecked()

  Determines whether this check box is currently checked.

  Returns:
    `true` if the check box is checked

### 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

### setName

    public void setName(java.lang.String name)

  Description copied from interface: `HasName`
  Sets the widget's name.

  Specified by:
    `setName` in interface `HasName`
  Parameters:
    `name` - the widget's new name

### onUnload

    protected void onUnload()

  This method is called when a widget is detached from the browser's document. Overridden because of IE bug that throws away checked state and in order to clear the event listener off of the `inputElem`.

  Overrides:
    `onUnload` in class `Widget`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD