com.ibm.lab.soln.resources
Class ActionResourceAction

java.lang.Object
  |
  +--com.ibm.lab.soln.resources.ActionResourceAction
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IObjectActionDelegate
Direct Known Subclasses:
ActionAddBuilderToProject, ActionAddCustomNature, ActionListBuilders, ActionManageTraceRCLs, ActionProcessResourceTree, ActionRemoveBuilderFromProject, ActionRemoveCustomNature

public abstract class ActionResourceAction
extends java.lang.Object
implements org.eclipse.ui.IObjectActionDelegate

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

selection

public org.eclipse.jface.viewers.IStructuredSelection selection
Holds selected project resource for run method access
Constructor Detail

ActionResourceAction

public ActionResourceAction()
Method Detail

resultError

protected void resultError(java.lang.String title,
                           java.lang.String msg)
Uses a MessageDialog to show errors in action processing.
See Also:
MessageDialog

resultInformation

protected void resultInformation(java.lang.String title,
                                 java.lang.String msg)
Uses a MessageDialog to show action results.
See Also:
MessageDialog

resultQuestion

protected boolean resultQuestion(java.lang.String title,
                                 java.lang.String msg)
Uses a MessageDialog to show errors in action processing.
See Also:
MessageDialog

selectionChanged

public 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.
Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate
Parameters:
action - action proxy that handles presentation portion of the plugin action
selection - current selection in the desktop
See Also:
IActionDelegate.selectionChanged(IAction, ISelection)

setActivePart

public void setActivePart(org.eclipse.jface.action.IAction action,
                          org.eclipse.ui.IWorkbenchPart targetPart)
Specified by:
setActivePart in interface org.eclipse.ui.IObjectActionDelegate