|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.etools.iseries.remotebuild.BuildActionDelegate
public abstract class BuildActionDelegate
Implements an action delegate that will invoke a set of actions on behalf of a selection made in the iSeries Project Navigator. The selection for this action is expected to be any number of resources associated with a single iSeries project.
Build style providers should subclass this class for their actions.
Field Summary | |
---|---|
static String |
Copyright
|
Constructor Summary | |
---|---|
BuildActionDelegate()
Create a new BuildActionDelegate. |
Method Summary | |
---|---|
protected boolean |
checkDirtyEditors()
Check all editors and presents a dialog requesting the user to save any dirty ones. |
protected abstract void |
checkSelection()
Checks the selection to see if it applies to this action. |
protected IWorkbenchPart |
getActivePart()
Returns the active workbench part on which this action was invoked. |
protected IBMiConnection |
getConnection()
Returns the connection relevant to this resource. |
protected AbstractISeriesProject |
getModelProject()
Returns the model project if there is exactly one covered by the selection. |
protected AbstractISeriesProject |
getModelProject(AbstractISeriesResource resource)
Returns the AbstractISeriesProject associated with an
AbstractISeriesResource . |
protected AbstractISeriesProject[] |
getModelProjects()
Returns an array of model projects that covers the selection. |
protected RBProject |
getProject()
Returns the RBProject resource derived from this
selection. |
protected RBProject[] |
getProjects()
Returns an array of RBProject that cover the selection. |
protected IStructuredSelection |
getSelection()
Returns the current selection if any has been made. |
protected Shell |
getShell()
Returns the shell associated with the part in which the selection occurs. |
RBStatus |
getStatus()
Returns the status of this operation. |
protected String |
getTaskName()
|
protected IWorkbenchWindow |
getWorkbenchWindow()
Retrieves the IWorkbenchWindow which can be as a IRunnableContext for operations if such a context is desired. |
protected abstract void |
handleActionException(Exception exception)
Handles the Exception that may be raised during the
performance of the action. |
protected void |
initialize()
Performs any initialization prior to running actions. |
boolean |
isCanceled()
Tests the canceled state of this operation. |
protected RBStatus |
performAction()
Performs the actual work of this operation. |
protected RBStatus |
performAction(IProgressMonitor monitor)
Performs the actual work of this operation. |
protected void |
performPostActions(IProgressMonitor monitor)
Performs post-action operations. |
protected void |
performPreActions(IProgressMonitor monitor)
Performs pre-action operations. |
void |
run(IAction action)
Runs the steps required to complete the action. |
protected void |
runWorkspaceOperation(Runnable runnable)
Runs a runnable that is part of a normal action inside a workspace modification envelope. |
void |
selectionChanged(IAction action,
ISelection selection)
Selection has changed. |
boolean |
selectionIsProject()
Tests if the selection is exactly one project. |
boolean |
selectionIsProjects()
Tests if the selection is only projects. |
void |
setActivePart(IAction action,
IWorkbenchPart part)
Set the workbench part that is requesting the action. |
protected void |
setCanceled(boolean canceled)
Sets the canceled state of this operation. |
protected void |
setEnabled(boolean enabled)
Sets the enabled state for the action that invoked this delegate. |
void |
showStatusMessage(RBStatus status)
Shows a status message and asks whether to cancel the operation. |
void |
showSystemMessage(SystemMessage message)
Shows a system message in a standard system message dialog. |
void |
showSystemMessageInUI(SystemMessage message)
Shows a system message from any thread. |
protected void |
terminate()
Performs any termination prior to ending the action. |
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
Constructor Detail |
---|
public BuildActionDelegate()
Method Detail |
---|
protected boolean checkDirtyEditors()
protected final void setEnabled(boolean enabled)
checkSelection
processing.
For use by subclasses.
protected final IStructuredSelection getSelection()
selectionChanged
and remains in effect until the
next one. Returns null
if no selection has yet been made.
For use by subclasses.
protected final IWorkbenchPart getActivePart()
For use by subclasses.
protected final Shell getShell()
A convenience method for use by subclasses. Can be used to get the shell for progress monitors.
protected final IWorkbenchWindow getWorkbenchWindow()
protected final AbstractISeriesProject getModelProject(AbstractISeriesResource resource)
AbstractISeriesProject
associated with an
AbstractISeriesResource
. All resources capable of being
selected can return this. An AbstractISeriesProjectRoot
,
which cannot be in a selection, will return null
.
For use by subclasses.
protected final AbstractISeriesProject getModelProject()
null
if there is none or more than one.
For use by subclasses.
protected final AbstractISeriesProject[] getModelProjects()
For use by subclasses.
protected final RBProject getProject()
RBProject
resource derived from this
selection.
protected final IBMiConnection getConnection()
protected final RBProject[] getProjects()
RBProject
that cover the selection.
public final RBStatus getStatus()
For use by clients testing this operation after it has finished.
protected final void setCanceled(boolean canceled)
For use by subclasses.
public final boolean isCanceled()
public final boolean selectionIsProject()
public final boolean selectionIsProjects()
protected void initialize()
run(IAction)
protected void performPreActions(IProgressMonitor monitor)
PreActions are run only if the current status is OK and the action has not been canceled.
run(IAction)
protected RBStatus performAction(IProgressMonitor monitor)
Performs the actual work of this operation. It is supplied a progress
monitor. It can retrieve its structured selection using
getSelection()
. It can retrieve its project using
getModelProject()
. Any long running action should create
a progress monitor from the context and periodically test the progress
monitor and cancel if requested.
The action is cancelable and runs in the UI thread.
Actions are run only if the current status is OK and the action has not been canceled.
The default implementation does nothing. Subclasses should either override this or performAction().
protected RBStatus performAction()
Performs the actual work of this operation. It can get create a progress
monitor from its context if necessary. It can retrieve its structured
selection using getSelection()
. It can retrieve its
project using getModelProject()
. Any long running action
should create a progress monitor from the context and periodically test
the progress monitor and cancel if requested.
The action is cancelable and runs in the UI thread.
The default implementation creates a ProgressMonitorDialog and runs performAction(monitor) within that. Can be overridden by subclasses if they prefer to use a different IRunnableContext.
protected void performPostActions(IProgressMonitor monitor)
PostActions are run only if the current status is OK and the action has not been canceled.
run(IAction)
protected void terminate()
run(IAction)
protected abstract void checkSelection()
setEnabled(boolean)
.
Subclasses must implement.
protected abstract void handleActionException(Exception exception)
Exception
that may be raised during the
performance of the action. Any logging to be done should be done here
since the exception is not re-thrown.
Subclasses must implement.
protected final void runWorkspaceOperation(Runnable runnable)
performAction(IProgressMonitor)
.
This is a convenience method for use by subclasses.
public final void selectionChanged(IAction action, ISelection selection)
Required by IObjectActionDelegate
.
Implemented here for all subclasses.
public final void setActivePart(IAction action, IWorkbenchPart part)
Required by IObjectActionDelegate
.
Implemented here for all subclasses.
public final void run(IAction action)
This action invokes the following 5 methods in succession.
initialize()
-- always run.performPreActions()
-- runs only if the operation has
not been canceled and the status is OK.performAction()
-- This provides the main or
normal action of this operation. Runs only if the operation has
not been canceled and the status is OK.performPostActions()
-- runs only if the operation
has not been canceled and the status is OK.terminate()
-- always run.
Required by IObjectActionDelegate
.
Implemented here for all subclasses.
protected String getTaskName()
public void showStatusMessage(RBStatus status)
public void showSystemMessage(SystemMessage message)
message
- the SystemMessage to show. If the message is null, this does
nothing.
If the message is an inquiry message, it is assumed to ask the question
"Do you want to continue?". If Yes is pressed the operation is continued.
If NO is pressed or the dialog is canceled, the operation is canceled.public void showSystemMessageInUI(SystemMessage message)
message
- The message to show.
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |