Interface DiffMergeModelContext
-
- All Superinterfaces:
EMFFormsViewContext
,ViewModelContext
- All Known Implementing Classes:
DiffMergeModelContextImpl
public interface DiffMergeModelContext extends ViewModelContext
TheDiffMergeModelContext
extends theViewModelContext
and allows to retrieve two origin objects.- Author:
- Eugen Neufeld
- See Also:
ViewModelContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.java.util.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.emfforms.spi.core.services.view.EMFFormsViewContext
changeDomainModel, registerEMFFormsContextListener, registerRootDomainModelChangeListener, unregisterEMFFormsContextListener, unregisterRootDomainModelChangeListener
-
Methods inherited from interface org.eclipse.emf.ecp.view.spi.context.ViewModelContext
addContextUser, dispose, getChildContext, getChildContext, getContextValue, getControlsFor, getControlsFor, getDomainModel, getParentContext, getParentVElement, getService, getViewModel, hasService, pause, putContextValue, reactivate, registerDisposeListener, registerDomainChangeListener, registerViewChangeListener, removeContextUser, 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
- theVControl
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
- theVControl
to get the index for- Returns:
- the index of the control
-
getControl
VControl getControl(int diffIndex) throws java.lang.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 aIllegalArgumentException
will be thrown.- Parameters:
diffIndex
- the diff index to get the control for- Returns:
- the
VControl
- Throws:
java.lang.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
- theVControl
to check- Returns:
- true if is merged
-
markControl
void markControl(VControl vControl, boolean merged)
Mark a control as merged.- Parameters:
vControl
- theVControl
to be mergedmerged
- true if control is merged, false otherwise
-
getMergedDomainObjects
java.util.Set<VDomainModelReference> getMergedDomainObjects()
Returns the set of domainModelReferences which are merged.- Returns:
- the set of merged
VDomainModelReferences
-
-