Search in sources :

Example 1 with JobAutoDashboardInput

use of com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardInput in project cubrid-manager by CUBRID.

the class OpenJobAutomationInfoAction method openJobsDetailInfoEditor.

/**
		 * open job detail info part
		 * @param database
		 */
public void openJobsDetailInfoEditor(CubridDatabase database) {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (null == window) {
        return;
    }
    if (database == null) {
        return;
    }
    /*Check it open same editor*/
    IEditorPart editorPart = getOpenedEditorPart(database, JobAutoDashboardEditorPart.ID);
    if (editorPart == null) {
        OpenJobAutomationInfoPartProgress progress = new OpenJobAutomationInfoPartProgress(database);
        progress.loadJobAutomationInfoList();
        if (progress.isSuccess()) {
            JobAutoDashboardInput input = new JobAutoDashboardInput(database, progress.getBackupPlanInfoList(), progress.getQueryPlanInfoList());
            try {
                window.getActivePage().openEditor(input, JobAutoDashboardEditorPart.ID);
            } catch (PartInitException e) {
                LOGGER.error("Can not initialize the trigger view list UI.", e);
            }
        }
    } else {
        JobAutoDashboardEditorPart jobAutoDetailInfoPart = (JobAutoDashboardEditorPart) editorPart;
        window.getActivePage().activate(jobAutoDetailInfoPart);
        jobAutoDetailInfoPart.refreshAll();
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) OpenJobAutomationInfoPartProgress(com.cubrid.cubridmanager.ui.cubrid.jobauto.progress.OpenJobAutomationInfoPartProgress) JobAutoDashboardInput(com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardInput) JobAutoDashboardEditorPart(com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardEditorPart) IEditorPart(org.eclipse.ui.IEditorPart) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

JobAutoDashboardEditorPart (com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardEditorPart)1 JobAutoDashboardInput (com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardInput)1 OpenJobAutomationInfoPartProgress (com.cubrid.cubridmanager.ui.cubrid.jobauto.progress.OpenJobAutomationInfoPartProgress)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1