com.sapportals.htmlb

Class RadioButton

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.EventValidationComponent
          extended bycom.sapportals.htmlb.StatefulButtonBase
              extended bycom.sapportals.htmlb.RadioButton
All Implemented Interfaces:
IEventValidationComponent, IUserDataComponent, LabeledComponent

public class RadioButton
extends StatefulButtonBase
implements IUserDataComponent, LabeledComponent

Basic Checkbox Control.

Copyright 2004 SAP AG


Field Summary
static String UI_ID
           
 
Fields inherited from class com.sapportals.htmlb.StatefulButtonBase
VAR_CONTENT, VAR_CONTENTFORGROUP, VAR_ELEMENT, VAR_ELEMENTFORGROUP
 
Constructor Summary
protected RadioButton(RadioButtonGroup parent)
          Create RadioButton.
protected RadioButton(RadioButtonGroup parent, String key)
          create RadioButton with key
 
Method Summary
 RadioButtonGroup getRadioButtonGroup()
          Get RadioButton group to which this RadioButton belongs.
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 String getUI()
          Get String identifier for this component.
 AbstractDataType getValueAsDataType()
          Get select state as AbstractDataType
protected  void initFromPageContext(IPageContext pc, String baseId)
          internal method to set users selection to the appropriate properties of the checkbox
 boolean isLabeled()
          checks if a label has been assigned to this component.
 boolean isSelected()
          Check select state.
 void render(int selector, IPageContext rendererContext)
          render an aspect of the component using the current context.
 void setLabeled(boolean isLabeled)
          notify the component that a label has been assigned to it.
 void setSelected(boolean selected)
          Set select state.
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 
Methods inherited from class com.sapportals.htmlb.StatefulButtonBase
getElement, getKey, getText, getTooltip, hasValidTooltip, isEncode, setElement, setEncode, setKey, setText, setTooltip, toString
 
Methods inherited from class com.sapportals.htmlb.EventValidationComponent
getAllValidators, getClientEvent, getClientEventMap, getErrorText, getServerEvent, getServerEventMap, getValidator, isDisabled, isEnabled, isRequiresValidation, renderJavascriptInterface, setClientEvent, setDisabled, setEnabled, setErrorText, setRequiresValidation, setServerEvent, setValidator
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromShortId, initializeFromId, isJsObjectNeeded, preRender, render, renderAsString, requiresForm, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values
Constructor Detail

RadioButton

protected RadioButton(RadioButtonGroup parent,
                      String key)
create RadioButton with key

Parameters:
parent - the group to which this RadioButton belongs
key - the key for this radioButton.

RadioButton

protected RadioButton(RadioButtonGroup parent)
Create RadioButton. Default Constructor is protected to enforce key creation.

Method Detail

getRadioButtonGroup

public RadioButtonGroup getRadioButtonGroup()
Get RadioButton group to which this RadioButton belongs.

Returns:
RadioButtonGroup

getUI

public String getUI()
Get String identifier for this component.

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

isSelected

public boolean isSelected()
Check select state.

Returns:
true if RadioButton was/is selected

setSelected

public void setSelected(boolean selected)
Set select state.

Parameters:
selected - boolean specifying select state

initFromPageContext

protected void initFromPageContext(IPageContext pc,
                                   String baseId)
internal method to set users selection to the appropriate properties of the checkbox

Overrides:
initFromPageContext in class Component
Parameters:
pc - the pagecontext from which to read the data
baseId - the prefix for the parameter keys

getValueAsDataType

public AbstractDataType getValueAsDataType()
Get select state as AbstractDataType

Specified by:
getValueAsDataType in interface IUserDataComponent
Returns:
DataBoolean instance indicating the select state

render

public void render(int selector,
                   IPageContext rendererContext)
render an aspect of the component using the current context. This method can be used by components that do not produce an atomic HTML code.

Parameters:
selector - the aspect to render.
rendererContext - the context in which to render.

setLabeled

public void setLabeled(boolean isLabeled)
Description copied from interface: LabeledComponent
notify the component that a label has been assigned to it.

Specified by:
setLabeled in interface LabeledComponent

isLabeled

public boolean isLabeled()
Description copied from interface: LabeledComponent
checks if a label has been assigned to this component.

Specified by:
isLabeled in interface LabeledComponent

getTextDirection

public ForcedTextDirection getTextDirection()
Gets the text direction for the component

Returns:
com.sapportals.htmlb.enum.ForcedTextDirection

setTextDirection

public void setTextDirection(ForcedTextDirection textDirection)
Sets the text direction for the component

Parameters:
textDirection - com.sapportals.htmlb.enum.ForcedTextDirection


Copyright 2006 SAP AG Complete Copyright Notice