RSE
Release 1.0

org.eclipse.rse.ui.actions
Class SystemCascadingRemoteServerBaseAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended byorg.eclipse.rse.ui.actions.SystemBaseAction
                  extended byorg.eclipse.rse.ui.actions.SystemBaseSubMenuAction
                      extended byorg.eclipse.rse.ui.actions.SystemCascadingRemoteServerBaseAction
All Implemented Interfaces:
IAction, IMenuListener, ISelectionChangedListener, ISystemAction

public abstract class SystemCascadingRemoteServerBaseAction
extends SystemBaseSubMenuAction
implements IMenuListener

This is the base class for actions that populate the "Remote Servers" cascading menu. The actions in this menu cascade again, into Start and Stop actions. These cascading actions are handling automatically by this base class, but when they are run, they call back into abstract methods in this base class, to actually start and stop the remote server/daemon.


Field Summary
 
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseSubMenuAction
actionLabel, createMenuEachTime, menuID, populateMenuEachTime, subMenu
 
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
SystemCascadingRemoteServerBaseAction(String label, String tooltip, Shell shell)
          Deprecated.  
 
Method Summary
protected  boolean canDetectServerState()
          Overridable method to tell the base code if you are able to determine dynamically if the server is currently running or not.
protected abstract  boolean isServerStarted(IHost connection)
          Overridable method to compute if this remote server/daemon is currently running or not.
 void menuAboutToShow(IMenuManager subMenu)
          Called when submenu is about to show.
 IMenuManager populateSubMenu(IMenuManager menu)
          Populate the submenu for this action.
protected  boolean shouldEnable(IHost connection)
          This method is an opportunity to decide whether to enable this action or not.
abstract  boolean startServer()
          Callback from the SystemRemoteServerStartAction class that is called when the user selects to start this remote server/daemon.
abstract  boolean stopServer()
          Callback from the SystemRemoteServerStartAction class that is called when the user selects to stop this remote server/daemon.
 
Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseSubMenuAction
cascadeAllInputs, createMnemonicsListener, createStandardGroups, getActions, getSelection, getShell, getSubMenu, getViewer, setCreateMenuEachTime, setEnabled, setInputs, setInputsFromSubMenuManager, setMenuID, setPopulateMenuEachTime, setSelection, setShell, setTest, setViewer
 
Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getFirstSelection, getHelpContextId, getNextSelection, getRemoteAdapter, getSelectionProvider, getShell, getSystemConnection, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, run, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setHost, setSelectionProvider, setSelectionSensitive, setTracing, setTracing, updateSelection
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 

Constructor Detail

SystemCascadingRemoteServerBaseAction

public SystemCascadingRemoteServerBaseAction(String label,
                                             String tooltip,
                                             Shell shell)
Deprecated.  

Constructor

Method Detail

populateSubMenu

public IMenuManager populateSubMenu(IMenuManager menu)
Populate the submenu for this action. Here is where we add the start and stop actions.

Specified by:
populateSubMenu in class SystemBaseSubMenuAction
Parameters:
menu - The cascading menu, which is created for you. Add your actions to it.
Returns:
The given menu if you just populated it, or a new menu if you want to create the menu yourself.

menuAboutToShow

public void menuAboutToShow(IMenuManager subMenu)
Called when submenu is about to show. We use this to decide whether to enable/disable the start and stop actions underneath.

Specified by:
menuAboutToShow in interface IMenuListener

shouldEnable

protected boolean shouldEnable(IHost connection)
This method is an opportunity to decide whether to enable this action or not. Sometimes we can determine if the connection is connected or not, in which case we want to disable this action if the connection is not connected.


canDetectServerState

protected boolean canDetectServerState()
Overridable method to tell the base code if you are able to determine dynamically if the server is currently running or not. The default is true, and so #isStarted(IHost) is called to determine enablement state of the cascading start and stop actions. If you cannot determine this, override this method and return false, and both start and stop will be enabled always.

Returns:
true if you have the capability of dynamically determining if this server is running.

isServerStarted

protected abstract boolean isServerStarted(IHost connection)
Overridable method to compute if this remote server/daemon is currently running or not. This decides the enablement of the start and stop actions underneath. If there is no way to determine this, return false from canDetectServerState(), and ignore this method.

Returns:
true if the server is currently running or not.

startServer

public abstract boolean startServer()
Callback from the SystemRemoteServerStartAction class that is called when the user selects to start this remote server/daemon.

Returns:
true if the remote server was successfully started, false if not.

stopServer

public abstract boolean stopServer()
Callback from the SystemRemoteServerStartAction class that is called when the user selects to stop this remote server/daemon.

Returns:
true if the remote server was successfully stopped, false if not.

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.