|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
org.eclipse.team.ui.mapping.MergeActionHandler
An abstract superclass that enables models to create handlers
for the basic merge operations (merge, overwrite and mark-as-merged).
This class makes use of a 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 Summary | |
---|---|
MergeActionHandler(ISynchronizePageConfiguration configuration)
Create the handler. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.eclipse.core.commands.AbstractHandler |
---|
addHandlerListener, fireHandlerChanged, hasListeners, isHandled, removeHandlerListener |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MergeActionHandler(ISynchronizePageConfiguration configuration)
configuration
- the configuration for the synchronize page displaying the model.Method Detail |
public static IHandler getDefaultHandler(String mergeActionId, ISynchronizePageConfiguration configuration)
mergeActionId
- the merge action idconfiguration
- the synchronization page configuration
null
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
isEnabled
in interface IHandler
isEnabled
in class AbstractHandler
true
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()
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.