com.sapportals.htmlb.toolbar

Class ToolbarInputField

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.EventValidationComponent
          extended bycom.sapportals.htmlb.toolbar.ToolbarInputField
All Implemented Interfaces:
IEventValidationComponent

public class ToolbarInputField
extends EventValidationComponent


Field Summary
static String UI_ID
           
 
Constructor Summary
ToolbarInputField(String name)
          creates a toolbar inputfield with a specific name
 
Method Summary
 ArrayList getAllValidators()
          returns all validator defined for this component
 DataBCD getBCD()
          get the DataBCD container from this InputField.
 DataDate getDate()
          get the DataDate container from this InputField.
protected  String getEncodedIdForForm(Form theForm)
          internal method to get additional data for encoding fields
 HorizontalTextAlignment getHAlign()
          gets the alignment to be used for rendering this InputField.
 DataInteger getInteger()
          get the DataInteger container from this InputField.
 String getLabelText()
          returns the labeltext for the inputfield
 int getMaxLength()
          returns the maximim number of character for the inputfield
 DataString getString()
          get the DataString container from this InputField.
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 DataTime getTime()
          get the DataTime container from this InputField.
 DataType getType()
          gets the current DataType of this InputField.
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 Object getValue()
          get the value associated with this InputField
 AbstractDataType getValueAsDataType()
          get the value the user entered as a AbstractDataType
 boolean getValueEncode()
           
 String getWidth()
          returns the width for the inputfield
protected  void initFromPageContext(IPageContext pc, String baseId)
          internal use only
protected  void initFromShortId(IPageContext pc, String id)
          internal use only
 void setBCD(Object bcd)
          set the DataBCD container to this InputField.
 void setDate(Object date)
          set the DataDate container for this InputField.
 void setHAlign(HorizontalTextAlignment align)
          set the aligment to be used for rendering this InputField.
 void setInteger(Object integer)
          set the Integer container to this InputField.
 void setLabelText(String labelText)
          sets the labeltext for the button
 void setMaxLength(int maxLength)
          sets the maximum number of character for the inputfield
 void setString(Object value)
          sets a String value for this InputField.
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 void setTime(Object time)
          set the DataTime container from this InputField.
 void setType(DataType type)
          sets the DataType for this InputField.
 void setValue(Object value)
          set the value for this InputField
 void setWidth(String width)
          sets the width for the inputfield
 
Methods inherited from class com.sapportals.htmlb.EventValidationComponent
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
getId, getParent, initializeFromId, isJsObjectNeeded, preRender, render, renderAsString, requiresForm, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

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

ToolbarInputField

public ToolbarInputField(String name)
creates a toolbar inputfield with a specific name

Parameters:
name - the name/ID for this toolbar inputfield
Method Detail

getMaxLength

public int getMaxLength()
returns the maximim number of character for the inputfield

Returns:
maximum length for the inputfield value

setMaxLength

public void setMaxLength(int maxLength)
sets the maximum number of character for the inputfield

Parameters:
maxLength - the maximum length for the inputfield value

getWidth

public String getWidth()
returns the width for the inputfield

Returns:
the inputfield width

setWidth

public void setWidth(String width)
sets the width for the inputfield

Parameters:
width - the inputfield width

getEncodedIdForForm

protected String getEncodedIdForForm(Form theForm)
internal method to get additional data for encoding fields

Overrides:
getEncodedIdForForm in class Component
Returns:
a String that uniquely identifies the InputField's datatype

initFromShortId

protected void initFromShortId(IPageContext pc,
                               String id)
internal use only

Overrides:
initFromShortId in class Component
Parameters:
id - the Id as it was returned by getEncodedIdForForm()

initFromPageContext

protected void initFromPageContext(IPageContext pc,
                                   String baseId)
internal use only

Overrides:
initFromPageContext in class Component
Parameters:
pc - the context, including the parameters
baseId - the prefix used for the component. (The result of a former RenderUtil.getIdForForm(rc, c);)

getValue

public Object getValue()
get the value associated with this InputField

Returns:
the value of this InputField

setValue

public void setValue(Object value)
set the value for this InputField

Parameters:
value - the value

setType

public void setType(DataType type)
sets the DataType for this InputField. This method will try to preserve any existing data.

Parameters:
type - the desired DataType for this InputField

getType

public DataType getType()
gets the current DataType of this InputField. May return null if no type (or value) has been set, yet.

Returns:
the DataType or null

setString

public void setString(Object value)
sets a String value for this InputField. This automatically sets the DataType of the InputField to DataString. If value is not of type String the default conversion using toString is used.

Parameters:
value - the value for this InputField

getString

public DataString getString()
get the DataString container from this InputField. If no value for the InputField has been set this will create a DataString instance and thus set the DataType of this InputField.

If the DataType of the InputField has already been set to something other than DataString this will throw an IllegalStateException exception

Returns:
a DataString
Throws:
IllegalStateException - if the InputField has a different type than DataString

setDate

public void setDate(Object date)
set the DataDate container for this InputField.


getDate

public DataDate getDate()
get the DataDate container from this InputField. If no value for the InputField has been set this will create a DataDate instance and thus set the DataType of this InputField.

If the DataType of the InputField has already been set to something other than DataDate this will throw an IllegalStateException exception

Returns:
a DataDate
Throws:
IllegalStateException - if the InputField has a different type than DataDate

setTime

public void setTime(Object time)
set the DataTime container from this InputField.


getTime

public DataTime getTime()
get the DataTime container from this InputField. If no value for the InputField has been set this will create a DataTime instance and thus set the DataType of this InputField.

If the DataType of the InputField has already been set to something other than DataTime this will throw an IllegalStateException exception

Returns:
a DataTime
Throws:
IllegalStateException - if the InputField has a different type than DataTime

setBCD

public void setBCD(Object bcd)
set the DataBCD container to this InputField.


getBCD

public DataBCD getBCD()
get the DataBCD container from this InputField. If no value for the InputField has been set this will create a DataBCD instance and thus set the DataType of this InputField.

If the DataType of the InputField has already been set to something other than DataBCD this will throw an IllegalStateException exception

Returns:
a DataBCD
Throws:
IllegalStateException - if the InputField has a different type than DataBCD

setInteger

public void setInteger(Object integer)
set the Integer container to this InputField.


getInteger

public DataInteger getInteger()
get the DataInteger container from this InputField. If no value for the InputField has been set this will create a DataInteger instance and thus set the DataType of this InputField.

If the DataInteger of the InputField has already been set to something other than DataInteger this will throw an IllegalStateException exception

Returns:
a DataInteger
Throws:
IllegalStateException - if the InputField has a different type than DataInteger

getValueAsDataType

public AbstractDataType getValueAsDataType()
get the value the user entered as a AbstractDataType

Returns:
the content of the InputField

getAllValidators

public ArrayList getAllValidators()
returns all validator defined for this component

Specified by:
getAllValidators in interface IEventValidationComponent
Overrides:
getAllValidators in class EventValidationComponent

getLabelText

public String getLabelText()
returns the labeltext for the inputfield

Returns:
the inputfield label text

setLabelText

public void setLabelText(String labelText)
sets the labeltext for the button


getUI

public String getUI()
get a identification String for the renderer that is unique across all supported components. E.g. you could simply return the class name of the component class. The reason for using a separate method and not some internal reflection method is that you can more easily extend the functionality or your Component class without having to rewrite the view class.

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

getValueEncode

public boolean getValueEncode()

getHAlign

public HorizontalTextAlignment getHAlign()
gets the alignment to be used for rendering this InputField.

Returns:
the aligment for this InputField.

setHAlign

public void setHAlign(HorizontalTextAlignment align)
set the aligment to be used for rendering this InputField.

Parameters:
align - the design for this InputField.

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