Search in sources :

Example 1 with TableDashboardInput

use of com.cubrid.common.ui.cubrid.table.dashboard.control.TableDashboardInput in project cubrid-manager by CUBRID.

the class OpenTargetAction method showTableDashboard.

public void showTableDashboard(CubridDatabase database) {
    if (database == null) {
        return;
    }
    if (database.getDatabaseInfo() == null || !JDBCConnectionManager.isConnectable(database.getDatabaseInfo())) {
        return;
    }
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window == null) {
        return;
    }
    TableDashboardInput input = new TableDashboardInput(database);
    TableDashboardPart tablesDetailInfoPart = (TableDashboardPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findEditor(input);
    if (tablesDetailInfoPart == null) {
        OpenTablesDetailInfoPartProgress progress = new OpenTablesDetailInfoPartProgress(database);
        progress.loadTablesInfo();
        if (progress.isSuccess()) {
            input.setTableList(progress.getList());
            try {
                window.getActivePage().openEditor(input, TableDashboardPart.ID);
            } catch (PartInitException e) {
                LOGGER.error("Can not initialize the db table list UI.", e);
            }
        }
    } else {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(tablesDetailInfoPart);
    }
}
Also used : TableDashboardInput(com.cubrid.common.ui.cubrid.table.dashboard.control.TableDashboardInput) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) OpenTablesDetailInfoPartProgress(com.cubrid.common.ui.spi.progress.OpenTablesDetailInfoPartProgress) PartInitException(org.eclipse.ui.PartInitException) TableDashboardPart(com.cubrid.common.ui.cubrid.table.dashboard.control.TableDashboardPart)

Aggregations

TableDashboardInput (com.cubrid.common.ui.cubrid.table.dashboard.control.TableDashboardInput)1 TableDashboardPart (com.cubrid.common.ui.cubrid.table.dashboard.control.TableDashboardPart)1 OpenTablesDetailInfoPartProgress (com.cubrid.common.ui.spi.progress.OpenTablesDetailInfoPartProgress)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1