Search in sources :

Example 1 with ServiceDashboardEditorInput

use of com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditorInput 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();
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) PartInitException(org.eclipse.ui.PartInitException) ServiceDashboardEditorInput(com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditorInput) ServiceDashboardEditor(com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditor)

Aggregations

ServiceDashboardEditor (com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditor)1 ServiceDashboardEditorInput (com.cubrid.cubridmanager.ui.service.editor.ServiceDashboardEditorInput)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1