This class is a secondary viewer to be included in HTML content within
JHContentViewer. The ViewerType can either be a SecondaryWindow or a Popup.
Activation is done be either a Button or a mouse enabled Label. Both Button
and Label support Text, Icon, or Text and Icon.
To use this class within HTML content use the <object> tag. Below is an
example usage:
<object CLASSID="java:com.sun.java.help.impl.JHSecondaryViewer">
<param name="content" value="secondary_contents.html">
<param name="viewerActivator" value="javax.help.LinkLabel">
<param name="viewerStyle" value="javax.help.Popup">
<param name="viewerSize" value="300,400">
<param name="text" value="Click here">
<param name="textFontFamily" value="SansSerif">
<param name="textFontSize" value="x-large">
<param name="textFontWeight" value="plain">
<param name="textFontStyle" value="italic">
<param name="textColor" value="red">
</object>
Valid parameters are:
- content - a valid url, can be relative to the current viewer
actionPerformed
public void actionPerformed(ActionEvent e)
Displays the viewer according to the viewerType
getContent
public String getContent()
Returns the content of the secondary viewer
getId
public String getId()
Returns the ID of the secondary viewer
getTextColor
public String getTextColor()
Returns the text Color of the activator text
getTextFontFamily
public String getTextFontFamily()
Returns the text Font family name of the activator text
getTextFontSize
public String getTextFontSize()
Returns the text Font family name of the activator text
getTextFontStyle
public String getTextFontStyle()
Returns the text Font style of the activator text
getTextFontWeight
public String getTextFontWeight()
Returns the text Font weight of the activator text
getViewerActivator
public String getViewerActivator()
Returns the viewer activator
getViewerLocation
public String getViewerLocation()
Returns the viewer Location. Location is relative to the screen or
a modal dialog box. The form of the location is "x,y".
The default location is 0,0.
getViewerName
public String getViewerName()
Returns the viewer name
getViewerSize
public String getViewerSize()
Returns the viewer's Size.
The form of the size is "width,height".
getViewerStyle
public String getViewerStyle()
Returns the current ViewerStyle
setContent
public void setContent(String content)
Set the content for the secondary viewer
setIconByID
public void setIconByID(String name)
Sets the icon in the activator by id.
setIconByName
public void setIconByName(String name)
Sets the icon in the activator by url or id. The url is relative to the
base address of the document.
setId
public void setId(String id)
Set the ID for content in the secondary viewer
setTextColor
public void setTextColor(String name)
Sets the text Color for the activator text.
The following is a list of supported Color names
- black
- blue
- cyan
- darkGray
- gray
- green
- lightGray
- magenta
- orange
- pink
- red
- white
- yellow
setTextFontFamily
public void setTextFontFamily(String family)
Sets the text Font family for the activator text.
For JDK 1.1 this must a family name of Dialog, DialogInput, Monospaced,
Serif, SansSerif, or Symbol.
setTextFontSize
public void setTextFontSize(String size)
Sets the text size for the activator text.
The String size is a valid Cascading Style Sheet value for
text size. Acceptable values are as follows:
- xx-small
- x-small
- small
- medium
- large
- x-large
- xx-large
- bigger - increase the current base font size by 1
- smaller - decrease the current base font size by 1
- xxpt - set the font size to a specific pt value of "xx"
- +x - increase the current base font size by a value of "x"
- -x - decrease the current base font size by a value of "x"
- x - set the font size to the point size associated with
the index "x"
setTextFontStyle
public void setTextFontStyle(String style)
Sets the text Font Style for the activator text.
Valid font styles are
setTextFontWeight
public void setTextFontWeight(String weight)
Sets the text Font Weigth for the activator text.
Valid weights are
setViewerActivator
public void setViewerActivator(String activator)
Sets the viewer activator.
Valid activators are
- javax.help.LinkButton
- javax.help.LinkLabel
The new activatory type will be used the next time a view is displayed.
setViewerLocation
public void setViewerLocation(String location)
Sets the viewer's location to display the content in.
Location is relative to the screen or a modal dialog box
The String must be in the form of "x,y". If no viewer location
is established the default is 0,0 for secondary windows. Location
is ignored for popups.
setViewerName
public void setViewerName(String name)
Sets the viewer name to display the content in.
Viewer is only valid for ViewerStyle "SecondaryWindow"
setViewerSize
public void setViewerSize(String size)
Sets the viewer's size to display the content in.
The String must be in the form of "width,heigt".
If no size is set the default is 200,200.
setViewerStyle
public void setViewerStyle(String style)
Sets the viewer style. There are two valid viewer styles:
- javax.help.SecondaryWindow
- javax.help.Popup
style
- a valid ViewerStyle