org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.actions

## Class MergeAction

- java.lang.Object
- - org.eclipse.core.commands.common.EventManager
  - - org.eclipse.jface.action.AbstractAction
    - - org.eclipse.jface.action.Action
      - - org.eclipse.ui.actions.BaseSelectionListenerAction
        - - org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.actions.MergeAction

All Implemented Interfaces:
  org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelectionChangedListener

Direct Known Subclasses:
  AbstractMergeContainedAction, MergeAllNonConflictingAction

    public class MergeAction
    extends org.eclipse.ui.actions.BaseSelectionListenerAction

Abstract Action that manages a merge of a difference in case of both sides of the comparison are editable.

Since:
  3.0

### Field Summary

Fields
`protected static com.google.common.base.Function<? super Adapter,? extends Notifier>` `ADAPTER__TARGET`
`protected ICompareEditingDomain` `editingDomain`
`protected IMerger.Registry` `mergerRegistry`

### Fields inherited from interface org.eclipse.jface.action.IAction

`AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT`

### Constructor Summary

Constructors
Constructor and Description
`MergeAction(IEMFCompareConfiguration compareConfiguration, IMerger.Registry mergerRegistry, MergeMode mode, org.eclipse.compare.INavigatable navigatable)` Constructor.
`MergeAction(IEMFCompareConfiguration compareConfiguration, IMerger.Registry mergerRegistry, MergeMode mode, org.eclipse.compare.INavigatable navigatable, org.eclipse.jface.viewers.IStructuredSelection selection)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `clearCache()`
`protected void` `contextualizeTooltip()` This method is used to created contextual tooltips.
`protected IMergeRunnable` `createMergeRunnable(MergeMode mode, boolean leftEditable, boolean rightEditable, IDiffRelationshipComputer relationshipComputer)`
`protected void` `execute(ICompareCommandStack commandStack, MergeMode mode, List<Diff> diffs)`
`protected void` `executeCompareCopyCommand(ICompareCommandStack commandStack, MergeMode mode, List<Diff> diffs)`
`protected IDiffRelationshipComputer` `getDiffRelationshipComputer()`
`List<Diff>` `getSelectedDifferences()` Returns the cached selected differences.
`protected Iterable<Diff>` `getSelectedDifferences(org.eclipse.jface.viewers.IStructuredSelection selection)`
`protected Iterable<Diff>` `getSelectedDifferences(Iterable<Diff> diffs)`
`protected MergeMode` `getSelectedMode()`
`protected com.google.common.base.Predicate<Diff>` `getStatePredicate()`
`protected void` `initToolTipAndImage(MergeMode mode)`
`protected boolean` `isLeftEditable()`
`protected boolean` `isLeftToRight()`
`protected boolean` `isMirrored()`
`protected boolean` `isRightEditable()`
`void` `run()`
`void` `setAdapterFactory(AdapterFactory adapterFactory)` Set the adapter factory used by this action.
`void` `setEditingDomain(ICompareEditingDomain editingDomain)`
`protected boolean` `updateSelection(org.eclipse.jface.viewers.IStructuredSelection selection)`

### Methods inherited from class org.eclipse.ui.actions.BaseSelectionListenerAction

`getStructuredSelection, runWithEvent, selectionChanged, selectionChanged`

### Methods inherited from class org.eclipse.jface.action.Action

`convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText`

### Methods inherited from class org.eclipse.jface.action.AbstractAction

`addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener`

### 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`

### Field Detail

#### ADAPTER__TARGET

    protected static final com.google.common.base.Function<? super Adapter,? extends Notifier> ADAPTER__TARGET

#### mergerRegistry

    protected final IMerger.Registry mergerRegistry

#### editingDomain

    protected ICompareEditingDomain editingDomain

### Constructor Detail

#### MergeAction

    public MergeAction(IEMFCompareConfiguration compareConfiguration,
                       IMerger.Registry mergerRegistry,
                       MergeMode mode,
                       org.eclipse.compare.INavigatable navigatable)

Constructor.

Parameters:
  `configuration` - The compare configuration object.

#### MergeAction

    public MergeAction(IEMFCompareConfiguration compareConfiguration,
                       IMerger.Registry mergerRegistry,
                       MergeMode mode,
                       org.eclipse.compare.INavigatable navigatable,
                       org.eclipse.jface.viewers.IStructuredSelection selection)

### Method Detail

#### createMergeRunnable

    protected IMergeRunnable createMergeRunnable(MergeMode mode,
                                                 boolean leftEditable,
                                                 boolean rightEditable,
                                                 IDiffRelationshipComputer relationshipComputer)

#### initToolTipAndImage

    protected void initToolTipAndImage(MergeMode mode)

#### contextualizeTooltip

    protected void contextualizeTooltip()

This method is used to created contextual tooltips.

#### run

    public void run()

Specified by:
  `run` in interface `org.eclipse.jface.action.IAction`
Overrides:
  `run` in class `org.eclipse.jface.action.Action`
See Also:
  `Action.run()`

#### execute

    protected void execute(ICompareCommandStack commandStack,
                           MergeMode mode,
                           List<Diff> diffs)

#### executeCompareCopyCommand

    protected void executeCompareCopyCommand(ICompareCommandStack commandStack,
                                             MergeMode mode,
                                             List<Diff> diffs)

#### updateSelection

    protected boolean updateSelection(org.eclipse.jface.viewers.IStructuredSelection selection)

Overrides:
  `updateSelection` in class `org.eclipse.ui.actions.BaseSelectionListenerAction`
See Also:
  `BaseSelectionListenerAction.updateSelection(org.eclipse.jface.viewers.IStructuredSelection)`

#### clearCache

    protected void clearCache()

Overrides:
  `clearCache` in class `org.eclipse.ui.actions.BaseSelectionListenerAction`
See Also:
  `BaseSelectionListenerAction.clearCache()`

#### getSelectedDifferences

    protected Iterable<Diff> getSelectedDifferences(org.eclipse.jface.viewers.IStructuredSelection selection)

#### getStatePredicate

    protected com.google.common.base.Predicate<Diff> getStatePredicate()

#### getSelectedDifferences

    protected Iterable<Diff> getSelectedDifferences(Iterable<Diff> diffs)

#### setEditingDomain

    public final void setEditingDomain(ICompareEditingDomain editingDomain)

Parameters:
  `newValue` -

#### setAdapterFactory

    public final void setAdapterFactory(AdapterFactory adapterFactory)

Set the adapter factory used by this action.

Parameters:
  `adapterFactory` - adapter factory

#### isLeftToRight

    protected final boolean isLeftToRight()

Returns:
  the leftToRight

#### getSelectedDifferences

    public List<Diff> getSelectedDifferences()

Returns the cached selected differences.

Returns:
  The cached selected differences.

#### getDiffRelationshipComputer

    protected IDiffRelationshipComputer getDiffRelationshipComputer()

#### getSelectedMode

    protected MergeMode getSelectedMode()

#### isLeftEditable

    protected boolean isLeftEditable()

#### isRightEditable

    protected boolean isRightEditable()

#### isMirrored

    protected boolean isMirrored()