Package com.nomagic.magicdraw.merge
Class CompareUtil
java.lang.Object
com.nomagic.magicdraw.merge.CompareUtil
- Direct Known Subclasses:
MergeUtil
Allows using MagicDraw project merge core to compare projects (find project differences).
See Open API manual for the usage details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProjectDifferencecompareProjects(Project project, ProjectDescriptor baseProjectDescriptor, ErrorHandler<Exception> errorHandler, Optimization optimization) Compare projects.static ProjectDifferencegetDifference(Project targetProject, ProjectDescriptor source, ProjectDescriptor ancestor, ErrorHandler<Exception> errorHandler, Optimization optimization) Discover project difference.static voidrestore(ProjectDifference difference) Dispose project difference.static voidshowDifferenceGUI(ProjectDifference projectDifference) Show project difference GUI.
-
Constructor Details
-
CompareUtil
public CompareUtil()
-
-
Method Details
-
compareProjects
@CheckForNull public static ProjectDifference compareProjects(Project project, ProjectDescriptor baseProjectDescriptor, ErrorHandler<Exception> errorHandler, Optimization optimization) throws IllegalStateException Compare projects. On success project difference is returned and the base project is active project.- Parameters:
project- target project.baseProjectDescriptor- source project descriptor.errorHandler- invoked if error occurs. Allows to perform custom action.optimization- optimization option.`- Returns:
- project difference.
- Throws:
IllegalStateException- if merge is not available
-
getDifference
@CheckForNull public static ProjectDifference getDifference(Project targetProject, ProjectDescriptor source, @CheckForNull ProjectDescriptor ancestor, ErrorHandler<Exception> errorHandler, Optimization optimization) throws IllegalStateException Discover project difference. On success project difference is returned and ancestor project is active project.- Parameters:
targetProject- target project.source- source project descriptor.ancestor- ancestor project descriptor. Used only for 3-way merge,nullfor 2-way merge.errorHandler- invoked if error occurs. Allows to perform custom action.optimization- optimization option.- Returns:
- project difference.
- Throws:
IllegalStateException- if merge is not available
-
restore
Dispose project difference.- Parameters:
difference- project difference.
-
showDifferenceGUI
public static void showDifferenceGUI(ProjectDifference projectDifference) throws IllegalStateException Show project difference GUI.- Parameters:
projectDifference- project difference.- Throws:
IllegalStateException- if diff is not available
-