org.eclipse.emf.ecp.diffmerge.spi.context
Interface DiffMergeModelContext

All Superinterfaces:
ViewModelContext
All Known Implementing Classes:
DiffMergeModelContextImpl

public interface DiffMergeModelContext
extends ViewModelContext

The DiffMergeModelContext extends the ViewModelContext and allows to retrieve two origin objects.

Author:
Eugen Neufeld
See Also:
ViewModelContext

Method Summary
 VControl getControl(int diffIndex)
          Returns the control based on the diff index.
 int getIndexOf(VControl control)
          Returns the diff index of a control.
 org.eclipse.emf.ecore.EObject getLeftModel()
          Gets the left model.
 Set<VDomainModelReference> getMergedDomainObjects()
          Returns the set of domainModelReferences which are merged.
 ControlPair getPairWithDiff(VControl control)
          Returns a pair containing the left and right control for the diff.
 org.eclipse.emf.ecore.EObject getRightModel()
          Gets the right model.
 int getTotalNumberOfDiffs()
          Returns the total number of differences.
 boolean hasDiff(VControl control)
          Checks whether a control has a diff.
 boolean isControlMerged(VControl vControl)
          Returns true if the control already was merged or doesn't have a difference at all.
 void markControl(VControl vControl, boolean merged)
          Mark a control as merged.
 
Methods inherited from interface org.eclipse.emf.ecp.view.spi.context.ViewModelContext
dispose, getControlsFor, getControlsFor, getDomainModel, getService, getViewModel, hasService, registerDomainChangeListener, registerViewChangeListener, unregisterDomainChangeListener, unregisterViewChangeListener
 

Method Detail

getLeftModel

org.eclipse.emf.ecore.EObject getLeftModel()
Gets the left model.

Returns:
the left model

getRightModel

org.eclipse.emf.ecore.EObject getRightModel()
Gets the right model.

Returns:
the right model

hasDiff

boolean hasDiff(VControl control)
Checks whether a control has a diff.

Parameters:
control - the VControl to check
Returns:
true if there is a difference

getPairWithDiff

ControlPair getPairWithDiff(VControl control)
Returns a pair containing the left and right control for the diff.

Parameters:
control - the control to get the pair for
Returns:
a pair or null if no diff exists for the provided control

getTotalNumberOfDiffs

int getTotalNumberOfDiffs()
Returns the total number of differences.

Returns:
the total number of differences

getIndexOf

int getIndexOf(VControl control)
Returns the diff index of a control. If the control does not have a diff the index will be -1.

Parameters:
control - the VControl to get the index for
Returns:
the index of the control

getControl

VControl getControl(int diffIndex)
                    throws IllegalArgumentException
Returns the control based on the diff index. If the index is less then 0 and greater or equals the total number of diff, then a IllegalArgumentException will be thrown.

Parameters:
diffIndex - the diff index to get the control for
Returns:
the VControl
Throws:
IllegalArgumentException - thrown if the index is invalid

isControlMerged

boolean isControlMerged(VControl vControl)
Returns true if the control already was merged or doesn't have a difference at all.

Parameters:
vControl - the VControl to check
Returns:
true if is merged

markControl

void markControl(VControl vControl,
                 boolean merged)
Mark a control as merged.

Parameters:
vControl - the VControl to be merged
merged - true if control is merged, false otherwise

getMergedDomainObjects

Set<VDomainModelReference> getMergedDomainObjects()
Returns the set of domainModelReferences which are merged.

Returns:
the set of merged VDomainModelReferences


Copyright © 2014. All Rights Reserved.