Search in sources :

Example 6 with PostgreSchema

use of org.jkiss.dbeaver.ext.postgresql.model.PostgreSchema in project dbeaver by serge-rider.

the class PostgreToolRestore method execute.

@Override
public void execute(IWorkbenchWindow window, IWorkbenchPart activePart, Collection<DBSObject> objects) throws DBException {
    for (DBSObject object : objects) {
        PostgreDatabase database;
        if (object instanceof PostgreSchema) {
            database = ((PostgreSchema) object).getDatabase();
        } else if (object instanceof PostgreDatabase) {
            database = (PostgreDatabase) object;
        } else {
            continue;
        }
        ToolWizardDialog dialog = new ToolWizardDialog(window, new PostgreRestoreWizard(database));
        dialog.open();
    }
}
Also used : DBSObject(org.jkiss.dbeaver.model.struct.DBSObject) ToolWizardDialog(org.jkiss.dbeaver.ui.dialogs.tools.ToolWizardDialog) PostgreDatabase(org.jkiss.dbeaver.ext.postgresql.model.PostgreDatabase) PostgreSchema(org.jkiss.dbeaver.ext.postgresql.model.PostgreSchema)

Aggregations

PostgreSchema (org.jkiss.dbeaver.ext.postgresql.model.PostgreSchema)6 PostgreTableBase (org.jkiss.dbeaver.ext.postgresql.model.PostgreTableBase)3 DBSObject (org.jkiss.dbeaver.model.struct.DBSObject)3 DBException (org.jkiss.dbeaver.DBException)2 ToolWizardDialog (org.jkiss.dbeaver.ui.dialogs.tools.ToolWizardDialog)2 SashForm (org.eclipse.swt.custom.SashForm)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 PostgreDataSource (org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource)1 PostgreDatabase (org.jkiss.dbeaver.ext.postgresql.model.PostgreDatabase)1 PostgreRole (org.jkiss.dbeaver.ext.postgresql.model.PostgreRole)1 SQLDatabasePersistAction (org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)1 CustomSashForm (org.jkiss.dbeaver.ui.controls.CustomSashForm)1