/** * Returns the workbench. * * @return the workbench */ private IWorkbench getWorkbench() { return getWindowConfigurer().getWorkbenchConfigurer().getWorkbench(); }
/** * Return true if the intro plugin is present and false otherwise. * * @return boolean */ public boolean hasIntro() { return getWorkbenchConfigurer().getWorkbench().getIntroManager() .hasIntro(); }
final Display display = configurer.getWorkbench().getDisplay(); if (display != null && !display.isDisposed()) { final long start = System.currentTimeMillis();
/** * Returns the location specified in command line when -showlocation is * defined. Otherwise returns null * * @return */ public String getCommandLineLocation() { IEclipseContext context = getWorkbenchConfigurer().getWorkbench().getService(IEclipseContext.class); return context != null ? (String) context.get(E4Workbench.FORCED_SHOW_LOCATION) : null; }
final Display display = configurer.getWorkbench().getDisplay(); handler = new Runnable() { @Override
/** * Shuts down the idle helper, removing any installed listeners, etc. */ void shutdown() { if (idleListener == null) { return; } final Display display = configurer.getWorkbench().getDisplay(); if (display != null && !display.isDisposed()) { try { display.asyncExec(() -> { display.timerExec(-1, handler); display.removeFilter(SWT.KeyUp, idleListener); display.removeFilter(SWT.MouseUp, idleListener); }); } catch (SWTException ex) { // ignore (display might be disposed) } } } }
@Override public void run() { if (!display.isDisposed() && !configurer.getWorkbench().isClosing()) { int nextInterval; final long start = System.currentTimeMillis(); //don't garbage collect if background jobs are running if (!Job.getJobManager().isIdle()) { nextInterval = IDLE_INTERVAL; } else if ((start - lastGC) < nextGCInterval) { //don't garbage collect if we have collected within the specific interval nextInterval = nextGCInterval - (int) (start - lastGC); } else { gcJob.schedule(); nextInterval = minGCInterval; } display.timerExec(nextInterval, this); } } };
if (getWorkbenchConfigurer().getWorkbench().getIntroManager() .hasIntro()) { PrefUtil.getAPIPreferenceStore().setValue( PrefUtil.saveAPIPrefs(); getWorkbenchConfigurer().getWorkbench().getIntroManager() .showIntro(configurer.getWindow(), false);
IWorkbenchPreferenceConstants.SHOW_INTRO); IIntroManager introManager = wbConfig.getWorkbench().getIntroManager();