public abstract class MergeActionHandler extends AbstractHandler
SynchronizationOperation to determine its
enablement state and execute the handler. Enablement is determined
using SynchronizationOperation.shouldRun() and the handler will
invoke TeamOperation.run() when executed.SynchronizationActionProvider| Constructor and Description |
|---|
MergeActionHandler(ISynchronizePageConfiguration configuration)
Create the handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Deregister this handler from selection change events.
|
Object |
execute(ExecutionEvent event)
Executes with the map of parameter values by name.
|
protected ISynchronizePageConfiguration |
getConfiguration()
Return the configuration of the synchronize page that is surfacing
the merge action to which this handler is registered.
|
static IHandler |
getDefaultHandler(String mergeActionId,
ISynchronizePageConfiguration configuration)
Return an instance of the default handler for the given merge action id.
|
protected abstract SynchronizationOperation |
getOperation()
Return the synchronization operation that performs
the merge operation.
|
SaveableComparison |
getSaveable()
Return the saveable that is the target of this handler.
|
protected IStructuredSelection |
getStructuredSelection()
Return the current selection.
|
boolean |
isEnabled()
Whether this handler is capable of executing at this time.
|
protected void |
setEnabled(boolean isEnabled)
Set the enablement of this handler.
|
protected void |
updateEnablement(IStructuredSelection selection)
Update the enablement of this handler for the new selection.
|
addHandlerListener, fireHandlerChanged, hasListeners, isHandled, removeHandlerListeneraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectpublic MergeActionHandler(ISynchronizePageConfiguration configuration)
configuration - the configuration for the synchronize page displaying the model.public static IHandler getDefaultHandler(String mergeActionId, ISynchronizePageConfiguration configuration)
mergeActionId - the merge action idconfiguration - the synchronization page configurationnullpublic void dispose()
dispose in interface IHandlerdispose in class AbstractHandlerIHandler.dispose()protected void updateEnablement(IStructuredSelection selection)
shouldRun
method of the handler's operation to determine the enablement
of this handler. Subclasses may override but should
either still invoke this method or call setEnabled(boolean)
to set the enablement.selection - the selectionprotected final ISynchronizePageConfiguration getConfiguration()
protected final IStructuredSelection getStructuredSelection()
public boolean isEnabled()
AbstractHandlerisEnabled in interface IHandlerisEnabled in class AbstractHandlertrueprotected void setEnabled(boolean isEnabled)
isEnabled - whether the handler is enabledpublic Object execute(ExecutionEvent event) throws ExecutionException
IHandlerevent - An event containing all the information about the current
state of the application; must not be null.null.ExecutionException - if an exception occurred during execution.protected abstract SynchronizationOperation getOperation()
public SaveableComparison getSaveable()
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.