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, removeHandlerListener, setBaseEnabled, setEnabled
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public 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 configurationnull
public void dispose()
dispose
in interface IHandler
dispose
in class AbstractHandler
IHandler.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()
AbstractHandler
AbstractHandler.setEnabled(Object)
so they can be notified
about framework execution contexts.isEnabled
in interface IHandler
isEnabled
in class AbstractHandler
true
AbstractHandler.setEnabled(Object)
,
AbstractHandler.setBaseEnabled(boolean)
protected void setEnabled(boolean isEnabled)
isEnabled
- whether the handler is enabledpublic Object execute(ExecutionEvent event) throws ExecutionException
IHandler
event
- 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()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.