Search in sources :

Example 6 with DBVObject

use of org.jkiss.dbeaver.model.virtual.DBVObject in project dbeaver by serge-rider.

the class ERDEditorEmbedded method doSave.

@Override
public void doSave(IProgressMonitor monitor) {
    try {
        // Save in virtual model as entity property.
        DBVObject vObject = this.getVirtualObject();
        if (vObject == null) {
            return;
        }
        Map<String, Object> diagramStateMap = new LinkedHashMap<>();
        vObject.setProperty(PROP_DIAGRAM_STATE, diagramStateMap);
        String diagramState = DiagramLoader.serializeDiagram(RuntimeUtils.makeMonitor(monitor), getDiagramPart(), getDiagram(), false, true);
        diagramStateMap.put(PROPS_DIAGRAM_SERIALIZED, diagramState);
        vObject.persistConfiguration();
        getCommandStack().markSaveLocation();
    } catch (Exception e) {
        log.error("Error saving diagram", e);
    }
    updateToolbarActions();
}
Also used : DBVObject(org.jkiss.dbeaver.model.virtual.DBVObject) DBSObject(org.jkiss.dbeaver.model.struct.DBSObject) DBException(org.jkiss.dbeaver.DBException) DBVObject(org.jkiss.dbeaver.model.virtual.DBVObject) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

DBException (org.jkiss.dbeaver.DBException)6 DBVObject (org.jkiss.dbeaver.model.virtual.DBVObject)6 DBSObject (org.jkiss.dbeaver.model.struct.DBSObject)4 StringReader (java.io.StringReader)2 LinkedHashMap (java.util.LinkedHashMap)2 EntityDiagram (org.jkiss.dbeaver.erd.ui.model.EntityDiagram)2 Document (org.w3c.dom.Document)2