public class CmsRadioButton
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.user.client.ui.HasHorizontalAlignment, com.google.gwt.event.dom.client.HasClickHandlers
In most cases, you will need to set the group of a radio button, which is a Java object, not just a string as in HTML radio buttons. Clicking on a radio button in a group will result in the radio button being selected, and none of the other buttons in the group being selected.
限定符和类型 | 字段和说明 |
---|---|
protected CmsToggleButton |
m_button
The wigdet used to implement the actual radio button.
|
protected CmsRadioButtonGroup |
m_group
The radio button group.
|
构造器和说明 |
---|
CmsRadioButton()
Creates a new radio button without setting the name and label text.
|
CmsRadioButton(java.lang.String name,
java.lang.String labelText)
Creates a new radio button.
|
限定符和类型 | 方法和说明 |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Adds a click handler to the radio button.
|
com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant |
getHorizontalAlignment()
This is the alignment of the text in reference to the checkbox, possible values are left or right.
|
java.lang.String |
getName()
Returns the value associated with this radio button.
|
CmsToggleButton |
getRadioButton()
Returns the radio button.
|
boolean |
isChecked()
Returns true if the radio button is checked.
|
boolean |
isEnabled()
Returns
true if this widget is enabled. |
void |
setChecked(boolean checked)
Sets the 'checked' status of the radio button.
|
void |
setEnabled(boolean enabled)
Enables or disables the radio button.
|
void |
setGroup(CmsRadioButtonGroup group)
Sets the group for this radio button.
|
void |
setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
This is the alignment of the text in reference to the checkbox, possible values are left or right.
|
void |
setName(java.lang.String name)
Sets the name of this radio button.
|
void |
setText(java.lang.String text)
Sets the text which is displayed next to the radio button.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
protected CmsToggleButton m_button
protected CmsRadioButtonGroup m_group
public CmsRadioButton()
public CmsRadioButton(java.lang.String name, java.lang.String labelText)
name
- the value associated with this radio buttonlabelText
- the label text of the radio buttonpublic com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler
在接口中 com.google.gwt.event.dom.client.HasClickHandlers
HasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
public com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
getHorizontalAlignment
在接口中 com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.getHorizontalAlignment()
public java.lang.String getName()
public CmsToggleButton getRadioButton()
public boolean isChecked()
public boolean isEnabled()
true
if this widget is enabled.true
if this widget is enabledpublic void setChecked(boolean checked)
checked
- if true, check the radio button, else uncheck itpublic void setEnabled(boolean enabled)
enabled
- if true, the radio button is enabled, else disabledpublic void setGroup(CmsRadioButtonGroup group)
group
- public void setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
setHorizontalAlignment
在接口中 com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant)
public void setName(java.lang.String name)
name
- the new namepublic void setText(java.lang.String text)
text
- the new text