public interface OpenMergeDialogOperation
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.
Modifier and Type | Field and Description |
---|---|
static OperationType<OpenMergeDialogOperation> |
TYPE
Configurable operation providing means to merge two textual sources.
|
Modifier and Type | Method and Description |
---|---|
String |
perform(String originalText,
String modifiedText)
Opens a differential view on the original and modified texts.
|
void |
setDialogTitle(String title)
Sets the title of the dialog.
|
void |
setModifiedHeader(String header)
Sets the header for the modified text section.
|
void |
setOriginalHeader(String header)
Sets the header for the original text section.
|
static final OperationType<OpenMergeDialogOperation> TYPE
void setDialogTitle(@NotNull String title)
title
- The dialog title.void setOriginalHeader(@NotNull String header)
header
- The original text's header.void setModifiedHeader(@NotNull String header)
header
- The modified text's header.@Nullable String perform(@NotNull String originalText, @NotNull String modifiedText)
originalText
- The original text.modifiedText
- The modified text.null
, else.Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210