Interface OpenMergeDialogOperation


public interface OpenMergeDialogOperation
Configurable operation providing means to merge two textual sources.

Example usage from within a Script:

 import de.espirit.firstspirit.agency.OperationAgent;
 import de.espirit.firstspirit.ui.operations.OpenMergeDialogOperation;

 operationAgent = context.requireSpecialist(OperationAgent.TYPE);
 operation = operationAgent.getOperation(OpenMergeDialogOperation.TYPE);
 operation.setDialogTitle("Title");
 operation.setOriginalHeader("Original");
 operation.setModifiedHeader("Modified");
 originalText = "Deleted\nSome\nOriginal\nText";
 modifiedText = "Some\nModified\nText\nInserted";
 resultingText = operation.perform(originalText, modifiedText);

 print("Merge result = '" + resultingText + "'");
 return 0;
 

The example will show a three column window having the original text on the left hand side, the modified text on the right hand side, and the original text with applied changes in the middle.

Since:
5.2.303
  • Field Details

  • Method Details

    • setDialogTitle

      void setDialogTitle(@NotNull String title)
      Sets the title of the dialog.
      Parameters:
      title - The dialog title.
      Since:
      5.2.303
    • setOriginalHeader

      void setOriginalHeader(@NotNull String header)
      Sets the header for the original text section.
      Parameters:
      header - The original text's header.
      Since:
      5.2.303
    • setModifiedHeader

      void setModifiedHeader(@NotNull String header)
      Sets the header for the modified text section.
      Parameters:
      header - The modified text's header.
      Since:
      5.2.303
    • perform

      @Nullable String perform(@NotNull String originalText, @NotNull String modifiedText)
      Opens a differential view on the original and modified texts.
      Parameters:
      originalText - The original text.
      modifiedText - The modified text.
      Returns:
      The resulting text, if a merge was successfully completed, null, else.
      Since:
      5.2.303