Hi HelpIndex Bean

Last modified: 23 March 1998.

Page Contents Class at a Glance  Class Description  Properties  Methods  Events  Supporting Classes  Possible improvements 
See also Bean Information  Using in the BDK Beanbox  Sample code  HiDemo example 


Class At A Glance

Class Name: HelpIndex
Extends: java.applet.Applet
Implements: HiListener, Serializable

Purpose

Key Properties and Events

Creation

Common Usage Commonly Used Methods

Class Description

Overview

Introspection Customization Example Use

Properties

Standard getXXX(), setXXX() or boolean isXXX() routine names are provided for each property.

If a property is [bound] then any changes (via setXXX()) are notified after the change has occurred. The HelpIndex bean calls the PropertyChangeListener.propertyChange() method on any registered listeners, passing a PropertyChangeEvent with the old and new values.

Properties which are only available to bean users are indicated by a single asterisk. A double asterisk indicates a standard Component property used by Hi HelpIndex. The "Param Equiv" column shows the equivalent applet parameter, where it is not obvious.

The colours are explained in the Colour Properties Guide below.

The use of filenames is also explained below.

Type Name Description Default Param
Equiv
** Color background [bound] Background colour (rw) white bgColor
boolean buttonShape [bound] True if the Contents' buttons are shaped square. Round if false.
Get using isButtonShapeSquare(). Set using setButtonShapeSquare().
(rw) false
ie Round
Color cardBgColor [bound] Card Background Colour (rw) #FFFFCC
String contentsIcons [bound] URL string of the Contents Icons image gif in the required format. (rw) "hiicons.gif"
* boolean contentsOnly [bound] True if only the Contents panel is shown, ie with no tabs above or Display Page below. (rw) false
* String currentIndex [bound] IndexURL of index to display (rw)
* String displayPage [bound] URL String of page to display. (rw)
* String displayTarget [bound] Target of page to display. (rw)
Color fieldBgColor [bound] Field background colour (rw) white
** Font font [bound] Font (rw) Dialog, 12 pt
** Color foreground [bound] Foreground colour (rw) black fgColor
boolean highMode [bound] True if display is higher than it is wide.
Display mode
(rw) true mode
String icon [bound] URL string of the icon image gif in the required format. (rw) "hi.gif"
Color iconBgColor [bound] Icon mode background colour (rw) bgColor
boolean iconCloseMode [bound] True if floating window closes after a page is displayed.
Display mode
(rw) false mode
boolean iconMode [bound] True if icon displayed initially.
Click for floating window.
Display mode
(rw) false mode
boolean iconPopupMode [bound] True if floating window pops up straight away.
Display mode
(rw) false mode
IndexParam[] index indexed Index and language files
It has its own property editor.
(rw) none index1, etc.
IndexParam[] indexes Index and language files
Provided for IDEs which do not support indexed properties
(rw) none index1, etc.
int indexLines [bound] Lines in keywords list box (rw) 4
* boolean indexOnly [bound] True if only the Index panel is shown, ie with no tabs above or Display Page below. (rw) false
Dimension minIconWindowSize [bound] Minimum width and height of icon window (rw)
int minQueryLength [bound] Minimum chars in query (rw) 0
int pageLines [bound] Lines in pages list box (rw) 2
Color selectColor [bound] Contents select colour (rw) green
* boolean syncedToBrowser [bound] Contents selection is synchronised to the browser's current document (rw) false
String tabIcons [bound] URL string of the tab Icons image gif in the required format. (rw) "hitabs.gif"
String target [bound] Target frame (rw) "_self"
Color tipBgColor [bound] Tip background colour (rw) #EFFFFF


Colour Properties Guide

Picture showing where colour parameters apply

Filenames Guide

When you specify filenames as properties, Hi HelpIndex looks for them in the following way.

If the Hi HelpIndex bean has an AppletContext then it will first try to open the filename as a URL, using the AppletContext codeBase or documentBase as appropriate to provide defaults (eg like new URL(getCodeBase(),filename);).
Note that this still allows you to specify absolute file URLs (though if run as an applet, you may not be able to access it).

If there is no AppletContext and the filename is a full URL then Hi HelpIndex will attempt to open this URL.

If not an absolute URL (or if the URL open fails) then Hi HelpIndex tries to open the file from the CLASSPATH. [ To do this, a slash character "/" is prefixed to filename.]
If "." is in the CLASSPATH, then specifying a filename of "hilogo.gif" will load this image file.

NB if specifying a Windows file as an absolute URLs, use the following style: file:///D:/JBuilder/myclasses/hilogo.gif
Do not the bar character after the drive letter, eg file:///D|/


Methods

The standard getXXX(), setXXX() or boolean isXXX() property access routines are NOT listed here.

instantiation HelpIndex()
control displayPage(HiEvent hie) Display the given page in the given target
getIndexCount() Returns the number of items in the index property array
lookupKeyword( String lookupText, boolean displayHit)) Display the Index tab and lookup given string.
If displayHit and there is a single hit, then the hit is displayed.
restart() requests that the HelpIndex screen be rebuilt
setIndex(int n, IndexParam value) As well as changing the index array, you can use this call to add a new IndexParam onto the end of the index array
syncToBrowserNow() Synchronises the Contents selection now
adding/removing listeners addPropertyChangeListener() add a listener for post-notification of changes in a bound property
removePropertyChangeListener() remove a listener for post-notification of changes in a bound property
addHiListener() add a listener for Hi display page events
removeHiListener() remove a listener for Hi display page events


Events

As Source As Listener

Supporting Classes

public class COM.phdcc.hi.IndexParam
{
    public String   IndexURL;                 // URL of index file
    public String   IndexURLCharEncoding;     // Character Encoding, or null
    public String   LanguageURL;              // URL of language file, or null
    public String   LanguageURLCharEncoding;  // Character Encoding, or null
    public boolean  noContents;               // do not display contents
    public	boolean noIndex;                  // do not display index
    public boolean  Sort;                     // sort contents
    public boolean  Index;                    // show index initially
    public boolean  Expanded;                 // expand contents
    public String   SelectURL;                // URL in Contents to select initially, or null
    public String   InitialQuery;             // Initial query in Index, or null
    public Locale   IndexLocale;              // Locale, or null
};

public class COM.phdcc.hi.HiEvent extends java.util.EventObject
{
    // Sending information to HelpIndex
    public String displayPage;
    public String displayTarget;

    HiEvent(Object source, String displayPage, String displayTarget);

    // HelpIndex generates events with this information as well.
    public String prevPage;
    public String prevTarget;
    public String nextPage;
    public String nextTarget;
    public String parentPage;
    public String parentTarget;
    public String homePage;
    public String homeTarget;

    HiEvent(Object source,
            String displayPage, String displayTarget,
            String prevPage,    String prevTarget,
            String nextPage,    String nextTarget,
            String parentPage,  String parentTarget,
            String homePage,    String homeTarget);
}

public interface COM.phdcc.hi.HiListener extends java.util.EventListener
{
    public void displayPage(HiEvent hie);
}

Possible improvements


HelpIndex    PHD