SilverStream
Application Server 3.5

com.sssw.rt.form
Interface AgiControl

All Superinterfaces:
AgiHelpInfo
All Known Implementing Classes:
AgcChoice, AgcList, AgcTextArea, AgcTextField, AgcView, PvBaseCanvas, PvBasePanel, AgcHTMLEditControl

public interface AgiControl
extends AgiHelpInfo

Interface implemented by SilverStream form controls. It provides some common methods.


Field Summary
static int IMAGE_MODE_CENTERED
          Displays a single image at its original size in the upper left corner of the form.
static int IMAGE_MODE_NORMAL
          Displays a single image at its original size in the upper left corner of the form.
static int IMAGE_MODE_STRETCH
          Displays a single image that is stretched to fill the entire form.
static int IMAGE_MODE_TILED
          Displays multiple copies of the image, repeating the image to fill the form.
 
Method Summary
 Image getBackgroundImage()
          Gets the background image of the control.
 int getBackgroundImageMode()
          Gets the mode for displaying the background image.
 Component getComponent()
          Returns the control itself.
 String getHelpInfo()
          Returns the help information (typically an URL) associated with a control.
 String getToolTipText()
          Gets the text that is displayed in the control's floating tooltip.
 void setBackgroundImage(Image backgroundimage)
          Sets the background image of the control.
 void setBackgroundImageMode(int mode)
          Sets the mode for displaying the background image.
 void setHelpInfo(String helpInfo)
          Specifies the help information (typically an URL) associated with a control.
 void setToolTipText(String text)
          Assigns the floating Tool Tip string for a control.
 

Field Detail

IMAGE_MODE_NORMAL

public static final int IMAGE_MODE_NORMAL
Displays a single image at its original size in the upper left corner of the form.
See Also:
AgiControl.getBackgroundImageMode(), AgiControl.setBackgroundImageMode(int)

IMAGE_MODE_CENTERED

public static final int IMAGE_MODE_CENTERED
Displays a single image at its original size in the upper left corner of the form.
See Also:
AgiControl.getBackgroundImageMode(), AgiControl.setBackgroundImageMode(int)

IMAGE_MODE_TILED

public static final int IMAGE_MODE_TILED
Displays multiple copies of the image, repeating the image to fill the form.
See Also:
AgiControl.getBackgroundImageMode(), AgiControl.setBackgroundImageMode(int)

IMAGE_MODE_STRETCH

public static final int IMAGE_MODE_STRETCH
Displays a single image that is stretched to fill the entire form.
See Also:
AgiControl.getBackgroundImageMode(), AgiControl.setBackgroundImageMode(int)
Method Detail

getComponent

public Component getComponent()
Returns the control itself. (Included for backward compatibility.)

getBackgroundImage

public Image getBackgroundImage()
Gets the background image of the control. Not all controls support a background image.
Example:
 	Image img = control1.getBackgroundImage();
 
See Also:
AgiControl.setBackgroundImage(Image)

setBackgroundImage

public void setBackgroundImage(Image backgroundimage)
Sets the background image of the control. Not all controls support a background image.
Parameters:
backgroundimage - the image to use as the control's background
Example:
 	control1.setBackgroundImage(getImage("pattern1.jpg"));
 
See Also:
AgiControl.getBackgroundImage()

getBackgroundImageMode

public int getBackgroundImageMode()
Gets the mode for displaying the background image. Not all controls support a background image.
Example:
   int mode = control1.getBackgroundImageMode();
   if (mode == AgiControl.IMAGE_MODE_CENTERED) 
   { ... }
 
See Also:
AgiControl.setBackgroundImageMode(int)

setBackgroundImageMode

public void setBackgroundImageMode(int mode)
Sets the mode for displaying the background image. Not all controls support a background image.
Parameters:
mode - an integer that corresponds to the mode
Example:
 	control1.setBackgroundImageMode(AgiControl.IMAGE_MODE_STRETCH);
 
See Also:
AgiControl.getBackgroundImageMode()

getToolTipText

public String getToolTipText()
Gets the text that is displayed in the control's floating tooltip.
Usage:

The getToolTipText() method returns null if no Tool Tip has been supplied. Set or change the contents of the Tool Tip property at runtime using the setToolTipText() method.

Example:

The following code fragment illustrates how to obtain a control's Tool Tip.

  String s;
  s = control1.getToolTipText();
 
See Also:
Tool Tip property, AgiControl.setToolTipText(String)

setToolTipText

public void setToolTipText(String text)
Assigns the floating Tool Tip string for a control.
Parameters:
tooltip - the Tool Tip text.
Usage:

The current Tool Tip string can be obtained by calling the getToolTipText() method. Because the Tool Tip text can be changed at runtime, the Tool Tip text can be changed for a multi-valued control based on its current value; for example, the Tool Tip text for a List control can be set based on the currently selected item.

Example:

The following code fragment illustrates how to set a control's Tool Tip.

  control1.setToolTipText("Customer Address");
 
See Also:
Tool Tip property, AgiControl.getToolTipText()

getHelpInfo

public String getHelpInfo()
Returns the help information (typically an URL) associated with a control. Used when processing F1 help.
Specified by:
getHelpInfo in interface AgiHelpInfo
Usage:

The Help Page value can be established at design time with the Help Page property, or at runtime using the setHelpInfo() method.

The getHelpInfo() method returns null if the Help Page value has not been set.

Example:

The following code fragment illustrates how to obtain the Help Page specification.

  String helppage;
  helppage = control1.getHelpInfo();
 
See Also:
Help Page property, AgiControl.setHelpInfo(String)

setHelpInfo

public void setHelpInfo(String helpInfo)
Specifies the help information (typically an URL) associated with a control. Used when processing F1 help.
Specified by:
setHelpInfo in interface AgiHelpInfo
Parameters:
helpInfo - The URL or page name of the help information for the control.
Usage:

The Help Page can either be the name of a page in the application's database, the name of a page in a different database (using the format database:pagename), or a full URL to a help page. Use the getHelpInfo() method to retrieve the Help Page 's current value.

Since the setHelpInfo() method can be called at runtime to change the help page, different help can be provided for multi-valued controls based on their value (for example, different help for a list control based on which item is selected).

Example:

The following code fragment illustrates how to set the help page.

    control1.setHelpInfo("MyFormHelpPage.html");
 
See Also:
Help Page property, AgiControl.getHelpInfo()

SilverStream
Application Server 3.5