use of org.whole.lang.ui.commands.OverwriteTextCommand in project whole by wholeplatform.
the class TextualDirectEditEditPolicy method getOverwriteTextCommand.
private Command getOverwriteTextCommand(TextualRequest request) {
Command command;
ITextualEntityPart textualEntityPart = (ITextualEntityPart) getHost();
String contentToOverwrite = request.getContent();
if (textualEntityPart.hasSelectionRange()) {
command = createInsertOverSelectionCommand(textualEntityPart, contentToOverwrite);
} else {
OverwriteTextCommand overwrite = new OverwriteTextCommand();
overwrite.setEntity(textualEntityPart.getModelTextEntity());
overwrite.setViewer(textualEntityPart.getViewer());
overwrite.setData(contentToOverwrite);
command = overwrite;
}
return command;
}
Aggregations