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
Modifier and TypeFieldDescriptionstatic final OperationType<OpenMergeDialogOperation>
Configurable operation providing means to merge two textual sources. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
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
-
TYPE
Configurable operation providing means to merge two textual sources.- Since:
- 5.2.303
-
-
Method Details
-
setDialogTitle
Sets the title of the dialog.- Parameters:
title
- The dialog title.- Since:
- 5.2.303
-
setOriginalHeader
Sets the header for the original text section.- Parameters:
header
- The original text's header.- Since:
- 5.2.303
-
setModifiedHeader
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
-