java.lang.Object | +--com.ibm.lab.soln.resources.ActionResourceAction
Common abstract superclass for resource actions. Provides common logic to
set the selected resource and display results and errors in a
MessageDialog
. A no-op stub implementation of the
setActivePart
method is also provided.
Most actions in this example expect a project as the selected resource, this logic does not care beyond expecting a structured selection.
Field Summary | |
org.eclipse.jface.viewers.IStructuredSelection |
selection
Holds selected project resource for run method access |
Constructor Summary | |
ActionResourceAction()
|
Method Summary | |
protected void |
resultError(java.lang.String title,
java.lang.String msg)
Uses a MessageDialog to show errors in action processing. |
protected void |
resultInformation(java.lang.String title,
java.lang.String msg)
Uses a MessageDialog to show action results. |
protected boolean |
resultQuestion(java.lang.String title,
java.lang.String msg)
Uses a MessageDialog to show errors in action processing. |
void |
selectionChanged(org.eclipse.jface.action.IAction action,
org.eclipse.jface.viewers.ISelection selection)
Used to save a local handle to the selected project resource. |
void |
setActivePart(org.eclipse.jface.action.IAction action,
org.eclipse.ui.IWorkbenchPart targetPart)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IActionDelegate |
run |
Field Detail |
public org.eclipse.jface.viewers.IStructuredSelection selection
Constructor Detail |
public ActionResourceAction()
Method Detail |
protected void resultError(java.lang.String title, java.lang.String msg)
MessageDialog
to show errors in action processing.MessageDialog
protected void resultInformation(java.lang.String title, java.lang.String msg)
MessageDialog
to show action results.MessageDialog
protected boolean resultQuestion(java.lang.String title, java.lang.String msg)
MessageDialog
to show errors in action processing.MessageDialog
public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
selectionChanged
in interface org.eclipse.ui.IActionDelegate
action
- action proxy that handles presentation
portion of the plugin actionselection
- current selection in the desktopIActionDelegate.selectionChanged(IAction, ISelection)
public void setActivePart(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart)
setActivePart
in interface org.eclipse.ui.IObjectActionDelegate