com.sapportals.htmlb

Class Button

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

public class Button
extends EventValidationComponent

A single button
Copyright 2004 SAP AG


Field Summary
static String UI_ID
           
 
Constructor Summary
protected Button()
           
  Button(String name)
          create a new button with a given name
  Button(String name, String text)
          create a new button with a given name
 
Method Summary
 ArrayList getAllValidators()
          returns the validators
 ButtonDesign getDesign()
          set the design to be used for rendering this button.
 InputField getFieldToTransferDataFrom()
          return the id of the field from which the data should be trabsfered into the window launching the value help
 String getOnClick()
          get the event name
 String getOnClientClick()
          get the JavaScript fragment that is executed on the client side if the user changes the selection
 String getText()
          get the text of this button
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 String getTooltip()
          get the tooltip of this button
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 String getWidth()
          get the width of this button
 boolean isCancelButton()
          return if this button is an CancelButton Cancel Buttons get a special validator that checks for changes discarded
 boolean isDataTransferingButton()
          returns if the button is used to tranfer data
 boolean isEncode()
          check if text should be encoded (default) or treated as native HTML.
 boolean isOKButton()
          return if this button is an OKButton OK Buttons get a special validator that runs validation on all input fields
 void setCancelButton(boolean CancelButton)
          Cancel Buttons get a special validator that checks for changes discarded
 void setDataTransferingButton(boolean dataTransferingButton)
          determines if the button is used to tranfer data
 void setDesign(ButtonDesign design)
          set the design to be used for rendering this button.
 void setEncode(boolean encode)
          sets if text should be encoded (default) or treated as native HTML.
 void setFieldToTransferDataFrom(InputField fieldToTransferDataFrom)
          return the id of the field from which the data should be trabsfered into the window launching the value help
 void setOKButton(boolean OKButton)
          OK Buttons get a special validator that runs validation on all input fields
 void setOnClick(String onClick)
          set the event name that is fired when the user clicks on this button
 void setOnClientClick(String onClientClick)
          set a Javascript fragment that is executed when the user clicks on this button
 void setText(String text)
          set the text of this button
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 void setTooltip(String tooltip)
          set the tooltip of this button
 void setWidth(String width)
          set the width of this button.
 
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
getEncodedIdForForm, getId, getParent, initFromPageContext, initFromShortId, 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

Button

protected Button()

Button

public Button(String name)
create a new button with a given name

Parameters:
name - the name/ID for this button

Button

public Button(String name,
              String text)
create a new button with a given name

Parameters:
name - the name/ID for this button
Method Detail

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

getText

public String getText()
get the text of this button

Returns:
the text

setText

public void setText(String text)
set the text of this button

Parameters:
text - the text for this button

getTooltip

public String getTooltip()
get the tooltip of this button

Returns:
the tooltip

setTooltip

public void setTooltip(String tooltip)
set the tooltip of this button

Parameters:
tooltip - the tooltip for this button

getOnClick

public String getOnClick()
get the event name

Returns:
the event name

setOnClick

public void setOnClick(String onClick)
set the event name that is fired when the user clicks on this button

Parameters:
onClick - the name of the event

getOnClientClick

public String getOnClientClick()
get the JavaScript fragment that is executed on the client side if the user changes the selection

Returns:
the JavaScript fragment.

setOnClientClick

public void setOnClientClick(String onClientClick)
set a Javascript fragment that is executed when the user clicks on this button

Parameters:
onClientClick - the Javascript

isOKButton

public boolean isOKButton()
return if this button is an OKButton OK Buttons get a special validator that runs validation on all input fields

Returns:
true if the button is an OKButton

setOKButton

public void setOKButton(boolean OKButton)
OK Buttons get a special validator that runs validation on all input fields

Parameters:
OKButton - true if the button should enforce validation

isCancelButton

public boolean isCancelButton()
return if this button is an CancelButton Cancel Buttons get a special validator that checks for changes discarded

Returns:
true if the button is an CancelButton

setCancelButton

public void setCancelButton(boolean CancelButton)
Cancel Buttons get a special validator that checks for changes discarded

Parameters:
CancelButton - true if the button should ask when discarding changes

getAllValidators

public ArrayList getAllValidators()
returns the validators

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

isEncode

public boolean isEncode()
check if text should be encoded (default) or treated as native HTML.

Returns:
true if the text should be encoded, else false

setEncode

public void setEncode(boolean encode)
sets if text should be encoded (default) or treated as native HTML.

Parameters:
encode - true if the text should be encoded, else false

getWidth

public String getWidth()
get the width of this button

Returns:
the width

setWidth

public void setWidth(String width)
set the width of this button. This is an HTML width, i.e. you can use percentages or fixed values. E.g. '100%', '95px', '95'


getDesign

public ButtonDesign getDesign()
set the design to be used for rendering this button. Please note: There should only be one EMPHASIZED button for your MiniApps.

Returns:
design the design for this button.

setDesign

public void setDesign(ButtonDesign design)
set the design to be used for rendering this button. Please note: There should only be one EMPHASIZED button for your MiniApps.

Parameters:
design - the design for this button.

getFieldToTransferDataFrom

public InputField getFieldToTransferDataFrom()
return the id of the field from which the data should be trabsfered into the window launching the value help


setFieldToTransferDataFrom

public void setFieldToTransferDataFrom(InputField fieldToTransferDataFrom)
return the id of the field from which the data should be trabsfered into the window launching the value help


isDataTransferingButton

public boolean isDataTransferingButton()
returns if the button is used to tranfer data


setDataTransferingButton

public void setDataTransferingButton(boolean dataTransferingButton)
determines if the button is used to tranfer data


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