com.isti.util.gui
Class ViewHTMLPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.isti.util.gui.ViewHTMLPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ViewHTMLPanel
extends javax.swing.JPanel

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

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean checkUrlFlag
           
protected  java.net.URL currentUrlObj
           
protected  boolean dialogClosedFlag
           
protected  boolean disableBackWhenEmptyFlag
           
protected  javax.swing.JEditorPane editorPaneObj
           
protected  java.util.Vector historyVec
           
protected  IstiDialogPopup hostDialogObj
           
protected  ILaunchBrowser launchBrowserObj
           
protected  javax.swing.JTextField locationTextFieldObj
           
protected  java.net.URL originalUrlObj
           
static CallBackStringFlag REMLINK_NOACTION_CALLBACK
          Constructor parameter for disabling launch-browser on remote link.
protected  CallBackStringFlag remoteLinkCallBackObj
           
protected  javax.swing.JScrollPane scrollPaneObj
           
protected  java.lang.Object userInputValueObj
           
protected  int xSize
           
protected  int ySize
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, boolean locationBarFlag)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, CallBackStringFlag remoteLinkCallBackObj)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, CallBackStringFlag remoteLinkCallBackObj, boolean locationBarFlag)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, java.lang.String initialRefStr)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, java.lang.String initialRefStr, boolean locationBarFlag)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, java.lang.String initialRefStr, CallBackStringFlag remoteLinkCallBackObj)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, java.lang.String initialRefStr, CallBackStringFlag remoteLinkCallBackObj, boolean locationBarFlag)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, boolean backButtonFlag, boolean launchButtonFlag, java.lang.String initialRefStr, CallBackStringFlag remoteLinkCallBackObj, boolean locationBarFlag, boolean locationBarDisableEditFlag)
          Creates a simple HTML viewer panel.
ViewHTMLPanel(java.net.URL urlObj, int xSize, int ySize, ILaunchBrowser launchBrowserObj, java.lang.String initialRefStr)
          Creates a simple HTML viewer panel.
 
Method Summary
protected  void addHistory(java.net.URL urlObj)
          Adds a URL to the history.
 void clearHistory()
          Clears the history buffer used by the "Back" button.
 void closeDialog()
          Closes the dialog object hosting this panel.
protected  boolean doLaunchBrowser(java.net.URL targetUrlObj)
          Launches a web browser pointing to the given page.
 boolean doSetPage(java.net.URL urlObj)
          Sets the URL of the currently viewed page.
 boolean doSetPage(java.net.URL urlObj, boolean historyFlag)
          Sets the URL of the currently viewed page.
 boolean getDialogClosedFlag()
          Returns the dialog-closed flag.
 javax.swing.JDialog getHostDialog()
          Returns the 'JDialog' object that is hosting this panel.
 java.lang.Object getInputValue()
          Returns the value the user has input in response to the 'showInDialog()' display.
 boolean isVisible()
          Overridden version that only returns 'true' if the dialog object hosting this panel is visible.
protected  void processHistoryChange()
          Processes a history change.
protected  java.net.URL removeHistory()
          Removes the last URL from the history.
protected  java.net.URL removeHistory(int index)
          Removes a URL from the history.
 void requestFocus()
          Overridden version that also requests focus onto the dialog object the hosts the panel (if currently visible).
 void resetViewer()
          Clears the history buffer used by the "Back" button and resets the page back to the original URL.
 void setCheck(boolean b)
          Sets if the URL should be checked if non-HTML.
 void setDialogVisible(boolean flgVal)
          Sets the visibility of this panel and the dialog object hosting this panel.
 void setDisableBackWhenEmpty(boolean b)
          Sets if the "Back" button should be disabled when the history is empty.
 boolean setPage(java.net.URL urlObj)
          Sets the URL of the currently viewed page.
 boolean setPage(java.net.URL urlObj, boolean historyFlag)
          Sets the URL of the currently viewed page.
 boolean setPageRef(java.lang.String refStr)
          Sets the viewed page to a reference (or anchor) on the current page.
 void showInDialog(java.awt.Component parentComponent, java.lang.String titleStr)
          Shows this 'ViewHTMLPanel' in a modal dialog window with a close button.
 void showInDialog(java.awt.Component parentComponent, java.lang.String titleStr, boolean modalFlag)
          Shows this 'ViewHTMLPanel' in a dialog window with a close button.
 java.lang.Object showInDialog(java.awt.Component parentComponent, java.lang.String titleStr, boolean modalFlag, java.lang.Object button1Obj)
          Shows this 'ViewHTMLPanel' in a dialog window with the given button object (if not given then a "Close" button will be used).
 java.lang.Object showInDialog(java.awt.Component parentComponent, java.lang.String titleStr, boolean modalFlag, java.lang.Object button1Obj, java.lang.Object button2Obj)
          Shows this 'ViewHTMLPanel' in a dialog window with the given button objects (if none are given then a "Close" button will be used).
 boolean showMessageText(java.lang.String msgStr)
          Displays the given text message in the viewer panel.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

editorPaneObj

protected final javax.swing.JEditorPane editorPaneObj

scrollPaneObj

protected final javax.swing.JScrollPane scrollPaneObj

historyVec

protected final java.util.Vector historyVec

xSize

protected final int xSize

ySize

protected final int ySize

remoteLinkCallBackObj

protected final CallBackStringFlag remoteLinkCallBackObj

locationTextFieldObj

protected final javax.swing.JTextField locationTextFieldObj

originalUrlObj

protected final java.net.URL originalUrlObj

currentUrlObj

protected java.net.URL currentUrlObj

launchBrowserObj

protected ILaunchBrowser launchBrowserObj

hostDialogObj

protected IstiDialogPopup hostDialogObj

userInputValueObj

protected java.lang.Object userInputValueObj

dialogClosedFlag

protected boolean dialogClosedFlag

checkUrlFlag

protected boolean checkUrlFlag

disableBackWhenEmptyFlag

protected boolean disableBackWhenEmptyFlag

REMLINK_NOACTION_CALLBACK

public static final CallBackStringFlag REMLINK_NOACTION_CALLBACK
Constructor parameter for disabling launch-browser on remote link.

Constructor Detail

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     java.lang.String initialRefStr,
                     CallBackStringFlag remoteLinkCallBackObj,
                     boolean locationBarFlag)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'LaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
initialRefStr - the initial reference (anchor) to display on the given URL, or null for none.
remoteLinkCallBackObj - a 'CallBackStringFlag' object whose method will be called when a remote or non-HTML link is clicked on, 'REMLINK_NOACTION_CALLBACK' for no action, or null to launch a browser to show the link (default).
locationBarFlag - true to show location bar; false to not (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     java.lang.String initialRefStr,
                     CallBackStringFlag remoteLinkCallBackObj,
                     boolean locationBarFlag,
                     boolean locationBarDisableEditFlag)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'LaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
initialRefStr - the initial reference (anchor) to display on the given URL, or null for none.
remoteLinkCallBackObj - a 'CallBackStringFlag' object whose method will be called when a remote or non-HTML link is clicked on, 'REMLINK_NOACTION_CALLBACK' for no action, or null to launch a browser to show the link (default).
locationBarFlag - true to show location bar; false to not (default).
locationBarDisableEditFlag - true to disable location bar edits, false to not (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     java.lang.String initialRefStr,
                     CallBackStringFlag remoteLinkCallBackObj)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
initialRefStr - the initial reference (anchor) to display on the given URL, or null for none.
remoteLinkCallBackObj - a 'CallBackStringFlag' object whose method will be called when a remote or non-HTML link is clicked on, 'REMLINK_NOACTION_CALLBACK' for no action, or null to launch a browser to show the link (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     java.lang.String initialRefStr)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
initialRefStr - the initial reference (anchor) to display on the given URL, or null for none.

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     java.lang.String initialRefStr,
                     boolean locationBarFlag)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
initialRefStr - the initial reference (anchor) to display on the given URL, or null for none.
locationBarFlag - true to show location bar; false to not (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     boolean locationBarFlag)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
locationBarFlag - true to show location bar; false to not (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     CallBackStringFlag remoteLinkCallBackObj,
                     boolean locationBarFlag)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
remoteLinkCallBackObj - a 'CallBackStringFlag' object whose method will be called when a remote or non-HTML link is clicked on, 'REMLINK_NOACTION_CALLBACK' for no action, or null to launch a browser to show the link (default).
locationBarFlag - true to show location bar; false to not (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     boolean backButtonFlag,
                     boolean launchButtonFlag,
                     CallBackStringFlag remoteLinkCallBackObj)
Creates a simple HTML viewer panel.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
backButtonFlag - true to show "Back" button.
launchButtonFlag - true to show "Launch Browser" button.
remoteLinkCallBackObj - a 'CallBackStringFlag' object whose method will be called when a remote or non-HTML link is clicked on, 'REMLINK_NOACTION_CALLBACK' for no action, or null to launch a browser to show the link (default).

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj,
                     java.lang.String initialRefStr)
Creates a simple HTML viewer panel. "Back" and "Launch Browser" buttons are shown.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
initialRefStr - the initial reference (anchor) to display on the given URL, or null for none.

ViewHTMLPanel

public ViewHTMLPanel(java.net.URL urlObj,
                     int xSize,
                     int ySize,
                     ILaunchBrowser launchBrowserObj)
Creates a simple HTML viewer panel. "Back" and "Launch Browser" buttons are shown.

Parameters:
urlObj - the initial URL to display, or null for none.
xSize - the X size for the panel.
ySize - the Y size for the panel.
launchBrowserObj - an existing 'ILaunchBrowser' object, or null to have this class create its own.
Method Detail

showInDialog

public java.lang.Object showInDialog(java.awt.Component parentComponent,
                                     java.lang.String titleStr,
                                     boolean modalFlag,
                                     java.lang.Object button1Obj,
                                     java.lang.Object button2Obj)
Shows this 'ViewHTMLPanel' in a dialog window with the given button objects (if none are given then a "Close" button will be used). If 'modalFlag' is true then this method will not return until the dialog window is dismissed.

Parameters:
parentComponent - the parent component for the dialog.
titleStr - the title string for the dialog.
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.
Returns:
The Object chosen by the user (UNINITIALIZED_VALUE if the user has not yet made a choice, or null if the user closed the window without making a choice).

showInDialog

public java.lang.Object showInDialog(java.awt.Component parentComponent,
                                     java.lang.String titleStr,
                                     boolean modalFlag,
                                     java.lang.Object button1Obj)
Shows this 'ViewHTMLPanel' in a dialog window with the given button object (if not given then a "Close" button will be used). If 'modalFlag' is true then this method will not return until the dialog window is dismissed.

Parameters:
parentComponent - the parent component for the dialog.
titleStr - the title string for the dialog.
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.
Returns:
The Object chosen by the user (UNINITIALIZED_VALUE if the user has not yet made a choice, or null if the user closed the window without making a choice).

showInDialog

public void showInDialog(java.awt.Component parentComponent,
                         java.lang.String titleStr,
                         boolean modalFlag)
Shows this 'ViewHTMLPanel' in a dialog window with a close button. If 'modalFlag' is true then this method will not return until the dialog window is dismissed.

Parameters:
parentComponent - the parent component for the dialog.
titleStr - the title string for the dialog.
modalFlag - true for a modal dialog, false for a modeless dialog (that allows other windows to be active at the same time).

showInDialog

public void showInDialog(java.awt.Component parentComponent,
                         java.lang.String titleStr)
Shows this 'ViewHTMLPanel' in a modal dialog window with a close button. This method does not return until the dialog window is dismissed.

Parameters:
parentComponent - the parent component for the dialog.
titleStr - the title string for the dialog.

closeDialog

public void closeDialog()
Closes the dialog object hosting this panel.


setPage

public final boolean setPage(java.net.URL urlObj,
                             boolean historyFlag)
Sets the URL of the currently viewed page. The URL is optionally checked to see if it's a remote or non-HTML URL (resulting in a browser launch or 'remoteLinkCallBackObj' invocation if so).

Parameters:
urlObj - URL of page to display.
historyFlag - true to save new URL to history Vector.
Returns:
true if successful, false if error.
See Also:
setCheck(boolean)

setPage

public boolean setPage(java.net.URL urlObj)
Sets the URL of the currently viewed page. The URL is optionally checked to see if it's a remote or non-HTML URL (resulting in a browser launch or 'remoteLinkCallBackObj' invocation if so). The new URL is saved in the history Vector.

Parameters:
urlObj - URL of page to display.
Returns:
true if successful, false if error.
See Also:
setCheck(boolean)

doSetPage

public final boolean doSetPage(java.net.URL urlObj,
                               boolean historyFlag)
Sets the URL of the currently viewed page. The URL is not checked to see if it's a remote or non-HTML URL (no browser launch or 'remoteLinkCallBackObj' invocation).

Parameters:
urlObj - URL of page to display.
historyFlag - true to save new URL to history Vector.
Returns:
true if successful, false if error.

doSetPage

public final boolean doSetPage(java.net.URL urlObj)
Sets the URL of the currently viewed page. The URL is not checked to see if it's a remote or non-HTML URL (no browser launch or 'remoteLinkCallBackObj' invocation). The new URL is saved in the history Vector.

Parameters:
urlObj - URL of page to display.
Returns:
true if successful, false if error.

setPageRef

public boolean setPageRef(java.lang.String refStr)
Sets the viewed page to a reference (or anchor) on the current page. The new URL is saved in the history Vector.

Parameters:
refStr - the reference (or anchor) to be viewed.
Returns:
true if successful, false if error.

showMessageText

public boolean showMessageText(java.lang.String msgStr)
Displays the given text message in the viewer panel.

Parameters:
msgStr - message text to display.
Returns:
true if successful; false if error.

clearHistory

public void clearHistory()
Clears the history buffer used by the "Back" button.


resetViewer

public void resetViewer()
Clears the history buffer used by the "Back" button and resets the page back to the original URL.


doLaunchBrowser

protected boolean doLaunchBrowser(java.net.URL targetUrlObj)
Launches a web browser pointing to the given page.

Parameters:
targetUrlObj - the URL object for the page.
Returns:
true if no errors are detected.

requestFocus

public void requestFocus()
Overridden version that also requests focus onto the dialog object the hosts the panel (if currently visible).

Overrides:
requestFocus in class javax.swing.JComponent

setCheck

public void setCheck(boolean b)
Sets if the URL should be checked if non-HTML.

Parameters:
b - true if the page should be checked, false otherwise.
See Also:
setPage(URL), setPage(URL, boolean)

setDisableBackWhenEmpty

public void setDisableBackWhenEmpty(boolean b)
Sets if the "Back" button should be disabled when the history is empty.

Parameters:
b - true if the "Back" button should be disabled when the history is empty, false otherwise.

setDialogVisible

public void setDialogVisible(boolean flgVal)
Sets the visibility of this panel and the dialog object hosting this panel.

Parameters:
flgVal - true for visible.

isVisible

public boolean isVisible()
Overridden version that only returns 'true' if the dialog object hosting this panel is visible.

Overrides:
isVisible in class java.awt.Component
Returns:
true if the panel is visible.

getHostDialog

public javax.swing.JDialog getHostDialog()
Returns the 'JDialog' object that is hosting this panel.

Returns:
the 'JDialog' host, or null if none.

getInputValue

public java.lang.Object getInputValue()
Returns the value the user has input in response to the 'showInDialog()' display.

Returns:
the Object the user specified, or null if none available.

getDialogClosedFlag

public boolean getDialogClosedFlag()
Returns the dialog-closed flag. The flag is set true if the dialog is closed via the 'closeDialog()' method, which can happen after a browser is launched.

Returns:
true if the dialog has been closed via the 'closeDialog()' method; false if not.

addHistory

protected void addHistory(java.net.URL urlObj)
Adds a URL to the history.

Parameters:
urlObj - the URL object.

processHistoryChange

protected void processHistoryChange()
Processes a history change.


removeHistory

protected java.net.URL removeHistory()
Removes the last URL from the history.

Returns:
the removed URL or null if none.

removeHistory

protected java.net.URL removeHistory(int index)
Removes a URL from the history.

Parameters:
index - the index of the URL in the history.
Returns:
the removed URL or null if none.