All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.ui.LinkLabelBase

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----com.sgi.sysadm.ui.richText.RichTextComponent
                                   |
                                   +----com.sgi.sysadm.ui.richText.RichTextArea
                                           |
                                           +----com.sgi.sysadm.ui.LinkLabelBase

public class LinkLabelBase
extends RichTextArea
This class can be used wherever a RichTextArea would be used, but where a standardized look is desired.

A LinkLabel's text and link is determined by resources. The string that is displayed in the label is determined by using the LABEL property. The link that the label launches is determined by the GLOSSARY property. Both of these properties are of the form <name>.something, where name is the name argument passed to the constructor. Since this class extends RichTextArea, it can handle launching everything that RichTextArea handles. Because this class will just show a normal label instead of a link if the GLOSSARY property is not found, it can be used for normal labels when there will be a possibility of desiring a link label at a later time.

Example
A call to new LinkLabelBase(rs, "MyLabel", "LinkLabel"), and a resource file with

 MyLabel.label = "My Nice Label:
 MyLabel.glossary = glossary.myGloss
 
Would show a LinkLabel with text "My Nice Label:". When the user clicked on the link, the "glossary.myGloss" glossary entry would be displayed.


Variable Index

 o GLOSSARY
A resource <name>.glossary is the glossary entry to display when the link is clicked.
 o LABEL
A resource <name>.label is the text that will be displayed in the link.
 o POST_TAGS
A resource <className>.postTags is a string that will be inserted at the end of the displayed text.
 o PRE_TAGS
A resource <className>.preTags is a string that will be inserted at the beginning of the displayed text.

Constructor Index

 o LinkLabelBase(ResourceStack, String, String)
The constructor

Method Index

 o setGlossary(String)
Set the glossary entry to be displayed.
 o setText(String)
Set the text to be displayed.

Variables

 o LABEL
 public static final String LABEL
A resource <name>.label is the text that will be displayed in the link. name is the name argument passed to the constructor. If this resource is not found, the name will be used as the displayed string.

 o GLOSSARY
 public static final String GLOSSARY
A resource <name>.glossary is the glossary entry to display when the link is clicked. name is the name argument passed to the constructor. If this resource is not found, the link will be rendered as a normal label instead of as a link.

 o PRE_TAGS
 public static final String PRE_TAGS
A resource <className>.preTags is a string that will be inserted at the beginning of the displayed text. className is the className argument passed to the constructor. For example, if this resource were set to <B>, then the label would be bold.

 o POST_TAGS
 public static final String POST_TAGS
A resource <className>.postTags is a string that will be inserted at the end of the displayed text. className is the className argument passed to the constructor. For example, this resource should be </B> if PRE_TAGS was set to <B>.

Constructors

 o LinkLabelBase
 public LinkLabelBase(ResourceStack rs,
                      String name,
                      String className)
The constructor

Parameters:
rs - The ResourceStack to use to lookup the resources
name - The name used for the LABEL and GLOSSARY resources.
className - The className used for the PRE_TAGS and POST_TAGS resources, as well as the name of the RichTextArea that is created.

Methods

 o setText
 public void setText(String text)
Set the text to be displayed.

Parameters:
text - The text to be displayed.
Overrides:
setText in class RichTextComponent
 o setGlossary
 public void setGlossary(String text)
Set the glossary entry to be displayed.

Parameters:
text - The link name of the glossary entry to be displayed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index