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 Summary

    Fields
    Modifier and Type
    Field
    Description
    Configurable operation providing means to merge two textual sources.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    perform(@NotNull String originalText, @NotNull String modifiedText)
    Opens a differential view on the original and modified texts.
    void
    setDialogTitle(@NotNull String title)
    Sets the title of the dialog.
    void
    setModifiedHeader(@NotNull String header)
    Sets the header for the modified text section.
    void
    setOriginalHeader(@NotNull String header)
    Sets the header for the original text section.
  • Field Details

  • Method Details

    • setDialogTitle

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

      void setOriginalHeader(@NotNull @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 @NotNull String header)
      Sets the header for the modified text section.
      Parameters:
      header - The modified text's header.
      Since:
      5.2.303
    • perform

      @Nullable @Nullable String perform(@NotNull @NotNull String originalText, @NotNull @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