Package com.sshtools.common.ui
Class SshToolsApplicationPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- 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
Nested Classes Modifier and Type Class Description 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
-
-
Field Summary
Fields Modifier and Type Field Description 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
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description SshToolsApplicationPanel()
Creates a new SshToolsApplicationPanel object.SshToolsApplicationPanel(java.awt.LayoutManager mgr)
Creates a new SshToolsApplicationPanel object.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addFavorite(StandardAction action)
abstract boolean
canClose()
Called by the application framework to test the closing stateabstract void
close()
Called by the application framework to close the panelvoid
deregisterAction(StandardAction action)
Deregister an actionStandardAction
getAction(java.lang.String name)
Get an action by nameSshToolsApplicationPanel.ActionMenu
getActionMenu(java.lang.String actionMenuName)
Gets a menu by nameSshToolsApplication
getApplication()
Get the application attached to the panelSshToolsApplicationContainer
getContainer()
Gets the container for this panel.javax.swing.JPopupMenu
getContextMenu()
Get the context menuabstract ResourceIcon
getIcon()
Get the icon for the paneljavax.swing.JMenuBar
getJMenuBar()
Get the main menuStatusBar
getStatusBar()
Get the status barjavax.swing.JToolBar
getToolBar()
Gets the toolbarvoid
init(SshToolsApplication application)
Initialize the panelabstract boolean
isConnected()
Returns the connected state of the panelboolean
isToolsVisible()
Determine if the toolbar, menu and statusbar are visiblevoid
rebuildActionComponents()
Rebuild all the action components such as toobar, context menuvoid
registerAction(StandardAction action)
Register a new actionvoid
registerActionMenu(SshToolsApplicationPanel.ActionMenu actionMenu)
Register a new menuvoid
setActionVisible(java.lang.String name, boolean visible)
Set an actions visible stateabstract void
setAvailableActions()
Called by the application framework when a change in connection state has occured.void
setContainer(SshToolsApplicationContainer container)
Sets the container for this panelvoid
setContainerTitle(java.io.File file)
Set the title of the containervoid
setMenuBarVisible(boolean visible)
Set the visible state of the menu barvoid
setStatusBarVisible(boolean visible)
Set the visible state of the statusbarvoid
setToolBarVisible(boolean visible)
Set the visible state of the toolbarvoid
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 detailstatic void
showErrorMessage(java.awt.Component parent, java.lang.String title, java.lang.Throwable exception)
Show an error message with detailvoid
showExceptionMessage(java.lang.String title, java.lang.String message)
Show an exception messagevoid
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
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
-
-
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:
-
-