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.
-
GLOSSARY
- A resource <name>.glossary is the glossary
entry to display when the link is clicked.
-
LABEL
- A resource <name>.label is the text that will
be displayed in the link.
-
POST_TAGS
- A resource <className>.postTags is a string that
will be inserted at the end of the displayed text.
-
PRE_TAGS
- A resource <className>.preTags is a string that
will be inserted at the beginning of the displayed text.
-
LinkLabelBase(ResourceStack, String, String)
- The constructor
-
setGlossary(String)
- Set the glossary entry to be displayed.
-
setText(String)
- Set the text to be displayed.
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.
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.
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.
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>.
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.
setText
public void setText(String text)
- Set the text to be displayed.
- Parameters:
- text - The text to be displayed.
- Overrides:
- setText in class RichTextComponent
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