use of com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardEditorPart 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();
}
}
use of com.cubrid.cubridmanager.ui.cubrid.jobauto.editor.JobAutoDashboardEditorPart in project cubrid-manager by CUBRID.
the class OpenJobAutomationInfoAction method getOpenedEditorPart.
/**
* Get opened IEditorPart
* @param database CubridDatabase
* @param editorId String
* @return
*/
private IEditorPart getOpenedEditorPart(CubridDatabase database, String editorId) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return null;
}
IEditorReference[] editorReferences = window.getActivePage().getEditorReferences();
for (IEditorReference reference : editorReferences) {
if (reference.getId().equals(editorId)) {
IEditorPart editor = reference.getEditor(false);
if (editor != null) {
if (editor instanceof JobAutoDashboardEditorPart) {
JobAutoDashboardEditorPart jobAutoDetailInfoPart = (JobAutoDashboardEditorPart) editor;
if (jobAutoDetailInfoPart.getDatabase().equals(database)) {
return editor;
}
}
}
}
}
return null;
}
Aggregations