Search in sources :

Example 1 with ViewDashboardInput

use of com.cubrid.common.ui.cubrid.view.editor.ViewDashboardInput in project cubrid-manager by CUBRID.

the class OpenTargetAction method openViewsDetailInfoEditor.

/**
	 * open view detail info part
	 * @param database
	 */
public void openViewsDetailInfoEditor(CubridDatabase database) {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (null == window) {
        return;
    }
    if (database == null) {
        return;
    }
    /*Check it open same editor*/
    IEditorPart editorPart = getOpenedEditorPart(database, ViewDashboardEditorPart.ID);
    if (editorPart == null) {
        OpenViewsDetailInfoPartProgress progress = new OpenViewsDetailInfoPartProgress(database);
        progress.loadViewsInfo();
        if (progress.isSuccess()) {
            ViewDashboardInput input = new ViewDashboardInput(database, progress.getViewList());
            try {
                window.getActivePage().openEditor(input, ViewDashboardEditorPart.ID);
            } catch (PartInitException e) {
                LOGGER.error("Can not initialize the view view list UI.", e);
            }
        }
    } else {
        ViewDashboardEditorPart viewsDetailInfoPart = (ViewDashboardEditorPart) editorPart;
        window.getActivePage().activate(viewsDetailInfoPart);
        viewsDetailInfoPart.refresh();
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ViewDashboardEditorPart(com.cubrid.common.ui.cubrid.view.editor.ViewDashboardEditorPart) OpenViewsDetailInfoPartProgress(com.cubrid.common.ui.spi.progress.OpenViewsDetailInfoPartProgress) ViewDashboardInput(com.cubrid.common.ui.cubrid.view.editor.ViewDashboardInput) IEditorPart(org.eclipse.ui.IEditorPart) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

ViewDashboardEditorPart (com.cubrid.common.ui.cubrid.view.editor.ViewDashboardEditorPart)1 ViewDashboardInput (com.cubrid.common.ui.cubrid.view.editor.ViewDashboardInput)1 OpenViewsDetailInfoPartProgress (com.cubrid.common.ui.spi.progress.OpenViewsDetailInfoPartProgress)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1