Package org.eclipse.team.ui.mapping
Class MergeActionHandler
java.lang.Object
org.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.- Since:
- 3.2
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionMergeActionHandler(ISynchronizePageConfiguration configuration) Create the handler.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()Deregister this handler from selection change events.execute(ExecutionEvent event) Executes with the map of parameter values by name.protected final ISynchronizePageConfigurationReturn the configuration of the synchronize page that is surfacing the merge action to which this handler is registered.static IHandlergetDefaultHandler(String mergeActionId, ISynchronizePageConfiguration configuration) Return an instance of the default handler for the given merge action id.protected abstract SynchronizationOperationReturn the synchronization operation that performs the merge operation.Return the saveable that is the target of this handler.protected final IStructuredSelectionReturn the current selection.booleanWhether this handler is capable of executing at this time.protected voidsetEnabled(boolean isEnabled) Set the enablement of this handler.protected voidupdateEnablement(IStructuredSelection selection) Update the enablement of this handler for the new selection.Methods inherited from class org.eclipse.core.commands.AbstractHandleraddHandlerListener, fireHandlerChanged, hasListeners, isHandled, removeHandlerListener, setBaseEnabled, setEnabledMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.commands.IHandlergetHandlerLabel
- 
Constructor Details- 
MergeActionHandlerCreate the handler.- Parameters:
- configuration- the configuration for the synchronize page displaying the model.
 
 
- 
- 
Method Details- 
getDefaultHandlerpublic static IHandler getDefaultHandler(String mergeActionId, ISynchronizePageConfiguration configuration) Return an instance of the default handler for the given merge action id. Note that this handler must be disposed by the caller when it is no longer needed.- Parameters:
- mergeActionId- the merge action id
- configuration- the synchronization page configuration
- Returns:
- the default handler for the given merge action or null
 
- 
disposepublic void dispose()Deregister this handler from selection change events.- Specified by:
- disposein interface- IHandler
- Overrides:
- disposein class- AbstractHandler
 
- 
updateEnablementUpdate the enablement of this handler for the new selection. By default, this method uses theshouldRunmethod of the handler's operation to determine the enablement of this handler. Subclasses may override but should either still invoke this method or callsetEnabled(boolean)to set the enablement.- Parameters:
- selection- the selection
 
- 
getConfigurationReturn the configuration of the synchronize page that is surfacing the merge action to which this handler is registered.- Returns:
- the synchronize page configuration
 
- 
getStructuredSelectionReturn the current selection.- Returns:
- the current selection.
 
- 
isEnabledpublic boolean isEnabled()Description copied from class:AbstractHandlerWhether this handler is capable of executing at this time. Subclasses may override this method. If clients override this method they should also consider overridingAbstractHandler.setEnabled(Object)so they can be notified about framework execution contexts.- Specified by:
- isEnabledin interface- IHandler
- Overrides:
- isEnabledin class- AbstractHandler
- Returns:
- true
- See Also:
 
- 
setEnabledprotected void setEnabled(boolean isEnabled) Set the enablement of this handler.- Parameters:
- isEnabled- whether the handler is enabled
 
- 
executeDescription copied from interface:IHandlerExecutes with the map of parameter values by name.- Parameters:
- event- An event containing all the information about the current state of the application; must not be- null.
- Returns:
- the result of the execution. Reserved for future use, must be
         null.
- Throws:
- ExecutionException- if an exception occurred during execution.
 
- 
getOperationReturn the synchronization operation that performs the merge operation.- Returns:
- a synchronization operation
 
- 
getSaveableReturn the saveable that is the target of this handler. By default, the saveable of this handlers operation is returned.- Returns:
- the saveable that is the target of this operation
 
 
-