/** * @return All the workbench windows */ public static IWorkbenchWindow[] getWorkbenchWindows () { return PlatformUI.getWorkbench().getWorkbenchWindows(); } /**
/** * Posts the update code "behind" the running operation. */ protected void postOnDisplayQue(Runnable runnable) { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); if (windows != null && windows.length > 0) { Display display = windows[0].getShell().getDisplay(); display.asyncExec(runnable); } else { runnable.run(); } }
/** * Posts the update code "behind" the running operation. */ protected void postOnDisplayQue(Runnable runnable) { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); if (windows != null && windows.length > 0) { Display display = windows[0].getShell().getDisplay(); display.asyncExec(runnable); } else runnable.run(); }
public void run(Runnable runnable) { if (Display.getCurrent() != null) { runnable.run(); } else { IWorkbench workbench= PlatformUI.getWorkbench(); IWorkbenchWindow[] windows= workbench.getWorkbenchWindows(); if (windows != null && windows.length > 0) { Display display= windows[0].getShell().getDisplay(); display.asyncExec(runnable); } else { runnable.run(); } } } }
/** called from EditboxPreferencePage * TODO still can't toggle on main window from Preferences * */ public static void toggleToolBarItemInAllWindows(boolean enabled) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window: windows){ toggleToolBarItem(window, enabled); } } /** called from EditBoxStartup */
/** * Show or hide the heap status based on selection. * @param selection */ private void updateHeapStatus(boolean selection) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { if(window instanceof WorkbenchWindow){ ((WorkbenchWindow) window).showHeapStatus(selection); } } } }
public static IWorkbenchWindow getWindow(Control control) { Shell shell = control.getShell(); IWorkbenchWindow[] windows = PlatformUI.getWorkbench() .getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { if (shell.equals(window.getShell())) return window; } return null; }
private static IWorkbenchWindow getActiveWindow() { IWorkbenchWindow w = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (w == null) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); if (windows.length > 0) { w = windows[0]; } } return w; }
private ViewContextManager() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows(); for (int i = 0; i < workbenchWindows.length; i++) { IWorkbenchWindow window = workbenchWindows[i]; windowOpened(window); } workbench.addWindowListener(this); }
private SourceLookupManager() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows(); for (int i = 0; i < workbenchWindows.length; i++) { IWorkbenchWindow window = workbenchWindows[i]; windowOpened(window); } workbench.addWindowListener(this); }
/** * @return the active workbench window */ public static IWorkbenchWindow getActiveWorkbenchWindow() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); return window != null ? window : PlatformUI.getWorkbench().getWorkbenchWindows()[0]; } /**
public static IWorkbenchWindow getWorkbenchWindow() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow result = workbench.getActiveWorkbenchWindow(); if (result == null && 0 < workbench.getWorkbenchWindowCount()) { IWorkbenchWindow[] ws = workbench.getWorkbenchWindows(); result = ws[0]; } return result; }
@Override public IStatus runInUIThread(IProgressMonitor monitor) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { IStatusLineManager slManager = getStatusLineManager(window); if (slManager != null) { slManager.appendToGroup(StatusLineManager.BEGIN_GROUP, getContributionItem()); slManager.update(false); break; } } return Status.OK_STATUS; } };
public void run() { if (fgManager == null) { fgManager = new EvaluationContextManager(); IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { fgManager.windowOpened(windows[i]); } workbench.addWindowListener(fgManager); fgManager.fActiveWindow = workbench.getActiveWorkbenchWindow(); } } };
public static Shell getShell() { if (getActiveWorkbenchShell() != null) { return getActiveWorkbenchShell(); } IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows(); return windows[0].getShell(); }
/** * @return */ public static Shell getActiveWorkbenchShell() { IWorkbenchWindow window = getActiveWorkbenchWindow(); if (window != null) { return window.getShell(); } IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows(); if (windows.length > 0) return windows[0].getShell(); return null; }
/** * Installs this AST provider. */ void install() { // Create and register activation listener fActivationListener= new ActivationListener(); PlatformUI.getWorkbench().addWindowListener(fActivationListener); // Ensure existing windows get connected IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i= 0, length= windows.length; i < length; i++) windows[i].getPartService().addPartListener(fActivationListener); }
/** * Installs this AST provider. */ void install() { // Create and register activation listener fActivationListener= new ActivationListener(); PlatformUI.getWorkbench().addWindowListener(fActivationListener); // Ensure existing windows get connected IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i= 0, length= windows.length; i < length; i++) windows[i].getPartService().addPartListener(fActivationListener); }
/** * Installs this AST provider. */ void install() { // Create and register activation listener fActivationListener= new ActivationListener(); PlatformUI.getWorkbench().addWindowListener(fActivationListener); // Ensure existing windows get connected IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i= 0, length= windows.length; i < length; i++) windows[i].getPartService().addPartListener(fActivationListener); }
public final static Shell getActiveShell() { IWorkbenchWindow window = PDEPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); if (window == null) { IWorkbenchWindow[] windows = PDEPlugin.getDefault().getWorkbench().getWorkbenchWindows(); if (windows.length > 0) return windows[0].getShell(); } else return window.getShell(); return getDisplay().getActiveShell(); }