com.isti.util.gui
Class ViewHTMLPanelHandler

java.lang.Object
  extended by com.isti.util.gui.ViewHTMLPanelHandler

public class ViewHTMLPanelHandler
extends java.lang.Object

Class ViewHTMLPanel implements a handler for simple HTML viewer panels (capable of viewing HTML files that reside in a 'jar' archive).


Field Summary
static java.lang.String[] DEFAULT_SHOW_BACK_LAUNCH_FILES
          The default for the "showBackLaunchFiles" option for the constructor.
 
Constructor Summary
ViewHTMLPanelHandler(IstiDialogUtil dialogUtilObj, LaunchBrowser launchBrowserObj)
          Creates a handler for simple HTML viewer panels.
ViewHTMLPanelHandler(IstiDialogUtil dialogUtilObj, LaunchBrowser launchBrowserObj, java.lang.String[] showBackLaunchFiles)
          Creates a handler for simple HTML viewer panels.
 
Method Summary
 ViewHTMLPanel buildShowViewerDialog(ViewHTMLPanel vPanelObj, java.lang.String fNameStr, java.awt.Component parentComponent, java.lang.String titleStr, boolean modalFlag, java.lang.Object button1Obj, java.lang.Object button2Obj, boolean showBackLaunchFlag, java.lang.String viewRefStr)
          Displays an HTML-viewer-panel-based dialog window.
protected  ViewHTMLPanel buildViewerDialog(java.lang.String fNameStr, boolean showBackLaunchFlag, java.lang.String initialRefStr)
          Creates an HTML-viewer-panel-based dialog window.
static java.lang.String getFileNameForMenuName(java.lang.String menuNameStr)
          Gets the file name for the specified menu name.
static boolean isShowFileMenuName(java.lang.String menuNameStr)
          Determines if the menu name is a show file menu name.
 void showFileDialog(java.lang.String nameStr, java.lang.String titleStr, java.awt.Component parentComponent)
          Displays the specified file in a dialog window.
 void showFileDialog(java.lang.String fNameStr, java.lang.String titleStr, java.awt.Component parentComponent, java.lang.String viewRefStr)
          Displays the specified HTML file in a dialog window.
 void showFileDialog(java.lang.String fNameStr, java.lang.String titleStr, java.awt.Component parentComponent, java.lang.String viewRefStr, boolean showBackLaunchFlag)
          Displays the specified HTML file in a dialog window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SHOW_BACK_LAUNCH_FILES

public static final java.lang.String[] DEFAULT_SHOW_BACK_LAUNCH_FILES
The default for the "showBackLaunchFiles" option for the constructor.

Constructor Detail

ViewHTMLPanelHandler

public ViewHTMLPanelHandler(IstiDialogUtil dialogUtilObj,
                            LaunchBrowser launchBrowserObj)
Creates a handler for simple HTML viewer panels.

Parameters:
dialogUtilObj - the dialog utility object for popup messages or null for none.
launchBrowserObj - an existing 'LaunchBrowser' object, or null to have this class create its own. By default any "Settings" files will automatically show the "Back" and "Launch Browser" buttons.

ViewHTMLPanelHandler

public ViewHTMLPanelHandler(IstiDialogUtil dialogUtilObj,
                            LaunchBrowser launchBrowserObj,
                            java.lang.String[] showBackLaunchFiles)
Creates a handler for simple HTML viewer panels.

Parameters:
dialogUtilObj - the dialog utility object for popup messages or null for none.
launchBrowserObj - an existing 'LaunchBrowser' object, or null to have this class create its own.
showBackLaunchFiles - files to automatically show "Back" and "Launch Browser" buttons or null for none.
Method Detail

buildShowViewerDialog

public ViewHTMLPanel buildShowViewerDialog(ViewHTMLPanel vPanelObj,
                                           java.lang.String fNameStr,
                                           java.awt.Component parentComponent,
                                           java.lang.String titleStr,
                                           boolean modalFlag,
                                           java.lang.Object button1Obj,
                                           java.lang.Object button2Obj,
                                           boolean showBackLaunchFlag,
                                           java.lang.String viewRefStr)
Displays an HTML-viewer-panel-based dialog window. If the HTML-viewer panel object has not yet been created then one will be built, otherwise the given panel will be displayed.

Parameters:
vPanelObj - the HTML-viewer panel to use, or null to build a new one.
fNameStr - the name of the HTML file to display.
parentComponent - the parent component for the dialog.
titleStr - the title to use.
modalFlag - true for a modal dialog, false for a modeless dialog (that allows other windows to be active at the same time).
button1Obj - first button object to use (can be a button component or a string), or null for none.
button2Obj - second button object to use (can be a button component or a string), or null for none.
showBackLaunchFlag - true to show "Back" and "Launch Browser" buttons.
viewRefStr - the reference (anchor) to display, null for none.
Returns:
If vPanelObj==null then the handle to the new HTML-viewer panel, otherwise vPanelObj.

getFileNameForMenuName

public static java.lang.String getFileNameForMenuName(java.lang.String menuNameStr)
Gets the file name for the specified menu name.

Parameters:
menuNameStr - the menu name string.
Returns:
the file name.

isShowFileMenuName

public static boolean isShowFileMenuName(java.lang.String menuNameStr)
Determines if the menu name is a show file menu name.

Parameters:
menuNameStr - the menu name string.
Returns:
true if the name string is a show file menu name.

showFileDialog

public void showFileDialog(java.lang.String nameStr,
                           java.lang.String titleStr,
                           java.awt.Component parentComponent)
Displays the specified file in a dialog window.

Parameters:
nameStr - the file name string or menu name string.
titleStr - the title to use.
parentComponent - the parent component for the dialog.

showFileDialog

public void showFileDialog(java.lang.String fNameStr,
                           java.lang.String titleStr,
                           java.awt.Component parentComponent,
                           java.lang.String viewRefStr)
Displays the specified HTML file in a dialog window.

Parameters:
fNameStr - the name of the HTML file to display.
titleStr - the title to use.
parentComponent - the parent component for the dialog.
viewRefStr - the reference (anchor) to display, null for none.

showFileDialog

public void showFileDialog(java.lang.String fNameStr,
                           java.lang.String titleStr,
                           java.awt.Component parentComponent,
                           java.lang.String viewRefStr,
                           boolean showBackLaunchFlag)
Displays the specified HTML file in a dialog window.

Parameters:
fNameStr - the name of the HTML file to display.
titleStr - the title to use.
parentComponent - the parent component for the dialog.
viewRefStr - the reference (anchor) to display, null for none.
showBackLaunchFlag - true to show "Back" and "Launch Browser" buttons.

buildViewerDialog

protected ViewHTMLPanel buildViewerDialog(java.lang.String fNameStr,
                                          boolean showBackLaunchFlag,
                                          java.lang.String initialRefStr)
Creates an HTML-viewer-panel-based dialog window.

Parameters:
fNameStr - the name of the HTML file to display.
showBackLaunchFlag - true to show "Back" and "Launch Browser" buttons.
initialRefStr - the initial reference (anchor) to display in the given file, or null for none.
Returns:
A new 'ViewHTMLPanel' object, or null if the given HTML file could not be found.