com.sun.java.help.impl

Class JHSecondaryViewer

Implemented Interfaces:
ActionListener, ViewAwareComponent

public class JHSecondaryViewer
extends JButton
implements ActionListener, ViewAwareComponent

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 &ltobject&gt tag. Below is an example usage:

 &ltobject CLASSID="java:com.sun.java.help.impl.JHSecondaryViewer"&gt
 &ltparam name="content" value="secondary_contents.html"&gt
 &ltparam name="viewerActivator" value="javax.help.LinkLabel"&gt
 &ltparam name="viewerStyle" value="javax.help.Popup"&gt
 &ltparam name="viewerSize" value="300,400"&gt
 &ltparam name="text" value="Click here"&gt
 &ltparam name="textFontFamily" value="SansSerif"&gt
 &ltparam name="textFontSize" value="x-large"&gt
 &ltparam name="textFontWeight" value="plain"&gt
 &ltparam name="textFontStyle" value="italic"&gt
 &ltparam name="textColor" value="red"&gt
 &lt/object&gt
 

Valid parameters are:

See Also:
  • id - a valid id from the current HelpSet,
  • viewerName - the name of the SecondaryWindow to display the content in,
  • viewerActivator - the activator type for the viewer. Either "javax.help.LinkButton" or "javax.help.LinkLabel",
  • viewerStyle - the style of the viewer. Either "SecondaryWindow" or "Popup",
  • viewerLocation - the x,y coordinates applied to a secondary window.,
  • viewerSize - the width, height applied to a viewer.,
  • iconByName - the url or id of a icon to be displayed in the activator. The url is relative to the base address of the document,
  • text - the text of the activator,
  • textFontFamily - the font family of the activator text,
  • textFontSize - the size of the activator text font. Size is specified in a css termonolgy. See the setTextFontSize for acceptable syntax,
  • textFontWeight - the activator text font weight,
  • textFontStyle - the activator text font style,
  • textColor - the activator text color,
      , JHSecondaryWindowBeanInfo
  • Field Summary

    static String
    LINK_BUTTON
    static String
    LINK_LABEL
    static String
    POPUP
    static String
    SECONDARY_WINDOW

    Constructor Summary

    JHSecondaryViewer()
    Create a secondaryviewer.

    Method Summary

    void
    actionPerformed(ActionEvent e)
    Displays the viewer according to the viewerType
    String
    getContent()
    Returns the content of the secondary viewer
    String
    getId()
    Returns the ID of the secondary viewer
    String
    getTextColor()
    Returns the text Color of the activator text
    String
    getTextFontFamily()
    Returns the text Font family name of the activator text
    String
    getTextFontSize()
    Returns the text Font family name of the activator text
    String
    getTextFontStyle()
    Returns the text Font style of the activator text
    String
    getTextFontWeight()
    Returns the text Font weight of the activator text
    String
    getViewerActivator()
    Returns the viewer activator
    String
    getViewerLocation()
    Returns the viewer Location.
    String
    getViewerName()
    Returns the viewer name
    String
    getViewerSize()
    Returns the viewer's Size.
    String
    getViewerStyle()
    Returns the current ViewerStyle
    void
    setContent(String content)
    Set the content for the secondary viewer
    void
    setIconByID(String name)
    Sets the icon in the activator by id.
    void
    setIconByName(String name)
    Sets the icon in the activator by url or id.
    void
    setId(String id)
    Set the ID for content in the secondary viewer
    void
    setTextColor(String name)
    Sets the text Color for the activator text.
    void
    setTextFontFamily(String family)
    Sets the text Font family for the activator text.
    void
    setTextFontSize(String size)
    Sets the text size for the activator text.
    void
    setTextFontStyle(String style)
    Sets the text Font Style for the activator text.
    void
    setTextFontWeight(String weight)
    Sets the text Font Weigth for the activator text.
    void
    setViewData(View v)
    Sets data optained from the View
    void
    setViewerActivator(String activator)
    Sets the viewer activator.
    void
    setViewerLocation(String location)
    Sets the viewer's location to display the content in.
    void
    setViewerName(String name)
    Sets the viewer name to display the content in.
    void
    setViewerSize(String size)
    Sets the viewer's size to display the content in.
    void
    setViewerStyle(String style)
    Sets the viewer style.

    Field Details

    LINK_BUTTON

    public static String LINK_BUTTON

    LINK_LABEL

    public static String LINK_LABEL

    POPUP

    public static String POPUP

    SECONDARY_WINDOW

    public static String SECONDARY_WINDOW

    Constructor Details

    JHSecondaryViewer

    public JHSecondaryViewer()
    Create a secondaryviewer. By default the viewer creates a button with the text of ">"

    Method Details

    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.
    See Also:
    setViewerLocation

    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".
    See Also:
    setViewerSize

    getViewerStyle

    public String getViewerStyle()
    Returns the current ViewerStyle

    setContent

    public void setContent(String content)
    Set the content for the secondary viewer
    Parameters:
    content - a valid URL

    setIconByID

    public void setIconByID(String name)
    Sets the icon in the activator by id.
    See Also:
    getIcon

    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.
    See Also:
    getIcon

    setId

    public void setId(String id)
    Set the ID for content in the secondary viewer
    Parameters:

    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
    • plain
    • italic

    setTextFontWeight

    public void setTextFontWeight(String weight)
    Sets the text Font Weigth for the activator text. Valid weights are
    • plain
    • bold

    setViewData

    public void setViewData(View v)
    Sets data optained from the View
    Specified by:
    setViewData in interface ViewAwareComponent

    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.
    See Also:
    getViewerLocation

    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.
    See Also:
    getViewerSize

    setViewerStyle

    public void setViewerStyle(String style)
    Sets the viewer style. There are two valid viewer styles:
    • javax.help.SecondaryWindow
    • javax.help.Popup

    Parameters:
    style - a valid ViewerStyle