use of com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditor in project cubrid-manager by CUBRID.
the class ServiceDashboardAction method run.
/**
* @see org.eclipse.jface.action.Action#run() Override the run method in
* order to complete showing brokers status server to a broker
*/
public void run() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (null == window) {
return;
}
/*Check it open same editor*/
ServiceDashboardEditor editorPart = findOpenedEditorPart();
if (editorPart == null) {
ServiceDashboardEditorInput editorInput = new ServiceDashboardEditorInput();
editorInput.setName("");
editorInput.setToolTipText(Messages.serviceDashboardPartToolTip);
try {
editorPart = (ServiceDashboardEditor) window.getActivePage().openEditor(editorInput, ServiceDashboardEditor.ID);
editorPart.loadAllData();
} catch (PartInitException ex) {
LOGGER.error(ex.getMessage());
}
} else {
window.getActivePage().activate(editorPart);
editorPart.loadAllData();
}
}
use of com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditor in project cubrid-manager by CUBRID.
the class ServiceDashboardAction method findOpenedEditorPart.
/**
* Get all opened query editor
*
* @return
*/
private ServiceDashboardEditor findOpenedEditorPart() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return null;
}
IEditorReference[] editorReferences = window.getActivePage().getEditorReferences();
for (IEditorReference reference : editorReferences) {
if (reference.getId().equals(ServiceDashboardEditor.ID)) {
ServiceDashboardEditor editor = (ServiceDashboardEditor) reference.getEditor(false);
if (editor != null) {
return editor;
}
}
}
return null;
}
Aggregations