Class HtmlDocumentComparisonParticipant
java.lang.Object
com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
com._1c.g5.v8.dt.internal.htmldocument.compare.HtmlDocumentComparisonParticipant
- All Implemented Interfaces:
IComparisonParticipant
Html document comparison participant.
-
Nested Class Summary
Nested classes/interfaces inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
AbstractEmfBasedComparisonParticipant.BmIdsWrapper, AbstractEmfBasedComparisonParticipant.EObjectClassFeatures
-
Field Summary
Fields inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
LOG_TYPES, pictureManager, projectFileSystemSupportProvider, qualifiedNameFilePathConverter, scopeProvider, topObjectFqnGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tells whether to able to break the correspondence for the specified node.addNewTopObjectToComparison
(IComparisonSession comparisonSession, String mainSymlink, org.eclipse.emf.ecore.EClass eClass) Adds a new node to the comparison for the top object.boolean
adoptExternalProperty
(IComparisonSession session, ExternalPropertyComparisonData extPropData) Adopts the given external property if it is supported by the participant instance.void
breakCorrespondence
(ComparisonContext comparisonContext, ComparisonNode node) Breaks the correspondence for the specified node.void
breakMainSideCorrespondence
(IComparisonSession session, ComparisonNode node) Breaks the main side correspondence represented by the specified model node.void
combineOneSideNodes
(ComparisonContext comparisonContext, ComparisonNode mainNode, ComparisonNode otherNode, List<Long> newNodeIds) Combines the specified two one-side nodes.compare
(TopComparisonNode node, ComparisonContext comparisonContext, org.eclipse.core.runtime.IProgressMonitor monitor) Compares objects contained in the specified model top node and returns a list of child nodes to be compared.protected ComparisonFlags
compareEmfObject
(TopComparisonNode topParent, LazyNodeProvider<? extends ComparisonNode> nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext) protected org.eclipse.emf.ecore.EObject
createImportedEObject
(org.eclipse.emf.ecore.EObject otherObject, IMergeSession mergeSession) createMergeContext
(TopComparisonNode node, IMergeSession mergeSession, ComparisonContext comparisonContext) Creates merge context for an upcoming merge operation.protected IEmfObjectMatcher
getCustomMatcher
(TopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext comparisonContext) Returns a custom matcher for the specified reference.getDefaultMergeRule
(ComparisonNode node, IComparisonSession session) Returns the default merge rule for the given node.getDefaultMustBeMerged
(ComparisonNode node, IComparisonSession session) Returns the default must be merged value for the given node.protected String
getExternalPropertyQualifyingType
(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference externalProperty) Returns the EClass of the specified external property of the specified EObject.protected String
getExternalPropertySymlink
(TopComparisonNode node, org.eclipse.emf.ecore.EReference externalProperty, ComparisonSide side, org.eclipse.emf.ecore.EObject eObject) Returns the symbolic link (FQN) of the specified external property.org.eclipse.emf.ecore.EPackage
Get EMF model package.getPotentialCorrespondingNodes
(ComparisonNode node, ComparisonSide sourceSide) Returns a list of candidate nodes for setting as corresponding to the specified node.protected org.eclipse.emf.ecore.EObject
importEmfObject
(MergeContext context, ComparisonNode mergingNode, org.eclipse.emf.ecore.EObject otherObject) protected boolean
isFeatureWithCustomMerge
(org.eclipse.emf.ecore.EStructuralFeature feature) org.eclipse.core.runtime.IStatus
merge
(TopComparisonNode node, MergeContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Merges the differences in the specified top node in the specified merge session.protected void
mergeEmfProperties
(MergeContext context, ComparisonNode mergingNode, AbstractComparedEmfObjects<?> mergingObjects) protected void
removeObjectFromListOnMerge
(MergeContext context, org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> mainList, org.eclipse.emf.ecore.EObject mainObject) Removes the given object from the given list on the MAIN side during the merge phase.retrieveComparedObjects
(ComparisonContext comparisonContext, ComparisonNode node) Returns a comparedEObject
s triple for the specified model node.boolean
supports
(ComparisonNode node) Indicates whether the participant supports comparison and merging of the specified node.void
updateComparison
(ComparisonContext comparisonContext, ComparisonNode node, List<Long> newNodeIds) Updates comparison for the given result node.void
validateMerge
(IMergeSession mergeSession, ComparisonContext comparisonContext, ComparisonNode node, List<MergeValidationProblem> validationProblems) Validates the process of merge of the specified model node.Methods inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
adaptOtherReference, adoptEClassToImport, adoptMainSideFeature, areDifferentEClassObjectsMergeable, assertEClassesMatch, calculateCompareValueFlags, checkForOneSideConflict, clear, compareEmfContainment, compareOneSideObject, comparePictureResource, compareReference, compareValue, createClassFeaturesInstance, createResourceForImportedObject, deletePictureResourceFile, findChildNodeByFeature, findChildNodeByMatchedId, getClassFeatures, getClassFeatures, getFeaturesToCompareForOneSideObject, getFeatureTypeDescription, getForcedDDRebuildScope, getMultiReferenceSymlinks, getMultiReferenceValueSymlink, getNodeFactory, getOtherSideFeature, getPictureResourcePath, getPotentialMergeProblemsDescriptions, getQualifiedName, getSingleReferenceSymlink, getTopNode, hasConflictChangesInCollection, importPictureResourceFile, isBmIdMayChangeOnMerge, isCandidateForPotentialMergeProblems, isExcludedFromComparison, isUnmatchableContainment, matchEmfObjects, mergeEmfReference, mergeOtherContainment, mergeUsingExternalTool, needCreateOneSideNode, onChildrenMerged, prepareRenameOperations, removeObjectFromContainerOnMerge, restoreCustomSettings, saveCustomSettings, setObjectToContainerOnMerge, skipFeatureOnImportEmfObject, supportsCustomMerging, supportsMergingUsingExternalTool, supportsPrioritizedMerging, translateReferencesInImportedObject, updatePictureResourceFile, wrapOtherReference
-
Constructor Details
-
HtmlDocumentComparisonParticipant
public HtmlDocumentComparisonParticipant()
-
-
Method Details
-
supports
Description copied from interface:IComparisonParticipant
Indicates whether the participant supports comparison and merging of the specified node.- Parameters:
node
- the node, notnull
- Returns:
true
if the participant supports comparison and merging,false
otherwise
-
getModelPackage
public org.eclipse.emf.ecore.EPackage getModelPackage()Description copied from interface:IComparisonParticipant
Get EMF model package.- Returns:
- the EMF model packge. Never code
null
.
-
compare
public List<Long> compare(TopComparisonNode node, ComparisonContext comparisonContext, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IComparisonParticipant
Compares objects contained in the specified model top node and returns a list of child nodes to be compared.- Parameters:
node
- the top node to run comparison for, notnull
comparisonContext
- the comparison context, notnull
monitor
- the progress monitor, can benull
. The clients are not supposed to report work to the monitor, except for the top object matching phase- Returns:
- a list of model node identifiers, never
null
-
merge
public org.eclipse.core.runtime.IStatus merge(TopComparisonNode node, MergeContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IComparisonParticipant
Merges the differences in the specified top node in the specified merge session. This may include deletion of the main object if the other object is absent, or, conversely, import ("copying") of the other object if the main object is absent.- Parameters:
node
- the top node to run merge for, notnull
context
- the current merge context, notnull
monitor
- the progress monitor, notnull
- Returns:
- the result of the merge operation
-
createMergeContext
public MergeContext createMergeContext(TopComparisonNode node, IMergeSession mergeSession, ComparisonContext comparisonContext) Description copied from interface:IComparisonParticipant
Creates merge context for an upcoming merge operation.- Parameters:
node
- the top node to be merged, notnull
mergeSession
- the current merge session, notnull
comparisonContext
- the comparison context, notnull
- Returns:
-
getPotentialCorrespondingNodes
public List<ComparisonNode> getPotentialCorrespondingNodes(ComparisonNode node, ComparisonSide sourceSide) Description copied from interface:IComparisonParticipant
Returns a list of candidate nodes for setting as corresponding to the specified node.- Parameters:
node
- the comparison result node to find potential correspondences for, notnull
sourceSide
- the source side of the correspondence, notnull
- Returns:
- a list of comparison result nodes, may be empty, never
null
-
breakCorrespondence
Description copied from interface:IComparisonParticipant
Breaks the correspondence for the specified node.- Parameters:
comparisonContext
- the comparison context, notnull
node
- the node with the correspondence to break, notnull
-
updateComparison
public void updateComparison(ComparisonContext comparisonContext, ComparisonNode node, List<Long> newNodeIds) Description copied from interface:IComparisonParticipant
Updates comparison for the given result node. Participants could introduce their own specific logic for managing internal states on comparison update.- Parameters:
comparisonContext
- the comparison context, notnull
node
- the node to update comparison for, notnull
newNodeIds
- the list of created new node Ids to fill, notnull
-
addNewTopObjectToComparison
public TopComparisonNode addNewTopObjectToComparison(IComparisonSession comparisonSession, String mainSymlink, org.eclipse.emf.ecore.EClass eClass) Description copied from interface:IComparisonParticipant
Adds a new node to the comparison for the top object. Participants could introduce their own specific logic for managing internal states on comparison update.- Parameters:
comparisonSession
- the comparison session hosting the model, notnull
mainSymlink
- the symlink for the top object to add, notnull
eClass
- of the object ot add, notnull
- Returns:
- The created result node for the object if supports.
null
otherwise.
-
combineOneSideNodes
public void combineOneSideNodes(ComparisonContext comparisonContext, ComparisonNode mainNode, ComparisonNode otherNode, List<Long> newNodeIds) Description copied from interface:IComparisonParticipant
Combines the specified two one-side nodes. The participant fills array of new node Ids created while combining the specified nodes. These node Ids must be scheduled for comparison in the external code.- Parameters:
comparisonContext
- the comparison context, notnull
mainNode
- the one-side MAIN node to be combined, notnull
otherNode
- the one-side OTHER node to be combined, notnull
newNodeIds
- the list of new node Ids to fill, notnull
-
ableToBreakCorrespondence
Description copied from interface:IComparisonParticipant
Tells whether to able to break the correspondence for the specified node.- Parameters:
node
- the comparison node to check, notnull
- Returns:
true
if it is possible to break the correspondence,false
otherwise
-
retrieveComparedObjects
public ComparedHtmlDocumentObjects retrieveComparedObjects(ComparisonContext comparisonContext, ComparisonNode node) Description copied from interface:IComparisonParticipant
Returns a comparedEObject
s triple for the specified model node.- Parameters:
comparisonContext
- the comparison context, notnull
node
- the model node, cannot benull
- Returns:
- the compared objects triple, never
null
-
validateMerge
public void validateMerge(IMergeSession mergeSession, ComparisonContext comparisonContext, ComparisonNode node, List<MergeValidationProblem> validationProblems) Description copied from interface:IComparisonParticipant
Validates the process of merge of the specified model node.- Parameters:
mergeSession
- the merge session, notnull
comparisonContext
- the comparison context, notnull
node
- the model nodevalidationProblems
- the list of collected validation problems to add new problem to
-
adoptExternalProperty
public boolean adoptExternalProperty(IComparisonSession session, ExternalPropertyComparisonData extPropData) Description copied from interface:IComparisonParticipant
Adopts the given external property if it is supported by the participant instance. If adopting is possible, the method fills the provided comparison data container by its own data to be used for adoption.- Parameters:
session
- the comparison session, notnull
extPropData
- the data of the external property to be adopted, cannot benull
- Returns:
true
if adopting is possible,false
otherwise
-
breakMainSideCorrespondence
Description copied from interface:IComparisonParticipant
Breaks the main side correspondence represented by the specified model node.- Parameters:
session
- the comparison session hosting the model, can not benull
node
- the node with the correspondence to break, can not benull
-
getDefaultMergeRule
Description copied from interface:IComparisonParticipant
Returns the default merge rule for the given node.- Parameters:
node
- the node to get default merge rule for, can not benull
session
- the comparison session, can not benull
- Returns:
- the default merge rule or
null
if it wasn't specified
-
getDefaultMustBeMerged
Description copied from interface:IComparisonParticipant
Returns the default must be merged value for the given node.- Parameters:
node
- the node to get default must be merged value for, can not benull
session
- the comparison session, can not benull
- Returns:
- the default must be merged value or
null
if it wasn't specified
-
createImportedEObject
protected org.eclipse.emf.ecore.EObject createImportedEObject(org.eclipse.emf.ecore.EObject otherObject, IMergeSession mergeSession) - Specified by:
createImportedEObject
in classAbstractEmfBasedComparisonParticipant
-
isFeatureWithCustomMerge
protected boolean isFeatureWithCustomMerge(org.eclipse.emf.ecore.EStructuralFeature feature) - Specified by:
isFeatureWithCustomMerge
in classAbstractEmfBasedComparisonParticipant
-
getExternalPropertySymlink
protected String getExternalPropertySymlink(TopComparisonNode node, org.eclipse.emf.ecore.EReference externalProperty, ComparisonSide side, org.eclipse.emf.ecore.EObject eObject) Description copied from class:AbstractEmfBasedComparisonParticipant
Returns the symbolic link (FQN) of the specified external property.- Specified by:
getExternalPropertySymlink
in classAbstractEmfBasedComparisonParticipant
- Parameters:
node
- the node with the external propertyexternalProperty
- theEReference
to the external propertyside
- the comparison sideeObject
- theEObject
referencing the external property- Returns:
- the symbolic link
-
getExternalPropertyQualifyingType
protected String getExternalPropertyQualifyingType(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference externalProperty) Description copied from class:AbstractEmfBasedComparisonParticipant
Returns the EClass of the specified external property of the specified EObject.- Specified by:
getExternalPropertyQualifyingType
in classAbstractEmfBasedComparisonParticipant
- Returns:
-
compareEmfObject
protected ComparisonFlags compareEmfObject(TopComparisonNode topParent, LazyNodeProvider<? extends ComparisonNode> nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext) - Overrides:
compareEmfObject
in classAbstractEmfBasedComparisonParticipant
-
getCustomMatcher
protected IEmfObjectMatcher getCustomMatcher(TopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext comparisonContext) Description copied from class:AbstractEmfBasedComparisonParticipant
Returns a custom matcher for the specified reference.- Overrides:
getCustomMatcher
in classAbstractEmfBasedComparisonParticipant
- Parameters:
topNode
- the top nodereference
- the reference to get a custom matcher forcomparisonContext
- the current comparison context, cannot benull
- Returns:
- a custom matcher or
null
if no custom matcher can be found
-
importEmfObject
protected org.eclipse.emf.ecore.EObject importEmfObject(MergeContext context, ComparisonNode mergingNode, org.eclipse.emf.ecore.EObject otherObject) - Overrides:
importEmfObject
in classAbstractEmfBasedComparisonParticipant
-
mergeEmfProperties
protected void mergeEmfProperties(MergeContext context, ComparisonNode mergingNode, AbstractComparedEmfObjects<?> mergingObjects) - Overrides:
mergeEmfProperties
in classAbstractEmfBasedComparisonParticipant
-
removeObjectFromListOnMerge
protected void removeObjectFromListOnMerge(MergeContext context, org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> mainList, org.eclipse.emf.ecore.EObject mainObject) Description copied from class:AbstractEmfBasedComparisonParticipant
Removes the given object from the given list on the MAIN side during the merge phase. Override in descendants if need customized behavior on deletion.- Overrides:
removeObjectFromListOnMerge
in classAbstractEmfBasedComparisonParticipant
- Parameters:
context
- the merge context, cannot benull
mainList
- the list to remove the object from, cannot benull
mainObject
- the object to be removed, cannot benull
-