com.sshtools.common.ui

Class SshToolsApplicationPanel

Known Direct Subclasses:
SshToolsApplicationClientPanel, SshToolsApplicationSessionPanel

public abstract class SshToolsApplicationPanel
extends JPanel

Version:
$Revision: 1.23 $
Author:
$author$

Nested Class Summary

static class
SshToolsApplicationPanel.ActionMenu

Field Summary

protected Vector
actionMenus
protected Vector
actions
protected HashMap
actionsVisible
protected SshToolsApplication
application
protected SshToolsApplicationContainer
container
protected JPopupMenu
contextMenu
protected Log
log
protected JMenuBar
menuBar
protected JToolBar
toolBar
protected boolean
toolsVisible

Constructor Summary

SshToolsApplicationPanel()
Creates a new SshToolsApplicationPanel object.
SshToolsApplicationPanel(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(String name)
Get an action by name
SshToolsApplicationPanel.ActionMenu
getActionMenu(String actionMenuName)
Gets a menu by name
SshToolsApplication
getApplication()
Get the application attached to the panel
SshToolsApplicationContainer
getContainer()
Gets the container for this panel.
JPopupMenu
getContextMenu()
Get the context menu
abstract ResourceIcon
getIcon()
Get the icon for the panel
JMenuBar
getJMenuBar()
Get the main menu
StatusBar
getStatusBar()
Get the status bar
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(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(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(Component parent, String mesg, String title, Throwable exception)
Show an error message with toggable detail
static void
showErrorMessage(Component parent, String title, Throwable exception)
Show an error message with detail
void
showExceptionMessage(String title, String message)
Show an exception message
void
showOptions()
Show the options dialog

Field Details

actionMenus

protected Vector actionMenus

actions

protected Vector actions

actionsVisible

protected HashMap actionsVisible

application

protected SshToolsApplication application

container

protected SshToolsApplicationContainer container

contextMenu

protected JPopupMenu contextMenu

log

protected Log log

menuBar

protected JMenuBar menuBar

toolBar

protected JToolBar toolBar

toolsVisible

protected boolean toolsVisible

Constructor Details

SshToolsApplicationPanel

public SshToolsApplicationPanel()
Creates a new SshToolsApplicationPanel object.

SshToolsApplicationPanel

public SshToolsApplicationPanel(LayoutManager mgr)
Creates a new SshToolsApplicationPanel object.
Parameters:
mgr -

Method Details

addFavorite

public void addFavorite(StandardAction action)

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

deregisterAction

public void deregisterAction(StandardAction action)
Deregister an action
Parameters:
action -

getAction

public StandardAction getAction(String name)
Get an action by name
Parameters:
name -
Returns:

getActionMenu

public SshToolsApplicationPanel.ActionMenu getActionMenu(String actionMenuName)
Gets a menu by name
Parameters:
actionMenuName -
Returns:

getApplication

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

getContainer

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

getContextMenu

public JPopupMenu getContextMenu()
Get the context menu
Returns:

getIcon

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

getJMenuBar

public JMenuBar getJMenuBar()
Get the main menu
Returns:

getStatusBar

public StatusBar getStatusBar()
Get the status bar
Returns:

getToolBar

public JToolBar getToolBar()
Gets the toolbar
Returns:

init

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

isConnected

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

isToolsVisible

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

rebuildActionComponents

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

registerAction

public void registerAction(StandardAction action)
Register a new action
Parameters:
action -

registerActionMenu

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

setActionVisible

public void setActionVisible(String name,
                             boolean visible)
Set an actions visible state
Parameters:
name -
visible -

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

setContainer

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

setContainerTitle

public void setContainerTitle(File file)
Set the title of the container
Parameters:
file -

setMenuBarVisible

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

setStatusBarVisible

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

setToolBarVisible

public void setToolBarVisible(boolean visible)
Set the visible state of the toolbar
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 -

showErrorMessage

public static void showErrorMessage(Component parent,
                                    String mesg,
                                    String title,
                                    Throwable exception)
Show an error message with toggable detail
Parameters:
parent -
mesg -
title -
exception -

showErrorMessage

public static void showErrorMessage(Component parent,
                                    String title,
                                    Throwable exception)
Show an error message with detail
Parameters:
parent -
title -
exception -

showExceptionMessage

public void showExceptionMessage(String title,
                                 String message)
Show an exception message
Parameters:
title -
message -

showOptions

public void showOptions()
Show the options dialog

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