Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.editor
Class SystemTextEditorHelpHandler

java.lang.Object
  extended by com.ibm.etools.systems.editor.SystemTextEditorHelpHandler
Direct Known Subclasses:
SQLHelpHandler

public class SystemTextEditorHelpHandler
extends Object

This class is a helper class. It has multiple purposes. Each properties file contains a mapping between something, to an HTML help page identifier.
Scenario 1
The constructer takes the name of a properties file, and the name of the plugin that contains the properties file. The properties file contains a mapping between a token, which can be a resource identifier (resid), to an HTML help page identifier. The plugin's class loader is used to load the properties file. The method getHelpPageFromToken can be used to obtain the help page from either a token, or resource identifier (resid). The help page identifier is formatted before it is returned. It is assumed that the plugin contains both the mapping properties file, and the help pages.
Scenario 2
The constructor takes the name of a properties file, and the name of the plugin that contains the properties file, as in the first scenario. The constructor also takes a second properties file, and the name of the plugin that contains it. The second properties file contains a mapping between a message identifier, and a resource identifier. The method getHelpPageFromMessageIdentifier can be used to obtain the help page from a message identifier. In this case, the method first maps the message identifier to a resource identifier, then maps the resource identifier to a help page identifier.
JLpex Help class
If this class is registered in JLpex as the help class (by calling the editor's setLanguageHelp method), the getHelpPage method is called by JLpex to obtain the help page. JLpex will then display the help page. If this class is not registered with JLpex, then, each constructor's parser argument can be set to null.


Field Summary
protected  PropertyResourceBundle _helpMessageTokenResourceBundle
           
protected  PropertyResourceBundle _helpTokenResourceBundle
           
protected  LpexCommonParser _parser
           
protected static String _strEmpty
           
protected  String _strHelpDocPluginID
           
protected  String _strHelpMessageDocPluginID
           
protected  String _strHelpMessageTokenTableFileName
           
protected  String _strHelpMessageTokenTablePluginID
           
protected  String _strHelpTokenTableFileName
           
protected  String _strHelpTokenTablePluginID
           
static String Copyright
           
 
Constructor Summary
SystemTextEditorHelpHandler(String strHelpTokenTablePluginID, String strHelpTokenTableFileName, String strHelpDocPluginID, String strHelpMessageTokenTablePluginID, String strHelpMessageTokenTableFileName, String strHelpMessageDocPluginID, LpexCommonParser parser)
          Constructor where a resid is mapped to a help page.
 
Method Summary
 String getHelpPage(LpexView view)
          Returns the help page identifier at the current cursor position.
 String getHelpPageFromMessageToken(String strToken)
          Called from Source Prompt view, or getHelpPage.
 String getHelpPageFromToken(String strToken)
          Called from Source Prompt view, or getHelpPage.
protected static String getHelpPageIDFromToken(String strDocPluginID, PropertyResourceBundle helpResourceBundle, String strToken)
          Returns the help page identifier given a token.
protected static PropertyResourceBundle loadPluginPropertiesFile(String strPluginID, String strHelpTableFileName)
          Loads the language help table that maps help resource IDs to html URLs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_strEmpty

protected static final String _strEmpty
See Also:
Constant Field Values

_strHelpTokenTablePluginID

protected String _strHelpTokenTablePluginID

_strHelpTokenTableFileName

protected String _strHelpTokenTableFileName

_strHelpDocPluginID

protected String _strHelpDocPluginID

_strHelpMessageTokenTablePluginID

protected String _strHelpMessageTokenTablePluginID

_strHelpMessageTokenTableFileName

protected String _strHelpMessageTokenTableFileName

_strHelpMessageDocPluginID

protected String _strHelpMessageDocPluginID

_parser

protected LpexCommonParser _parser

_helpTokenResourceBundle

protected PropertyResourceBundle _helpTokenResourceBundle

_helpMessageTokenResourceBundle

protected PropertyResourceBundle _helpMessageTokenResourceBundle
Constructor Detail

SystemTextEditorHelpHandler

public SystemTextEditorHelpHandler(String strHelpTokenTablePluginID,
                                   String strHelpTokenTableFileName,
                                   String strHelpDocPluginID,
                                   String strHelpMessageTokenTablePluginID,
                                   String strHelpMessageTokenTableFileName,
                                   String strHelpMessageDocPluginID,
                                   LpexCommonParser parser)
Constructor where a resid is mapped to a help page.

Method Detail

getHelpPage

public String getHelpPage(LpexView view)
Returns the help page identifier at the current cursor position. The parser is called to obtain the current token.


getHelpPageFromMessageToken

public String getHelpPageFromMessageToken(String strToken)
Called from Source Prompt view, or getHelpPage. The message help table is to have keys that are numbers only. Returns the help page identifier given a token or help resource identifier.


getHelpPageFromToken

public String getHelpPageFromToken(String strToken)
Called from Source Prompt view, or getHelpPage. Returns the help page identifier given a token or help resource identifier.


getHelpPageIDFromToken

protected static String getHelpPageIDFromToken(String strDocPluginID,
                                               PropertyResourceBundle helpResourceBundle,
                                               String strToken)
Returns the help page identifier given a token. The token key is searched for in the property resource bundle. The corresponding HTML page identifier is read from the bundle. A string consisting of the plugin identifier and the page identifier is returned. The resulting string can be given to the help system.


loadPluginPropertiesFile

protected static PropertyResourceBundle loadPluginPropertiesFile(String strPluginID,
                                                                 String strHelpTableFileName)
Loads the language help table that maps help resource IDs to html URLs


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.