|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.core.ui.actions.SystemAbstractPopupMenuExtensionAction
This is a base class to simplify the creation of actions supplied via the com.ibm.etools.systems.core.popupMenus extension point.
The only method you must implement is run()
.
You may optionally override getEnabled(Object[])
Convenience methods are:
getShell()
getProxyAction()
getSelection()
getSelectionCount()
getSelectedRemoteObjects()
getFirstSelectedRemoteObject()
getRemoteAdapter(Object)
getSubSystem()
getSubSystemFactory()
getSystemConnection()
runCommand(String)
getRemoteObjectName(Object obj, ISystemRemoteElementAdapter adapter)
getRemoteObjectSubSystemFactoryId(Object obj, ISystemRemoteElementAdapter adapter)
getRemoteObjectTypeCategory(Object obj, ISystemRemoteElementAdapter adapter)
getRemoteObjectType(Object obj, ISystemRemoteElementAdapter adapter)
getRemoteObjectSubType(Object obj, ISystemRemoteElementAdapter adapter)
getRemoteObjectSubSubType(Object obj, ISystemRemoteElementAdapter adapter)
ISystemRemoteElementAdapter
,
SystemPromptDialog
Field Summary | |
---|---|
static String |
copyright
|
protected static Object[] |
EMPTY_ARRAY
|
protected IAction |
proxyAction
|
protected IStructuredSelection |
sel
|
protected Shell |
shell
|
protected IWorkbenchPart |
viewPart
|
Constructor Summary | |
---|---|
SystemAbstractPopupMenuExtensionAction()
Constructor |
Method Summary | |
---|---|
IWorkbenchPart |
getActivePart()
Get the current view part. |
protected RemoteCmdSubSystem |
getCommandSubSystem()
Internal method to find and return the associated command subsystem, for the purpose of issuing a remote command. |
boolean |
getEnabled(Object[] currentlySelected)
The user has selected one or more objects. |
Object |
getFirstSelectedRemoteObject()
Retrieve the first selected object, for convenience. |
ISystemRemoteElementAdapter |
getFirstSelectedRemoteObjectAdapter()
Retrieve the adapter of the first selected object as an ISystemRemoteElementAdapter object, for convenience. |
IAction |
getProxyAction()
Return the proxy action for this action delegate |
ISystemRemoteElementAdapter |
getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElementAdapter for the given object. |
String |
getRemoteObjectName(Object obj,
ISystemRemoteElementAdapter adapter)
Returns the name of the given remote object, given its remote object adapter. |
String |
getRemoteObjectSubSubType(Object obj,
ISystemRemoteElementAdapter adapter)
Returns the sub-subtype of the given remote object, given its remote object adapter. |
String |
getRemoteObjectSubSystemFactoryId(Object obj,
ISystemRemoteElementAdapter adapter)
Returns the id of the subsystem factory of the given remote object, given its remote object adapter. |
String |
getRemoteObjectSubType(Object obj,
ISystemRemoteElementAdapter adapter)
Returns the subtype of the given remote object, given its remote object adapter. |
String |
getRemoteObjectType(Object obj,
ISystemRemoteElementAdapter adapter)
Returns the type of the given remote object, given its remote object adapter. |
String |
getRemoteObjectTypeCategory(Object obj,
ISystemRemoteElementAdapter adapter)
Returns the type category of the given remote object, given its remote object adapter. |
ISystemRemoteElementAdapter[] |
getSelectedRemoteObjectAdapters()
Retrieve the adapters of the currently selected objects as an array of ISystemRemoteElementAdapter objects. |
Object[] |
getSelectedRemoteObjects()
Retrieve the currently selected objects as an array of Object objects. |
IStructuredSelection |
getSelection()
Retrieve the current selected objects as a structured selection |
int |
getSelectionCount()
Retrieve the number of items currently selected |
Shell |
getShell()
Return the shell hosting this action |
SubSystem |
getSubSystem()
Returns the subsystem from which the selected remote objects were resolved. |
SubSystemFactory |
getSubSystemFactory()
Returns the subsystem factory which owns the subsystem from which the selected remote objects were resolved |
SystemConnection |
getSystemConnection()
Return the SystemConnection from which the selected remote objects were resolved |
String |
getWorkingDirectory(IRemoteFile selectedFile)
Helper method to return the path to change-directory to, given a selected remote file object Same as RemoteCommandHelpers.getWorkingDirectory(IRemoteFile) |
void |
printTest()
Debug method to print out details of given selected object... |
abstract void |
run()
The user has selected this action. |
void |
run(IAction action)
The Eclipse-supplied proxy action has been selected to run. |
Object[] |
runCommand(String command)
Execute a remote command. |
boolean |
runCommand(String cmdString,
String path)
This is a more flexible version of runCommand that allows explicitly specifying more options than the other flavor. |
void |
selectionChanged(IAction action,
ISelection sel)
Called by Eclipse when the user selects something. |
void |
setActivePart(IAction action,
IWorkbenchPart part)
|
void |
setChecked(boolean checked)
For toggle actions (attribute state specified in action tag), set the toggle state |
void |
setEnabled(boolean enabled)
Change the enabled state of the action |
void |
showInView(IRemoteCommandShell cmd)
Show/log the given command in the commands view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
protected IWorkbenchPart viewPart
protected IStructuredSelection sel
protected IAction proxyAction
protected Shell shell
protected static final Object[] EMPTY_ARRAY
Constructor Detail |
public SystemAbstractPopupMenuExtensionAction()
Method Detail |
public abstract void run()
public boolean getEnabled(Object[] currentlySelected)
public void setActivePart(IAction action, IWorkbenchPart part)
IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
public IWorkbenchPart getActivePart()
public void run(IAction action)
run()
.
IActionDelegate#run(IAction)
public void selectionChanged(IAction action, ISelection sel)
IActionDelegate#selectionChanged(IAction, ISelection)
public void setChecked(boolean checked)
public void setEnabled(boolean enabled)
public IAction getProxyAction()
public Shell getShell()
public IStructuredSelection getSelection()
public int getSelectionCount()
public Object[] getSelectedRemoteObjects()
getRemoteAdapter(Object)
public Object getFirstSelectedRemoteObject()
getRemoteAdapter(Object)
public ISystemRemoteElementAdapter[] getSelectedRemoteObjectAdapters()
public ISystemRemoteElementAdapter getFirstSelectedRemoteObjectAdapter()
public ISystemRemoteElementAdapter getRemoteAdapter(Object o)
public String getRemoteObjectName(Object obj, ISystemRemoteElementAdapter adapter)
adapter.getName(obj);
public String getRemoteObjectSubSystemFactoryId(Object obj, ISystemRemoteElementAdapter adapter)
adapter.getSubSystemFactoryId(obj);
public String getRemoteObjectTypeCategory(Object obj, ISystemRemoteElementAdapter adapter)
adapter.getRemoteTypeCategory(obj);
public String getRemoteObjectType(Object obj, ISystemRemoteElementAdapter adapter)
adapter.getRemoteType(obj);
public String getRemoteObjectSubType(Object obj, ISystemRemoteElementAdapter adapter)
adapter.getRemoteSubType(obj);
public String getRemoteObjectSubSubType(Object obj, ISystemRemoteElementAdapter adapter)
adapter.getRemoteSubSubType(obj);
public SubSystem getSubSystem()
public SubSystemFactory getSubSystemFactory()
public SystemConnection getSystemConnection()
public Object[] runCommand(String command)
This flavour will start a new shell to run the command, and will not set the current directory.
See also runCommand(String,String)
.
command
- Command to be executed remotely.
public String getWorkingDirectory(IRemoteFile selectedFile)
RemoteCommandHelpers.getWorkingDirectory(IRemoteFile)
public boolean runCommand(String cmdString, String path)
RemoteCommandHelpers.runUniversalCommand(Shell,String,String,RemoteCmdSubSystem)
cmdString
- - the resolved commandpath
- - the path to run the command against. Can be absolute or relative or null. This will become the current directory. See getWorkingDirectory(IRemoteFile)
getWorkingDirectory(IRemoteFile)
public void showInView(IRemoteCommandShell cmd)
RemoteCommandHelpers.showInView(IRemoteCommandShell)
protected RemoteCmdSubSystem getCommandSubSystem()
public void printTest()
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |