Class EMFCompareConfiguration
- java.lang.Object
-
- org.eclipse.compare.CompareConfiguration
-
- org.eclipse.emf.compare.ide.ui.internal.configuration.ForwardingCompareConfiguration
-
- org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration
-
- All Implemented Interfaces:
IEMFCompareConfiguration
public class EMFCompareConfiguration extends ForwardingCompareConfiguration implements IEMFCompareConfiguration
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.compare.ide.ui.internal.configuration.ForwardingCompareConfiguration
ForwardingCompareConfiguration.MirroredPropertyChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
DISPLAY_FILTERS
static String
DISPLAY_GROUP_PROVIDERS
static String
DISPLAY_SAVE_ACTION
static String
DISPLAY_SELECT_UNRESOLVED_DIFF_ACTIONS
static String
MIRRORED
This property name is equivalent toCompareConfiguration.MIRRORED
however we redefine it for backwards compatibility.
-
Constructor Summary
Constructors Constructor Description EMFCompareConfiguration(org.eclipse.compare.CompareConfiguration compareConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.compare.CompareConfiguration
delegate()
void
dispose()
.void
disposeComparison()
dispose()
is only called when the comparison editor is closed, whereas EMFCompareConfiguration follows its own separate lifecycle.void
disposeListeners()
dispose()
is only called when the comparison editor is closed, whereas EMFCompareConfiguration are created and discarded on each change of the ContentMergeViewer input.AdapterFactory
getAdapterFactory()
org.eclipse.swt.graphics.Image
getAncestorImage(Object element)
String
getAncestorLabel(Object element)
boolean
getBooleanProperty(String key, boolean dflt)
Comparison
getComparison()
IComparisonScope
getComparisonScope()
IDiffRelationshipComputer
getDiffRelationshipComputer()
ICompareEditingDomain
getEditingDomain()
EMFCompare
getEMFComparator()
com.google.common.eventbus.EventBus
getEventBus()
org.eclipse.swt.graphics.Image
getLeftImage(Object element)
String
getLeftLabel(Object element)
MergeMode
getMergePreviewMode()
org.eclipse.swt.graphics.Image
getRightImage(Object element)
String
getRightLabel(Object element)
StructureMergeViewerFilter
getStructureMergeViewerFilter()
StructureMergeViewerGrouper
getStructureMergeViewerGrouper()
protected void
initStructureMergeViewerFilter(Comparison comparison, IComparisonScope comparisonScope)
protected void
initStructureMergeViewerGroupProvider(Comparison comparison, IComparisonScope comparisonScope)
void
setAdapterFactory(AdapterFactory adapterFactory)
void
setComparisonAndScope(Comparison newComparison, IComparisonScope newComparisonScope)
void
setDiffRelationshipComputer(IDiffRelationshipComputer diffRelationshipComputer)
void
setEditingDomain(ICompareEditingDomain newValue)
void
setEMFComparator(EMFCompare newComparator)
void
setLabelProvider(Class<? extends org.eclipse.compare.structuremergeviewer.ICompareInput> inputType, org.eclipse.compare.ICompareInputLabelProvider labelProvider)
void
setMergePreviewMode(MergeMode previewMergeMode)
-
Methods inherited from class org.eclipse.emf.compare.ide.ui.internal.configuration.ForwardingCompareConfiguration
addPropertyChangeListener, fireChange, getContainer, getImage, getImage, getLabelProvider, getPreferenceStore, getProperty, isChangeIgnored, isEditable, isLeftEditable, isMirrored, isRightEditable, removePropertyChangeListener, setAncestorImage, setAncestorLabel, setChangeIgnored, setContainer, setDefaultLabelProvider, setLabelProvider, setLeftEditable, setLeftImage, setLeftLabel, setProperty, setRightEditable, setRightImage, setRightLabel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfiguration
isLeftEditable, isMirrored, isRightEditable
-
-
-
-
Field Detail
-
DISPLAY_GROUP_PROVIDERS
public static final String DISPLAY_GROUP_PROVIDERS
- See Also:
- Constant Field Values
-
DISPLAY_FILTERS
public static final String DISPLAY_FILTERS
- See Also:
- Constant Field Values
-
DISPLAY_SAVE_ACTION
public static final String DISPLAY_SAVE_ACTION
- See Also:
- Constant Field Values
-
DISPLAY_SELECT_UNRESOLVED_DIFF_ACTIONS
public static final String DISPLAY_SELECT_UNRESOLVED_DIFF_ACTIONS
- See Also:
- Constant Field Values
-
MIRRORED
public static final String MIRRORED
This property name is equivalent toCompareConfiguration.MIRRORED
however we redefine it for backwards compatibility.- See Also:
- Constant Field Values
-
-
Method Detail
-
getEventBus
public com.google.common.eventbus.EventBus getEventBus()
- Specified by:
getEventBus
in interfaceIEMFCompareConfiguration
- See Also:
IEMFCompareConfiguration.getEventBus()
-
delegate
protected org.eclipse.compare.CompareConfiguration delegate()
- Specified by:
delegate
in classForwardingCompareConfiguration
- See Also:
ForwardingCompareConfiguration.delegate()
-
dispose
public void dispose()
.The lifecycle of the EMFCompareConfiguration (ECC) does not follow the lifecycle of its delegate CompareConfiguration (CC). CC are created once per comparison editor instance. The comparison editor lives from the moment the user starts a comparison to the moment the user closes the editor. In-between, the user will be able to switch from one content merge viewer (CMV) to another by changing his selection in the structure merge viewer (SMW). For example, selecting an EObject in the SMV will show tree representations of these EObject in the CMV, whilst selecting a text attribute in the SMW will switch the CMV representation to textual viewers. When switching CMV, the ECC needs a partial dispose in order to change its installed listeners (this will also happen when mirroring the comparison). Furthermore, the user will be able to switch the whole comparison from one file to another if he has selected multiple files for comparison (for example, by comparing in a compare dialog). When switching from one file to another, the whole EMF Compare comparison needs to change, and thus we need to dispose of the ECC, but the CC cannot be disposed at that time since its own lifecycle hasn't come to an end.
Because of this, there are three separate 'dispose' methods on an ECC. First is the inherited
dispose()
which will dispose of this whole ECC after disposing its delegate CC. Second isdisposeListeners()
which will only undertake a partial clean up of this ECC : listeners of the ECC are disposed, but not the Comparison itself, nor the delegate CC. Finally,disposeComparison()
will discard both the listeners and Comparison, but not the delegate CC.- Overrides:
dispose
in classForwardingCompareConfiguration
- See Also:
org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfiguration#dispose()
-
disposeListeners
public void disposeListeners()
dispose()
is only called when the comparison editor is closed, whereas EMFCompareConfiguration are created and discarded on each change of the ContentMergeViewer input. This will be called to dispose of the specific setup that was made by the EMFCompareConfiguration wrapper to its underlying CompareConfiguration. See documentation ofdispose()
.- See Also:
dispose()
-
disposeComparison
public void disposeComparison()
dispose()
is only called when the comparison editor is closed, whereas EMFCompareConfiguration follows its own separate lifecycle. See documentation ofdispose()
.- See Also:
dispose()
-
getBooleanProperty
public boolean getBooleanProperty(String key, boolean dflt)
- Specified by:
getBooleanProperty
in interfaceIEMFCompareConfiguration
-
getComparison
public Comparison getComparison()
- Specified by:
getComparison
in interfaceIEMFCompareConfiguration
-
getEMFComparator
public EMFCompare getEMFComparator()
- Specified by:
getEMFComparator
in interfaceIEMFCompareConfiguration
-
getEditingDomain
public ICompareEditingDomain getEditingDomain()
- Specified by:
getEditingDomain
in interfaceIEMFCompareConfiguration
-
getMergePreviewMode
public MergeMode getMergePreviewMode()
- Specified by:
getMergePreviewMode
in interfaceIEMFCompareConfiguration
-
getAdapterFactory
public AdapterFactory getAdapterFactory()
- Specified by:
getAdapterFactory
in interfaceIEMFCompareConfiguration
-
getDiffRelationshipComputer
public IDiffRelationshipComputer getDiffRelationshipComputer()
- Specified by:
getDiffRelationshipComputer
in interfaceIEMFCompareConfiguration
-
getComparisonScope
public IComparisonScope getComparisonScope()
- Specified by:
getComparisonScope
in interfaceIEMFCompareConfiguration
- See Also:
IEMFCompareConfiguration.getComparisonScope()
-
setEMFComparator
public void setEMFComparator(EMFCompare newComparator)
- Specified by:
setEMFComparator
in interfaceIEMFCompareConfiguration
-
setEditingDomain
public void setEditingDomain(ICompareEditingDomain newValue)
- Specified by:
setEditingDomain
in interfaceIEMFCompareConfiguration
-
setComparisonAndScope
public void setComparisonAndScope(Comparison newComparison, IComparisonScope newComparisonScope)
- Specified by:
setComparisonAndScope
in interfaceIEMFCompareConfiguration
- See Also:
org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfiguration#setComparisonAndScope(org.eclipse.emf.compare.scope.IComparisonScope, org.eclipse.emf.compare.Comparison)
-
initStructureMergeViewerGroupProvider
protected void initStructureMergeViewerGroupProvider(Comparison comparison, IComparisonScope comparisonScope)
-
initStructureMergeViewerFilter
protected void initStructureMergeViewerFilter(Comparison comparison, IComparisonScope comparisonScope)
-
setMergePreviewMode
public void setMergePreviewMode(MergeMode previewMergeMode)
- Specified by:
setMergePreviewMode
in interfaceIEMFCompareConfiguration
-
setAdapterFactory
public void setAdapterFactory(AdapterFactory adapterFactory)
- Specified by:
setAdapterFactory
in interfaceIEMFCompareConfiguration
-
setDiffRelationshipComputer
public void setDiffRelationshipComputer(IDiffRelationshipComputer diffRelationshipComputer)
- Specified by:
setDiffRelationshipComputer
in interfaceIEMFCompareConfiguration
-
getStructureMergeViewerGrouper
public StructureMergeViewerGrouper getStructureMergeViewerGrouper()
- Specified by:
getStructureMergeViewerGrouper
in interfaceIEMFCompareConfiguration
- See Also:
IEMFCompareConfiguration.getStructureMergeViewerGrouper()
-
getStructureMergeViewerFilter
public StructureMergeViewerFilter getStructureMergeViewerFilter()
- Specified by:
getStructureMergeViewerFilter
in interfaceIEMFCompareConfiguration
- See Also:
IEMFCompareConfiguration.getStructureMergeViewerFilter()
-
setLabelProvider
public void setLabelProvider(Class<? extends org.eclipse.compare.structuremergeviewer.ICompareInput> inputType, org.eclipse.compare.ICompareInputLabelProvider labelProvider)
-
getLeftLabel
public String getLeftLabel(Object element)
- Overrides:
getLeftLabel
in classForwardingCompareConfiguration
-
getLeftImage
public org.eclipse.swt.graphics.Image getLeftImage(Object element)
- Overrides:
getLeftImage
in classForwardingCompareConfiguration
-
getRightLabel
public String getRightLabel(Object element)
- Overrides:
getRightLabel
in classForwardingCompareConfiguration
-
getRightImage
public org.eclipse.swt.graphics.Image getRightImage(Object element)
- Overrides:
getRightImage
in classForwardingCompareConfiguration
-
getAncestorLabel
public String getAncestorLabel(Object element)
- Overrides:
getAncestorLabel
in classForwardingCompareConfiguration
-
getAncestorImage
public org.eclipse.swt.graphics.Image getAncestorImage(Object element)
- Overrides:
getAncestorImage
in classForwardingCompareConfiguration
-
-