Interface DiffAndMergeTools
- All Known Subinterfaces:
StandalonePluginWorkspace
,WebappPluginWorkspace
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface DiffAndMergeTools
Tools used for executing operations like finding differences between files and folders,
or merging different files.
- Since:
- 18.1
-
Method Summary
Modifier and TypeMethodDescriptionopenDiffFilesApplication
(String leftLabelText, URL leftURL, String rightLabelText, URL rightURL) Open the diff files tool with initial left and right URLs to compare.openDiffFilesApplication
(String leftLabelText, URL leftURL, String rightLabelText, URL rightURL, URL ancestorURL, boolean showAncestorURLPanel) Open the diff files tool with initial left and right URLs to compare.openDiffFilesApplication
(URL leftURL, URL rightURL) Open the diff files tool with initial left and right URLs to compare.openDiffFilesApplication
(URL leftURL, URL rightURL, URL ancestorURL) Open the diff files tool with initial left and right URLs to compare.openMergeApplication
(File baseDir, File personalModifiedFilesDir, File externalModifiedFilesDir, Map<String, String> mergeOptions) Displays a modal dialog that allows you to see and accept/reject the differences between the provided files.boolean
openMergeApplication
(String dialogTitle, String applyButtonText, boolean applyAllChangesInitialy, String leftLabelText, URL leftURL, boolean leftURLEditable, boolean leftURLModified, String rightLabelText, URL rightURL, boolean rightEditorEditable, boolean rightURLModified, URL ancestorURL) Open the merge tool with initial left and right URLs to compare.openPreviewDialog
(String title, String previewButtonName, LinkedHashMap<URL, URL> resourcesMap) Open the modal preview dialog.
-
Method Details
-
openDiffFilesApplication
Object openDiffFilesApplication(String leftLabelText, URL leftURL, String rightLabelText, URL rightURL) Open the diff files tool with initial left and right URLs to compare. The comparison will begin automatically and the content types for the URLs will be auto-detected. This works only when the API is used in the standalone version of Oxygen.- Parameters:
leftLabelText
- The left - side label text. Whennull
, the leftURL value is presented in the files comparison tool. When specified, it is presented instead of the leftURL value.leftURL
- The left-side URL to diff. Can benull
.rightLabelText
- The right - side label text. Whennull
, the rightURL value is presented in the files comparison tool. When specified, it is presented instead of the rightURL value.rightURL
- The right-side URL to diff. Can benull
.- Returns:
- The shown non-modal swing JFrame or
null
if a frame is not shown. You can use that to add a close listener for example. - Since:
- 23.1
-
openDiffFilesApplication
Open the diff files tool with initial left and right URLs to compare. The comparison will begin automatically and the content types for the URLs will be auto-detected. This works only when the API is used in the standalone version of Oxygen.- Parameters:
leftURL
- The left-side URL to diff. Can benull
.rightURL
- The right-side URL to diff. Can benull
.- Returns:
- The shown non-modal swing JFrame or
null
if a frame is not shown. You can use that to add a close listener for example. - Since:
- 18
-
openDiffFilesApplication
Open the diff files tool with initial left and right URLs to compare. If the ancestor URL is specified the comparison will be performed in three-way mode. The left and right URLs will be compared relatively to the ancestor (base) URL. If the ancestor URL isnull
the comparison will be performed in two-way mode. The comparison will begin automatically and the content types for the URLs will be auto-detected. This works only when the API is used in the standalone version of Oxygen.- Parameters:
leftURL
- The left-side URL to diff. Can benull
.rightURL
- The right-side URL to diff. Can benull
.ancestorURL
- The ancestor (base) URL to diff. Can benull
.- Returns:
- The shown non-modal swing JFrame or
null
if a frame is not shown. You can use that to add a close listener for example. - Since:
- 18.1
-
openDiffFilesApplication
Object openDiffFilesApplication(String leftLabelText, URL leftURL, String rightLabelText, URL rightURL, URL ancestorURL, boolean showAncestorURLPanel) Open the diff files tool with initial left and right URLs to compare. If the ancestor URL is specified the comparison will be performed in three-way mode. The left and right URLs will be compared relatively to the ancestor (base) URL. If the ancestor URL isnull
the comparison will be performed in two-way mode. The comparison will begin automatically and the content types for the URLs will be auto-detected. This works only when the API is used in the standalone version of Oxygen.- Parameters:
leftLabelText
- The left - side label text. Whennull
, the leftURL value is presented in the files comparison tool. When specified, it is presented instead of the leftURL value.leftURL
- The left-side URL to diff. Can benull
.rightLabelText
- The right - side label text. Whennull
, the rightURL value is presented in the files comparison tool. When specified, it is presented instead of the rightURL value.rightURL
- The right-side URL to diff. Can benull
.ancestorURL
- The ancestor (base) URL to diff. Can benull
.showAncestorURLPanel
- True if should show the ancestor url panel in a three way comparison- Returns:
- The shown non-modal swing JFrame or
null
if a frame is not shown. You can use that to add a close listener for example. - Since:
- 23.1
-
openMergeApplication
List<MergedFileState> openMergeApplication(File baseDir, File personalModifiedFilesDir, File externalModifiedFilesDir, Map<String, String> mergeOptions) throws MergeFilesExceptionDisplays a modal dialog that allows you to see and accept/reject the differences between the provided files. These differences are obtained as a result of a three-way comparison between:- the base files - the ones located in the baseDir directory. These are the initial files, before any changes were made by your or by others.
- the personal modified files - the ones located in the personalModifiedFilesDir directory.
These are actually the base files after they were modified by you. These files will be opened in the left side of the comparison tool.
OBS: The files are modified during the merging. - the external modified files - the ones located in the externalModifiedFilesDir directory.
These are actually the base files after they were modified by others. These files will be opened in the right side of the comparison tool.
These files are not touched by the merging.
flowers.dita
, but the file is missing from the externalModifiedFilesDir folder. This means that the dialog will present a delete file modification. If you accepted this modification, theflowers.dita
file from the personalModifiedFilesDir directory will be removed. When closing the dialog by pressing "OK", this method will return a list containing a singleMergedFileState
object, withMergedFileState.MergeStatus.DELETED
state, pointing to theflowers.dita
file from personalModifiedFilesDir.- Parameters:
baseDir
- The directory containing initial, unaltered files.personalModifiedFilesDir
- The directory containing the files modified by you. These files are modified during the merging.externalModifiedFilesDir
- The directory containing the files modified by others.mergeOptions
- The options used in the merge operation. The keys that can be used in this map are found inMergeFilesOptionsConstants
.- Returns:
- The list of merged files states. Each entry from this list corresponds to a
merged file and contains information about the file location and the merging result (deleted, added, modified).
The list is
null
when the dialog is canceled. - Throws:
MergeFilesException
- Exception thrown in case the merge operation fails.- Since:
- 18.1
-
openPreviewDialog
List<URL> openPreviewDialog(String title, String previewButtonName, LinkedHashMap<URL, URL> resourcesMap) Open the modal preview dialog. The resources are presented in the order in which they are placed in the map.- Parameters:
title
- The dialog title. Ifnull
it defaults to "Preview"previewButtonName
- The preview button name. Ifnull
it defaults to "Update".resourcesMap
- A map between an URL containing the initial content and an URL containing the modified content.- Returns:
- The list of selected resources,
null
if user cancels dialog. - Since:
- 26.0
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-
openMergeApplication
boolean openMergeApplication(String dialogTitle, String applyButtonText, boolean applyAllChangesInitialy, String leftLabelText, URL leftURL, boolean leftURLEditable, boolean leftURLModified, String rightLabelText, URL rightURL, boolean rightEditorEditable, boolean rightURLModified, URL ancestorURL) throws IOException Open the merge tool with initial left and right URLs to compare. The tool is presented in a modal dialog. The content in the right part is read only and can be merged to the left part. If the ancestor URL is specified the comparison will be performed in three-way mode. The left and right URLs will be compared relatively to the ancestor (base) URL. If the ancestor URL isnull
the comparison will be performed in two-way mode. The comparison will begin automatically and the content types for the URLs will be auto-detected. This works only when the API is used in the standalone version of Oxygen.- Parameters:
dialogTitle
- The title of the dialog. By default it is named "Merge"applyButtonText
- The text for the "Apply" button, by default it is "Apply".applyAllChangesInitialy
-true
to apply all changes from the not editable to the editable panel if Apply is pressed just after the dialog is opened.leftLabelText
- The left - side label text. Whennull
, the leftURL value is presented in the files comparison tool. When specified, it is presented instead of the leftURL value.leftURL
- The left-side URL to diff. Can benull
.leftURLEditable
-true
if the left editor is editable.leftURLModified
-true
to assume the left URL modified from the very beginning.rightLabelText
- The right - side label text. Whennull
, the rightURL value is presented in the files comparison tool. When specified, it is presented instead of the rightURL value.rightURL
- The right-side URL to diff. Can benull
.rightEditorEditable
-true
if the right editor is editable.rightURLModified
-true
to assume the right URL modified from the very beginning.ancestorURL
- The ancestor (base) URL to diff. Can benull
.- Returns:
true
if the user clicked "Apply" to perform the merge,false
if the user closed the dialog without merging.- Throws:
IOException
- If failed to save the content of the modified documents if "Apply" is clicked.- Since:
- 26.0
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-