diff options
author | Simon Scholz | 2015-10-02 15:31:34 +0000 |
---|---|---|
committer | Simon Scholz | 2015-10-02 15:31:34 +0000 |
commit | f843b9637aef6f88a548fd4e73213a356bdefc7c (patch) | |
tree | 42d90e448c5aa07b8865046d28b53538d99ac274 | |
parent | 7980143452bffaa7761f933cdbf044af6d06c167 (diff) | |
download | eclipse.platform.ui-f843b9637aef6f88a548fd4e73213a356bdefc7c.tar.gz eclipse.platform.ui-f843b9637aef6f88a548fd4e73213a356bdefc7c.tar.xz eclipse.platform.ui-f843b9637aef6f88a548fd4e73213a356bdefc7c.zip |
Bug 478895 - Fix formating error in E4Application
Change-Id: I0809b389b5d646533f24f64f4e42b257785c1f9d
Signed-off-by: Simon Scholz <simon.scholz@vogella.com>
-rw-r--r-- | bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java | 88 |
1 files changed, 32 insertions, 56 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java index 2147a852be1..3d730bc6637 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java +++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java @@ -151,8 +151,7 @@ public class E4Application implements IApplication { // place it off so it's not visible shell.setLocation(0, 10000); } - if (!checkInstanceLocation(instanceLocation, shell, - workbench.getContext())) + if (!checkInstanceLocation(instanceLocation, shell, workbench.getContext())) return EXIT_OK; // Create and run the UI (if any) @@ -185,8 +184,7 @@ public class E4Application implements IApplication { handler.save(); } else { Logger logger = new WorkbenchLogger(PLUGIN_ID); - logger.error( - new Exception(), // log a stack trace for debugging + logger.error(new Exception(), // log a stack trace for debugging "Attempted to save a workbench model that had no top-level windows! " //$NON-NLS-1$ + "Skipped saving the model to avoid corruption."); //$NON-NLS-1$ } @@ -278,8 +276,7 @@ public class E4Application implements IApplication { IEclipseContext addonStaticContext = EclipseContextFactory.create(); for (MAddon addon : appModel.getAddons()) { addonStaticContext.set(MAddon.class, addon); - Object obj = factory.create(addon.getContributionURI(), appContext, - addonStaticContext); + Object obj = factory.create(addon.getContributionURI(), appContext, addonStaticContext); addon.setObject(obj); } @@ -305,8 +302,7 @@ public class E4Application implements IApplication { return workbench = new E4Workbench(appModel, appContext); } - private void setCSSContextVariables(IApplicationContext applicationContext, - IEclipseContext context) { + private void setCSSContextVariables(IApplicationContext applicationContext, IEclipseContext context) { boolean highContrastMode = getApplicationDisplay().getHighContrast(); String cssURI = highContrastMode ? null : getArgValue(IWorkbench.CSS_URI_ARG, applicationContext, false); @@ -315,8 +311,8 @@ public class E4Application implements IApplication { context.set(IWorkbench.CSS_URI_ARG, cssURI); } - String themeId = highContrastMode ? HIGH_CONTRAST_THEME_ID : getArgValue(E4Application.THEME_ID, - applicationContext, false); + String themeId = highContrastMode ? HIGH_CONTRAST_THEME_ID + : getArgValue(E4Application.THEME_ID, applicationContext, false); if (themeId == null && cssURI == null) { themeId = DEFAULT_THEME_ID; @@ -326,9 +322,9 @@ public class E4Application implements IApplication { // validate static CSS URI if (cssURI != null && !cssURI.startsWith("platform:/plugin/")) { - System.err - .println("Warning. Use the \"platform:/plugin/Bundle-SymbolicName/path/filename.extension\" URI for the parameter: " - + IWorkbench.CSS_URI_ARG); //$NON-NLS-1$ + System.err.println( + "Warning. Use the \"platform:/plugin/Bundle-SymbolicName/path/filename.extension\" URI for the parameter: " + + IWorkbench.CSS_URI_ARG); // $NON-NLS-1$ context.set(E4Application.THEME_ID, cssURI); } @@ -341,7 +337,6 @@ public class E4Application implements IApplication { Location instanceLocation = WorkbenchSWTActivator.getDefault().getInstanceLocation(); - URI applicationModelURI = determineApplicationModelURI(appContext); eclipseContext.set(E4Workbench.INITIAL_WORKBENCH_MODEL_URI, applicationModelURI); @@ -447,8 +442,7 @@ public class E4Application implements IApplication { } final String brandingProperty = appContext.getBrandingProperty(argName); - return brandingProperty == null ? System.getProperty(argName) - : brandingProperty; + return brandingProperty == null ? System.getProperty(argName) : brandingProperty; } /** @@ -460,7 +454,7 @@ public class E4Application implements IApplication { final String fullArgName = "-" + SHOWLOCATION_ARG_NAME; for (int i = 0; i < args.length; i++) { // ignore case for compatibility reasons - if (fullArgName.equalsIgnoreCase(args[i])) { //$NON-NLS-1$ + if (fullArgName.equalsIgnoreCase(args[i])) { // $NON-NLS-1$ String name = null; if (args.length > i + 1) { name = args[i + 1]; @@ -487,19 +481,17 @@ public class E4Application implements IApplication { IExtensionRegistry registry = RegistryFactory.getRegistry(); ExceptionHandler exceptionHandler = new ExceptionHandler(); - ReflectionContributionFactory contributionFactory = new ReflectionContributionFactory( - registry); + ReflectionContributionFactory contributionFactory = new ReflectionContributionFactory(registry); serviceContext.set(IContributionFactory.class, contributionFactory); serviceContext.set(IExceptionHandler.class, exceptionHandler); serviceContext.set(IExtensionRegistry.class, registry); - serviceContext.set(Adapter.class, ContextInjectionFactory.make( - EclipseAdapter.class, serviceContext)); + serviceContext.set(Adapter.class, ContextInjectionFactory.make(EclipseAdapter.class, serviceContext)); // No default log provider available if (serviceContext.get(ILoggerProvider.class) == null) { - serviceContext.set(ILoggerProvider.class, ContextInjectionFactory - .make(DefaultLoggerProvider.class, serviceContext)); + serviceContext.set(ILoggerProvider.class, + ContextInjectionFactory.make(DefaultLoggerProvider.class, serviceContext)); } return serviceContext; @@ -576,10 +568,8 @@ public class E4Application implements IApplication { } if (instanceLocation == null) { - MessageDialog.openError( - shell, - WorkbenchSWTMessages.IDEApplication_workspaceMandatoryTitle, - WorkbenchSWTMessages.IDEApplication_workspaceMandatoryMessage); + MessageDialog.openError(shell, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryTitle, + WorkbenchSWTMessages.IDEApplication_workspaceMandatoryMessage); return false; } @@ -606,21 +596,16 @@ public class E4Application implements IApplication { // 2. directory could not be created File workspaceDirectory = new File(instanceLocation.getURL().getFile()); if (workspaceDirectory.exists()) { - MessageDialog.openError( - shell, - WorkbenchSWTMessages.IDEApplication_workspaceCannotLockTitle, - WorkbenchSWTMessages.IDEApplication_workspaceCannotLockMessage); + MessageDialog.openError(shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockTitle, + WorkbenchSWTMessages.IDEApplication_workspaceCannotLockMessage); } else { - MessageDialog.openError( - shell, - WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetTitle, + MessageDialog.openError(shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetMessage); } } catch (IOException e) { Logger logger = new WorkbenchLogger(PLUGIN_ID); logger.error(e); - MessageDialog.openError(shell, - WorkbenchSWTMessages.InternalError, e.getMessage()); + MessageDialog.openError(shell, WorkbenchSWTMessages.InternalError, e.getMessage()); } return false; } @@ -664,12 +649,9 @@ public class E4Application implements IApplication { // other than the current ide version -- find out if the user wants // to use it anyhow. String title = WorkbenchSWTMessages.IDEApplication_versionTitle; - String message = NLS.bind( - WorkbenchSWTMessages.IDEApplication_versionMessage, - url.getFile()); + String message = NLS.bind(WorkbenchSWTMessages.IDEApplication_versionMessage, url.getFile()); - MessageBox mbox = new MessageBox(shell, SWT.OK | SWT.CANCEL - | SWT.ICON_WARNING | SWT.APPLICATION_MODAL); + MessageBox mbox = new MessageBox(shell, SWT.OK | SWT.CANCEL | SWT.ICON_WARNING | SWT.APPLICATION_MODAL); mbox.setText(title); mbox.setMessage(message); return mbox.open() == SWT.OK; @@ -766,8 +748,7 @@ public class E4Application implements IApplication { // make sure the file exists File versionFile = new File(metaDir, VERSION_FILENAME); - if (!versionFile.exists() - && (!create || !versionFile.createNewFile())) { + if (!versionFile.exists() && (!create || !versionFile.createNewFile())) { return null; } @@ -813,10 +794,8 @@ public class E4Application implements IApplication { public boolean changed(IEclipseContext context) { IEclipseContext activeChildContext = context.getActiveChild(); if (activeChildContext != null) { - Object selection = activeChildContext - .get(IServiceConstants.ACTIVE_SELECTION); - theContext.set(IServiceConstants.ACTIVE_SELECTION, - selection); + Object selection = activeChildContext.get(IServiceConstants.ACTIVE_SELECTION); + theContext.set(IServiceConstants.ACTIVE_SELECTION, selection); } return true; } @@ -824,15 +803,12 @@ public class E4Application implements IApplication { // we create a selection service handle on every node that we are asked // about as handle needs to know its context - appContext.set(ESelectionService.class.getName(), - new ContextFunction() { - @Override - public Object compute(IEclipseContext context, - String contextKey) { - return ContextInjectionFactory.make( - SelectionServiceImpl.class, context); - } - }); + appContext.set(ESelectionService.class.getName(), new ContextFunction() { + @Override + public Object compute(IEclipseContext context, String contextKey) { + return ContextInjectionFactory.make(SelectionServiceImpl.class, context); + } + }); } static public void initializeWindowServices(MWindow childWindow) { |