com.sapportals.htmlb

Class Link

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Container
          extended bycom.sapportals.htmlb.EventValidationContainer
              extended bycom.sapportals.htmlb.Link
All Implemented Interfaces:
IEventValidationComponent, LabeledComponent

public class Link
extends EventValidationContainer
implements LabeledComponent

Link Control


Field Summary
static String UI_ID
           
static int VAR_BEGIN
           
static int VAR_END
           
static int VAR_TEXT
           
 
Fields inherited from class com.sapportals.htmlb.Container
elements
 
Constructor Summary
Link(String name)
          Creates a Link object with the specific name.
Link(String name, String text)
          Creates a Link object with the specific name and text.
 
Method Summary
 Component addComponent(Component c)
          add a component to this container
 String addText(String text)
          add a raw text to this container
 LinkFontSize getFontSize()
           
 TextView getInnerText()
           
 LinkDesign getLinkDesign()
           
 String getOnClick()
           
 String getOnClientClick()
          get the JavaScript fragment that is executed on the client side if the user changes the selection
 String getReference()
           
 String getTarget()
           
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 String getTooltip()
           
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 boolean getWrapping()
           
 boolean isLabeled()
          checks if a label has been assigned to this component.
 boolean isRequiresValidation()
          determines if the validation is required or not before submitting server event
 void preRender(IPageContext pc)
          preRender traverses the component tree right before rendering
 void removerHoverMenu(HoverMenu menu)
           
 boolean requiresForm()
          Determines if this Link requires to be placed in form.
 void setFontSize(LinkFontSize fontSize)
           
 void setLabeled(boolean isLabeled)
          notify the component that a label has been assigned to it.
 void setLinkDesign(LinkDesign linkDesign)
           
 void setOnClick(String onClick)
           
 void setOnClientClick(String onClientClick)
          set a Javascript fragment that is executed when the user clicks on this button
 void setReference(String reference)
           
 void setRequiresValidation(boolean validation)
           
 void setTarget(String target)
          The target argument specifies where to display the content of the selected hyperlink.
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 void setTooltip(String tooltip)
           
 void setWrapping(boolean Wrapping)
           
 String toString()
           
 
Methods inherited from class com.sapportals.htmlb.EventValidationContainer
getAllValidators, getClientEvent, getClientEventMap, getErrorText, getServerEvent, getServerEventMap, getValidator, isDisabled, isEnabled, renderJavascriptInterface, setClientEvent, setDisabled, setEnabled, setErrorText, setServerEvent, setValidator
 
Methods inherited from class com.sapportals.htmlb.Container
addRawText, getChildCount, iterator, removeComponent, render
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromPageContext, initFromShortId, initializeFromId, isJsObjectNeeded, 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

VAR_BEGIN

public static final int VAR_BEGIN
See Also:
Constant Field Values

VAR_END

public static final int VAR_END
See Also:
Constant Field Values

VAR_TEXT

public static final int VAR_TEXT
See Also:
Constant Field Values
Constructor Detail

Link

public Link(String name)
Creates a Link object with the specific name.


Link

public Link(String name,
            String text)
Creates a Link object with the specific name and text.

Method Detail

addText

public String addText(String text)
Description copied from class: Container
add a raw text to this container

Overrides:
addText in class Container
Parameters:
text - the text to add

addComponent

public Component addComponent(Component c)
Description copied from class: Container
add a component to this container

Overrides:
addComponent in class Container
Parameters:
c - the component to add

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:
component identifier

getOnClick

public String getOnClick()
Returns:
onCLick event identifier

setOnClick

public void setOnClick(String onClick)

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

getTarget

public String getTarget()
Returns:
target name where the hypertext link will be displayed
See Also:
setTarget(String)

setTarget

public void setTarget(String target)
The target argument specifies where to display the content of the selected hyperlink. Commonly used in conjunction with frames and multiple browser windows. Special target names: "_self" Default value. Shows content in the same frame or window as the source document. "_parent" Causes the document to be loaded into the parent window or frameset containing the frame containing the hypertext reference. If the reference is in a window or top-level frame, it is equivalent to the target _self. "_top" Causers the document to be loaded into the window containing the hypertext link, replacing any frames currently displayed intthe window. "_blank" Show in a new, unnamed top-level window. "name" Show in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.


getTooltip

public String getTooltip()
Returns:
text which is displayed when the mouse pauses over the link.

setTooltip

public void setTooltip(String tooltip)

getFontSize

public LinkFontSize getFontSize()

setFontSize

public void setFontSize(LinkFontSize fontSize)

getLinkDesign

public LinkDesign getLinkDesign()

setLinkDesign

public void setLinkDesign(LinkDesign linkDesign)

getInnerText

public TextView getInnerText()

getReference

public String getReference()
Returns:
hyperlink definition

setReference

public void setReference(String reference)

toString

public String toString()

requiresForm

public boolean requiresForm()
Determines if this Link requires to be placed in form.

Overrides:
requiresForm in class Component
Returns:
true if a server side event action is set for this link.

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

removerHoverMenu

public void removerHoverMenu(HoverMenu menu)

preRender

public void preRender(IPageContext pc)
preRender traverses the component tree right before rendering

Overrides:
preRender in class Container

isRequiresValidation

public boolean isRequiresValidation()
Description copied from interface: IEventValidationComponent
determines if the validation is required or not before submitting server event

Specified by:
isRequiresValidation in interface IEventValidationComponent
Overrides:
isRequiresValidation in class EventValidationContainer

setRequiresValidation

public void setRequiresValidation(boolean validation)

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

getWrapping

public boolean getWrapping()
Returns:
wrapping true if wrapping is required. Default is true

setWrapping

public void setWrapping(boolean Wrapping)
Parameters:
Wrapping - true if wrapping is required


Copyright 2006 SAP AG Complete Copyright Notice