Class MergeActionHandler

    • Constructor Detail

      • MergeActionHandler

        public MergeActionHandler​(ISynchronizePageConfiguration configuration)
        Create the handler.
        configuration - the configuration for the synchronize page displaying the model.
    • Method Detail

      • getDefaultHandler

        public 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.
        mergeActionId - the merge action id
        configuration - the synchronization page configuration
        the default handler for the given merge action or null
      • updateEnablement

        protected void updateEnablement​(IStructuredSelection selection)
        Update the enablement of this handler for the new selection. By default, this method uses the 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 selection
      • getConfiguration

        protected final ISynchronizePageConfiguration getConfiguration()
        Return the configuration of the synchronize page that is surfacing the merge action to which this handler is registered.
        the synchronize page configuration
      • getStructuredSelection

        protected final IStructuredSelection getStructuredSelection()
        Return the current selection.
        the current selection.
      • setEnabled

        protected void setEnabled​(boolean isEnabled)
        Set the enablement of this handler.
        isEnabled - whether the handler is enabled
      • execute

        public Object execute​(ExecutionEvent event)
                       throws ExecutionException
        Description copied from interface: IHandler
        Executes with the map of parameter values by name.
        event - An event containing all the information about the current state of the application; must not be null.
        the result of the execution. Reserved for future use, must be null.
        ExecutionException - if an exception occurred during execution.
      • getOperation

        protected abstract SynchronizationOperation getOperation()
        Return the synchronization operation that performs the merge operation.
        a synchronization operation
      • getSaveable

        public SaveableComparison getSaveable()
        Return the saveable that is the target of this handler. By default, the saveable of this handlers operation is returned.
        the saveable that is the target of this operation