com.sapportals.htmlb

Class TextView

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.TextView
All Implemented Interfaces:
LabeledComponent

public class TextView
extends Component
implements LabeledComponent

A TextView is a simple text that supports several designs.


Field Summary
static String UI_ID
           
 
Constructor Summary
TextView()
           
TextView(String text)
           
 
Method Summary
 TextViewDesign getDesign()
          gets the design to be used for rendering this TextView.
 HorizontalTextAlignment getHAlign()
          gets the alignment to be used for rendering this TextView.
 HoverMenu getHoverMenu()
          returns the hover menu which should be displayed as mouse moves over the text
 TextViewLayout getLayout()
           
 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 isEncode()
          check if text should be encoded (default) or treated as native HTML.
 boolean isLabeled()
          is labled
 boolean isNested()
           
 boolean isRequired()
          check if this TextView indicates that an InputField is required.
 boolean isWrapping()
          determines if wrapping is allowed for this TextView.
 void removerHoverMenu(HoverMenu menu)
           
 boolean requiresForm()
          check if a special component really requires a form around it.
 void setDesign(TextViewDesign design)
          set the design to be used for rendering this TextView.
 void setEncode(boolean encode)
           
 void setHAlign(HorizontalTextAlignment align)
          set the aligment to be used for rendering this TextView.
 void setHoverMenu(HoverMenu hoverMenu)
          sets the hove menu which should be displayed as mouse moves over the text
 void setLabeled(boolean isLabeled)
          set labled
 void setLayout(TextViewLayout layout)
          sets the Layout of the TextView.
 void setNested(boolean nested)
           
 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 setWidth(String width)
          set the width of the input field
 void setWrapping(boolean wrapping)
          sets if wrapping is allowed for this TextView.
 
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, toString, wait, wait, wait
 

Field Detail

UI_ID

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

TextView

public TextView()

TextView

public TextView(String text)
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)

getLayout

public TextViewLayout getLayout()

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

setLayout

public void setLayout(TextViewLayout layout)
sets the Layout of the TextView.

Parameters:
layout -

getDesign

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

Returns:
the design for this TextView.

setDesign

public void setDesign(TextViewDesign design)
set the design to be used for rendering this TextView.

Parameters:
design - the design for this TextView.

isRequired

public boolean isRequired()
check if this TextView indicates that an InputField is required.

Returns:
true if the labeled field is required
See Also:
Label

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.

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

getHoverMenu

public HoverMenu getHoverMenu()
returns the hover menu which should be displayed as mouse moves over the text


setHoverMenu

public void setHoverMenu(HoverMenu hoverMenu)
sets the hove menu which should be displayed as mouse moves over the text


setLabeled

public void setLabeled(boolean isLabeled)
set labled

Specified by:
setLabeled in interface LabeledComponent

isLabeled

public boolean isLabeled()
is labled

Specified by:
isLabeled in interface LabeledComponent

removerHoverMenu

public void removerHoverMenu(HoverMenu menu)

getHAlign

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

Returns:
the aligment for this TextView.

setHAlign

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

Parameters:
align - the design for this TextView.

setNested

public void setNested(boolean nested)

isNested

public boolean isNested()

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