/** * Returns the workbench. * * @return the workbench */ private IWorkbench getWorkbench() { return getWindowConfigurer().getWorkbenchConfigurer().getWorkbench(); }
/** * {@inheritDoc} */ @Override public void initialize(IWorkbenchConfigurer configurer) { super.initialize(configurer); // save the state of the application regarding its position etc. configurer.setSaveAndRestore(true); }
/** * Declares an IDE-specific workbench image. * * @param symbolicName * the symbolic name of the image * @param path * the path of the image file; this path is relative to the base * of the IDE plug-in * @param shared * <code>true</code> if this is a shared image, and * <code>false</code> if this is not a shared image * @see IWorkbenchConfigurer#declareImage */ private void declareWorkbenchImage(Bundle ideBundle, String symbolicName, String path, boolean shared) { URL url = FileLocator.find(ideBundle, new Path(path), null); ImageDescriptor desc = ImageDescriptor.createFromURL(url); getWorkbenchConfigurer().declareImage(symbolicName, desc, shared); }
Boolean introOpened = (Boolean) wbConfig.getData(key); if (introOpened != null && introOpened.booleanValue()) { return; wbConfig.setData(key, Boolean.TRUE); IIntroManager introManager = wbConfig.getWorkbench().getIntroManager();
IStatus status = myConfigurer[0].restoreState(); if (!status.isOK()) { if (status.getCode() == IWorkbenchConfigurer.RESTORE_CODE_EXIT) { myConfigurer[0].openFirstTimeWindow();
workbenchConfigurer.emergencyClose(); } catch (RuntimeException re) {
/** * Return true if the intro plugin is present and false otherwise. * * @return boolean */ public boolean hasIntro() { return getWorkbenchConfigurer().getWorkbench().getIntroManager() .hasIntro(); }
@Override public void initialize(IWorkbenchConfigurer configurer) { PluginActionBuilder.setAllowIdeLogging(true); // make sure we always save and restore workspace state configurer.setSaveAndRestore(true); // register workspace adapters IDE.registerAdapters(); // register shared images declareWorkbenchImages(); // initialize the activity helper activityHelper = IDEWorkbenchActivityHelper.getInstance(); // initialize idle handler idleHelper = new IDEIdleHelper(configurer); // initialize the workspace undo monitor workspaceUndoMonitor = WorkspaceUndoMonitor.getInstance(); // show Help button in JFace dialogs TrayDialog.setDialogHelpAvailable(true); // Set the default value of the preference controlling the workspace // name displayed in the window title. setWorkspaceNameDefault(); if (!jfaceComparatorIsSet) { // Policy.setComparator can only be called once in Jface lifetime Policy.setComparator(Collator.getInstance()); jfaceComparatorIsSet = true; } }
/** * 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(); if (display != null && !display.isDisposed()) { final long start = System.currentTimeMillis();
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);