Search in sources :

Example 1 with ContentEditorInput

use of org.jkiss.dbeaver.ui.editors.content.ContentEditorInput in project dbeaver by serge-rider.

the class XMLPanelEditor method primeEditorValue.

@Override
public void primeEditorValue(@NotNull DBRProgressMonitor monitor, @NotNull StyledText control, @NotNull DBDContent value) throws DBException {
    monitor.beginTask("Prime content value", 1);
    try {
        monitor.subTask("Prime XML value");
        IEditorInput sqlInput = new ContentEditorInput(valueController, null, null, monitor);
        editor.init(subSite, sqlInput);
    } catch (Exception e) {
        throw new DBException("Can't load XML vaue", e);
    } finally {
        monitor.done();
    }
}
Also used : DBException(org.jkiss.dbeaver.DBException) ContentEditorInput(org.jkiss.dbeaver.ui.editors.content.ContentEditorInput) IEditorInput(org.eclipse.ui.IEditorInput) DBCException(org.jkiss.dbeaver.model.exec.DBCException) DBException(org.jkiss.dbeaver.DBException) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with ContentEditorInput

use of org.jkiss.dbeaver.ui.editors.content.ContentEditorInput in project dbeaver by serge-rider.

the class XMLPanelEditor method extractEditorValue.

@Override
public void extractEditorValue(@NotNull DBRProgressMonitor monitor, @NotNull StyledText control, @NotNull DBDContent value) throws DBException {
    monitor.beginTask("Read XML value", 1);
    try {
        monitor.subTask("Read XML value");
        editor.doSave(RuntimeUtils.getNestedMonitor(monitor));
        final ContentEditorInput editorInput = (ContentEditorInput) editor.getEditorInput();
        editorInput.updateContentFromFile(RuntimeUtils.getNestedMonitor(monitor));
    } catch (Exception e) {
        throw new DBException("Error saving XML value", e);
    } finally {
        monitor.done();
    }
}
Also used : DBException(org.jkiss.dbeaver.DBException) ContentEditorInput(org.jkiss.dbeaver.ui.editors.content.ContentEditorInput) DBCException(org.jkiss.dbeaver.model.exec.DBCException) DBException(org.jkiss.dbeaver.DBException) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

PartInitException (org.eclipse.ui.PartInitException)2 DBException (org.jkiss.dbeaver.DBException)2 DBCException (org.jkiss.dbeaver.model.exec.DBCException)2 ContentEditorInput (org.jkiss.dbeaver.ui.editors.content.ContentEditorInput)2 IEditorInput (org.eclipse.ui.IEditorInput)1