SilverStream
Application Server 3.5

com.sssw.shr.page
Class AgpLabel

java.lang.Object
 |
 +--com.sssw.shr.page.AgpTag
       |
       +--com.sssw.shr.page.AgpControlBase
             |
             +--com.sssw.shr.page.AgpLabel
All Implemented Interfaces:
AgiJavaScriptEnhanced, AgiPageControl, Cloneable, Externalizable, Serializable

public class AgpLabel
extends AgpControlBase

A control representing text. The text can be programmatically changed or bound to an expression. It cannot be edited by the user.

Properties:
Enable HTML Generation, Expression, Name, Parameters, Target Expression, Type, URL Expression
Events:
eventLinkPerformed, validationFailed, validationTest, valueChanged
See Also:
Serialized Form

Field Summary
static int LABELTYPE_EVENT_LINK
           
static int LABELTYPE_EXPRESSION_LINK
           
static int LABELTYPE_LABEL
           
 
Fields inherited from class com.sssw.shr.page.AgpTag
UNIT_PERCENT, UNIT_PIXEL
 
Constructor Summary
AgpLabel()
           
 
Method Summary
 String getLinkTarget()
          Returns the string that is used as a destination if this label is an Expression Link.
 boolean getRawHTMLMode()
          Returns whether the control is in raw HTML mode.
 String getTargetFrame()
          Returns the name of the frame that will be used to display the destination page if this label is an Expression Link.
 String getText()
          Returns the text displayed in the control.
 int getType()
          Returns an int representing the type of control.
 void setLinkTarget(String target)
          Specify the destination to be used if this label is an Expression Link.
 void setRawHTMLMode(boolean israw)
          Sets whether the control is in raw HTML mode.
 void setTargetFrame(String targetFrame)
          Specify the frame that will be used to display the destination page if this label is an Expression Link.
 void setText(String text)
          Sets the text to display in the control.
 void setType(int type)
          Sets the type of label.
 
Methods inherited from class com.sssw.shr.page.AgpControlBase
getName
 
Methods inherited from class com.sssw.shr.page.AgpTag
getBoolProperty, getEnableHTMLGeneration, getIntArrayProperty, getIntProperty, getIntPropertyUnit, getProperty, getStringArrayProperty, invalidateHTML, removeProperty, setEnableHTMLGeneration, setIntProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods implemented from interface com.sssw.shr.page.AgiJavaScriptEnhanced
generateFunction, generateRepaintScript, generateScriptInitializers, getFunctionNameForMethod, getFunctionNames, getMethodNames, getScriptObjectName, isHTMLRepaintPending, isJavaScriptRepaintPending
 
Methods implemented from interface com.sssw.shr.page.AgiPageControl
generateHTML, getPrefix, notifyPageLoaded, notifyPageRequestBegin, notifyPageRequestEnd, notifyPostValue, notifyPostValues
 
Methods implemented from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

LABELTYPE_LABEL

public static final int LABELTYPE_LABEL

LABELTYPE_EXPRESSION_LINK

public static final int LABELTYPE_EXPRESSION_LINK

LABELTYPE_EVENT_LINK

public static final int LABELTYPE_EVENT_LINK
Constructor Detail

AgpLabel

public AgpLabel()
Method Detail

getText

public String getText()
Returns the text displayed in the control. This text can be bound to an expression at design time using the Expression field in the Property Inspector, or it can be set programmatically using the setText() method.
Example:
 		String s = Label1.getText();
 
See Also:
Expression property, AgpLabel.setText(String text)

setText

public void setText(String text)
Sets the text to display in the control.
Parameters:
text - a string to display.
Example:
 		Label1.setText("Hello world!");
 

If the label's text was set at design time using the Expression field of the Property Inspector, the design-time setting will always override the setText() method.

See Also:
Expression property, AgpLabel.getText()

getType

public int getType()
Returns an int representing the type of control. The following constants refer to the possible values:
Example:
 		String s;
 		if (Label1.getType() == AgpLabel.LABELTYPE_LABEL)
 			s = "Label 1 is a Label for simple text display.";
 		else if (Label1.getType() == AgpLabel.LABELTYPE_EXPRESSION_LINK)
 			s = "Label 1 is an Expresssion Link for navigating to another page.";
 		else if (Label1.getType() == AgpLabel.LABELTYPE_EVENT_LINK)
 			s = "Label 1 is an Event Link for performing an action on this page.";
 
 
See Also:
Type property, AgpLabel.getLinkTarget(), AgpLabel.getTargetFrame(), AgpLabel.setLinkTarget(String target), AgpLabel.setTargetFrame(String targetFrame), AgpLabel.setType(int type)

setType

public void setType(int type)
Sets the type of label.
Parameters:
type - an int representing the type. These constants refer to the possible values:
  • LABELTYPE_LABEL - Label.
  • LABELTYPE_EXPRESSION_LINK - Expression.
  • LABELTYPE_EVENT_LINK - Event link.
Example:
 		Label1.setType(AgpLabel.LABELTYPE_LABEL);
 
See Also:
Type property, AgpLabel.getLinkTarget(), AgpLabel.getTargetFrame(), AgpLabel.setLinkTarget(String target), AgpLabel.setTargetFrame(String targetFrame), AgpLabel.getType()

getLinkTarget

public String getLinkTarget()
Returns the string that is used as a destination if this label is an Expression Link. The Link Target can be bound to an expression at design time using the URL Expression field in the Property Inspector, or it can be set at run time using the setType() method.

The Link Target corresponds to the HREF attribute of an HTML anchor (A) tag.

See Also:
AgpLabel.getType(), AgpLabel.getTargetFrame(), AgpLabel.setLinkTarget(String target), AgpLabel.setTargetFrame(String targetFrame), AgpLabel.setType(int type)

setLinkTarget

public void setLinkTarget(String target)
Specify the destination to be used if this label is an Expression Link.

The Link Target corresponds to the HREF attribute of an HTML anchor (A) tag.

If this property is set at design time, using the URL Expression field in the Property Inspector, the design-time setting will always override any values set programmatically using this method.

Parameters:
target - a string that specifies the link target.
See Also:
AgpLabel.getLinkTarget(), AgpLabel.getTargetFrame(), AgpLabel.setTargetFrame(String targetFrame), AgpLabel.getType(), AgpLabel.setType(int type)

getTargetFrame

public String getTargetFrame()
Returns the name of the frame that will be used to display the destination page if this label is an Expression Link. This value can be bound to an expression at design time using the "Target Expression" field of the Property Inspector, or it can be set at run time using the setTargetFrame().

The Target Frame corresponds to the TARGET attribute of an HTML anchor (A) tag.

See Also:
AgpLabel.getLinkTarget(), AgpLabel.setLinkTarget(String target), AgpLabel.setTargetFrame(String targetFrame), AgpLabel.getType(), AgpLabel.setType(int type)

setTargetFrame

public void setTargetFrame(String targetFrame)
Specify the frame that will be used to display the destination page if this label is an Expression Link.

The Target Frame corresponds to the TARGET attribute of an HTML anchor (A) tag.

Parameters:
targetFrame - a String specifying the target frame.
Usage:

If this property is set at design time, using the URL Expression field in the Property Inspector, the design-time setting will always override any values set programmatically using this method.

See Also:
AgpLabel.getLinkTarget(), AgpLabel.setLinkTarget(String target), AgpLabel.setTargetFrame(String targetFrame), AgpLabel.getType(), AgpLabel.setType(int type)

getRawHTMLMode

public boolean getRawHTMLMode()
Returns whether the control is in raw HTML mode.
Example:
 		if (Label1.getRawHTMLMode() == true)
 			Label1.setText("Hello world!");
 		else
 			Label1.setText("Hello world!");
 
See Also:
AgpLabel.setRawHTMLMode(boolean israw)

setRawHTMLMode

public void setRawHTMLMode(boolean israw)
Sets whether the control is in raw HTML mode.
Parameters:
israw - true if control should be in raw HTML mode, otherwise false.
Example:
 		Label1.setRawHTMLMode(true);
 		Label1.setText("Hello world!
How are you?");
See Also:
AgpLabel.getRawHTMLMode()

SilverStream
Application Server 3.5