com.sapportals.htmlb

Class Label

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

public class Label
extends EventValidationComponent

A Label is a label for an input component Copyright (c) SAP AG 2001


Field Summary
static String UI_ID
           
 
Constructor Summary
Label(String text)
           
Label(String text, LabeledComponent field)
           
 
Method Summary
 TextViewDesign getDesign()
          gets the design to be used for rendering this Label.
 String getLabeledComponentId()
           
 LabeledComponent getLabelFor()
           
 String getLabledComponentClassName()
           
 String getText()
           
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 String getTooltip()
          gets the Tooltip for this TextView.
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 String getWidth()
          get the width of the input field
 boolean hasDesignBar()
           
 boolean isEncode()
          check if text should be encoded (default) or treated as native HTML.
 boolean isRequired()
          checks if this TextView indicates that an input in the labeled field is required.
 boolean isValid()
          checks if this Label indicates that an input in the labeled field is valid.
 boolean isWrapping()
          determines if wrapping is allowed for this TextView.
 boolean requiresForm()
          check if a special component really requires a form around it.
 void setDesign(TextViewDesign design)
          sets the design to be used for rendering this Label.
 void setEncode(boolean encode)
           
 void setHasDesignBar(boolean hasDesignBar)
           
 void setLabeledComponentId(String labeledComponent)
          required for JSPs.
 void setLabelFor(LabeledComponent labeledComponent)
           
 void setLabledComponentClassName(String className)
           
 void setRequired(boolean required)
          sets if this TextView indicates that an InputField is required.
 void setText(String text)
           
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 void setTooltip(String tooltip)
          sets the Tooltip for this TextView.
 void setValid(boolean valid)
          sets if this Label indicates that an InputField is valid.
 void setWidth(String width)
          set the width of the input field
 void setWrapping(boolean wrapping)
          sets if wrapping is allowed for this TextView.
 String 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, initFromPageContext, initFromShortId, initializeFromId, isJsObjectNeeded, preRender, render, renderAsString, 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

Label

public Label(String text)

Label

public Label(String text,
             LabeledComponent field)
Method Detail

getUI

public String getUI()
Description copied from class: Component
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()

setText

public void setText(String text)

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)

getTooltip

public String getTooltip()
gets the Tooltip for this TextView. Tooltips can not contain HTML coding.

Returns:
the tooltip text

setTooltip

public void setTooltip(String tooltip)
sets the Tooltip for this TextView. Tooltips can not contain HTML coding.

Parameters:
tooltip - the tooltip text

getDesign

public TextViewDesign getDesign()
gets the design to be used for rendering this Label.

Returns:
the design for this Label.

setDesign

public void setDesign(TextViewDesign design)
sets the design to be used for rendering this Label.

Parameters:
design - the design for this Label.

getLabelFor

public LabeledComponent getLabelFor()

setLabelFor

public void setLabelFor(LabeledComponent labeledComponent)

setLabeledComponentId

public void setLabeledComponentId(String labeledComponent)
required for JSPs.


getLabeledComponentId

public String getLabeledComponentId()

isRequired

public boolean isRequired()
checks if this TextView indicates that an input in the labeled field is required.

Returns:
true if the labeled field is required

setRequired

public void setRequired(boolean required)
sets if this TextView indicates that an InputField is required.

Parameters:
required - true, if the TextView should indicate a required field.

isValid

public boolean isValid()
checks if this Label indicates that an input in the labeled field is valid.

Returns:
true if the labeled field is valid

setValid

public void setValid(boolean valid)
sets if this Label indicates that an InputField is valid.

Parameters:
valid - true, if the Label should indicate a valid field.

setHasDesignBar

public void setHasDesignBar(boolean hasDesignBar)

hasDesignBar

public boolean hasDesignBar()

getWidth

public String getWidth()
get the width of the input field

Returns:
the width of the input field

setWidth

public void setWidth(String width)
set the width of the input field

Parameters:
width - the width of the input field

isWrapping

public boolean isWrapping()
determines if wrapping is allowed for this TextView. Default value is false.

Returns:
true is this TextView may wrap

setWrapping

public void setWrapping(boolean wrapping)
sets if wrapping is allowed for this TextView. Default value is false.

Parameters:
wrapping - true is this TextView may wrap

requiresForm

public boolean requiresForm()
check if a special component really requires a form around it. TextViews never require a form.

Overrides:
requiresForm in class Component
Returns:
false

toString

public String toString()

setLabledComponentClassName

public void setLabledComponentClassName(String className)

getLabledComponentClassName

public String getLabledComponentClassName()

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