use of org.jkiss.dbeaver.model.data.storage.StringContentStorage in project dbeaver by dbeaver.
the class AbstractTextPanelEditor method extractEditorValue.
@Override
public void extractEditorValue(@NotNull DBRProgressMonitor monitor, @NotNull StyledText control, @NotNull DBDContent value) throws DBException {
if (valueController.getValue() instanceof DBDContent) {
monitor.beginTask("Extract text", 1);
try {
monitor.subTask("Extracting text from editor");
editor.doSave(RuntimeUtils.getNestedMonitor(monitor));
final IEditorInput editorInput = editor.getEditorInput();
if (editorInput instanceof ContentEditorInput) {
final ContentEditorInput contentEditorInput = (ContentEditorInput) editorInput;
contentEditorInput.updateContentFromFile(monitor, value);
}
} catch (Exception e) {
throw new DBException("Error extracting text from editor", e);
} finally {
monitor.done();
}
} else {
value.updateContents(monitor, new StringContentStorage(control.getText()));
}
}
Aggregations