Package 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
Modifier and Type
Field
Description
`protected ICompareEditingDomain`
`editingDomain`
`protected final 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
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

Modifier and Type
Method
Description
`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()`
`protected List<Diff>`
`getSelectedDifferences()`
Returns the cached selected differences.
`protected List<Diff>`
`getSelectedDifferences(Stream<Diff> diffs)`
`protected List<Diff>`
`getSelectedDifferences(org.eclipse.jface.viewers.IStructuredSelection selection)`
`protected MergeMode`
`getSelectedMode()`
`protected Predicate<Diff>`
`getStatePredicate()`
`protected void`
`initToolTipAndImage(MergeMode mode)`
`protected boolean`
`isLeftEditable()`
`protected final boolean`
`isLeftToRight()`
`protected boolean`
`isMirrored()`
`protected boolean`
`isRightEditable()`
`void`
`run()`
`final void`
`setAdapterFactory(AdapterFactory adapterFactory)`
Set the adapter factory used by this action.
`final 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 Details

### mergerRegistry

protected final IMerger.Registry mergerRegistry

### editingDomain

protected ICompareEditingDomain editingDomain

## Constructor Details

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

### 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 List<Diff> getSelectedDifferences(org.eclipse.jface.viewers.IStructuredSelection selection)

### getStatePredicate

protected Predicate<Diff> getStatePredicate()

### getSelectedDifferences

protected List<Diff> getSelectedDifferences(Stream<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

protected 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()