com.sshtools.common.ui
Class SshToolsApplicationPanel

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.sshtools.common.ui.SshToolsApplicationPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
SshToolsApplicationClientPanel, SshToolsApplicationSessionPanel

public abstract class SshToolsApplicationPanel
extends javax.swing.JPanel

Version:
$Revision: 1.23 $
Author:
$author$
See Also:
Serialized Form

Nested Class Summary
static class SshToolsApplicationPanel.ActionMenu
           
 
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  java.util.Vector actionMenus
           
protected  java.util.Vector actions
           
protected  java.util.HashMap actionsVisible
           
protected  SshToolsApplication application
           
protected  SshToolsApplicationContainer container
           
protected  javax.swing.JPopupMenu contextMenu
           
protected  org.apache.commons.logging.Log log
           
protected  javax.swing.JMenuBar menuBar
           
protected  javax.swing.JToolBar toolBar
           
protected  boolean toolsVisible
           
 
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
SshToolsApplicationPanel()
          Creates a new SshToolsApplicationPanel object.
SshToolsApplicationPanel(java.awt.LayoutManager mgr)
          Creates a new SshToolsApplicationPanel object.
 
Method Summary
 void addFavorite(StandardAction action)
           
abstract  boolean canClose()
          Called by the application framework to test the closing state
abstract  void close()
          Called by the application framework to close the panel
 void deregisterAction(StandardAction action)
          Deregister an action
 StandardAction getAction(java.lang.String name)
          Get an action by name
 SshToolsApplicationPanel.ActionMenu getActionMenu(java.lang.String actionMenuName)
          Gets a menu by name
 SshToolsApplication getApplication()
          Get the application attached to the panel
 SshToolsApplicationContainer getContainer()
          Gets the container for this panel.
 javax.swing.JPopupMenu getContextMenu()
          Get the context menu
abstract  ResourceIcon getIcon()
          Get the icon for the panel
 javax.swing.JMenuBar getJMenuBar()
          Get the main menu
 StatusBar getStatusBar()
          Get the status bar
 javax.swing.JToolBar getToolBar()
          Gets the toolbar
 void init(SshToolsApplication application)
          Initialize the panel
abstract  boolean isConnected()
          Returns the connected state of the panel
 boolean isToolsVisible()
          Determine if the toolbar, menu and statusbar are visible
 void rebuildActionComponents()
          Rebuild all the action components such as toobar, context menu
 void registerAction(StandardAction action)
          Register a new action
 void registerActionMenu(SshToolsApplicationPanel.ActionMenu actionMenu)
          Register a new menu
 void setActionVisible(java.lang.String name, boolean visible)
          Set an actions visible state
abstract  void setAvailableActions()
          Called by the application framework when a change in connection state has occured.
 void setContainer(SshToolsApplicationContainer container)
          Sets the container for this panel
 void setContainerTitle(java.io.File file)
          Set the title of the container
 void setMenuBarVisible(boolean visible)
          Set the visible state of the menu bar
 void setStatusBarVisible(boolean visible)
          Set the visible state of the statusbar
 void setToolBarVisible(boolean visible)
          Set the visible state of the toolbar
 void setToolsVisible(boolean visible)
          Set the visible state of all tools.
static void showErrorMessage(java.awt.Component parent, java.lang.String mesg, java.lang.String title, java.lang.Throwable exception)
          Show an error message with toggable detail
static void showErrorMessage(java.awt.Component parent, java.lang.String title, java.lang.Throwable exception)
          Show an error message with detail
 void showExceptionMessage(java.lang.String title, java.lang.String message)
          Show an exception message
 void showOptions()
          Show the options dialog
 
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, 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, 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, isVisible, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log

application

protected SshToolsApplication application

menuBar

protected javax.swing.JMenuBar menuBar

toolBar

protected javax.swing.JToolBar toolBar

contextMenu

protected javax.swing.JPopupMenu contextMenu

container

protected SshToolsApplicationContainer container

actions

protected java.util.Vector actions

actionsVisible

protected java.util.HashMap actionsVisible

toolsVisible

protected boolean toolsVisible

actionMenus

protected java.util.Vector actionMenus
Constructor Detail

SshToolsApplicationPanel

public SshToolsApplicationPanel()
Creates a new SshToolsApplicationPanel object.


SshToolsApplicationPanel

public SshToolsApplicationPanel(java.awt.LayoutManager mgr)
Creates a new SshToolsApplicationPanel object.

Parameters:
mgr -
Method Detail

canClose

public abstract boolean canClose()
Called by the application framework to test the closing state

Returns:

close

public abstract void close()
Called by the application framework to close the panel


setAvailableActions

public abstract void setAvailableActions()
Called by the application framework when a change in connection state has occured. The available actions should be enabled/disabled in this methods implementation


setActionVisible

public void setActionVisible(java.lang.String name,
                             boolean visible)
Set an actions visible state

Parameters:
name -
visible -

getContainer

public SshToolsApplicationContainer getContainer()
Gets the container for this panel.

Returns:

setContainer

public void setContainer(SshToolsApplicationContainer container)
Sets the container for this panel

Parameters:
container -

registerActionMenu

public void registerActionMenu(SshToolsApplicationPanel.ActionMenu actionMenu)
Register a new menu

Parameters:
actionMenu -

getActionMenu

public SshToolsApplicationPanel.ActionMenu getActionMenu(java.lang.String actionMenuName)
Gets a menu by name

Parameters:
actionMenuName -
Returns:

getAction

public StandardAction getAction(java.lang.String name)
Get an action by name

Parameters:
name -
Returns:

deregisterAction

public void deregisterAction(StandardAction action)
Deregister an action

Parameters:
action -

registerAction

public void registerAction(StandardAction action)
Register a new action

Parameters:
action -

init

public void init(SshToolsApplication application)
          throws SshToolsApplicationException
Initialize the panel

Parameters:
application -
Throws:
SshToolsApplicationException

showOptions

public void showOptions()
Show the options dialog


rebuildActionComponents

public void rebuildActionComponents()
Rebuild all the action components such as toobar, context menu


isToolsVisible

public boolean isToolsVisible()
Determine if the toolbar, menu and statusbar are visible

Returns:

addFavorite

public void addFavorite(StandardAction action)

setMenuBarVisible

public void setMenuBarVisible(boolean visible)
Set the visible state of the menu bar

Parameters:
visible -

setToolBarVisible

public void setToolBarVisible(boolean visible)
Set the visible state of the toolbar

Parameters:
visible -

setStatusBarVisible

public void setStatusBarVisible(boolean visible)
Set the visible state of the statusbar

Parameters:
visible -

setToolsVisible

public void setToolsVisible(boolean visible)
Set the visible state of all tools. This will set the toolbar, menu and status bar visible states to the value provided.

Parameters:
visible -

showExceptionMessage

public void showExceptionMessage(java.lang.String title,
                                 java.lang.String message)
Show an exception message

Parameters:
title -
message -

showErrorMessage

public static void showErrorMessage(java.awt.Component parent,
                                    java.lang.String title,
                                    java.lang.Throwable exception)
Show an error message with detail

Parameters:
parent -
title -
exception -

showErrorMessage

public static void showErrorMessage(java.awt.Component parent,
                                    java.lang.String mesg,
                                    java.lang.String title,
                                    java.lang.Throwable exception)
Show an error message with toggable detail

Parameters:
parent -
mesg -
title -
exception -

isConnected

public abstract boolean isConnected()
Returns the connected state of the panel

Returns:

setContainerTitle

public void setContainerTitle(java.io.File file)
Set the title of the container

Parameters:
file -

getToolBar

public javax.swing.JToolBar getToolBar()
Gets the toolbar

Returns:

getContextMenu

public javax.swing.JPopupMenu getContextMenu()
Get the context menu

Returns:

getJMenuBar

public javax.swing.JMenuBar getJMenuBar()
Get the main menu

Returns:

getStatusBar

public StatusBar getStatusBar()
Get the status bar

Returns:

getApplication

public SshToolsApplication getApplication()
Get the application attached to the panel

Returns:

getIcon

public abstract ResourceIcon getIcon()
Get the icon for the panel

Returns:


Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.