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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object openDiffFilesApplication​(java.lang.String leftLabelText, java.net.URL leftURL, java.lang.String rightLabelText, java.net.URL rightURL)
      Open the diff files tool with initial left and right URLs to compare.
      java.lang.Object openDiffFilesApplication​(java.lang.String leftLabelText, java.net.URL leftURL, java.lang.String rightLabelText, java.net.URL rightURL, java.net.URL ancestorURL, boolean showAncestorURLPanel)
      Open the diff files tool with initial left and right URLs to compare.
      java.lang.Object openDiffFilesApplication​(java.net.URL leftURL, java.net.URL rightURL)
      Open the diff files tool with initial left and right URLs to compare.
      java.lang.Object openDiffFilesApplication​(java.net.URL leftURL, java.net.URL rightURL, java.net.URL ancestorURL)
      Open the diff files tool with initial left and right URLs to compare.
      java.util.List<MergedFileState> openMergeApplication​(java.io.File baseDir, java.io.File personalModifiedFilesDir, java.io.File externalModifiedFilesDir, java.util.Map<java.lang.String,​java.lang.String> mergeOptions)
      Displays a modal dialog that allows you to see and accept/reject the differences between the provided files.
      boolean openMergeApplication​(java.lang.String dialogTitle, java.lang.String applyButtonText, boolean applyAllChangesInitialy, java.lang.String leftLabelText, java.net.URL leftURL, boolean leftURLEditable, boolean leftURLModified, java.lang.String rightLabelText, java.net.URL rightURL, boolean rightEditorEditable, boolean rightURLModified, java.net.URL ancestorURL)
      Open the merge tool with initial left and right URLs to compare.
      java.util.List<java.net.URL> openPreviewDialog​(java.lang.String title, java.lang.String previewButtonName, java.util.LinkedHashMap<java.net.URL,​java.net.URL> resourcesMap)
      Open the modal preview dialog.
    • Method Detail

      • openDiffFilesApplication

        java.lang.Object openDiffFilesApplication​(java.lang.String leftLabelText,
                                                  java.net.URL leftURL,
                                                  java.lang.String rightLabelText,
                                                  java.net.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. When null, 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 be null.
        rightLabelText - The right - side label text. When null, 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 be null.
        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

        java.lang.Object openDiffFilesApplication​(java.net.URL leftURL,
                                                  java.net.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:
        leftURL - The left-side URL to diff. Can be null.
        rightURL - The right-side URL to diff. Can be null.
        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

        java.lang.Object openDiffFilesApplication​(java.net.URL leftURL,
                                                  java.net.URL rightURL,
                                                  java.net.URL ancestorURL)
        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 is null 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 be null.
        rightURL - The right-side URL to diff. Can be null.
        ancestorURL - The ancestor (base) URL to diff. Can be null.
        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

        java.lang.Object openDiffFilesApplication​(java.lang.String leftLabelText,
                                                  java.net.URL leftURL,
                                                  java.lang.String rightLabelText,
                                                  java.net.URL rightURL,
                                                  java.net.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 is null 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. When null, 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 be null.
        rightLabelText - The right - side label text. When null, 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 be null.
        ancestorURL - The ancestor (base) URL to diff. Can be null.
        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

        java.util.List<MergedFileState> openMergeApplication​(java.io.File baseDir,
                                                             java.io.File personalModifiedFilesDir,
                                                             java.io.File externalModifiedFilesDir,
                                                             java.util.Map<java.lang.String,​java.lang.String> mergeOptions)
                                                      throws MergeFilesException
        Displays 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:
        1. 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.
        2. 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.
        3. 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.
        For example, let's say that both baseDir and personalModifiedFilesDir contain a file named 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, the flowers.dita file from the personalModifiedFilesDir directory will be removed. When closing the dialog by pressing "OK", this method will return a list containing a single MergedFileState object, with MergedFileState.MergeStatus.DELETED state, pointing to the flowers.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 in MergeFilesOptionsConstants.
        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

        java.util.List<java.net.URL> openPreviewDialog​(java.lang.String title,
                                                       java.lang.String previewButtonName,
                                                       java.util.LinkedHashMap<java.net.URL,​java.net.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. If null it defaults to "Preview"
        previewButtonName - The preview button name. If null 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​(java.lang.String dialogTitle,
                                     java.lang.String applyButtonText,
                                     boolean applyAllChangesInitialy,
                                     java.lang.String leftLabelText,
                                     java.net.URL leftURL,
                                     boolean leftURLEditable,
                                     boolean leftURLModified,
                                     java.lang.String rightLabelText,
                                     java.net.URL rightURL,
                                     boolean rightEditorEditable,
                                     boolean rightURLModified,
                                     java.net.URL ancestorURL)
                              throws java.io.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 is null 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. When null, 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 be null.
        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. When null, 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 be null.
        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 be null.
        Returns:
        true if the user clicked "Apply" to perform the merge, false if the user closed the dialog without merging.
        Throws:
        java.io.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.