diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.commands/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.core.commands/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.commands/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.commands/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.core diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.core.databinding -Bundle-Version: 1.7.0.qualifier +Bundle-Version: 1.7.100.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.core org.eclipse.core.databinding - 1.7.0-SNAPSHOT + 1.7.100-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -57,7 +57,7 @@ */ try { icuBigDecimal = Class.forName("com.ibm.icu.math.BigDecimal"); //$NON-NLS-1$ - icuBigDecimalCtr = icuBigDecimal.getConstructor(new Class[] {BigInteger.class, int.class}); + icuBigDecimalCtr = icuBigDecimal.getConstructor(BigInteger.class, int.class); // System.out.println("DEBUG: Full ICU4J support state: icuBigDecimal="+(icuBigDecimal != null)+", icuBigDecimalCtr="+(icuBigDecimalCtr != null)); //$NON-NLS-1$ //$NON-NLS-2$ } catch(ClassNotFoundException e) {} @@ -133,7 +133,7 @@ // Full ICU4J present. Convert java.math.BigDecimal to ICU BigDecimal to format. Bug #180392. BigDecimal o = (BigDecimal) fromObject; try { - fromObject = icuBigDecimalCtr.newInstance(new Object[] {o.unscaledValue(), Integer.valueOf(o.scale())}); + fromObject = icuBigDecimalCtr.newInstance(o.unscaledValue(), Integer.valueOf(o.scale())); } catch(InstantiationException e) {} catch(InvocationTargetException e) {} diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.core.databinding.beans -Bundle-Version: 1.4.200.qualifier +Bundle-Version: 1.4.300.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.core org.eclipse.core.databinding.beans - 1.4.200-SNAPSHOT + 1.4.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 Matthew Hall and others. + * Copyright (c) 2008, 2018 Matthew Hall and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -59,7 +59,7 @@ if (!writeMethod.isAccessible()) { writeMethod.setAccessible(true); } - writeMethod.invoke(source, new Object[] { value }); + writeMethod.invoke(source, value); } catch (InvocationTargetException e) { /* * InvocationTargetException wraps any exception thrown by the diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyListenerSupport.java eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyListenerSupport.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyListenerSupport.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyListenerSupport.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -89,15 +89,11 @@ try { try { - method = bean.getClass().getMethod( - methodName, - new Class[] { String.class, - PropertyChangeListener.class }); + method = bean.getClass().getMethod(methodName, String.class, PropertyChangeListener.class); parameters = new Object[] { propertyName, listener }; } catch (NoSuchMethodException e) { - method = bean.getClass().getMethod(methodName, - new Class[] { PropertyChangeListener.class }); + method = bean.getClass().getMethod(methodName, PropertyChangeListener.class); parameters = new Object[] { listener }; } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.observable/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.observable/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.observable/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.observable/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -16,7 +16,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.core diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.property/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.property/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.core.databinding.property/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.core.databinding.property/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,7 +15,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.core diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/build.properties eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/build.properties --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/build.properties 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/build.properties 2018-12-05 21:43:06.000000000 +0000 @@ -19,4 +19,3 @@ plugin.properties source.. = src/ src.includes = about.html -jre.compilation.profile = JavaSE-1.8 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin -Bundle-Version: 0.12.300.qualifier +Bundle-Version: 0.12.400.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.annotation, javax.inject;version="1.0.0", diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.core.commands - 0.12.300-SNAPSHOT + 0.12.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs 2018-12-05 21:43:06.000000000 +0000 @@ -129,8 +129,11 @@ org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 @@ -140,6 +143,7 @@ org.eclipse.jdt.core.formatter.alignment_for_assignment=0 org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 @@ -409,6 +413,9 @@ org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false org.eclipse.jdt.core.formatter.lineSplit=120 org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs 2018-12-05 21:43:06.000000000 +0000 @@ -98,6 +98,8 @@ sp_cleanup.qualify_static_member_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_modifiers=false +sp_cleanup.remove_redundant_semicolons=false sp_cleanup.remove_redundant_type_arguments=false sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java 2018-12-05 21:43:06.000000000 +0000 @@ -24,9 +24,26 @@ * @noimplement */ public interface ECommandService { + /** + * Allows to create an instance of an existing command based on the id parameter + * + * @param id - Command to create + * @param parameters - Map of the parameters of the command or null + * @return ParameterizedCommand - created command or null + */ public ParameterizedCommand createCommand(String id, Map parameters); /** + * Allows to create an instance of an existing command based on the id parameter + * which does not require parameters Delegates to createCommand(String,Map) + * passing in null as Map parameter + * + * @param id - Command to create + * @return ParameterizedCommand - created command or null + */ + public ParameterizedCommand createCommand(String id); + + /** * @param id * @param name * @param description diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java 2018-12-05 21:43:06.000000000 +0000 @@ -46,6 +46,11 @@ } @Override + public ParameterizedCommand createCommand(String id) { + return createCommand(id, null); + } + + @Override public Category defineCategory(String id, String name, String description) { Category cat = commandManager.getCategory(id); if (!cat.isDefined()) { @@ -85,4 +90,5 @@ public Command getCommand(String commandId) { return commandManager.getCommand(commandId); } + } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java 2018-12-05 21:43:06.000000000 +0000 @@ -166,7 +166,8 @@ ExecutionException executionException = (ExecutionException) e.getCause(); throw executionException; } - throw new ExecutionException("Error invoking " + handler + " in " + staticContext, e); //$NON-NLS-1$ //$NON-NLS-2$ + String message = "Error executing '" + commandId + "': " + e.getMessage(); //$NON-NLS-1$ //$NON-NLS-2$ + throw new ExecutionException(message, e); } finally { if (localStaticContext != null) { localStaticContext.dispose(); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java 2018-12-05 21:43:06.000000000 +0000 @@ -194,6 +194,12 @@ try { return executeHandler(command, staticContext); } finally { + Object obj = staticContext.get(HandlerServiceImpl.HANDLER_EXCEPTION); + if (obj instanceof ExecutionException) { + if (logger != null) { + logger.error((Throwable) obj, "Command '" + command.getId() + "' failed"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } staticContext.dispose(); } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.emf.xpath/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.emf.xpath/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.emf.xpath/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.emf.xpath/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.bindings;singleton:=true -Bundle-Version: 0.12.200.qualifier +Bundle-Version: 0.12.300.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.bindings/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.bindings/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.bindings/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.bindings/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.bindings - 0.12.200-SNAPSHOT + 0.12.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java 2018-12-05 21:43:06.000000000 +0000 @@ -326,6 +326,8 @@ if (serviceContext != null) { StringBuilder sb = new StringBuilder("\n\tExecution context: "); //$NON-NLS-1$ sb.append(describe(serviceContext)); + sb.append("\n\tHandler: "); //$NON-NLS-1$ + sb.append(obj); logger.trace(sb.toString()); } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin -Bundle-Version: 0.12.300.qualifier +Bundle-Version: 0.12.400.qualifier Export-Package: org.eclipse.e4.ui.css.core;x-internal:=true, org.eclipse.e4.ui.css.core.css2;x-friends:="org.eclipse.e4.ui.css.swt.theme,org.eclipse.e4.ui.css.swt,org.eclipse.e4.ui.css.jface", org.eclipse.e4.ui.css.core.dom;x-friends:="org.eclipse.e4.ui.css.swt,org.eclipse.ui.views.properties.tabbed", diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.css.core - 0.12.300-SNAPSHOT + 0.12.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java 2018-12-05 21:43:06.000000000 +0000 @@ -61,7 +61,7 @@ * @return retrieved CSS properties or null * @throws Exception */ - default public String retrieveCSSProperty(Object element, String property, String pseudo, CSSEngine engine) + public default String retrieveCSSProperty(Object element, String property, String pseudo, CSSEngine engine) throws Exception { return null; } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java 2018-12-05 21:43:06.000000000 +0000 @@ -216,9 +216,7 @@ } } } - InputStream stream = null; - try { - stream = url.openStream(); + try (InputStream stream = url.openStream()) { InputSource tempStream = new InputSource(); tempStream.setURI(url.toString()); tempStream.setByteStream(stream); @@ -232,10 +230,6 @@ for (int j = 0; j < tempRules.getLength(); j++) { masterList.add(tempRules.item(j)); } - } finally { - if (stream != null) { - stream.close(); - } } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.css.swt;singleton:=true -Bundle-Version: 0.13.200.qualifier +Bundle-Version: 0.13.300.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.css.swt - 0.13.200-SNAPSHOT + 0.13.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 Angelo Zerr and others. + * Copyright (c) 2008, 2018 Angelo Zerr and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -16,8 +16,6 @@ import org.eclipse.e4.ui.css.core.engine.CSSEngine; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; /** @@ -28,12 +26,9 @@ CSSEngine engine; public CSSSWTApplyStylesListener(Display display, final CSSEngine engine) { this.engine = engine; - display.addListener(SWT.Skin, new Listener() { - @Override - public void handleEvent(Event event) { - if (engine != null) { - engine.applyStyles(event.widget, false); - } + display.addListener(SWT.Skin, event -> { + if (engine != null) { + engine.applyStyles(event.widget, false); } }); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyPaddingSWTHandler.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyPaddingSWTHandler.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyPaddingSWTHandler.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyPaddingSWTHandler.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 IBM Corporation and others. + * Copyright (c) 2010, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -181,7 +181,7 @@ } try { - Method m = renderer.getClass().getMethod("getPadding", new Class[]{}); + Method m = renderer.getClass().getMethod("getPadding"); Rectangle pad = (Rectangle) m.invoke(renderer); // TBD: is there a CTF equivalent ? @@ -211,10 +211,7 @@ if (top != pad.x || right != pad.y || bottom != pad.width || left != pad.height) { - Method m2 = renderer.getClass().getMethod( - "setPadding", - new Class[] { int.class, int.class, int.class, - int.class }); + Method m2 = renderer.getClass().getMethod("setPadding", int.class, int.class, int.class, int.class); m2.invoke(renderer, left, right, top, bottom); } } catch (Exception e) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyUnselectedTabsSWTHandler.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2016 IBM Corporation and others. + * Copyright (c) 2010, 2018 IBM Corporation and others. * * This * program and the accompanying materials are made available under the terms of @@ -25,7 +25,6 @@ import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.w3c.dom.css.CSSValue; @@ -95,14 +94,11 @@ return; } - final Listener resizeListener = new Listener() { - @Override - public void handleEvent(Event event) { - CTabFolder folder = (CTabFolder) event.widget; - for (Control child : folder.getChildren()) { - if (isReskinRequired(child)) { - child.reskin(SWT.NONE); - } + final Listener resizeListener = event -> { + CTabFolder folder1 = (CTabFolder) event.widget; + for (Control child : folder1.getChildren()) { + if (isReskinRequired(child)) { + child.reskin(SWT.NONE); } } }; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 Angelo Zerr and others. + * Copyright (c) 2008, 2018 Angelo Zerr and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -25,8 +25,6 @@ import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; /** * SWT Resources Registry to cache SWT Resource like Color, Cursor and Font and @@ -40,12 +38,7 @@ } // When SWT Display will dispose, all SWT resources stored // into cache will be dispose it too. - display.addListener(SWT.Dispose, new Listener() { - @Override - public void handleEvent(Event event) { - dispose(); - } - }); + display.addListener(SWT.Dispose, event -> dispose()); } @Override diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt.theme/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt.theme/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.css.swt.theme/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.css.swt.theme/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.di/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.di/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.di/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.di/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -4,7 +4,7 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.e4.ui.di -Bundle-Version: 1.2.300.qualifier +Bundle-Version: 1.2.400.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Import-Package: javax.inject;version="1.0.0", diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.di/META-INF/p2.inf eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.di/META-INF/p2.inf --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.di/META-INF/p2.inf 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.di/META-INF/p2.inf 2018-12-05 21:43:06.000000000 +0000 @@ -1,14 +1,3 @@ requires.0.namespace = osgi.extender requires.0.name = osgi.component -requires.0.range = [1.2.0, 2) -# Bug 538564 - Tycho 1.2.0 is only able to start tests with -# org.eclipse.equinox.ds installed (configuring its start level). -# However, org.eclipse.equinox.ds is now discarded and org.apache.felix.scr -# replaces it as provider for `osgi.extender`. Tycho 1.2.0 is not able to -# set the right start level for org.apache.felix.scr. -# So we explicitly add org.eclipse.equinox.ds to keep compatility with -# Tycho 1.2.0: Tycho sets a start-level for org.eclipse.equinox.ds, so -# when the bundle starts it also starts org.apache.felix.scr (as requirement). -requires.1.namespace = osgi.bundle -requires.1.name = org.eclipse.equinox.ds -requires.1.range = 0.0.0 \ No newline at end of file +requires.0.range = [1.2.0, 2) \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.di/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.di/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.di/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.di/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.di - 1.2.300-SNAPSHOT + 1.2.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.dialogs/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.dialogs/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.dialogs/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.dialogs/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.model.workbench/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.model.workbench/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.model.workbench/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.model.workbench/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.e4.ui.model.workbench;singleton:=true -Bundle-Version: 2.1.100.qualifier +Bundle-Version: 2.1.200.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.model.workbench/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.model.workbench/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.model.workbench/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.model.workbench/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.model.workbench - 2.1.100-SNAPSHOT + 2.1.200-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.progress/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.progress/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.progress/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.progress/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -11,7 +11,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.services;singleton:=true -Bundle-Version: 1.3.200.qualifier +Bundle-Version: 1.3.300.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.services/META-INF/p2.inf eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.services/META-INF/p2.inf --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.services/META-INF/p2.inf 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.services/META-INF/p2.inf 2018-12-05 21:43:06.000000000 +0000 @@ -2,15 +2,4 @@ requires.0.name = osgi.component requires.0.range = [1.2.0, 2) requires.1.namespace = osgi.service -requires.1.name = org.osgi.service.event.EventAdmin -# Bug 538564 - Tycho 1.2.0 is only able to start tests with -# org.eclipse.equinox.ds installed (configuring its start level). -# However, org.eclipse.equinox.ds is now discarded and org.apache.felix.scr -# replaces it as provider for `osgi.extender`. Tycho 1.2.0 is not able to -# set the right start level for org.apache.felix.scr. -# So we explicitly add org.eclipse.equinox.ds to keep compatility with -# Tycho 1.2.0: Tycho sets a start-level for org.eclipse.equinox.ds, so -# when the bundle starts it also starts org.apache.felix.scr (as requirement). -requires.2.namespace = osgi.bundle -requires.2.name = org.eclipse.equinox.ds -requires.2.range = 0.0.0 \ No newline at end of file +requires.1.name = org.osgi.service.event.EventAdmin \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.services/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.services/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.services/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.services/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.services - 1.3.200-SNAPSHOT + 1.3.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.swt.gtk/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.swt.gtk/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.swt.gtk/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.swt.gtk/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,12 +2,13 @@ Bundle-ManifestVersion: 2 Bundle-Name: %fragmentName Bundle-SymbolicName: org.eclipse.e4.ui.swt.gtk;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.0.500.qualifier Fragment-Host: org.eclipse.e4.ui.css.swt.theme;bundle-version="0.10.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: fragment-gtk Bundle-Vendor: %providerName Eclipse-PlatformFilter: (osgi.ws=gtk) -Import-Package: org.eclipse.e4.core.services.events, +Import-Package: javax.annotation, + org.eclipse.e4.core.services.events, org.osgi.service.event;version="1.3.1" Automatic-Module-Name: org.eclipse.e4.ui.swt.gtk diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.swt.gtk/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.swt.gtk/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.swt.gtk/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.swt.gtk/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,12 +14,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.swt.gtk - 1.0.400-SNAPSHOT + 1.0.500-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.widgets/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.widgets/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.widgets/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.widgets/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -4,7 +4,7 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.e4.ui.widgets -Bundle-Version: 1.2.200.qualifier +Bundle-Version: 1.2.300.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.e4.ui.widgets;x-friends:="org.eclipse.e4.ui.workbench.swt" Require-Bundle: org.eclipse.swt;bundle-version="[3.6.0,4.0.0)" diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.widgets/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.widgets/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.widgets/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.widgets/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.widgets - 1.2.200-SNAPSHOT + 1.2.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.widgets/src/org/eclipse/e4/ui/widgets/ImageBasedFrame.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.widgets/src/org/eclipse/e4/ui/widgets/ImageBasedFrame.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.widgets/src/org/eclipse/e4/ui/widgets/ImageBasedFrame.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.widgets/src/org/eclipse/e4/ui/widgets/ImageBasedFrame.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 IBM Corporation and others. + * Copyright (c) 2012, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -17,18 +17,13 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.events.ControlListener; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseMoveListener; import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.ToolBar; @@ -65,35 +60,23 @@ this.vertical = vertical; this.draggable = draggable; - addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - drawFrame(e); - } - }); + addPaintListener(e -> drawFrame(e)); - addListener(SWT.MouseExit, new Listener() { - @Override - public void handleEvent(Event event) { - ImageBasedFrame frame = (ImageBasedFrame) event.widget; - frame.setCursor(null); - } + addListener(SWT.MouseExit, event -> { + ImageBasedFrame frame = (ImageBasedFrame) event.widget; + frame.setCursor(null); }); - addMouseMoveListener(new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - // Compute the display location for the handle - // Note that this is an empty rect if !draggable - Rectangle handleRect = getHandleRect(); - - ImageBasedFrame frame = (ImageBasedFrame) e.widget; - if (handleRect.contains(e.x, e.y)) { - frame.setCursor(frame.getDisplay().getSystemCursor( - SWT.CURSOR_SIZEALL)); - } else { - frame.setCursor(null); - } + addMouseMoveListener(e -> { + // Compute the display location for the handle + // Note that this is an empty rect if !draggable + Rectangle handleRect = getHandleRect(); + + ImageBasedFrame frame = (ImageBasedFrame) e.widget; + if (handleRect.contains(e.x, e.y)) { + frame.setCursor(frame.getDisplay().getSystemCursor(SWT.CURSOR_SIZEALL)); + } else { + frame.setCursor(null); } }); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.workbench;singleton:=true -Bundle-Version: 1.7.0.qualifier +Bundle-Version: 1.8.0.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/META-INF/p2.inf eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/META-INF/p2.inf --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/META-INF/p2.inf 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/META-INF/p2.inf 2018-12-05 21:43:06.000000000 +0000 @@ -2,15 +2,4 @@ requires.0.name = osgi.component requires.0.range = [1.2.0, 2) requires.1.namespace = osgi.service -requires.1.name = org.osgi.service.event.EventAdmin -# Bug 538564 - Tycho 1.2.0 is only able to start tests with -# org.eclipse.equinox.ds installed (configuring its start level). -# However, org.eclipse.equinox.ds is now discarded and org.apache.felix.scr -# replaces it as provider for `osgi.extender`. Tycho 1.2.0 is not able to -# set the right start level for org.apache.felix.scr. -# So we explicitly add org.eclipse.equinox.ds to keep compatility with -# Tycho 1.2.0: Tycho sets a start-level for org.eclipse.equinox.ds, so -# when the bundle starts it also starts org.apache.felix.scr (as requirement). -requires.2.namespace = osgi.bundle -requires.2.name = org.eclipse.equinox.ds -requires.2.range = 0.0.0 \ No newline at end of file +requires.1.name = org.osgi.service.event.EventAdmin \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.workbench - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/schema/org.eclipse.e4.workbench.model.exsd eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/schema/org.eclipse.e4.workbench.model.exsd --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/schema/org.eclipse.e4.workbench.model.exsd 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/schema/org.eclipse.e4.workbench.model.exsd 2018-12-05 21:43:06.000000000 +0000 @@ -161,7 +161,7 @@ - A optional key under which to store the model element in the context. The value of "id" is used if this value is not specified. + An optional key under which to store the model element in the context. The value of "id" is used if this value is not specified. diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ActivePartLookupFunction.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ActivePartLookupFunction.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ActivePartLookupFunction.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ActivePartLookupFunction.java 2018-12-05 21:43:06.000000000 +0000 @@ -13,6 +13,7 @@ *******************************************************************************/ package org.eclipse.e4.ui.internal.workbench; +import java.util.List; import org.eclipse.e4.core.contexts.ContextFunction; import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.ui.model.application.MApplication; @@ -49,7 +50,8 @@ MUIElement parent = part.getCurSharedRef() != null ? part.getCurSharedRef().getParent() : part.getParent(); if (parent == null) return part; - if (parent.getTags().contains(IPresentationEngine.MINIMIZED) + List parentTags = parent.getTags(); + if (parentTags.contains(IPresentationEngine.MINIMIZED) && !parentTags.contains(IPresentationEngine.ACTIVE) && !part.getTags().contains(IPresentationEngine.ACTIVE)) { return null; } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java 2018-12-05 21:43:06.000000000 +0000 @@ -248,7 +248,7 @@ } } else if ((searchFlags & IN_SHARED_AREA) != 0) { // Only recurse through the shared areas - List areas = findElements(searchContainer, null, MArea.class, null); + List areas = findElements(searchContainer, null, MArea.class); for (MArea area : areas) { findElementsRecursive(area, clazz, matcher, elements, searchFlags); } @@ -394,13 +394,17 @@ } @Override - public List findElements(MUIElement searchRoot, String id, Class clazz, - List tagsToMatch) { + public List findElements(MUIElement searchRoot, String id, Class clazz, List tagsToMatch) { ElementMatcher matcher = new ElementMatcher(id, clazz, tagsToMatch); return findElements(searchRoot, clazz, ANYWHERE, matcher); } @Override + public List findElements(MUIElement searchRoot, String id, Class clazz) { + return findElements(searchRoot, id, clazz, null); + } + + @Override public List findElements(MUIElement searchRoot, String id, Class clazz, List tagsToMatch, int searchFlags) { ElementMatcher matcher = new ElementMatcher(id, clazz, tagsToMatch); @@ -430,7 +434,7 @@ return null; } - List elements = findElements(searchRoot, id, MUIElement.class, null); + List elements = findElements(searchRoot, id, MUIElement.class); if (elements.size() > 0) { return elements.get(0); } @@ -475,7 +479,7 @@ MUIElement clone = (MUIElement) EcoreUtil.copy(eObj); // null out all the references - List phList = findElements(clone, null, MPlaceholder.class, null); + List phList = findElements(clone, null, MPlaceholder.class); for (MPlaceholder ph : phList) { // Skip placeholders in the sharedArea int location = getElementLocation(ph); @@ -534,7 +538,7 @@ // the model processor classes EPlaceholderResolver resolver = appContext.get(EPlaceholderResolver.class); // Re-resolve any placeholder references - List phList = findElements(element, null, MPlaceholder.class, null); + List phList = findElements(element, null, MPlaceholder.class); List nullRefList = new ArrayList<>(); for (MPlaceholder ph : phList) { if (resolveAlways) { @@ -925,6 +929,7 @@ } // Remove any minimized stacks for this perspective + String perspectiveSuffix = "(" + persp.getElementId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ List bars = findElements(window, null, MTrimBar.class, null); List toRemove = new ArrayList<>(); for (MTrimBar bar : bars) { @@ -933,7 +938,7 @@ continue; } String id = barKid.getElementId(); - if (id != null && id.contains(persp.getElementId())) { + if (id != null && id.contains(perspectiveSuffix)) { toRemove.add((MToolControl) barKid); } } @@ -976,7 +981,7 @@ @Override public MPerspective getActivePerspective(MWindow window) { - List pStacks = findElements(window, null, MPerspectiveStack.class, null); + List pStacks = findElements(window, null, MPerspectiveStack.class); if (pStacks.size() == 1) { MPerspective perspective = pStacks.get(0).getSelectedElement(); return perspective; @@ -1104,7 +1109,7 @@ if (perspective != null) { persps.add(perspective); } else { - persps = findElements(window, null, MPerspective.class, null); + persps = findElements(window, null, MPerspective.class); } for (MPerspective persp : persps) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartActivationHistory.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartActivationHistory.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartActivationHistory.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartActivationHistory.java 2018-12-05 21:43:06.000000000 +0000 @@ -267,8 +267,7 @@ } // no sibling candidate, find another part in the area to activate - candidate = findActivationCandidate( - modelService.findElements(area, null, MPart.class, null), part); + candidate = findActivationCandidate(modelService.findElements(area, null, MPart.class), part); if (candidate != null) { return candidate; } @@ -290,8 +289,7 @@ if (full) { generalActivationHistory.remove(part); } else { - for (MPlaceholder placeholder : modelService.findElements(window, null, - MPlaceholder.class, null)) { + for (MPlaceholder placeholder : modelService.findElements(window, null, MPlaceholder.class)) { // if there is at least one placeholder around, we should keep this if (placeholder.getRef() == part && placeholder.isToBeRendered()) { return; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartOnTopManager.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartOnTopManager.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartOnTopManager.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartOnTopManager.java 2018-12-05 21:43:06.000000000 +0000 @@ -132,7 +132,7 @@ private void handleNewAndOldSelectedElementsOfElementContainer(Object oldValue, Object newValue) { if (newValue instanceof MElementContainer) { - List newParts = modelService.findElements((MElementContainer) newValue, null, MPart.class, null); + List newParts = modelService.findElements((MElementContainer) newValue, null, MPart.class); if (oldValue instanceof MElementContainer) { List oldParts = modelService.findElements((MElementContainer) oldValue, null, MPart.class, null); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java 2018-12-05 21:43:06.000000000 +0000 @@ -585,7 +585,7 @@ @Override public boolean isPartOrPlaceholderInPerspective(String elementId, MPerspective perspective) { - List findElements = modelService.findElements(perspective, elementId, MPart.class, null); + List findElements = modelService.findElements(perspective, elementId, MPart.class); if (!findElements.isEmpty()) { MPart part = findElements.get(0); @@ -840,8 +840,8 @@ } @Override - public MPart createPart(String id) { - MPartDescriptor descriptor = modelService.getPartDescriptor(id); + public MPart createPart(String partDescriptorId) { + MPartDescriptor descriptor = modelService.getPartDescriptor(partDescriptorId); return modelService.createPart(descriptor); } @@ -894,7 +894,7 @@ parent = parent.getParent(); } - List phs = modelService.findElements(parent, descId, MPlaceholder.class, null); + List phs = modelService.findElements(parent, descId, MPlaceholder.class); if (phs.size() == 1) { MPlaceholder ph = phs.get(0); sharedPart.setCloseable(ph.isCloseable()); @@ -988,8 +988,7 @@ activeStack.getChildren().add(providedPart); } else { // Find the first visible stack in the area - List sharedStacks = modelService.findElements(area, null, - MPartStack.class, null); + List sharedStacks = modelService.findElements(area, null, MPartStack.class); if (sharedStacks.size() > 0) { for (MPartStack stack : sharedStacks) { if (stack.isToBeRendered()) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/PostWorkbenchClose.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/PostWorkbenchClose.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/PostWorkbenchClose.java 1970-01-01 00:00:00.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/PostWorkbenchClose.java 2018-12-05 21:43:06.000000000 +0000 @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2018 KGU-Consulting GmbH and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Stefan N�bauer - initial API and implementation + *******************************************************************************/ +package org.eclipse.e4.ui.workbench.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Use this annotation to describe methods that will participate in the + * application lifecycle. This method will be called after the model is + * persisted and the workbench is closed. + * + *

IMPORTANT!

Use this annotation with care in your application + * lifecycle since many eclipse services are already down. + *
    + *
  • IPresentationEngine is stopped
  • + *
  • UIEventPublisher is removed
  • + *
  • E4Workbench is unregistered from Framework service registry
  • + *
+ * + * @since 1.8 + */ +@Documented +@Target({ ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +public @interface PostWorkbenchClose { + // intentionally left empty +} diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EModelService.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EModelService.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EModelService.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EModelService.java 2018-12-05 21:43:06.000000000 +0000 @@ -150,6 +150,23 @@ List tagsToMatch); /** + * This is a convenience method that forwards the parameters on to + * {@link EModelService#findElements(MUIElement, String, Class, List)}, passing + * null as 'tagsToMatch'. + * + * @param searchRoot The element at which to start the search. This element must + * be non-null and is included in the search. + * @param id The id of the element search for, can be null + * @param clazz The type of element to be searched for. If non-null this + * also defines the return type of the List. + * @return The generically typed list of matching elements. + * + * @since 1.8 + * + */ + List findElements(MUIElement searchRoot, String id, Class clazz); + + /** * Return a list of any elements that match the given search criteria. The * search is recursive and includes the specified search root. Any of the search * parameters may be specified as null in which case that field diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPartService.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPartService.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPartService.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPartService.java 2018-12-05 21:43:06.000000000 +0000 @@ -163,12 +163,12 @@ /** * Creates a new part of the given id. * - * @param id - * the identifier of the part, must not be null - * @return a new part of the given id, or null if no part descriptors can be found - * that match the specified id + * @param partDescriptorId the identifier of the Part Descriptor, must not be + * null + * @return a new part of the given id, or null if no part + * descriptors can be found that match the specified partDescriptorId */ - MPart createPart(String id); + MPart createPart(String partDescriptorId); /** * Creates a new placeholder for a part of the given id. diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench3/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench3/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench3/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench3/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.workbench.addons.swt;singleton:=true -Bundle-Version: 1.3.200.qualifier +Bundle-Version: 1.3.300.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.workbench.addons.swt - 1.3.200-SNAPSHOT + 1.3.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/PartDragAgent.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/PartDragAgent.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/PartDragAgent.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/PartDragAgent.java 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,9 @@ package org.eclipse.e4.ui.workbench.addons.dndaddon; +import java.util.List; import org.eclipse.e4.ui.model.application.ui.MUIElement; +import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; @@ -42,7 +44,13 @@ // Drag a part that is in a stack if (info.itemElement instanceof MStackElement) { // Prevent dragging 'No Move' parts - if (info.itemElement.getTags().contains(IPresentationEngine.NO_MOVE)) { + List tags; + if (info.itemElement instanceof MPlaceholder) { + tags = ((MPlaceholder) info.itemElement).getRef().getTags(); + } else { + tags = info.itemElement.getTags(); + } + if (tags.contains(IPresentationEngine.NO_MOVE)) { return null; } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java 2018-12-05 21:43:06.000000000 +0000 @@ -86,9 +86,6 @@ @Inject private IEclipseContext context; - @Inject - private EPartService partService; - // Allow 'local' changes to the tags private boolean ignoreTagChanges = false; @@ -312,8 +309,7 @@ if (winShell == null) { return; } - List tcList = modelService.findElements(window, null, MToolControl.class, - null); + List tcList = modelService.findElements(window, null, MToolControl.class); final MPerspective curPersp = ps.getSelectedElement(); if (curPersp != null) { @@ -431,8 +427,7 @@ return; } - List trimStacks = modelService.findElements(perspWin, null, - MToolControl.class, null); + List trimStacks = modelService.findElements(perspWin, null, MToolControl.class); for (MToolControl trimStack : trimStacks) { // Only care about MToolControls that are TrimStacks if (TrimStack.CONTRIBUTION_URI.equals(trimStack.getContributionURI())) { @@ -467,7 +462,7 @@ private String getWinCache(MWindow win, MPerspective perspective) { StringBuilder winStrBuilder = new StringBuilder(); - List stackList = modelService.findElements(win, null, MPartStack.class, null); + List stackList = modelService.findElements(win, null, MPartStack.class); for (MPartStack stack : stackList) { winStrBuilder.append(getStackTrimLoc(stack, perspective)); } @@ -588,8 +583,7 @@ if (element.getWidget() instanceof CTabFolder) { return (CTabFolder) element.getWidget(); } - List stacks = modelService.findElements(element, null, MPartStack.class, - null); + List stacks = modelService.findElements(element, null, MPartStack.class); for (MPartStack stack : stacks) { if (stack.getWidget() instanceof CTabFolder) { return (CTabFolder) stack.getWidget(); @@ -630,6 +624,8 @@ adjustCTFButtons(element); // Activate a part other than the trimStack so that if the tool item is pressed // immediately it will still open the stack. + MWindow win = MinMaxAddonUtil.getWindowFor(element); + EPartService partService = win.getContext().get(EPartService.class); partService.requestActivation(); } @@ -738,8 +734,7 @@ // special case for windows with no perspectives (eg bug 372614: // intro part with no perspectives). We know we're outside // of the perspective stack, so find it top-down - List pStacks = modelService.findElements(win, null, - MPerspectiveStack.class, null); + List pStacks = modelService.findElements(win, null, MPerspectiveStack.class); perspStack = (pStacks.size() > 0) ? pStacks.get(0) : null; } else { perspStack = persp.getParent(); @@ -900,6 +895,7 @@ MinMaxAddonUtil.unzoomStackOfMinMaxChildrenArea(this, element); // There are more views available to be active... + EPartService partService = win.getContext().get(EPartService.class); partService.requestActivation(); } @@ -959,8 +955,7 @@ // Find the Perspective Stack int loc = modelService.getElementLocation(element); if ((loc & EModelService.OUTSIDE_PERSPECTIVE) != 0) { - List psList = modelService.findElements(win, null, - MPerspectiveStack.class, null); + List psList = modelService.findElements(win, null, MPerspectiveStack.class); if (psList.size() == 1) { MPerspectiveStack perspStack = psList.get(0); if (element != perspStack && perspStack != null @@ -1101,4 +1096,4 @@ return bar; } -} +} \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddonUtil.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddonUtil.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddonUtil.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddonUtil.java 2018-12-05 21:43:06.000000000 +0000 @@ -158,8 +158,7 @@ if (!placeholder.getRef().getTags().contains(MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG)) { continue; } - List partStacks = modelService.findElements(placeholder, null, MPartStack.class, - null); + List partStacks = modelService.findElements(placeholder, null, MPartStack.class); if (partStacks.contains(element)) { continue; } @@ -253,8 +252,7 @@ if (placeholder.getRef().getTags().contains(MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG)) { foundRelevantArea = true; } - List partStacks = modelService.findElements(placeholder, null, MPartStack.class, - null); + List partStacks = modelService.findElements(placeholder, null, MPartStack.class); for (MPartStack partStack : partStacks) { if (partStack == element) { continue; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java 2018-12-05 21:43:06.000000000 +0000 @@ -738,8 +738,7 @@ private MUIElement findElement() { MUIElement result; - List ps = modelService.findElements(window, null, - MPerspectiveStack.class, null); + List ps = modelService.findElements(window, null, MPerspectiveStack.class); if (ps.isEmpty()) { String toolControlId = toolControl.getElementId(); int index = toolControlId.indexOf('('); @@ -754,8 +753,7 @@ MPerspective persp = null; if (perspId != null) { - List perspectives = modelService.findElements(ps.get(0), perspId, MPerspective.class, - null); + List perspectives = modelService.findElements(ps.get(0), perspId, MPerspective.class); if (perspectives != null && !perspectives.isEmpty()) { persp = perspectives.get(0); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java 2018-12-05 21:43:06.000000000 +0000 @@ -46,7 +46,7 @@ MCompositePart myPart; List getSubParts() { - List childParts = ms.findElements(myPart, null, MPart.class, null); + List childParts = ms.findElements(myPart, null, MPart.class); return childParts; } @@ -99,7 +99,7 @@ } void callingAllParts(Class clz) { - List parts = ms.findElements(myPart, null, MPart.class, null); + List parts = ms.findElements(myPart, null, MPart.class); for (MPart part : parts) { if (part == myPart) { continue; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.workbench.renderers.swt;singleton:=true -Bundle-Version: 0.14.300.qualifier +Bundle-Version: 0.14.400.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -12,7 +12,7 @@ org.eclipse.e4.core.di;bundle-version="1.1.0", org.eclipse.e4.ui.services;bundle-version="0.9.0", org.eclipse.swt;bundle-version="[3.5.0,4.0.0)", - org.eclipse.jface;bundle-version="[3.5.0,4.0.0)", + org.eclipse.jface;bundle-version="[3.15.0,4.0.0)", org.eclipse.e4.ui.workbench.swt;bundle-version="0.9.0", org.eclipse.e4.ui.model.workbench;bundle-version="0.9.0", org.eclipse.e4.core.commands;bundle-version="0.9.0", diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.workbench.renderers.swt - 0.14.300-SNAPSHOT + 0.14.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java 2018-12-05 21:43:06.000000000 +0000 @@ -135,8 +135,7 @@ ctf.setHighlightEnabled(false); // Find the stack in the area that used to have the min/max state - List stacks = modelService.findElements(areaModel, null, - MPartStack.class, null); + List stacks = modelService.findElements(areaModel, null, MPartStack.class); MPartStack curStack = null; for (MPartStack stack : stacks) { if (stack.isToBeRendered() @@ -191,8 +190,7 @@ // OK now copy over the min/max state of the area stack to the // remaining part stack - List stacks = modelService.findElements(areaModel, - null, MPartStack.class, null); + List stacks = modelService.findElements(areaModel, null, MPartStack.class); for (MPartStack stack : stacks) { if (stack.isToBeRendered() && stack.getWidget() instanceof CTabFolder) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ElementReferenceRenderer.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ElementReferenceRenderer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ElementReferenceRenderer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ElementReferenceRenderer.java 2018-12-05 21:43:06.000000000 +0000 @@ -129,8 +129,7 @@ // Reparent the context(s) (if any) IEclipseContext newParentContext = modelService .getContainingContext(aPH); - List allContexts = modelService.findElements( - refElement, null, MContext.class, null); + List allContexts = modelService.findElements(refElement, null, MContext.class); for (MContext ctxtElement : allContexts) { IEclipseContext theContext = ctxtElement .getContext(); @@ -166,7 +165,7 @@ IEclipseContext newParentContext = modelService .getContainingContext(currentRef); List allContexts = modelService.findElements( - refElement, null, MContext.class, null); + refElement, null, MContext.class); for (MContext ctxtElement : allContexts) { IEclipseContext theContext = ctxtElement.getContext(); // this may be null if it hasn't been rendered yet diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java 2018-12-05 21:43:06.000000000 +0000 @@ -24,12 +24,14 @@ import java.util.List; import java.util.Map; import javax.inject.Inject; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IStateListener; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.commands.State; import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.e4.core.commands.ECommandService; import org.eclipse.e4.core.commands.EHandlerService; +import org.eclipse.e4.core.commands.internal.HandlerServiceImpl; import org.eclipse.e4.core.commands.internal.ICommandHelpService; import org.eclipse.e4.core.contexts.EclipseContextFactory; import org.eclipse.e4.core.contexts.IContextFunction; @@ -434,6 +436,12 @@ EHandlerService service = lclContext.get(EHandlerService.class); final IEclipseContext staticContext = getStaticContext(trigger); service.executeHandler(cmd, staticContext); + Object object = staticContext.get(HandlerServiceImpl.HANDLER_EXCEPTION); + if (object instanceof ExecutionException) { + if (logger != null) { + logger.error((Throwable) object, "Command '" + cmd.getId() + "' failed"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } } @Override diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java 2018-12-05 21:43:06.000000000 +0000 @@ -206,8 +206,7 @@ } } else if (part.getCurSharedRef() != null) { MWindow topWin = modelService.getTopLevelWindowFor(part); - List partRefs = modelService.findElements(topWin, part.getElementId(), MPlaceholder.class, - null); + List partRefs = modelService.findElements(topWin, part.getElementId(), MPlaceholder.class); for (MPlaceholder ref : partRefs) { CTabItem item = findItemForPart(ref, null); if (item != null) { @@ -947,7 +946,7 @@ if (win == null) return null; - List refs = modelService.findElements(win, null, MPlaceholder.class, null); + List refs = modelService.findElements(win, null, MPlaceholder.class); if (refs != null) { for (MPlaceholder ref : refs) { if (ref.getRef() != part) diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java 2018-12-05 21:43:06.000000000 +0000 @@ -22,6 +22,7 @@ *******************************************************************************/ package org.eclipse.e4.ui.workbench.renderers.swt; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -76,9 +77,11 @@ import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.jface.util.Throttler; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; import org.eclipse.swt.widgets.Widget; @@ -111,6 +114,12 @@ private ToolItemUpdater enablementUpdater = new ToolItemUpdater(); + // See Bug 536308 + // remove disableThrottling system property in 4.11 if no problems are + // identified in 4.10 + private static boolean disableThrottling = System.getProperty("bug_536308.disable.throttling") != null; //$NON-NLS-1$ + + @Inject private Logger logger; @@ -321,7 +330,7 @@ @Inject @Optional private void subscribeTopicAppStartup(@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) Event event) { - List toolBars = modelService.findElements(application, null, MToolBar.class, null); + List toolBars = modelService.findElements(application, null, MToolBar.class); for (MToolBar mToolBar : toolBars) { if (mToolBar.getTags().contains(IPresentationEngine.HIDDEN_EXPLICITLY)) { mToolBar.setVisible(false); @@ -336,11 +345,12 @@ @PostConstruct public void init() { context.set(ToolBarManagerRenderer.class, this); + Throttler throttler = new Throttler(Display.getDefault(), Duration.ofMillis(200), + () -> getUpdater().updateContributionItems(ALL_SELECTOR)); String[] vars = { "org.eclipse.ui.internal.services.EvaluationService.evaluate", //$NON-NLS-1$ IServiceConstants.ACTIVE_CONTEXTS, - IServiceConstants.ACTIVE_PART, IServiceConstants.ACTIVE_SELECTION, IServiceConstants.ACTIVE_SHELL }; updateVariables.addAll(Arrays.asList(vars)); @@ -352,7 +362,14 @@ for (String var : updateVariables) { context.get(var); } - getUpdater().updateContributionItems(ALL_SELECTOR); + // See Bug 536308 + // remove disableThrottling system property in 4.11 if no problems are + // identified in 4.10 + if (disableThrottling) { + getUpdater().updateContributionItems(ALL_SELECTOR); + } else { + throttler.throttledExec(); + } return true; } }; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemUpdater.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemUpdater.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemUpdater.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemUpdater.java 2018-12-05 21:43:06.000000000 +0000 @@ -15,13 +15,26 @@ package org.eclipse.e4.ui.workbench.renderers.swt; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.eclipse.e4.ui.workbench.Selector; +import org.eclipse.swt.widgets.Display; -public class ToolItemUpdater { +public class ToolItemUpdater implements Runnable { + private static int DELAY = 100; + private long timestampOfEarliestQueuedUpdate = 0; private List itemsToCheck = new ArrayList<>(); private final List orphanedToolItems = new ArrayList<>(); + private final Set itemsToUpdateLater = new LinkedHashSet<>(); + + public ToolItemUpdater() { + String delayProperty = System.getProperty("ToolItemUpdaterDelayInMs"); //$NON-NLS-1$ + if (delayProperty != null) { + DELAY = Integer.parseInt(delayProperty); + } + } void registerItem(AbstractContributionItem item) { if (!itemsToCheck.contains(item)) { @@ -34,10 +47,23 @@ } public void updateContributionItems(Selector selector) { + boolean doRunNow = false; for (final AbstractContributionItem ci : itemsToCheck) { if (ci.getModel() != null && ci.getModel().getParent() != null) { if (selector.select(ci.getModel())) { - ci.updateItemEnablement(); + itemsToUpdateLater.add(ci); + if (timestampOfEarliestQueuedUpdate == 0) { + timestampOfEarliestQueuedUpdate = System.nanoTime(); + } + if (System.nanoTime() - timestampOfEarliestQueuedUpdate > DELAY * 1_000_000) { + // runnable was not called within the last DELAY milliseconds, do it now. + // For scenario: a plugin is forcing that updateContributionItems is called + // again and again in less than given DELAY frequency. TimerExec would then + // never be executed. + doRunNow = true; + } else { + Display.getDefault().timerExec(DELAY, this); + } } } else { orphanedToolItems.add(ci); @@ -47,5 +73,18 @@ itemsToCheck.removeAll(orphanedToolItems); orphanedToolItems.clear(); } + if (doRunNow) { + run(); + } + } + + @Override + public void run() { + timestampOfEarliestQueuedUpdate = 0; + AbstractContributionItem[] copy = itemsToUpdateLater.toArray(new AbstractContributionItem[] {}); + itemsToUpdateLater.clear(); + for (AbstractContributionItem it : copy) { + it.updateItemEnablement(); + } } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java 2018-12-05 21:43:06.000000000 +0000 @@ -62,6 +62,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.util.Geometry; +import org.eclipse.jface.util.Util; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.LabelProvider; @@ -74,7 +75,6 @@ import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.Resource; import org.eclipse.swt.layout.GridData; @@ -334,7 +334,7 @@ */ private boolean closeDetachedWindow(MWindow window) { EPartService partService = window.getContext().get(EPartService.class); - List parts = modelService.findElements(window, null, MPart.class, null); + List parts = modelService.findElements(window, null, MPart.class); // this saves one part at a time, not ideal but better than not saving // at all for (MPart part : parts) { @@ -418,7 +418,7 @@ } // Force the shell onto the display if it would be invisible otherwise Display display = Display.getCurrent(); - Monitor closestMonitor = getClosestMonitor(display, Geometry.centerPoint(modelBounds)); + Monitor closestMonitor = Util.getClosestMonitor(display, Geometry.centerPoint(modelBounds)); Rectangle displayBounds = closestMonitor.getClientArea(); if (!modelBounds.intersects(displayBounds)) { Geometry.moveInside(modelBounds, displayBounds); @@ -496,44 +496,6 @@ return newWidget; } - /** - * TODO: Create an API for this method and delete this version. See bug - * 491273 - * - * Returns the monitor whose client area contains the given point. If no - * monitor contains the point, returns the monitor that is closest to the - * point. If this is ever made public, it should be moved into a separate - * utility class. - * - * @param toSearch - * point to find (display coordinates) - * @param toFind - * point to find (display coordinates) - * @return the montor closest to the given point - */ - private static Monitor getClosestMonitor(Display toSearch, Point toFind) { - int closest = Integer.MAX_VALUE; - - Monitor[] monitors = toSearch.getMonitors(); - Monitor result = monitors[0]; - - for (Monitor current : monitors) { - Rectangle clientArea = current.getClientArea(); - - if (clientArea.contains(toFind)) { - return current; - } - - int distance = Geometry.distanceSquared(Geometry.centerPoint(clientArea), toFind); - if (distance < closest) { - closest = distance; - result = current; - } - } - - return result; - } - private void setCloseHandler(MWindow window) { IEclipseContext context = window.getContext(); // no direct model parent, must be a detached window @@ -678,7 +640,7 @@ } else if (parent != null) { window.setToBeRendered(false); // this is a detached window, check for parts - if (modelService.findElements(window, null, MPart.class, null) + if (modelService.findElements(window, null, MPart.class) .isEmpty()) { // if no parts, remove it if (parent instanceof MWindow) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.workbench.swt;singleton:=true -Bundle-Version: 0.14.300.qualifier +Bundle-Version: 0.14.400.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/p2.inf eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/p2.inf --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/p2.inf 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/p2.inf 2018-12-05 21:43:06.000000000 +0000 @@ -1,14 +1,3 @@ requires.0.namespace = osgi.extender requires.0.name = osgi.component -requires.0.range = [1.2.0, 2) -# Bug 538564 - Tycho 1.2.0 is only able to start tests with -# org.eclipse.equinox.ds installed (configuring its start level). -# However, org.eclipse.equinox.ds is now discarded and org.apache.felix.scr -# replaces it as provider for `osgi.extender`. Tycho 1.2.0 is not able to -# set the right start level for org.apache.felix.scr. -# So we explicitly add org.eclipse.equinox.ds to keep compatility with -# Tycho 1.2.0: Tycho sets a start-level for org.eclipse.equinox.ds, so -# when the bundle starts it also starts org.apache.felix.scr (as requirement). -requires.1.namespace = osgi.bundle -requires.1.name = org.eclipse.equinox.ds -requires.1.range = 0.0.0 \ No newline at end of file +requires.0.range = [1.2.0, 2) \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.e4 org.eclipse.e4.ui.workbench.swt - 0.14.300-SNAPSHOT + 0.14.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java 2018-12-05 21:43:06.000000000 +0000 @@ -74,6 +74,7 @@ import org.eclipse.e4.ui.workbench.IModelResourceHandler; import org.eclipse.e4.ui.workbench.IWorkbench; import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate; +import org.eclipse.e4.ui.workbench.lifecycle.PostWorkbenchClose; import org.eclipse.e4.ui.workbench.lifecycle.PreSave; import org.eclipse.e4.ui.workbench.lifecycle.ProcessAdditions; import org.eclipse.e4.ui.workbench.lifecycle.ProcessRemovals; @@ -166,6 +167,9 @@ saveModel(); workbench.close(); + if (lcManager != null) { + ContextInjectionFactory.invoke(lcManager, PostWorkbenchClose.class, workbench.getContext(), null); + } if (workbench.isRestart()) { return EXIT_RESTART; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.jface/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jface;singleton:=true -Bundle-Version: 3.14.100.qualifier +Bundle-Version: 3.15.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/.options eclipse-platform-ui-4.10/bundles/org.eclipse.jface/.options --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/.options 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/.options 2018-12-05 21:43:06.000000000 +0000 @@ -1,7 +1,7 @@ # Debugging options for the org.eclipse.jface plugin. # Turn on debugging for the org.eclipse.jface plugin. -org.eclipse.jface/debug=true +org.eclipse.jface/debug=false # Colorize bidi-processed fields and add tooltips/messages that show the configured handlingType for text widgets org.eclipse.jface/debug/bidiUtils=false diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.jface/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.jface org.eclipse.jface - 3.14.100-SNAPSHOT + 3.15.0-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/.settings/.api_filters eclipse-platform-ui-4.10/bundles/org.eclipse.jface/.settings/.api_filters --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/.settings/.api_filters 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/.settings/.api_filters 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,21 @@ + + + + + + + + + + + + + + + + diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/NativeKeyFormatter.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/NativeKeyFormatter.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/NativeKeyFormatter.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/NativeKeyFormatter.java 2018-12-05 21:43:06.000000000 +0000 @@ -152,7 +152,7 @@ sortedKeys[index++] = lookup.getShift(); } - } else if (Util.isGtk() || Util.isMotif()) { + } else if (Util.isGtk()) { if ((modifierKeys & lookup.getShift()) != 0) { sortedKeys[index++] = lookup.getShift(); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java 2018-12-05 21:43:06.000000000 +0000 @@ -22,7 +22,6 @@ import org.eclipse.jface.dialogs.PopupDialog; import org.eclipse.jface.preference.JFacePreferences; import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.Util; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusAdapter; @@ -615,17 +614,10 @@ */ @Override protected final Control createDialogArea(final Composite parent) { - // Use virtual where appropriate (see flag definition). - if (USE_VIRTUAL) { - proposalTable = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL - | SWT.VIRTUAL); - - Listener listener = event -> handleSetData(event); - proposalTable.addListener(SWT.SetData, listener); - } else { - proposalTable = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL); - } + proposalTable = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL); + Listener listener = event -> handleSetData(event); + proposalTable.addListener(SWT.SetData, listener); // set the proposals to force population of the table. setProposals(filterProposals(proposals, filterText)); @@ -733,25 +725,10 @@ // If there is a table if (isValid()) { final int newSize = newProposals.length; - if (USE_VIRTUAL) { // Set and clear the virtual table. Data will be // provided in the SWT.SetData event handler. - proposalTable.setItemCount(newSize); - proposalTable.clearAll(); - } else { - // Populate the table manually - proposalTable.setRedraw(false); - proposalTable.setItemCount(newSize); - TableItem[] items = proposalTable.getItems(); - for (int i = 0; i < items.length; i++) { - TableItem item = items[i]; - IContentProposal proposal = newProposals[i]; - item.setText(getString(proposal)); - item.setImage(getImage(proposal)); - item.setData(proposal); - } - proposalTable.setRedraw(true); - } + proposalTable.setItemCount(newSize); + proposalTable.clearAll(); // Default to the first selection if there is content. if (newProposals.length > 0) { selectProposal(0); @@ -895,6 +872,13 @@ return ret; } + /** + * Asynchronously recompute proposals. + */ + private void refresh() { + asyncRecomputeProposals(filterText); + } + /* * Show the currently selected proposal's description in a secondary * popup. @@ -1077,14 +1061,6 @@ public static final int FILTER_CUMULATIVE = 3; /* - * Set to true to use a Table with SWT.VIRTUAL. This is a - * workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=98585#c40 - * The corresponding SWT bug is - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=90321 - */ - private static final boolean USE_VIRTUAL = !Util.isMotif(); - - /* * The delay before showing a secondary popup. */ private static final int POPUP_DELAY = 750; @@ -2181,4 +2157,16 @@ return false; } + /** + * Reloads the proposals from the content provider and fills them into the + * proposal pop-up, if the pop-up is currently open. + * + * @since 3.15 + */ + public void refresh() { + if (isProposalPopupOpen()) { + popup.refresh(); + } + } + } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/util/LocalSelectionTransfer.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/util/LocalSelectionTransfer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/util/LocalSelectionTransfer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/util/LocalSelectionTransfer.java 2018-12-05 21:43:06.000000000 +0000 @@ -128,8 +128,8 @@ @Override public Object nativeToJava(TransferData transferData) { Object result = super.nativeToJava(transferData); - if (isInvalidNativeType(result)) { - Policy.getLog().log(new Status( + if (result != null && isInvalidNativeType(result)) { + Policy.getLog().log(new Status( IStatus.ERROR, Policy.JFACE, IStatus.ERROR, diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java 2018-12-05 21:43:06.000000000 +0000 @@ -24,6 +24,10 @@ import java.util.TreeSet; import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Monitor; /** *

@@ -494,6 +498,7 @@ * Windowing system constant. * @since 3.5 */ + @Deprecated public static final String WS_MOTIF = "motif";//$NON-NLS-1$ /** @@ -506,12 +511,14 @@ * Windowing system constant. * @since 3.5 */ + @Deprecated public static final String WS_PHOTON = "photon";//$NON-NLS-1$ /** * Windowing system constant. * @since 3.5 */ + @Deprecated public static final String WS_CARBON = "carbon";//$NON-NLS-1$ /** @@ -559,7 +566,7 @@ */ public static boolean isLinux() { final String ws = SWT.getPlatform(); - return WS_GTK.equals(ws) || WS_MOTIF.equals(ws); + return WS_GTK.equals(ws); } /** @@ -577,6 +584,7 @@ * @return true for motif platforms * @since 3.5 */ + @Deprecated public static boolean isMotif() { final String ws = SWT.getPlatform(); return WS_MOTIF.equals(ws); @@ -587,6 +595,7 @@ * @return true for photon platforms * @since 3.5 */ + @Deprecated public static boolean isPhoton() { final String ws = SWT.getPlatform(); return WS_PHOTON.equals(ws); @@ -597,6 +606,7 @@ * @return true for carbon platforms * @since 3.5 */ + @Deprecated public static boolean isCarbon() { final String ws = SWT.getPlatform(); return WS_CARBON.equals(ws); @@ -648,4 +658,37 @@ private Util() { // Not allowed. } + + /** + * Returns the monitor whose client area contains the given point. If no monitor + * contains the point, returns the monitor that is closest to the point. If this + * is ever made public, it should be moved into a separate utility class. + * + * @param toSearch point to find (display coordinates) + * @param toFind point to find (display coordinates) + * @return the monitor closest to the given point + * @since 3.15 + */ + public static Monitor getClosestMonitor(Display toSearch, Point toFind) { + int closest = Integer.MAX_VALUE; + + Monitor[] monitors = toSearch.getMonitors(); + Monitor result = monitors[0]; + + for (Monitor current : monitors) { + Rectangle clientArea = current.getClientArea(); + + if (clientArea.contains(toFind)) { + return current; + } + + int distance = Geometry.distanceSquared(Geometry.centerPoint(clientArea), toFind); + if (distance < closest) { + closest = distance; + result = current; + } + } + + return result; + } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewer.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewer.java 2018-12-05 21:43:06.000000000 +0000 @@ -87,8 +87,8 @@ * the control you want to hook on */ protected void hookEditingSupport(Control control) { - // Needed for backwards comp with AbstractTreeViewer and TableTreeViewer - // who are not hooked this way others may already overwrite and provide + // Needed for backwards comp with AbstractTreeViewer + // which is not hooked this way others may already overwrite and provide // their // own impl if (viewerEditor != null) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledCellLabelProvider.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledCellLabelProvider.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledCellLabelProvider.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledCellLabelProvider.java 2018-12-05 21:43:06.000000000 +0000 @@ -358,10 +358,20 @@ int y = textBounds.y + Math.max(0, (textBounds.height - layoutBounds.height) / 2); - Rectangle saveClipping = gc.getClipping(); - gc.setClipping(textBounds); - textLayout.draw(gc, x, y); - gc.setClipping(saveClipping); + if (gc.isClipped()) { + Rectangle saveClipping = gc.getClipping(); + gc.setClipping(textBounds); + textLayout.draw(gc, x, y); + gc.setClipping(saveClipping); + } else { + // in the case of no clipping, a tooltip will be drawn and the horizontal + // alignment for the tooltip should be LEFT, so x has to be set to textBounds.x + // Because the other alignments are not working combined with the tooltip, since + // these are aligned to the textBounds.width which depends on the cell + // width which is wrong for the tooltip case. + x = textBounds.x; + textLayout.draw(gc, x, y); + } } if (drawFocus(event)) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableTreeViewer.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableTreeViewer.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableTreeViewer.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableTreeViewer.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,805 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Tom Schindl - bug 153993 - *******************************************************************************/ - -package org.eclipse.jface.viewers; - -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.TableTree; -import org.eclipse.swt.custom.TableTreeEditor; -import org.eclipse.swt.custom.TableTreeItem; -import org.eclipse.swt.events.FocusAdapter; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.TreeListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Widget; - -/** - * A concrete viewer based on a SWT TableTree control. - *

- * This class is not intended to be subclassed outside the viewer framework. It - * is designed to be instantiated with a pre-existing SWT table tree control and - * configured with a domain-specific content provider, label provider, element - * filter (optional), and element sorter (optional). - *

- *

- * Content providers for table tree viewers must implement the - * ITreeContentProvider interface. - *

- *

- * Label providers for table tree viewers must implement either the - * ITableLabelProvider or the ILabelProvider interface - * (see TableTreeViewer.setLabelProvider for more details). - *

- * - * @deprecated As of 3.1 use {@link TreeViewer} instead - * @noreference This API will be deleted in a future release. See bug 436505 for - * details. - * @noextend This API will be deleted in a future release. See bug 436505 for - * details. - */ -@Deprecated -public class TableTreeViewer extends AbstractTreeViewer { - /** - * Internal table viewer implementation. - */ - private TableTreeEditorImpl tableEditorImpl; - - /** - * This viewer's table tree control. - */ - private TableTree tableTree; - - /** - * This viewer's table tree editor. - */ - private TableTreeEditor tableTreeEditor; - - /** - * Copied from original TableEditorImpl and moved here since refactoring - * completely wiped out the original implementation in 3.3 - * - * @since 3.1 - */ - class TableTreeEditorImpl { - - private CellEditor cellEditor; - - private CellEditor[] cellEditors; - - private ICellModifier cellModifier; - - private String[] columnProperties; - - private Item tableItem; - - private int columnNumber; - - private ICellEditorListener cellEditorListener; - - private FocusListener focusListener; - - private MouseListener mouseListener; - - private int doubleClickExpirationTime; - - private ColumnViewer viewer; - - private TableTreeEditorImpl(ColumnViewer viewer) { - this.viewer = viewer; - initCellEditorListener(); - } - - /** - * Returns this TableViewerImpl viewer - * - * @return the viewer - */ - public ColumnViewer getViewer() { - return viewer; - } - - private void activateCellEditor() { - if( cellEditors != null ) { - if( cellEditors[columnNumber] != null && cellModifier != null ) { - Object element = tableItem.getData(); - String property = columnProperties[columnNumber]; - - if( cellModifier.canModify(element, property) ) { - cellEditor = cellEditors[columnNumber]; - - cellEditor.addListener(cellEditorListener); - - Object value = cellModifier.getValue(element, property); - cellEditor.setValue(value); - // Tricky flow of control here: - // activate() can trigger callback to cellEditorListener - // which will clear cellEditor - // so must get control first, but must still call activate() - // even if there is no control. - final Control control = cellEditor.getControl(); - cellEditor.activate(); - if (control == null) { - return; - } - setLayoutData(cellEditor.getLayoutData()); - setEditor(control, tableItem, columnNumber); - cellEditor.setFocus(); - if (focusListener == null) { - focusListener = new FocusAdapter() { - @Override - public void focusLost(FocusEvent e) { - applyEditorValue(); - } - }; - } - control.addFocusListener(focusListener); - mouseListener = new MouseAdapter() { - @Override - public void mouseDown(MouseEvent e) { - // time wrap? - // check for expiration of doubleClickTime - if (e.time <= doubleClickExpirationTime) { - control.removeMouseListener(mouseListener); - cancelEditing(); - handleDoubleClickEvent(); - } else if (mouseListener != null) { - control.removeMouseListener(mouseListener); - } - } - }; - control.addMouseListener(mouseListener); - } - } - } - } - - /** - * Activate a cell editor for the given mouse position. - */ - private void activateCellEditor(MouseEvent event) { - if (tableItem == null || tableItem.isDisposed()) { - // item no longer exists - return; - } - int columnToEdit; - int columns = getColumnCount(); - if (columns == 0) { - // If no TableColumn, Table acts as if it has a single column - // which takes the whole width. - columnToEdit = 0; - } else { - columnToEdit = -1; - for (int i = 0; i < columns; i++) { - Rectangle bounds = getBounds(tableItem, i); - if (bounds.contains(event.x, event.y)) { - columnToEdit = i; - break; - } - } - if (columnToEdit == -1) { - return; - } - } - - columnNumber = columnToEdit; - activateCellEditor(); - } - - /** - * Deactivates the currently active cell editor. - */ - public void applyEditorValue() { - CellEditor c = this.cellEditor; - if (c != null) { - // null out cell editor before calling save - // in case save results in applyEditorValue being re-entered - // see 1GAHI8Z: ITPUI:ALL - How to code event notification when - // using cell editor ? - this.cellEditor = null; - Item t = this.tableItem; - // don't null out table item -- same item is still selected - if (t != null && !t.isDisposed()) { - saveEditorValue(c, t); - } - setEditor(null, null, 0); - c.removeListener(cellEditorListener); - Control control = c.getControl(); - if (control != null) { - if (mouseListener != null) { - control.removeMouseListener(mouseListener); - } - if (focusListener != null) { - control.removeFocusListener(focusListener); - } - } - c.deactivate(); - } - } - - /** - * Cancels the active cell editor, without saving the value back to the - * domain model. - */ - public void cancelEditing() { - if (cellEditor != null) { - setEditor(null, null, 0); - cellEditor.removeListener(cellEditorListener); - CellEditor oldEditor = cellEditor; - cellEditor = null; - oldEditor.deactivate(); - } - } - - /** - * Start editing the given element. - * - * @param element - * @param column - */ - public void editElement(Object element, int column) { - if (cellEditor != null) { - applyEditorValue(); - } - - setSelection(new StructuredSelection(element), true); - Item[] selection = getSelection(); - if (selection.length != 1) { - return; - } - - tableItem = selection[0]; - - // Make sure selection is visible - showSelection(); - columnNumber = column; - activateCellEditor(); - - } - - /** - * Return the array of CellEditors used in the viewer - * - * @return the cell editors - */ - public CellEditor[] getCellEditors() { - return cellEditors; - } - - /** - * Get the cell modifier - * - * @return the cell modifier - */ - public ICellModifier getCellModifier() { - return cellModifier; - } - - /** - * Return the properties for the column - * - * @return the array of column properties - */ - public Object[] getColumnProperties() { - return columnProperties; - } - - /** - * Handles the mouse down event; activates the cell editor. - * - * @param event - * the mouse event that should be handled - */ - public void handleMouseDown(MouseEvent event) { - if (event.button != 1) { - return; - } - - if (cellEditor != null) { - applyEditorValue(); - } - - // activate the cell editor immediately. If a second mouseDown - // is received prior to the expiration of the doubleClick time then - // the cell editor will be deactivated and a doubleClick event will - // be processed. - // - doubleClickExpirationTime = event.time - + Display.getCurrent().getDoubleClickTime(); - - Item[] items = getSelection(); - // Do not edit if more than one row is selected. - if (items.length != 1) { - tableItem = null; - return; - } - tableItem = items[0]; - - activateCellEditor(event); - } - - private void initCellEditorListener() { - cellEditorListener = new ICellEditorListener() { - @Override - public void editorValueChanged(boolean oldValidState, - boolean newValidState) { - // Ignore. - } - - @Override - public void cancelEditor() { - TableTreeEditorImpl.this.cancelEditing(); - } - - @Override - public void applyEditorValue() { - TableTreeEditorImpl.this.applyEditorValue(); - } - }; - } - - /** - * Return whether there is an active cell editor. - * - * @return true if there is an active cell editor; - * otherwise false is returned. - */ - public boolean isCellEditorActive() { - return cellEditor != null; - } - - /** - * Saves the value of the currently active cell editor, by delegating to - * the cell modifier. - */ - private void saveEditorValue(CellEditor cellEditor, Item tableItem) { - if( cellModifier != null ) { - if( ! cellEditor.isValueValid() ) { - // Do what???? - } - } - String property = null; - - if( columnProperties != null && columnNumber < columnProperties.length ) { - property = columnProperties[columnNumber]; - } - cellModifier.modify(tableItem, property, cellEditor.getValue()); - } - - /** - * Set the cell editors - * - * @param editors - */ - public void setCellEditors(CellEditor[] editors) { - this.cellEditors = editors; - } - - /** - * Set the cell modifier - * - * @param modifier - */ - public void setCellModifier(ICellModifier modifier) { - this.cellModifier = modifier; - } - - /** - * Set the column properties - * - * @param columnProperties - */ - public void setColumnProperties(String[] columnProperties) { - this.columnProperties = columnProperties; - } - - Rectangle getBounds(Item item, int columnNumber) { - return ((TableTreeItem) item).getBounds(columnNumber); - } - - int getColumnCount() { - // getColumnCount() should be a API in TableTree. - return getTableTree().getTable().getColumnCount(); - } - - Item[] getSelection() { - return getTableTree().getSelection(); - } - - void setEditor(Control w, Item item, int columnNumber) { - tableTreeEditor.setEditor(w, (TableTreeItem) item, columnNumber); - } - - void setSelection(StructuredSelection selection, boolean b) { - TableTreeViewer.this.setSelection(selection, b); - } - - void showSelection() { - getTableTree().showSelection(); - } - - void setLayoutData(CellEditor.LayoutData layoutData) { - tableTreeEditor.horizontalAlignment = layoutData.horizontalAlignment; - tableTreeEditor.grabHorizontal = layoutData.grabHorizontal; - tableTreeEditor.minimumWidth = layoutData.minimumWidth; - } - - void handleDoubleClickEvent() { - Viewer viewer = getViewer(); - fireDoubleClick(new DoubleClickEvent(viewer, viewer.getSelection())); - fireOpen(new OpenEvent(viewer, viewer.getSelection())); - } - } - - /** - * Creates a table tree viewer on the given table tree control. The viewer - * has no input, no content provider, a default label provider, no sorter, - * and no filters. - * - * @param tree - * the table tree control - */ - @Deprecated - public TableTreeViewer(TableTree tree) { - super(); - tableTree = tree; - hookControl(tree); - tableTreeEditor = new TableTreeEditor(tableTree); - tableEditorImpl = new TableTreeEditorImpl(this); - } - - /** - * Creates a table tree viewer on a newly-created table tree control under - * the given parent. The table tree control is created using the SWT style - * bits MULTI, H_SCROLL, V_SCROLL, and BORDER. The viewer - * has no input, no content provider, a default label provider, no sorter, - * and no filters. - * - * @param parent - * the parent control - */ - @Deprecated - public TableTreeViewer(Composite parent) { - this(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); - } - - /** - * Creates a table tree viewer on a newly-created table tree control under - * the given parent. The table tree control is created using the given SWT - * style bits. The viewer has no input, no content provider, a default label - * provider, no sorter, and no filters. - * - * @param parent - * the parent control - * @param style - * the SWT style bits - */ - @Deprecated - public TableTreeViewer(Composite parent, int style) { - this(new TableTree(parent, style)); - } - - @Override - protected void addTreeListener(Control c, TreeListener listener) { - ((TableTree) c).addTreeListener(listener); - } - - @Override - @Deprecated - public void cancelEditing() { - tableEditorImpl.cancelEditing(); - } - - @Override - protected void doUpdateItem(Item item, Object element) { - // update icon and label - // Similar code in TableTreeViewer.doUpdateItem() - IBaseLabelProvider prov = getLabelProvider(); - ITableLabelProvider tprov = null; - - if (prov instanceof ITableLabelProvider) { - tprov = (ITableLabelProvider) prov; - } - - int columnCount = tableTree.getTable().getColumnCount(); - TableTreeItem ti = (TableTreeItem) item; - // Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT - - // TableViewer with 0 columns does not work - for (int column = 0; column < columnCount || column == 0; column++) { - String text = "";//$NON-NLS-1$ - Image image = null; - if (tprov != null) { - text = tprov.getColumnText(element, column); - image = tprov.getColumnImage(element, column); - } else { - if (column == 0) { - ViewerLabel updateLabel = new ViewerLabel(item.getText(), - item.getImage()); - buildLabel(updateLabel, element); - - // As it is possible for user code to run the event - // loop check here. - if (item.isDisposed()) { - unmapElement(element, item); - return; - } - - text = updateLabel.getText(); - image = updateLabel.getImage(); - } - } - - // Avoid setting text to null - if (text == null) { - text = ""; //$NON-NLS-1$ - } - - ti.setText(column, text); - // Apparently a problem to setImage to null if already null - if (ti.getImage(column) != image) { - ti.setImage(column, image); - } - - getColorAndFontCollector().setFontsAndColors(element); - getColorAndFontCollector().applyFontsAndColors(ti); - } - - } - - @Override - @Deprecated - public void editElement(Object element, int column) { - tableEditorImpl.editElement(element, column); - } - - @Override - @Deprecated - public CellEditor[] getCellEditors() { - return tableEditorImpl.getCellEditors(); - } - - @Override - @Deprecated - public ICellModifier getCellModifier() { - return tableEditorImpl.getCellModifier(); - } - - @Override - protected Item[] getChildren(Widget o) { - if (o instanceof TableTreeItem) { - return ((TableTreeItem) o).getItems(); - } - if (o instanceof TableTree) { - return ((TableTree) o).getItems(); - } - return null; - } - - @Override - protected Item getChild(Widget widget, int index) { - if (widget instanceof TableTreeItem) { - return ((TableTreeItem) widget).getItem(index); - } - if (widget instanceof TableTree) { - return ((TableTree) widget).getItem(index); - } - return null; - } - - @Override - @Deprecated - public Object[] getColumnProperties() { - return tableEditorImpl.getColumnProperties(); - } - - @Override - @Deprecated - public Control getControl() { - return tableTree; - } - - /** - * Returns the element with the given index from this viewer. Returns - * null if the index is out of range. - *

- * This method is internal to the framework. - *

- * - * @param index - * the zero-based index - * @return the element at the given index, or null if the - * index is out of range - */ - @Deprecated - public Object getElementAt(int index) { - // XXX: Workaround for 1GBCSB1: SWT:WIN2000 - TableTree should have - // getItem(int index) - TableTreeItem i = tableTree.getItems()[index]; - if (i != null) { - return i.getData(); - } - return null; - } - - @Override - protected boolean getExpanded(Item item) { - return ((TableTreeItem) item).getExpanded(); - } - - @Override - protected Item getItemAt(Point p) { - return getTableTree().getTable().getItem(p); - } - - @Override - protected int getItemCount(Control widget) { - return ((TableTree) widget).getItemCount(); - } - - @Override - protected int getItemCount(Item item) { - return ((TableTreeItem) item).getItemCount(); - } - - @Override - protected org.eclipse.swt.widgets.Item[] getItems( - org.eclipse.swt.widgets.Item item) { - return ((TableTreeItem) item).getItems(); - } - - /** - * The table tree viewer implementation of this Viewer - * framework method returns the label provider, which in the case of table - * tree viewers will be an instance of either - * ITableLabelProvider or ILabelProvider. If - * it is an ITableLabelProvider, then it provides a separate - * label text and image for each column. If it is an - * ILabelProvider, then it provides only the label text and - * image for the first column, and any remaining columns are blank. - */ - @Override - @Deprecated - public IBaseLabelProvider getLabelProvider() { - return super.getLabelProvider(); - } - - @Override - protected Item getParentItem(Item item) { - return ((TableTreeItem) item).getParentItem(); - } - - @Override - protected Item[] getSelection(Control widget) { - return ((TableTree) widget).getSelection(); - } - - /** - * Returns this table tree viewer's table tree control. - * - * @return the table tree control - */ - @Deprecated - public TableTree getTableTree() { - return tableTree; - } - - @Override - protected void hookControl(Control control) { - super.hookControl(control); - tableTree.getTable().addMouseListener(new MouseAdapter() { - @Override - public void mouseDown(MouseEvent e) { - /* - * If user clicked on the [+] or [-], do not activate - * CellEditor. - */ - // XXX: This code should not be here. SWT should either have - // support to see - // if the user clicked on the [+]/[-] or manage the table editor - // activation - org.eclipse.swt.widgets.TableItem[] items = tableTree - .getTable().getItems(); - for (TableItem item : items) { - Rectangle rect = item.getImageBounds(0); - if (rect.contains(e.x, e.y)) { - return; - } - } - - tableEditorImpl.handleMouseDown(e); - } - }); - } - - @Override - @Deprecated - public boolean isCellEditorActive() { - return tableEditorImpl.isCellEditorActive(); - } - - @Override - protected Item newItem(Widget parent, int flags, int ix) { - TableTreeItem item; - if (ix >= 0) { - if (parent instanceof TableTreeItem) { - item = new TableTreeItem((TableTreeItem) parent, flags, ix); - } else { - item = new TableTreeItem((TableTree) parent, flags, ix); - } - } else { - if (parent instanceof TableTreeItem) { - item = new TableTreeItem((TableTreeItem) parent, flags); - } else { - item = new TableTreeItem((TableTree) parent, flags); - } - } - return item; - } - - @Override - protected void removeAll(Control widget) { - ((TableTree) widget).removeAll(); - } - - @Override - @Deprecated - public void setCellEditors(CellEditor[] editors) { - tableEditorImpl.setCellEditors(editors); - } - - @Override - @Deprecated - public void setCellModifier(ICellModifier modifier) { - tableEditorImpl.setCellModifier(modifier); - } - - @Override - @Deprecated - public void setColumnProperties(String[] columnProperties) { - tableEditorImpl.setColumnProperties(columnProperties); - } - - @Override - @Deprecated - protected void setExpanded(Item node, boolean expand) { - ((TableTreeItem) node).setExpanded(expand); - } - - @Override - @Deprecated - protected void setSelection(List items) { - TableTreeItem[] newItems = new TableTreeItem[items.size()]; - items.toArray(newItems); - getTableTree().setSelection(newItems); - } - - @Override - @Deprecated - protected void showItem(Item item) { - getTableTree().showItem((TableTreeItem) item); - } -} diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java 2018-12-05 21:43:06.000000000 +0000 @@ -20,6 +20,7 @@ import org.eclipse.jface.util.Geometry; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.jface.util.Util; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ShellAdapter; import org.eclipse.swt.events.ShellEvent; @@ -898,41 +899,6 @@ returnCode = code; } - /** - * Returns the monitor whose client area contains the given point. If no - * monitor contains the point, returns the monitor that is closest to the - * point. If this is ever made public, it should be moved into a separate - * utility class. - * - * @param toSearch - * point to find (display coordinates) - * @param toFind - * point to find (display coordinates) - * @return the monitor closest to the given point - */ - private static Monitor getClosestMonitor(Display toSearch, Point toFind) { - int closest = Integer.MAX_VALUE; - - Monitor[] monitors = toSearch.getMonitors(); - Monitor result = monitors[0]; - - for (Monitor current : monitors) { - Rectangle clientArea = current.getClientArea(); - - if (clientArea.contains(toFind)) { - return current; - } - - int distance = Geometry.distanceSquared(Geometry - .centerPoint(clientArea), toFind); - if (distance < closest) { - closest = distance; - result = current; - } - } - - return result; - } /** * Given the desired position of the window, this method returns an adjusted @@ -952,7 +918,7 @@ Rectangle result = new Rectangle(preferredSize.x, preferredSize.y, preferredSize.width, preferredSize.height); - Monitor mon = getClosestMonitor(getShell().getDisplay(), Geometry + Monitor mon = Util.getClosestMonitor(getShell().getDisplay(), Geometry .centerPoint(result)); Rectangle bounds = mon.getClientArea(); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jface.databinding -Bundle-Version: 1.8.300.qualifier +Bundle-Version: 1.8.400.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.jface org.eclipse.jface.databinding - 1.8.300-SNAPSHOT + 1.8.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/dialog/DialogPageSupport.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/dialog/DialogPageSupport.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/dialog/DialogPageSupport.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/dialog/DialogPageSupport.java 2018-12-05 21:43:06.000000000 +0000 @@ -34,8 +34,6 @@ import org.eclipse.core.databinding.observable.list.ListDiff; import org.eclipse.core.databinding.observable.list.ListDiffEntry; import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.databinding.observable.value.IValueChangeListener; -import org.eclipse.core.databinding.observable.value.ValueChangeEvent; import org.eclipse.core.databinding.util.Policy; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; @@ -43,8 +41,6 @@ import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; /** * Connects the validation result from the given data binding context to the @@ -89,18 +85,14 @@ .getElement(); IObservableList targets = validationStatusProvider.getTargets(); if (listDiffEntry.isAddition()) { - targets - .addListChangeListener(validationStatusProviderTargetsListener); + targets.addListChangeListener(validationStatusProviderTargetsListener); for (Iterator it = targets.iterator(); it.hasNext();) { - ((IObservable) it.next()) - .addChangeListener(uiChangeListener); + ((IObservable) it.next()).addChangeListener(uiChangeListener); } } else { - targets - .removeListChangeListener(validationStatusProviderTargetsListener); + targets.removeListChangeListener(validationStatusProviderTargetsListener); for (Iterator it = targets.iterator(); it.hasNext();) { - ((IObservable) it.next()) - .removeChangeListener(uiChangeListener); + ((IObservable) it.next()).removeChangeListener(uiChangeListener); } } } @@ -174,18 +166,8 @@ } aggregateStatusProvider - .addValueChangeListener(new IValueChangeListener() { - @Override - public void handleValueChange(ValueChangeEvent event) { - statusProviderChanged(); - } - }); - dialogPage.getShell().addListener(SWT.Dispose, new Listener() { - @Override - public void handleEvent(Event event) { - dispose(); - } - }); + .addValueChangeListener(event -> statusProviderChanged()); + dialogPage.getShell().addListener(SWT.Dispose, event -> dispose()); aggregateStatusProvider.addStaleListener(new IStaleListener() { @Override public void handleStale(StaleEvent staleEvent) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTObservableListDecorator.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTObservableListDecorator.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTObservableListDecorator.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTObservableListDecorator.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 Matthew Hall and others. + * Copyright (c) 2008, 2018 Matthew Hall and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -19,7 +19,6 @@ import org.eclipse.core.databinding.observable.list.IObservableList; import org.eclipse.jface.databinding.swt.ISWTObservableList; import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Widget; @@ -42,12 +41,7 @@ disposeListener); } - private Listener disposeListener = new Listener() { - @Override - public void handleEvent(Event event) { - SWTObservableListDecorator.this.dispose(); - } - }; + private Listener disposeListener = event -> SWTObservableListDecorator.this.dispose(); @Override public synchronized void dispose() { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTVetoableValueDecorator.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTVetoableValueDecorator.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTVetoableValueDecorator.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/SWTVetoableValueDecorator.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 Matthew Hall and others. + * Copyright (c) 2008, 2018 Matthew Hall and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -21,7 +21,6 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.jface.databinding.swt.ISWTObservableValue; import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Widget; @@ -34,24 +33,15 @@ private Widget widget; private WidgetStringValueProperty property; - private Listener verifyListener = new Listener() { - @Override - public void handleEvent(Event event) { - String currentText = (String) property.getValue(widget); - String newText = currentText.substring(0, event.start) + event.text - + currentText.substring(event.end); - if (!fireValueChanging(Diffs.createValueDiff(currentText, newText))) { - event.doit = false; - } + private Listener verifyListener = event -> { + String currentText = (String) property.getValue(widget); + String newText = currentText.substring(0, event.start) + event.text + currentText.substring(event.end); + if (!fireValueChanging(Diffs.createValueDiff(currentText, newText))) { + event.doit = false; } }; - private Listener disposeListener = new Listener() { - @Override - public void handleEvent(Event event) { - SWTVetoableValueDecorator.this.dispose(); - } - }; + private Listener disposeListener = event -> SWTVetoableValueDecorator.this.dispose(); /** * @param widget diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/util/JFaceProperty.java eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/util/JFaceProperty.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/util/JFaceProperty.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/util/JFaceProperty.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 IBM Corporation and others. + * Copyright (c) 2008, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -75,7 +75,7 @@ @Override protected void doAddTo(Object model) { try { - addPropertyListenerMethod.invoke(model, new Object[] { this }); + addPropertyListenerMethod.invoke(model, this); } catch (Exception e) { throw new IllegalStateException(e.getMessage()); } @@ -84,8 +84,7 @@ @Override protected void doRemoveFrom(Object model) { try { - removePropertyListenerMethod.invoke(model, - new Object[] { this }); + removePropertyListenerMethod.invoke(model, this); } catch (Exception e) { throw new IllegalStateException(e.getMessage()); } @@ -97,27 +96,23 @@ * @param property * @param clazz */ - public JFaceProperty(String fieldName, String property, Class clazz) { + public JFaceProperty(String fieldName, String property, Class clazz) { this.property = property; // Create all the necessary method ahead of time to ensure they are // available try { try { String getterName = getGetterName(fieldName); - getterMethod = clazz.getMethod(getterName, new Class[] {}); + getterMethod = clazz.getMethod(getterName); } catch (NoSuchMethodException e) { String getterName = getBooleanGetterName(fieldName); - getterMethod = clazz.getMethod(getterName, new Class[] {}); + getterMethod = clazz.getMethod(getterName); } returnType = getterMethod.getReturnType(); - setterMethod = clazz.getMethod(getSetterName(fieldName), - new Class[] { returnType }); - addPropertyListenerMethod = clazz - .getMethod( - "addPropertyChangeListener", new Class[] { IPropertyChangeListener.class }); //$NON-NLS-1$ - removePropertyListenerMethod = clazz - .getMethod( - "removePropertyChangeListener", new Class[] { IPropertyChangeListener.class }); //$NON-NLS-1$ + setterMethod = clazz.getMethod(getSetterName(fieldName), returnType); + addPropertyListenerMethod = clazz.getMethod("addPropertyChangeListener", IPropertyChangeListener.class); //$NON-NLS-1$ + removePropertyListenerMethod = clazz.getMethod("removePropertyChangeListener", //$NON-NLS-1$ + IPropertyChangeListener.class); } catch (SecurityException e) { throw new IllegalArgumentException(); } catch (NoSuchMethodException e) { @@ -134,7 +129,7 @@ @Override protected Object doGetValue(Object model) { try { - return getterMethod.invoke(model, new Object[] {}); + return getterMethod.invoke(model); } catch (InvocationTargetException e) { throw new IllegalStateException(e.getMessage()); } catch (IllegalAccessException e) { @@ -145,7 +140,7 @@ @Override protected void doSetValue(Object model, Object value) { try { - setterMethod.invoke(model, new Object[] { value }); + setterMethod.invoke(model); } catch (IllegalAccessException e) { throw new IllegalStateException(e.getMessage()); } catch (InvocationTargetException e) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui; singleton:=true -Bundle-Version: 3.110.0.qualifier +Bundle-Version: 3.111.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.ui.internal.UIPlugin Bundle-ActivationPolicy: lazy @@ -11,7 +11,7 @@ Export-Package: org.eclipse.ui.internal;x-internal:=true Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", org.eclipse.swt;bundle-version="[3.103.0,4.0.0)";visibility:=reexport, - org.eclipse.jface;bundle-version="[3.13.0,4.0.0)";visibility:=reexport, + org.eclipse.jface;bundle-version="[3.15.0,4.0.0)";visibility:=reexport, org.eclipse.ui.workbench;bundle-version="[3.112.0,4.0.0)";visibility:=reexport, org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui/plugin.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui/plugin.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui/plugin.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui/plugin.xml 2018-12-05 21:43:06.000000000 +0000 @@ -777,6 +777,17 @@ + + + + eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui - 3.110.0-SNAPSHOT + 3.111.0-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui/schema/propertyPages.exsd eclipse-platform-ui-4.10/bundles/org.eclipse.ui/schema/propertyPages.exsd --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui/schema/propertyPages.exsd 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui/schema/propertyPages.exsd 2018-12-05 21:43:06.000000000 +0000 @@ -102,7 +102,7 @@ - a fully qualified name of the class for which the page is registered. This class does not need to implement <tt>IAdaptable</tt>. Objects that are not an instance of <tt>IAdaptable</tt> will be wrappered in an <tt>IAdaptable</tt> before being sent to the property page's instance (an <tt>org.eclipse.ui.IWorkbenchPropertyPage</tt>). + a fully qualified name of the class for which the page is registered. This class does not need to implement <tt>IAdaptable</tt>. Objects that are not an instance of <tt>IAdaptable</tt> will be wrapped in an <tt>IAdaptable</tt> before being sent to the property page's instance (an <tt>org.eclipse.ui.IWorkbenchPropertyPage</tt>). <p>Deprecated in Eclipse 3.3. Use the instanceOf or adapt element of the enabledWhen element instead. If duplicate page definitions were previously used to register the page for multiple objectClass types, these should be combined into one page definition using multiple instanceOf elements combined inside an or element</p> @@ -137,7 +137,7 @@ <p>Deprecated in Eclipse 3.3. Use adapt sub element of the enabledWhen element instead</p> -<strong>NOTE:</strong> The adaptable attribute will attempt adapt an object to <code>org.eclipse.core.resources.IResource</code> before referencing the types registered in <code>Platform#getAdaptorManager</code>. The enabledWhen element has no special case tests for <code>org.eclipse.core.resources.IResource</code> and uses <code>Platform#getAdaptorManager</code> to look up adaptable types. These can be registered using the <code>org.eclipse.core.runtime.adaptors</code> extension point. +<strong>NOTE:</strong> The adaptable attribute will attempt to adapt an object to <code>org.eclipse.core.resources.IResource</code> before referencing the types registered in <code>Platform#getAdaptorManager</code>. The enabledWhen element has no special case tests for <code>org.eclipse.core.resources.IResource</code> and uses <code>Platform#getAdaptorManager</code> to look up adaptable types. These can be registered using the <code>org.eclipse.core.runtime.adaptors</code> extension point. @@ -183,7 +183,7 @@ - This element is used to evaluate the attribute state of each object in the current selection. A match only if each object in the selection has the specified attribute state. Each object in the selection must implement, or adapt to, <samp>org.eclipse.ui.IActionFilter</samp>. + This element is used to evaluate the attribute state of each object in the current selection. A match occurs only if each object in the selection has the specified attribute state. Each object in the selection must implement, or adapt to, <samp>org.eclipse.ui.IActionFilter</samp>. diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui/.settings/.api_filters eclipse-platform-ui-4.10/bundles/org.eclipse.ui/.settings/.api_filters --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui/.settings/.api_filters 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui/.settings/.api_filters 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,13 @@ + + + + + + + + diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.browser/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.browser/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.browser/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.browser/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.cocoa/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.cocoa/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.cocoa/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.cocoa/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,7 +15,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %name Bundle-SymbolicName: org.eclipse.ui.forms;singleton:=true -Bundle-Version: 3.7.300.qualifier +Bundle-Version: 3.7.400.qualifier Bundle-Vendor: %provider-name Bundle-Localization: plugin Export-Package: org.eclipse.ui.forms, diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/.options eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/.options --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/.options 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/.options 2018-12-05 21:43:06.000000000 +0000 @@ -1,4 +1,4 @@ -org.eclipse.ui.forms/debug=true -org.eclipse.ui.forms/debug/text=true -org.eclipse.ui.forms/debug/focus=true -org.eclipse.ui.forms/debug/textsize=true \ No newline at end of file +org.eclipse.ui.forms/debug=false +org.eclipse.ui.forms/debug/text=false +org.eclipse.ui.forms/debug/focus=false +org.eclipse.ui.forms/debug/textsize=false \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.forms - 3.7.300-SNAPSHOT + 3.7.400-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormText.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormText.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormText.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormText.java 2018-12-05 21:43:06.000000000 +0000 @@ -1292,8 +1292,6 @@ selectedLink = null; for (int i = 0; i < paragraphs.length; i++) { Paragraph p = paragraphs[i]; - if (i > 0) - selData.markNewLine(); p.computeSelection(gc, resourceTable, selectedLink, selData); } gc.dispose(); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BreakSegment.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BreakSegment.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BreakSegment.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BreakSegment.java 2018-12-05 21:43:06.000000000 +0000 @@ -72,6 +72,5 @@ @Override public void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData) { - selData.markNewLine(); } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/SelectionData.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/SelectionData.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/SelectionData.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/SelectionData.java 2018-12-05 21:43:06.000000000 +0000 @@ -28,7 +28,6 @@ private Point start; private Point stop; private ArrayList segments; - private boolean newLineNeeded; public SelectionData(MouseEvent e) { display = e.display; @@ -39,13 +38,9 @@ fg = e.display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT); } - public void markNewLine() { - newLineNeeded=true; - } public void addSegment(String text) { - if (newLineNeeded) { + if (segments.size() > 0) { segments.add(System.getProperty("line.separator")); //$NON-NLS-1$ - newLineNeeded=false; } segments.add(text); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/FilteredResourcesSelectionDialog.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/FilteredResourcesSelectionDialog.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/FilteredResourcesSelectionDialog.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/FilteredResourcesSelectionDialog.java 2018-12-05 21:43:06.000000000 +0000 @@ -448,12 +448,14 @@ String patternNoExtension = patternDot == -1 ? pattern : pattern.substring(0, patternDot); boolean m1 = patternNoExtension.equals(n1); boolean m2 = patternNoExtension.equals(n2); - if (m1 && m2) - return 0; - if (m1) - return -1; - if (m2) - return 1; + if (!m1 || !m2) { + if (m1) { + return -1; + } + if (m2) { + return 1; + } + } } int comparability = collator.compare(n1, n2); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardDataTransferPage.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardDataTransferPage.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardDataTransferPage.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardDataTransferPage.java 2018-12-05 21:43:06.000000000 +0000 @@ -295,8 +295,7 @@ MessageDialog dialog = new MessageDialog(getContainer().getShell(), IDEWorkbenchMessages.Question, (Image) null, message, MessageDialog.NONE, 0, - IDialogConstants.YES_LABEL, - IDialogConstants.NO_LABEL) { + IDEWorkbenchMessages.WizardDataTransfer_overwrite_button_label, IDialogConstants.CANCEL_LABEL) { // $NON-NLS-1$ @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui.ide; singleton:=true -Bundle-Version: 3.14.100.qualifier +Bundle-Version: 3.14.200.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.ui.internal.ide.IDEWorkbenchPlugin Bundle-ActivationPolicy: lazy @@ -67,7 +67,8 @@ org.eclipse.e4.core.di;bundle-version="[1.6.0,2.0.0)", org.eclipse.e4.core.di.extensions;bundle-version="[0.14.0,1.0.0)", org.eclipse.osgi.services;bundle-version="3.5.0" -Import-Package: com.ibm.icu.text +Import-Package: javax.annotation, + com.ibm.icu.text Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Automatic-Module-Name: org.eclipse.ui.ide diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.ide - 3.14.100-SNAPSHOT + 3.14.200-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/schema/markerSupport.exsd eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/schema/markerSupport.exsd --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/schema/markerSupport.exsd 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/schema/markerSupport.exsd 2018-12-05 21:43:06.000000000 +0000 @@ -389,7 +389,7 @@ - A markerField is the definition of a org.eclipse.ui.views.markers.MarkerField used to define a column + A markerField is the definition of an org.eclipse.ui.views.markers.MarkerField used to define a column diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ChooseWorkspaceDialog.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ChooseWorkspaceDialog.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ChooseWorkspaceDialog.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ChooseWorkspaceDialog.java 2018-12-05 21:43:06.000000000 +0000 @@ -37,6 +37,7 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.TextProcessor; import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Point; @@ -50,7 +51,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; @@ -420,10 +420,12 @@ panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); panel.setFont(parent.getFont()); - Label label = new Label(panel, SWT.NONE); + CLabel label = new CLabel(panel, SWT.NONE); label.setText(IDEWorkbenchMessages.ChooseWorkspaceDialog_workspaceEntryLabel); + label.setMargins(0, 0, 2, 0); - text = new Combo(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN); + text = new Combo(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN); + new DirectoryProposalContentAssist().apply(text); text.setFocus(); text.setLayoutData(new GridData(400, SWT.DEFAULT)); text.addModifyListener(e -> { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/DirectoryProposalContentAssist.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/DirectoryProposalContentAssist.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/DirectoryProposalContentAssist.java 1970-01-01 00:00:00.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/DirectoryProposalContentAssist.java 2018-12-05 21:43:06.000000000 +0000 @@ -0,0 +1,386 @@ +/******************************************************************************* + * Copyright (c) 2018 vogella GmbH and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Fabian Pfaff - initial API and implementation + *******************************************************************************/ +package org.eclipse.ui.internal.ide; + +import static java.util.stream.Collectors.toList; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import org.eclipse.jface.bindings.keys.KeyStroke; +import org.eclipse.jface.bindings.keys.ParseException; +import org.eclipse.jface.fieldassist.ComboContentAdapter; +import org.eclipse.jface.fieldassist.ContentProposal; +import org.eclipse.jface.fieldassist.ContentProposalAdapter; +import org.eclipse.jface.fieldassist.ControlDecoration; +import org.eclipse.jface.fieldassist.FieldDecoration; +import org.eclipse.jface.fieldassist.FieldDecorationRegistry; +import org.eclipse.jface.fieldassist.IContentProposal; +import org.eclipse.jface.fieldassist.IContentProposalListener2; +import org.eclipse.jface.fieldassist.IContentProposalProvider; +import org.eclipse.jface.fieldassist.IControlContentAdapter; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.internal.WorkbenchMessages; + +/** + * Adds content assist to a Combo, that is intended to be used to choose a + * directory. + */ +public class DirectoryProposalContentAssist { + + private static class FileNameSubstringMatchContentProposalProvider implements IContentProposalProvider { + + private List proposals = Collections.emptyList(); + + /** + * Returns an array of valid proposals filtered by substring matching of the + * fileName. + * + * @param contents the current contents of the text field + * @param position the current position of the cursor in the contents + * + * @return the array of {@link IContentProposal} that represent valid proposals + * for the field. + */ + @Override + public IContentProposal[] getProposals(String contents, int position) { + if (position == 0) { + return null; + } + String substring = contents.substring(0, position); + Pattern pattern = Pattern.compile(substring, + Pattern.LITERAL | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); + IContentProposal[] filteredProposals = proposals.stream() + .filter(proposal -> proposal.length() >= substring.length() && pattern.matcher(proposal).find()) + .map(ContentProposal::new) + .toArray(IContentProposal[]::new); + return filteredProposals.length == 0 ? null : filteredProposals; + } + + /** + * Set the Strings to be used as content proposals. + * + * @param proposals the Strings to be used as proposals. + */ + public void setProposals(List proposals) { + this.proposals = proposals; + } + + } + + private static class OpenableContentProposalAdapter extends ContentProposalAdapter { + + private static final String CONTENT_ASSIST_DECORATION_ID = "org.eclipse.ui.internal.ide.DirectoryProposalContentAssist$ReopenableContentProposalAdapter"; //$NON-NLS-1$ + + public OpenableContentProposalAdapter(Control control, IControlContentAdapter controlContentAdapter, + IContentProposalProvider proposalProvider, KeyStroke keyStroke, char[] autoActivationCharacters) { + super(control, controlContentAdapter, proposalProvider, keyStroke, autoActivationCharacters); + installContentProposalFieldDecoration(control, keyStroke); + } + + /** + * Installs a field decoration that shows the user that the control supports + * content assist. + * + * @param control the control that supports content assist + * @param keyStroke the key stroke to be shown in the field decoration hover + * text + */ + private void installContentProposalFieldDecoration(Control control, KeyStroke keyStroke) { + ControlDecoration decoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT); + decoration.setShowOnlyOnFocus(true); + FieldDecoration dec = getContentAssistFieldDecoration(keyStroke); + decoration.setImage(dec.getImage()); + decoration.setDescriptionText(dec.getDescription()); + } + + /** + * Return the field decoration that should be used to indicate that content + * assist is available for a field. Ensure that the decoration text includes the + * correct key binding. + * + * @param keyStroke the key stroke to be shown in the hover text + * @return the {@link FieldDecoration} that should be used to show content + * assist. + **/ + private FieldDecoration getContentAssistFieldDecoration(KeyStroke keyStroke) { + FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); + String decId = CONTENT_ASSIST_DECORATION_ID + keyStroke; + FieldDecoration dec = registry.getFieldDecoration(decId); + + // If there is not one, base ours on the standard JFace one. + if (dec == null) { + FieldDecoration originalDec = registry.getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); + + registry.registerFieldDecoration(decId, null, originalDec.getImage()); + dec = registry.getFieldDecoration(decId); + } + dec.setDescription(NLS.bind(WorkbenchMessages.ContentAssist_Cue_Description_Key, keyStroke)); + return dec; + } + + @Override + public void openProposalPopup() { + super.openProposalPopup(); + } + + } + + private class DirectoryProposalAutoCompleteField { + + private FileNameSubstringMatchContentProposalProvider proposalProvider; + private OpenableContentProposalAdapter adapter; + + public DirectoryProposalAutoCompleteField(Control control, IControlContentAdapter controlContentAdapter) { + proposalProvider = new FileNameSubstringMatchContentProposalProvider(); + KeyStroke triggeringKeyStroke = safeKeyStroke("Ctrl+Space"); //$NON-NLS-1$ + String backspace = "\b"; //$NON-NLS-1$ + String delete = "\u007F"; //$NON-NLS-1$ + char[] autoactivationChars = ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + backspace //$NON-NLS-1$ + + delete).toCharArray(); + adapter = new OpenableContentProposalAdapter(control, controlContentAdapter, proposalProvider, + triggeringKeyStroke, autoactivationChars); + adapter.setPropagateKeys(true); + adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); + } + + private KeyStroke safeKeyStroke(String keyStrokePattern) { + try { + return KeyStroke.getInstance(keyStrokePattern); + } catch (ParseException e) { + return null; + } + } + + /** + * Sets the given proposals on the content provider and forces the proposal + * pop-up to refresh its content. + * + * @param proposals the proposals to set + * @param openProposalPopup if the proposal pop-up should be opened + */ + public void refreshProposals(List proposals, boolean openProposalPopup) { + proposalProvider.setProposals(proposals); + adapter.refresh(); + if (openProposalPopup) { + adapter.openProposalPopup(); + } + } + + } + + private Path lastDir; + private DirectoryProposalAutoCompleteField autoCompleteField; + private Combo directoryCombo; + /** + * The {@link ContentProposalAdapter} closes the proposal pop-up when the + * proposals are empty. This remembers the popup state and reopen the popup + * after the proposals have been updated by the asynchronous job. + */ + private boolean popupActivated = false; + private List> proposalUpdateFutures = Collections.synchronizedList(new ArrayList<>()); + + /** + * Applies auto-completion to a Combo that is intended to be used to choose a + * directory. Proposals are triggered automatically, but can also be triggered + * by pressing Ctrl+Space. + * + * @param combo the Combo that gets the auto-completion applied + */ + public void apply(Combo combo) { + directoryCombo = combo; + autoCompleteField = new DirectoryProposalAutoCompleteField(directoryCombo, new ComboContentAdapter()); + + getContentProposalAdapter().addContentProposalListener(e -> updateProposals(directoryCombo.getText(), false)); + getContentProposalAdapter().addContentProposalListener(new IContentProposalListener2() { + + @Override + public void proposalPopupOpened(ContentProposalAdapter adapter) { + popupActivated = true; + } + + @Override + public void proposalPopupClosed(ContentProposalAdapter adapter) { + // do nothing on purpose + } + }); + + directoryCombo.addVerifyListener(e -> { + boolean openProposalPopup = true; + if (e.text.length() > 1) { + openProposalPopup = false; + } + updateProposals(directoryCombo.getText().substring(0, directoryCombo.getCaretPosition()), + openProposalPopup); + }); + + directoryCombo.addKeyListener(KeyListener.keyPressedAdapter(e -> { + if (e.keyCode == SWT.ESC) { + popupActivated = false; + } + })); + // use key release because otherwise the caret position is not yet updated + directoryCombo.addKeyListener(KeyListener.keyReleasedAdapter(e -> { + if (isTraverse(e)) { + int caretPosition = directoryCombo.getCaretPosition(); + updateProposals(directoryCombo.getText().substring(0, caretPosition), popupActivated); + } + })); + + directoryCombo.addMouseListener(MouseListener.mouseUpAdapter(e -> { + int caretPosition = ((Combo) e.getSource()).getCaretPosition(); + updateProposals(directoryCombo.getText().substring(0, caretPosition), false); + })); + } + + private boolean isTraverse(KeyEvent e) { + return e.keyCode == SWT.ARROW_LEFT || e.keyCode == SWT.ARROW_RIGHT + || e.keyCode == SWT.HOME || e.keyCode == SWT.END; + } + + /** + * Checks if the directory in the combo has changed. If the directory has + * changed the proposals get asynchronously updated with the subfolders of the + * new directory. If the current content of the combo is not a valid directory + * the proposals get cleared. + */ + private void updateProposals(String textFromCombo, boolean openProposalPopup) { + Path dir = pathWithoutFileName(textFromCombo); + if (dir != null && dir.equals(lastDir)) { + if (openProposalPopup) { + autoCompleteField.adapter.openProposalPopup(); + } + return; + } + if (dir == null || !safeIsDirectory(dir)) { + updateProposals(Collections.emptyList(), false); + lastDir = null; + return; + } + + lastDir = dir; + + CompletableFuture completableFuture = CompletableFuture + .runAsync(() -> updateProposals(retrieveDirectoriesIn(dir), openProposalPopup)); + + proposalUpdateFutures.add(completableFuture); + proposalUpdateFutures.removeIf(CompletableFuture::isDone); + } + + private List retrieveDirectoriesIn(Path dir) { + try (Stream files = Files.list(dir)) { + return filterPaths(files).sorted().collect(toList()); + } catch (IOException ex) { + return new ArrayList<>(); + } + } + + private void updateProposals(List proposals, boolean openProposalPopup) { + directoryCombo.getDisplay().syncExec(() -> autoCompleteField.refreshProposals(proposals, openProposalPopup)); + } + + private Path pathWithoutFileName(String inputPath) { + int lastIndex = inputPath.lastIndexOf(File.separatorChar); + if (separatorNotFound(lastIndex)) { + return null; + } + return safeGetPath(removeFileName(inputPath, lastIndex)); + } + + private boolean separatorNotFound(int lastIndex) { + return lastIndex < 0; + } + + private String removeFileName(String text, int lastIndex) { + if (lastIndex == 0) { + return File.separator; + } + return text.substring(0, lastIndex + 1); + } + + private Path safeGetPath(String text) { + try { + return Paths.get(text); + } catch (InvalidPathException ex) { + return null; + } + } + + private boolean safeIsDirectory(Path dir) { + try { + return dir.toFile().isDirectory(); + } catch (SecurityException ex) { + return false; + } + } + + /** + * Filters out files and hidden directories. + * + * @param paths the Paths to filter + * @return the filtered paths + */ + private Stream filterPaths(Stream paths) { + return paths.filter(path -> { + try { + return safeIsDirectory(path) && !Files.isHidden(path); + } catch (IOException e) { + return false; + } + }).map(path -> path.toString() + File.separator); + } + + public DirectoryProposalAutoCompleteField getAutoCompleteField() { + return autoCompleteField; + } + + public ContentProposalAdapter getContentProposalAdapter() { + return autoCompleteField.adapter; + } + + /** + * Wait until the asynchronous proposal refresh is finished. This method is + * intended to by used by tests. + * + * @param timeout timeout in milliseconds + * @throws TimeoutException if the wait timed out + * @throws ExecutionException if the future completed exceptionally + * @throws InterruptedException if the current thread was interrupted while + * waiting + */ + protected void wait(int timeout) throws InterruptedException, ExecutionException, TimeoutException { + CompletableFuture.allOf(proposalUpdateFutures.toArray(new CompletableFuture[proposalUpdateFutures.size()])) + .get(timeout, TimeUnit.MILLISECONDS); + } + +} diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java 2018-12-05 21:43:06.000000000 +0000 @@ -31,7 +31,6 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.e4.core.services.statusreporter.StatusReporter; import org.eclipse.jface.util.Util; -import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; @@ -140,13 +139,12 @@ } private IResource getSelectionResource(ExecutionEvent event) { - ISelection selection = HandlerUtil.getCurrentSelection(event); - if ((selection == null) || (selection.isEmpty()) - || (!(selection instanceof IStructuredSelection))) { + IStructuredSelection selection = HandlerUtil.getCurrentStructuredSelection(event); + if ((selection == null) || (selection.isEmpty())) { return null; } - Object selectedObject = ((IStructuredSelection) selection) + Object selectedObject = selection .getFirstElement(); IResource item = Adapters.adapt(selectedObject, IResource.class); return item; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java 2018-12-05 21:43:06.000000000 +0000 @@ -159,4 +159,10 @@ */ int MAX_MAX_SIMULTANEOUS_BUILD = 1000; + /** + * Key to allow products define initial default grouping for the Problems view + * family + */ + String INITIAL_DEFAULT_MARKER_GROUPING = "INITIAL_DEFAULT_MARKER_GROUPING"; //$NON-NLS-1$ + } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 2018-12-05 21:43:06.000000000 +0000 @@ -421,6 +421,7 @@ public static String WizardDataTransfer_existsQuestion; public static String WizardDataTransfer_overwriteNameAndPathQuestion; public static String WizardDataTransfer_exceptionMessage; + public static String WizardDataTransfer_overwrite_button_label; public static String WizardTransferPage_selectTypes; public static String WizardTransferPage_selectAll; public static String WizardTransferPage_deselectAll; @@ -525,6 +526,22 @@ public static String WorkbenchPreference_unsupportedEncoding; public static String WorkbenchPreference_encoding_encodingMessage; + public static String UriHandlerPreferencePage_Warning_OtherApp; + + public static String UriHandlerPreferencePage_Warning_OtherApp_Description; + + // --- Link Handler Preference Page --- + public static String UrlHandlerPreferencePage_Handler_Label; + public static String UrlHandlerPreferencePage_Handler_Text_No_Application; + public static String UrlHandlerPreferencePage_Page_Description; + public static String UrlHandlerPreferencePage_ColumnName_SchemeName; + public static String UrlHandlerPreferencePage_ColumnName_SchemeDescription; + public static String UrlHandlerPreferencePage_ColumnName_Handler; + public static String UrlHandlerPreferencePage_Column_Handler_Text_Current_Application; + public static String UrlHandlerPreferencePage_Column_Handler_Text_Other_Application; + public static String UrlHandlerPreferencePage_Error_Reading_Scheme; + public static String UrlHandlerPreferencePage_Error_Writing_Scheme; + // ---workspace --- public static String IDEWorkspacePreference_autobuild; public static String IDEWorkspacePreference_autobuildToolTip; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties 2018-12-05 21:43:06.000000000 +0000 @@ -392,6 +392,7 @@ WizardDataTransfer_existsQuestion = ''{0}'' already exists. Would you like to overwrite it? WizardDataTransfer_overwriteNameAndPathQuestion = Overwrite ''{0}'' in folder ''{1}''? WizardDataTransfer_exceptionMessage = Error occurred during operation: {0} +WizardDataTransfer_overwrite_button_label = &Overwrite WizardTransferPage_selectTypes = Filter &Types... WizardTransferPage_selectAll = &Select All WizardTransferPage_deselectAll = &Deselect All @@ -504,6 +505,20 @@ WorkbenchPreference_encoding_encodingMessage = Byte Order Mark is {0} +# --- Link Handler Preference Page --- +UriHandlerPreferencePage_Warning_OtherApp=Action not possible +UriHandlerPreferencePage_Warning_OtherApp_Description=Another application ({0}) handles the "{1}" scheme.\n\nRemove the "{1}" scheme in the other application first. +UrlHandlerPreferencePage_Handler_Label=Application: +UrlHandlerPreferencePage_Handler_Text_No_Application=No application +UrlHandlerPreferencePage_Page_Description=Link handlers define how your application deals with hyperlinks using a given scheme.\nThis page allows you to enable and disable link handlers in this application. +UrlHandlerPreferencePage_ColumnName_SchemeName=Scheme +UrlHandlerPreferencePage_ColumnName_SchemeDescription=Description +UrlHandlerPreferencePage_ColumnName_Handler=Handler +UrlHandlerPreferencePage_Column_Handler_Text_Current_Application=This application +UrlHandlerPreferencePage_Column_Handler_Text_Other_Application=Other application +UrlHandlerPreferencePage_Error_Reading_Scheme=Error while reading scheme information from operating system +UrlHandlerPreferencePage_Error_Writing_Scheme=Error while writing scheme information to operating system + # ---Workspace IDEWorkspacePreference_autobuild = &Build automatically IDEWorkspacePreference_autobuildToolTip = Build automatically on resource modification diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java 2018-12-05 21:43:06.000000000 +0000 @@ -65,6 +65,8 @@ import org.eclipse.ui.ide.IDEActionFactory; import org.eclipse.ui.ide.IIDEActionConstants; import org.eclipse.ui.internal.IPreferenceConstants; +import org.eclipse.ui.internal.IWorkbenchGraphicConstants; +import org.eclipse.ui.internal.WorkbenchImages; import org.eclipse.ui.internal.WorkbenchMessages; import org.eclipse.ui.internal.WorkbenchPlugin; import org.eclipse.ui.internal.handlers.IActionCommandMappingService; @@ -710,7 +712,8 @@ // 'Open Perspective' menu entry String openText = IDEWorkbenchMessages.Workbench_openPerspective; - MenuManager changePerspMenuMgr = new MenuManager(openText, "openPerspective"); //$NON-NLS-1$ + MenuManager changePerspMenuMgr = new MenuManager(openText, + WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_NEW_PAGE), "openPerspective"); //$NON-NLS-1$ IContributionItem changePerspMenuItem = ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(getWindow()); changePerspMenuMgr.add(changePerspMenuItem); menu.add(changePerspMenuMgr); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/CachedMarkerBuilder.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/CachedMarkerBuilder.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/CachedMarkerBuilder.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/CachedMarkerBuilder.java 2018-12-05 21:43:06.000000000 +0000 @@ -622,9 +622,7 @@ */ boolean[] readChangeFlags() { boolean [] changes=new boolean[changeFlags.length]; - for (int i = 0; i < changes.length; i++) { - changes[i]=changeFlags[i]; - } + System.arraycopy(changeFlags, 0, changes, 0, changes.length); return changes; } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java 2018-12-05 21:43:06.000000000 +0000 @@ -805,12 +805,16 @@ @Override public void partHidden(IWorkbenchPartReference partRef) { - if (partRef.getId().equals(getSite().getId())) { - isViewVisible= false; - Markers markers = getActiveViewerInputClone(); - Integer[] counts = markers.getMarkerCounts(); - setTitleToolTip(getStatusMessage(markers, counts)); + if (!partRef.getId().equals(getSite().getId())) { + return; } + if (partRef.getPart(false) != ExtendedMarkersView.this) { + return; + } + isViewVisible = false; + Markers markers = getActiveViewerInputClone(); + Integer[] counts = markers.getMarkerCounts(); + setTitleToolTip(getStatusMessage(markers, counts)); } @Override @@ -825,16 +829,20 @@ @Override public void partVisible(IWorkbenchPartReference partRef) { - if (partRef.getId().equals(getSite().getId())) { - isViewVisible = true; - boolean needUpdate = hasPendingChanges(); - if (needUpdate) { - // trigger UI update, the data is changed meanwhile - builder.getUpdateScheduler().scheduleUIUpdate(MarkerUpdateScheduler.SHORT_DELAY); - } else { - // data is same as before, only clear tooltip - setTitleToolTip(null); - } + if (!partRef.getId().equals(getSite().getId())) { + return; + } + if (partRef.getPart(false) != ExtendedMarkersView.this) { + return; + } + isViewVisible = true; + boolean needUpdate = hasPendingChanges(); + if (needUpdate) { + // trigger UI update, the data is changed meanwhile + builder.getUpdateScheduler().scheduleUIUpdate(MarkerUpdateScheduler.SHORT_DELAY); + } else { + // data is same as before, only clear tooltip + setTitleToolTip(null); } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java 2018-12-05 21:43:06.000000000 +0000 @@ -101,6 +101,7 @@ private String viewId; private IPropertyChangeListener filterPreferenceListener; + private String initialDefaultCategoryName; /** * Create a new MarkerContentGenerator @@ -212,7 +213,7 @@ } void restoreState(IMemento memento) { - initDefaults(); + initDefaults(memento); if (memento == null) { return; } @@ -252,7 +253,7 @@ } } - private void initDefaults() { + private void initDefaults(IMemento memento) { IPreferenceStore store = IDEWorkbenchPlugin.getDefault().getPreferenceStore(); markerLimitsEnabled = store.getBoolean(IDEInternalPreferences.USE_MARKER_LIMITS); markerLimits = store.getInt(IDEInternalPreferences.MARKER_LIMITS_VALUE); @@ -261,6 +262,12 @@ visibleFields = new MarkerField[initialFields.length]; System.arraycopy(initialFields, 0, visibleFields, 0, initialFields.length); + + // On first startup, check if there is a custom group id set to be default + if (memento == null) { + initialDefaultCategoryName = store + .getString(viewId + "." + IDEInternalPreferences.INITIAL_DEFAULT_MARKER_GROUPING); //$NON-NLS-1$ + } } /** @@ -284,6 +291,9 @@ * Get the category name from the receiver. */ String getCategoryName() { + if (initialDefaultCategoryName != null) { + return initialDefaultCategoryName; + } return generatorDescriptor.getCategoryName(); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixHandler.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixHandler.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixHandler.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixHandler.java 2018-12-05 21:43:06.000000000 +0000 @@ -117,9 +117,7 @@ } else { service.runInUI(context, resolutionsRunnable, null); } - } catch (InvocationTargetException exception) { - throw new ExecutionException(exception.getLocalizedMessage(), exception); - } catch (InterruptedException exception) { + } catch (InvocationTargetException | InterruptedException exception) { throw new ExecutionException(exception.getLocalizedMessage(), exception); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixPage.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixPage.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixPage.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixPage.java 2018-12-05 21:43:06.000000000 +0000 @@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.ColumnWeightData; import org.eclipse.jface.viewers.ILabelProviderListener; @@ -79,7 +80,7 @@ private TableViewer resolutionsList; private CheckboxTableViewer markersTable; private IWorkbenchPartSite site; - private final IMarker[] selectedMarkers; + private IMarker[] selectedMarkers; /** @@ -122,8 +123,7 @@ control.setLayout(layout); Label resolutionsLabel = new Label(control, SWT.NONE); - resolutionsLabel - .setText(MarkerMessages.MarkerResolutionDialog_Resolutions_List_Title); + resolutionsLabel.setText(MarkerMessages.MarkerResolutionDialog_Resolutions_List_Title); resolutionsLabel.setLayoutData(new FormData()); @@ -137,8 +137,7 @@ resolutionsList.getControl().setLayoutData(listData); Label title = new Label(control, SWT.NONE); - title - .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Title); + title.setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Title); FormData labelData = new FormData(); labelData.top = new FormAttachment(resolutionsList.getControl(), 0); labelData.left = new FormAttachment(0); @@ -163,8 +162,7 @@ Dialog.applyDialogFont(control); - resolutionsList.setSelection(new StructuredSelection(resolutionsList - .getElementAt(0))); + resolutionsList.setSelection(new StructuredSelection(resolutionsList.getElementAt(0))); markersTable.setCheckedElements(selectedMarkers); @@ -219,25 +217,8 @@ * @param control */ private void createResolutionsList(Composite control) { - resolutionsList= new TableViewer(control, SWT.BORDER | SWT.SINGLE - | SWT.V_SCROLL); - resolutionsList.setContentProvider(new IStructuredContentProvider() { - @Override - public Object[] getElements(Object inputElement) { - return resolutions.keySet().toArray(); - } - - @Override - public void dispose() { - - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, - Object newInput) { - - } - }); + resolutionsList = new TableViewer(control, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); + resolutionsList.setContentProvider(ArrayContentProvider.getInstance()); resolutionsList.setLabelProvider(new LabelProvider() { @Override @@ -251,7 +232,7 @@ } }); - resolutionsList.setInput(this); + resolutionsList.setInput(resolutions.keySet().toArray()); resolutionsList.setComparator(new ViewerComparator() { /** @@ -292,8 +273,7 @@ * @param control */ private void createMarkerTable(Composite control) { - markersTable = CheckboxTableViewer.newCheckList(control, SWT.BORDER - | SWT.V_SCROLL | SWT.SINGLE); + markersTable = CheckboxTableViewer.newCheckList(control, SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE); createTableColumns(); @@ -305,7 +285,8 @@ @Override public Object[] getElements(Object inputElement) { - IMarkerResolution selected = getSelectedResolution(); + IMarkerResolution selected = (IMarkerResolution) resolutionsList.getStructuredSelection() + .getFirstElement(); if (selected == null) { return new Object[0]; } @@ -317,8 +298,7 @@ } @Override - public void inputChanged(Viewer viewer, Object oldInput, - Object newInput) { + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } }); @@ -328,8 +308,7 @@ @Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 0) - return Util.getImage(((IMarker) element).getAttribute( - IMarker.SEVERITY, -1)); + return Util.getImage(((IMarker) element).getAttribute(IMarker.SEVERITY, -1)); return null; } @@ -436,12 +415,10 @@ layout.addColumnData(new ColumnWeightData(70, true)); TableColumn tc = new TableColumn(table, SWT.NONE, 0); - tc - .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Location); + tc.setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Location); layout.addColumnData(new ColumnWeightData(30, true)); tc = new TableColumn(table, SWT.NONE, 0); - tc - .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Resource); + tc.setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Resource); } @@ -451,9 +428,9 @@ * @return IMarker or null */ public IMarker getSelectedMarker() { - ISelection selection = markersTable.getSelection(); - if (!selection.isEmpty() && selection instanceof IStructuredSelection) { - IStructuredSelection struct = (IStructuredSelection) selection; + IStructuredSelection selection = markersTable.getStructuredSelection(); + if (!selection.isEmpty()) { + IStructuredSelection struct = selection; if (struct.size() == 1) return (IMarker) struct.getFirstElement(); } @@ -472,11 +449,12 @@ */ void performFinish(IProgressMonitor monitor) { - final IMarkerResolution resolution = getSelectedResolution(); + IMarkerResolution resolution = (IMarkerResolution) resolutionsList.getStructuredSelection() + .getFirstElement(); if (resolution == null) return; - final Object[] checked = markersTable.getCheckedElements(); + Object[] checked = markersTable.getCheckedElements(); if (checked.length == 0) return; @@ -488,12 +466,8 @@ System.arraycopy(checked, 0, markers, 0, checked.length); ((WorkbenchMarkerResolution) resolution).run(markers, monitor1); }); - } catch (InvocationTargetException e) { - StatusManager.getManager().handle( - MarkerSupportInternalUtilities.errorFor(e)); - } catch (InterruptedException e) { - StatusManager.getManager().handle( - MarkerSupportInternalUtilities.errorFor(e)); + } catch (InvocationTargetException | InterruptedException e) { + StatusManager.getManager().handle(MarkerSupportInternalUtilities.errorFor(e)); } } else { @@ -522,25 +496,6 @@ } } - - } - - /** - * Return the marker resolution that is currently selected/ - * - * @return IMarkerResolution or null if there is no - * selection. - */ - private IMarkerResolution getSelectedResolution() { - ISelection selection = resolutionsList.getSelection(); - if (!(selection instanceof IStructuredSelection)) { - return null; - } - - Object first = ((IStructuredSelection) selection).getFirstElement(); - - return (IMarkerResolution) first; - } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/SmartImportRootWizardPage.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/SmartImportRootWizardPage.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/SmartImportRootWizardPage.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/SmartImportRootWizardPage.java 2018-12-05 21:43:06.000000000 +0000 @@ -481,9 +481,10 @@ Link showDetectorsLink = new Link(parent, SWT.NONE); showDetectorsLink.setText(DataTransferMessages.SmartImportWizardPage_showAvailableDetectors); GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - showDetectorsLink.setLayoutData(gridData); + gridData.horizontalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.horizontalSpan = 4; + showDetectorsLink.setLayoutData(gridData); showDetectorsLink.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardArchiveFileResourceImportPage1.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardArchiveFileResourceImportPage1.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardArchiveFileResourceImportPage1.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardArchiveFileResourceImportPage1.java 2018-12-05 21:43:06.000000000 +0000 @@ -59,8 +59,6 @@ private static final String STORE_OVERWRITE_EXISTING_RESOURCES_ID = "WizardZipFileResourceImportPage1.STORE_OVERWRITE_EXISTING_RESOURCES_ID"; //$NON-NLS-1$ - private static final String STORE_SELECTED_TYPES_ID = "WizardZipFileResourceImportPage1.STORE_SELECTED_TYPES_ID"; //$NON-NLS-1$ - private final String[] fileImportMask; /** @@ -86,10 +84,11 @@ setTitle(DataTransferMessages.ArchiveExport_exportTitle); setDescription(DataTransferMessages.ArchiveImport_description); - if(fileImportMask == null) + if (fileImportMask == null) { this.fileImportMask = FILE_IMPORT_MASK; - else + } else { this.fileImportMask = fileImportMask; + } } /** @@ -392,8 +391,9 @@ fileSystemObjects); operation.setContext(getShell()); - if (!executeImportOperation(operation)) + if (!executeImportOperation(operation)) { return false; + } ArchiveFileManipulations.closeStructureProvider(importStructureProvider, getShell()); return true; @@ -481,14 +481,6 @@ sourceNames = addToHistory(sourceNames, sourceNameField.getText()); settings.put(STORE_SOURCE_NAMES_ID, sourceNames); - - // update specific types to import history - String[] selectedTypesNames = settings - .getArray(STORE_SELECTED_TYPES_ID); - if (selectedTypesNames == null) { - selectedTypesNames = new String[0]; - } - settings.put(STORE_OVERWRITE_EXISTING_RESOURCES_ID, overwriteExistingResourcesCheckbox.getSelection()); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/CopyAction.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/CopyAction.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/CopyAction.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/CopyAction.java 2018-12-05 21:43:06.000000000 +0000 @@ -130,9 +130,7 @@ if (actualLength < length) { String[] tempFileNames = fileNames; fileNames = new String[actualLength]; - for (int i = 0; i < actualLength; i++) { - fileNames[i] = tempFileNames[i]; - } + System.arraycopy(tempFileNames, 0, fileNames, 0, actualLength); } setClipboard(resources, fileNames, buf.toString()); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/NavigatorDragAdapter.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/NavigatorDragAdapter.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/NavigatorDragAdapter.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/NavigatorDragAdapter.java 2018-12-05 21:43:06.000000000 +0000 @@ -175,9 +175,7 @@ if (actualLength < length) { String[] tempFileNames = fileNames; fileNames = new String[actualLength]; - for (int i = 0; i < actualLength; i++) { - fileNames[i] = tempFileNames[i]; - } + System.arraycopy(tempFileNames, 0, fileNames, 0, actualLength); } event.data = fileNames; } @@ -217,7 +215,6 @@ private IResource[] getSelectedResources(int resourceTypes) { List resources = new ArrayList<>(); - IResource[] result = new IResource[0]; ISelection selection = selectionProvider.getSelection(); if (!(selection instanceof IStructuredSelection) || selection.isEmpty()) { @@ -236,7 +233,7 @@ } } } - result = new IResource[resources.size()]; + IResource[] result = new IResource[resources.size()]; resources.toArray(result); return result; } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard.java 2018-12-05 21:43:06.000000000 +0000 @@ -439,22 +439,17 @@ if (finalPersp != null && finalPersp instanceof IPluginContribution) { IPluginContribution contribution = (IPluginContribution) finalPersp; if (contribution.getPluginId() != null) { - IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI - .getWorkbench().getActivitySupport(); - IActivityManager activityManager = workbenchActivitySupport - .getActivityManager(); + IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport(); + IActivityManager activityManager = workbenchActivitySupport.getActivityManager(); IIdentifier identifier = activityManager - .getIdentifier(WorkbenchActivityHelper - .createUnifiedId(contribution)); - Set idActivities = identifier.getActivityIds(); + .getIdentifier(WorkbenchActivityHelper.createUnifiedId(contribution)); + Set idActivities = identifier.getActivityIds(); if (!idActivities.isEmpty()) { - Set enabledIds = new HashSet(activityManager - .getEnabledActivityIds()); + Set enabledIds = new HashSet<>(activityManager.getEnabledActivityIds()); if (enabledIds.addAll(idActivities)) { - workbenchActivitySupport - .setEnabledActivityIds(enabledIds); + workbenchActivitySupport.setEnabledActivityIds(enabledIds); } } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui.ide.application;singleton:=true -Bundle-Version: 1.3.0.qualifier +Bundle-Version: 1.3.100.qualifier Bundle-Vendor: %Plugin.providerName Bundle-Localization: plugin Bundle-ClassPath: . diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/plugin.properties eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/plugin.properties --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/plugin.properties 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/plugin.properties 2018-12-05 21:43:06.000000000 +0000 @@ -17,6 +17,7 @@ PreferencePages.Startup = Startup and Shutdown PreferencePages.Startup.Workspaces = Workspaces +PreferencePages.General.LinkHandlers = Link Handlers Perspective.resourcePerspective = Resource Perspective.resourceDescription = This perspective is designed to provide general resource viewing and navigation. @@ -40,4 +41,7 @@ command.zoomIn.mnemonic=I command.zoomOut.mnemonic=O -keyword.problems = problems \ No newline at end of file +keyword.problems = problems +keyword.linkhanders = link handlers schemes + +page.name = Link Handlers \ No newline at end of file diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/plugin.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/plugin.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/plugin.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/plugin.xml 2018-12-05 21:43:06.000000000 +0000 @@ -27,6 +27,15 @@ id="org.eclipse.ui.preferencePages.Startup.Workspaces"> + + + + @@ -168,5 +177,9 @@ id="org.eclipse.ui.ide.application.problems" label="%keyword.problems"> + + diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.ide.application - 1.3.0-SNAPSHOT + 1.3.100-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/dialogs/UriSchemeHandlerPreferencePage.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/dialogs/UriSchemeHandlerPreferencePage.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/dialogs/UriSchemeHandlerPreferencePage.java 1970-01-01 00:00:00.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/dialogs/UriSchemeHandlerPreferencePage.java 2018-12-05 21:43:06.000000000 +0000 @@ -0,0 +1,378 @@ +/******************************************************************************* +* Copyright (c) 2018 SAP SE and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +* +* Contributors: +* SAP SE - initial API and implementation +*******************************************************************************/ +package org.eclipse.ui.internal.ide.application.dialogs; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.layout.PixelConverter; +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.internal.IWorkbenchHelpContextIds; +import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; +import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; +import org.eclipse.ui.statushandlers.StatusManager; +import org.eclipse.urischeme.IOperatingSystemRegistration; +import org.eclipse.urischeme.IScheme; +import org.eclipse.urischeme.ISchemeInformation; +import org.eclipse.urischeme.IUriSchemeExtensionReader; + +/** + * This page contributes to URL handler for URISchemes in preference page of + * General section + * + */ +public class UriSchemeHandlerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { + + Text handlerLocation; + CheckboxTableViewer tableViewer; + private String currentLocation = null; + IStatusManagerWrapper statusManagerWrapper = new IStatusManagerWrapper() { + }; + IMessageDialogWrapper messageDialogWrapper = new IMessageDialogWrapper() { + }; + + IOperatingSystemRegistration operatingSystemRegistration = null; + IUriSchemeExtensionReader extensionReader = null; + private Composite handlerComposite; + + @SuppressWarnings("javadoc") + public UriSchemeHandlerPreferencePage() { + super.setDescription(IDEWorkbenchMessages.UrlHandlerPreferencePage_Page_Description); + } + + @Override + public void init(IWorkbench workbench) { + if (operatingSystemRegistration == null) { + operatingSystemRegistration = IOperatingSystemRegistration.getInstance(); + } + if (extensionReader == null) { + extensionReader = IUriSchemeExtensionReader.newInstance(); + } + if (operatingSystemRegistration != null) { + currentLocation = operatingSystemRegistration.getEclipseLauncher(); + } + } + + @Override + protected Control createContents(Composite parent) { + if (PlatformUI.isWorkbenchRunning()) { + // enabled plain JUnit tests + PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, + IWorkbenchHelpContextIds.LINK_HANDLERS_PREFERENCE_PAGE); + } + noDefaultAndApplyButton(); + addFiller(parent, 2); + createTableViewerForSchemes(parent); + createHandlerLocationControls(parent); + return parent; + } + + private void addFiller(Composite composite, int horizontalSpan) { + PixelConverter pixelConverter = new PixelConverter(composite); + Label filler = new Label(composite, SWT.LEFT); + GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); + gd.horizontalSpan = horizontalSpan; + gd.heightHint = pixelConverter.convertHeightInCharsToPixels(1) / 2; + filler.setLayoutData(gd); + } + + private void createTableViewerForSchemes(Composite parent) { + Composite editorComposite = new Composite(parent, SWT.NONE); + GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false); + gridData.horizontalSpan = 2; + gridData.horizontalIndent = 0; + editorComposite.setLayoutData(gridData); + Table schemeTable = new Table(editorComposite, + SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK); + schemeTable.setHeaderVisible(true); + schemeTable.setLinesVisible(true); + schemeTable.setFont(parent.getFont()); + + // Table columns, Scheme name and Scheme Descriptions + TableColumnLayout tableColumnlayout = new TableColumnLayout(); + editorComposite.setLayout(tableColumnlayout); + + TableColumn nameColumn = new TableColumn(schemeTable, SWT.NONE, 0); + nameColumn.setText(IDEWorkbenchMessages.UrlHandlerPreferencePage_ColumnName_SchemeName); + + TableColumn descriptionColumn = new TableColumn(schemeTable, SWT.NONE, 1); + descriptionColumn.setText(IDEWorkbenchMessages.UrlHandlerPreferencePage_ColumnName_SchemeDescription); + + TableColumn appColumn = new TableColumn(schemeTable, SWT.NONE, 2); + appColumn.setText(IDEWorkbenchMessages.UrlHandlerPreferencePage_ColumnName_Handler); + + tableColumnlayout.setColumnData(nameColumn, new ColumnWeightData(20)); + tableColumnlayout.setColumnData(descriptionColumn, new ColumnWeightData(60)); + tableColumnlayout.setColumnData(appColumn, new ColumnWeightData(20)); + + tableViewer = new CheckboxTableViewer(schemeTable); + tableViewer.setContentProvider(ArrayContentProvider.getInstance()); + tableViewer.setLabelProvider(new ItemLabelProvider()); + + TableSchemeSelectionListener listener = new TableSchemeSelectionListener(); + tableViewer.addSelectionChangedListener(listener); + tableViewer.addCheckStateListener(listener); + + Collection schemeInformationList = Collections.emptyList(); + // Gets the schemes from extension points for URI schemes + try { + schemeInformationList = retrieveSchemeInformationList(); + } catch (Exception e) { + IStatus status = new Status(IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, 1, + IDEWorkbenchMessages.UrlHandlerPreferencePage_Error_Reading_Scheme, e); + statusManagerWrapper.handle(status, StatusManager.BLOCK | StatusManager.LOG); + } + tableViewer.setInput(schemeInformationList); + + for (UiSchemeInformation schemeInformation : schemeInformationList) { + tableViewer.setChecked(schemeInformation, schemeInformation.checked); + } + } + + private void createHandlerLocationControls(Composite parent) { + handlerComposite = new Composite(parent, SWT.NONE); + GridLayoutFactory.fillDefaults().numColumns(2).applyTo(handlerComposite); + GridDataFactory.fillDefaults().grab(true, false).applyTo(handlerComposite); + + new Label(handlerComposite, SWT.NONE).setText(IDEWorkbenchMessages.UrlHandlerPreferencePage_Handler_Label); + + handlerLocation = new Text(handlerComposite, SWT.READ_ONLY | SWT.BORDER); + handlerLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + + handlerComposite.setVisible(false); // set visible on table selection + } + + /** + * Schemes which are part of extension points for URI Schemes and are registered + * to operating system are consolidated here + * + * @return the supported and registered URI schemes of this instance of eclipse + * @throws Exception + */ + private Collection retrieveSchemeInformationList() throws Exception { + Collection returnList = new ArrayList<>(); + Collection schemes = extensionReader.getSchemes(); + if (operatingSystemRegistration != null) { + for (ISchemeInformation info : operatingSystemRegistration.getSchemesInformation(schemes)) { + returnList.add(new UiSchemeInformation(info.isHandled(), info)); + } + } + return returnList; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.preference.PreferencePage#performOk() + */ + @SuppressWarnings("unchecked") + @Override + public boolean performOk() { + if (operatingSystemRegistration == null) { + return true; + } + + List toAdd = new ArrayList<>(); + List toRemove = new ArrayList<>(); + for (UiSchemeInformation info : (Collection) tableViewer.getInput()) { + if (info.checked && !info.information.isHandled()) { + toAdd.add(info.information); + } + if (!info.checked && info.information.isHandled()) { + toRemove.add(info.information); + } + } + + try { + operatingSystemRegistration.handleSchemes(toAdd, toRemove); + } catch (Exception e) { + IStatus status = new Status(IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, 1, + IDEWorkbenchMessages.UrlHandlerPreferencePage_Error_Writing_Scheme, e); + statusManagerWrapper.handle(status, StatusManager.BLOCK | StatusManager.LOG); + } + return true; + } + + private class TableSchemeSelectionListener implements ICheckStateListener, ISelectionChangedListener { + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org. + * eclipse.jface.viewers.SelectionChangedEvent) + */ + @Override + public void selectionChanged(SelectionChangedEvent event) { + handleSelection(); + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse. + * jface.viewers.CheckStateChangedEvent) + */ + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + handleCheckbox(event); + + } + + private void handleSelection() { + IStructuredSelection selection = tableViewer.getStructuredSelection(); + Object firstElement = selection != null ? selection.getFirstElement() : null; + if (firstElement != null && firstElement instanceof UiSchemeInformation) { + setSchemeDetails((UiSchemeInformation) firstElement); + handlerComposite.setVisible(true); + } + } + + private void setSchemeDetails(UiSchemeInformation schemeInfo) { + if (schemeInfo.checked) { + handlerLocation.setText(currentLocation); + + } else if (schemeIsHandledByOther(schemeInfo.information)) { + handlerLocation.setText(schemeInfo.information.getHandlerInstanceLocation()); + } else { + // checkbox not checked and: + // - no other handler handles it + // - or this eclipse handled it before (checkbox was unchecked but not yet + // applied) + handlerLocation.setText(IDEWorkbenchMessages.UrlHandlerPreferencePage_Handler_Text_No_Application); + } + } + + private void handleCheckbox(CheckStateChangedEvent event) { + UiSchemeInformation schemeInformation = (UiSchemeInformation) event.getElement(); + + if (event.getChecked() && schemeIsHandledByOther(schemeInformation.information)) { + // macOS: As lsregister always registers all plist files we cannot set a handler + // for a scheme that is already handled by another application. + // For Windows and Linux this might work - needs to be tested. + // As we think this is a edge case we start with a restrictive implementation. + schemeInformation.checked = false; + tableViewer.setChecked(schemeInformation, schemeInformation.checked); + + messageDialogWrapper.openWarning(getShell(), + IDEWorkbenchMessages.UriHandlerPreferencePage_Warning_OtherApp, + NLS.bind(IDEWorkbenchMessages.UriHandlerPreferencePage_Warning_OtherApp_Description, + schemeInformation.information.getHandlerInstanceLocation(), + schemeInformation.information.getName())); + + return; + } + schemeInformation.checked = event.getChecked(); + setSchemeDetails(schemeInformation); + tableViewer.update(schemeInformation, null); + } + } + + private boolean schemeIsHandledByOther(ISchemeInformation info) { + boolean schemeIsNotHandled = !info.isHandled(); + boolean handlerLocationIsSet = info.getHandlerInstanceLocation() != null + && !info.getHandlerInstanceLocation().isEmpty(); + return schemeIsNotHandled && handlerLocationIsSet; + } + + private final class ItemLabelProvider extends LabelProvider implements ITableLabelProvider { + + @Override + public Image getColumnImage(Object element, int columnIndex) { + return null; + } + + @Override + public String getColumnText(Object element, int columnIndex) { + if (element instanceof UiSchemeInformation) { + UiSchemeInformation schemeInfo = (UiSchemeInformation) element; + switch (columnIndex) { + case 0: + return schemeInfo.information.getName(); + case 1: + return schemeInfo.information.getDescription(); + case 2: + String text = ""; //$NON-NLS-1$ + if (schemeInfo.checked) { + text = IDEWorkbenchMessages.UrlHandlerPreferencePage_Column_Handler_Text_Current_Application; + + } else if (schemeIsHandledByOther(schemeInfo.information)) { + text = IDEWorkbenchMessages.UrlHandlerPreferencePage_Column_Handler_Text_Other_Application; + } + return text; + default: + throw new IllegalArgumentException("Unknown column"); //$NON-NLS-1$ + } + } + return null; // cannot happen + } + + @Override + public boolean isLabelProperty(Object element, String property) { + return false; + } + } + + final static class UiSchemeInformation { + public boolean checked; + public ISchemeInformation information; + + public UiSchemeInformation(boolean checked, ISchemeInformation information) { + this.checked = checked; + this.information = information; + } + } + + interface IStatusManagerWrapper { + default void handle(IStatus status, int style) { + StatusManager.getManager().handle(status, style); + } + } + + interface IMessageDialogWrapper { + default void openWarning(Shell shell, String title, String message) { + MessageDialog.openWarning(shell, title, message); + } + } +} diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java 2018-12-05 21:43:06.000000000 +0000 @@ -200,7 +200,7 @@ * otherwise */ @SuppressWarnings("rawtypes") - private Object checkInstanceLocation(Shell shell, Map applicationArguments) { + protected Object checkInstanceLocation(Shell shell, Map applicationArguments) { // -data @none was specified but an ide requires workspace Location instanceLoc = Platform.getInstanceLocation(); if (instanceLoc == null) { @@ -295,13 +295,6 @@ if (instanceLoc.set(workspaceUrl, true)) { launchData.writePersistedData(); writeWorkspaceVersion(); - - // bug 455162, bug 427393: unhide the splash after the - // workspace was selected to show the progress bar - if (parentShellVisible && isValidShell(shell)) { - shell.setVisible(true); - shell.forceActive(); - } return null; } } catch (IllegalStateException e) { @@ -321,7 +314,7 @@ // by this point it has been determined that the workspace is // already in use -- force the user to choose again - MessageDialog dialog = new MessageDialog(shell, IDEWorkbenchMessages.IDEApplication_workspaceInUseTitle, + MessageDialog dialog = new MessageDialog(null, IDEWorkbenchMessages.IDEApplication_workspaceInUseTitle, null, NLS.bind(IDEWorkbenchMessages.IDEApplication_workspaceInUseMessage, workspaceUrl.getFile()), MessageDialog.ERROR, 1, IDEWorkbenchMessages.IDEApplication_workspaceInUse_Retry, IDEWorkbenchMessages.IDEApplication_workspaceInUse_Choose); @@ -430,7 +423,7 @@ * @return true if the argument URL is ok to use as a workspace and false * otherwise. */ - private boolean checkValidWorkspace(Shell shell, URL url) { + protected boolean checkValidWorkspace(Shell shell, URL url) { // a null url is not a valid workspace if (url == null) { return false; @@ -441,17 +434,7 @@ return true; } - Version version = readWorkspaceVersion(url); - // if the version could not be read, then there is not any existing - // workspace data to trample, e.g., perhaps its a new directory that - // is just starting to be used as a workspace - if (version == null) { - return true; - } - - final Version ide_version = toMajorMinorVersion(WORKSPACE_CHECK_REFERENCE_BUNDLE_VERSION); - Version workspace_version = toMajorMinorVersion(version); - int versionCompareResult = workspace_version.compareTo(ide_version); + int versionCompareResult = compareWorkspaceAndIdeVersions(url); // equality test is required since any version difference (newer // or older) may result in data being trampled @@ -502,11 +485,42 @@ return true; } + /** + * Compares the version of the workspace with the specified URL, to the version + * of the running IDE. + * + * @param url The URL of the workspace. + * + * @return + *
    + *
  • A negative integer if the workspace has a version less than that + * of the IDE.
  • + *
  • A positive integer if the IDE has a version greater than that of + * the IDE.
  • + *
  • {@code 0} if the IDE has version equal to the IDE, or if the + * workspace has no version at all.
  • + *
+ */ + protected int compareWorkspaceAndIdeVersions(URL url) { + Version version = readWorkspaceVersion(url); + // if the version could not be read, then there is not any existing + // workspace data to trample, e.g., perhaps its a new directory that + // is just starting to be used as a workspace + if (version == null) { + return 0; + } + + final Version ide_version = toMajorMinorVersion(WORKSPACE_CHECK_REFERENCE_BUNDLE_VERSION); + Version workspace_version = toMajorMinorVersion(version); + int versionCompareResult = workspace_version.compareTo(ide_version); + return versionCompareResult; + } + /** - * Look at the argument URL for the workspace's version information. Return - * that version if found and null otherwise. - */ - private static Version readWorkspaceVersion(URL workspace) { + * @return Look at the argument URL for the workspace's version information. + * Return that version if found and null otherwise. + */ + protected static Version readWorkspaceVersion(URL workspace) { File versionFile = getVersionFile(workspace, false); if (versionFile == null || !versionFile.exists()) { return null; @@ -609,7 +623,7 @@ * @return An url to the file or null if the version file does not exist or * could not be created. */ - private static File getVersionFile(URL workspaceUrl, boolean create) { + protected static File getVersionFile(URL workspaceUrl, boolean create) { if (workspaceUrl == null) { return null; } @@ -638,7 +652,7 @@ /** * @return the major and minor parts of the given version */ - private static Version toMajorMinorVersion(Version version) { + protected static Version toMajorMinorVersion(Version version) { return new Version(version.getMajor(), version.getMinor(), 0); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2016 IBM Corporation and others. + * Copyright (c) 2003, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -61,7 +61,6 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; @@ -161,14 +160,11 @@ */ private final int workspaceWaitDelay; - private final Listener closeListener = new Listener() { - @Override - public void handleEvent(Event event) { - boolean doExit = IDEWorkbenchWindowAdvisor.promptOnExit(null); - event.doit = doExit; - if (!doExit) - event.type = SWT.None; - } + private final Listener closeListener = event -> { + boolean doExit = IDEWorkbenchWindowAdvisor.promptOnExit(null); + event.doit = doExit; + if (!doExit) + event.type = SWT.None; }; /** @@ -517,19 +513,14 @@ final boolean applyPolicy = ResourcesPlugin.getWorkspace() .getDescription().isApplyFileStatePolicy(); - IRunnableWithProgress runnable = new IRunnableWithProgress() { - @Override - public void run(IProgressMonitor monitor) { - try { - if (applyPolicy) - monitor = new CancelableProgressMonitorWrapper( - monitor, p); - - status.merge(((Workspace) ResourcesPlugin - .getWorkspace()).save(true, true, monitor)); - } catch (CoreException e) { - status.merge(e.getStatus()); - } + IRunnableWithProgress runnable = monitor -> { + try { + if (applyPolicy) + monitor = new CancelableProgressMonitorWrapper(monitor, p); + + status.merge(((Workspace) ResourcesPlugin.getWorkspace()).save(true, true, monitor)); + } catch (CoreException e) { + status.merge(e.getStatus()); } }; diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.monitoring/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.monitoring/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.monitoring/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.monitoring/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -16,7 +16,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui.navigator; singleton:=true -Bundle-Version: 3.7.200.qualifier +Bundle-Version: 3.7.300.qualifier Bundle-Activator: org.eclipse.ui.internal.navigator.NavigatorPlugin Bundle-Vendor: %Plugin.providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.navigator - 3.7.200-SNAPSHOT + 3.7.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java 2018-12-05 21:43:06.000000000 +0000 @@ -476,8 +476,8 @@ } /** - * @return The Navigator Content Service which populates this instance of - * Common Navigator + * @return The Navigator Action Service which populates this instance of Common + * Navigator */ public NavigatorActionService getNavigatorActionService() { return commonManager.getNavigatorActionService(); diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentExtension.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentExtension.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentExtension.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentExtension.java 2018-12-05 21:43:06.000000000 +0000 @@ -66,7 +66,7 @@ /** * The real underlying implementation may only support the * {@link ILabelProvider} interface, but a simple delegate is used when this - * is the case to ensure that clients may anticpate an + * is the case to ensure that clients may anticipate an * {@link ICommonLabelProvider} interface. * *

Since 3.4, the returned label provider may also implement diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui.navigator.resources; singleton:=true -Bundle-Version: 3.6.200.qualifier +Bundle-Version: 3.6.300.qualifier Bundle-Activator: org.eclipse.ui.internal.navigator.resources.plugin.WorkbenchNavigatorPlugin Bundle-Vendor: %Plugin.providerName Bundle-Localization: plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator.resources/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator.resources/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator.resources/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator.resources/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,11 +14,11 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.navigator.resources - 3.6.200-SNAPSHOT + 3.6.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectsLabelProvider.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectsLabelProvider.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectsLabelProvider.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectsLabelProvider.java 2018-12-05 21:43:06.000000000 +0000 @@ -13,12 +13,18 @@ ******************************************************************************/ package org.eclipse.ui.internal.navigator.resources.nested; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Set; +import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.function.Supplier; import org.eclipse.core.internal.resources.MarkerManager; import org.eclipse.core.internal.resources.Workspace; @@ -39,28 +45,32 @@ @SuppressWarnings("restriction") public class NestedProjectsLabelProvider extends ResourceExtensionLabelProvider { - private CompletableFuture> severitiesPerContainer = null; private IResourceChangeListener refreshSeveritiesOnProblemMarkerChange; + private ProblemsModelSupplier supplier; + private CompletableFuture> severities = null; @Override public void init(ICommonContentExtensionSite aConfig) { super.init(aConfig); - this.severitiesPerContainer = refreshSeverities(); + supplier = new ProblemsModelSupplier(); + this.severities = refreshSeverities(null); refreshSeveritiesOnProblemMarkerChange = event -> { if (event.getDelta() == null) { return; } + Set dirtyResources = new HashSet<>(); MarkerManager markerManager = ((Workspace) WorkbenchNavigatorPlugin.getWorkspace()).getMarkerManager(); try { event.getDelta().accept(delta -> { - if (severitiesPerContainer != null) { - IMarkerDelta[] markerDeltas = delta.getMarkerDeltas(); - for (IMarkerDelta markerDelta : markerDeltas) { - if (markerManager.isSubtype(markerDelta.getType(), IMarker.PROBLEM)) { - severitiesPerContainer.cancel(true); - severitiesPerContainer = null; + IMarkerDelta[] markerDeltas = delta.getMarkerDeltas(); + for (IMarkerDelta markerDelta : markerDeltas) { + if (markerManager.isSubtype(markerDelta.getType(), IMarker.PROBLEM)) { + if (severities != null && !severities.isDone()) { + severities.cancel(true); + severities = null; return false; } + dirtyResources.add(markerDelta.getResource()); } } return true; @@ -69,8 +79,8 @@ WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); } - if (severitiesPerContainer == null) { - this.severitiesPerContainer = refreshSeverities(); + if (!dirtyResources.isEmpty()) { + this.severities = refreshSeverities(dirtyResources); } }; WorkbenchNavigatorPlugin.getWorkspace().addResourceChangeListener(refreshSeveritiesOnProblemMarkerChange); @@ -82,38 +92,140 @@ super.dispose(); } - private CompletableFuture> refreshSeverities() { - return CompletableFuture.supplyAsync(() -> { - Map severities = new HashMap<>(); + private CompletableFuture> refreshSeverities(Set dirty) { + if (dirty != null) { + supplier.markDirty(dirty); + } + return CompletableFuture.supplyAsync(supplier); + } + + private final class ProblemsModelSupplier implements Supplier> { + private Set dirty = null; + private Map cache = new HashMap<>(); + + @Override + public Map get() { + Set currentDirty = null; + if (dirty != null) { + // create a local copy to be thread safe + currentDirty = new HashSet<>(); + currentDirty.addAll(this.dirty); + this.dirty.removeAll(currentDirty); + removeFromCache(currentDirty); + } + try { - for (IMarker marker : WorkbenchNavigatorPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { - int severity = marker.getAttribute(IMarker.SEVERITY, -1); - IContainer container = marker.getResource().getParent(); - if (marker.getResource() instanceof IContainer) { - container = (IContainer) marker.getResource(); - } - while (container != null) { - if (!severities.containsKey(container) || severities.get(container).intValue() < severity) { - severities.put(container, Integer.valueOf(severity)); - if (container.getType() == IResource.FOLDER) { - container = container.getParent(); - } else if (container.getType() == IResource.PROJECT) { - container = NestedProjectManager.getInstance().getMostDirectOpenContainer((IProject)container); - } else { - container = null; - } - } else { - container = null; + for (IMarker marker : WorkbenchNavigatorPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, + true, IResource.DEPTH_INFINITE)) { + IResource resource = marker.getResource(); + if (currentDirty == null || currentDirty.contains(resource)) { + int severity = marker.getAttribute(IMarker.SEVERITY, 0); + if (severity >= 0) { + propagateSeverityToCache(resource, severity); } } } + // initialize dirty so we won't rebuild model from scratch + markDirty(Collections.emptySet()); } catch (CoreException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); throw new RuntimeException(e); + } catch (CancellationException e) { + // ignore + return Collections.emptyMap(); } - return severities; - }); + return cache; + } + + /** + * Removes element from the cache and then fix the parent hierarchy for removed + * elements (remove from cache if no problem remain under node, or re-compute + * and propagate new highest severity) + * + * @param toRemove + */ + private void removeFromCache(Set toRemove) { + Set dirtyLeafContainers = new HashSet<>(); + for (IResource resource : toRemove) { + final IContainer initialContainer = resource instanceof IContainer ? (IContainer) resource + : resource.getParent(); + dirtyLeafContainers + .removeIf(leafContainer -> leafContainer.getLocation() + .isPrefixOf(initialContainer.getLocation())); + if (dirtyLeafContainers.stream() + .noneMatch(leafContainer -> initialContainer.getLocation() + .isPrefixOf(leafContainer.getLocation()))) { + dirtyLeafContainers.add(initialContainer); + } + if (resource.getType() == IResource.FILE) { + cache.remove(resource); + } + IContainer container = initialContainer; + while (container != null && cache.containsKey(container)) { + cache.remove(container); + container = getParentInView(container); + } + } + dirtyLeafContainers.forEach(leafContainer -> { + IContainer container = leafContainer; + while (container != null) { + int severity = getMaxChildrenSeverityInCache(container); + if (severity >= 0) { + propagateSeverityToCache(container, severity); + } + container = getParentInView(container); + } + }); + } + + private int getMaxChildrenSeverityInCache(IContainer container) { + if (!container.isAccessible()) { + return -1; + } + Set children = new HashSet<>(); + try { + children.addAll(Arrays.asList(container.members())); + } catch (CoreException ex) { + WorkbenchNavigatorPlugin.log("Cannot access members", //$NON-NLS-1$ + WorkbenchNavigatorPlugin.createErrorStatus(ex.getMessage(), ex)); + } + children.addAll(Arrays.asList(NestedProjectManager.getInstance().getDirectChildrenProjects(container))); + int[] severity = new int[] { -1 }; + children.forEach(child -> { + if (cache.containsKey(child) && cache.get(child).intValue() > severity[0]) { + severity[0] = cache.get(child).intValue(); + } + }); + return severity[0]; + } + + private void propagateSeverityToCache(IResource resource, int severity) { + while (resource != null) { + if (!cache.containsKey(resource) || cache.get(resource).intValue() < severity) { + cache.put(resource, Integer.valueOf(severity)); + resource = getParentInView(resource); + } else { + resource = null; + } + } + } + + private IContainer getParentInView(IResource resource) { + if (resource.getType() == IResource.PROJECT) { + return NestedProjectManager.getInstance().getMostDirectOpenContainer((IProject) resource); + } + return resource.getParent(); + } + + public void markDirty(Set dirty) { + synchronized (this) { + if (this.dirty == null) { + this.dirty = new HashSet<>(); + } + } + this.dirty.addAll(dirty); + } } @Override @@ -134,11 +246,12 @@ protected int getHighestProblemSeverity(IResource resource) { int problemSeverity = super.getHighestProblemSeverity(resource); if (resource instanceof IContainer && problemSeverity < IMarker.SEVERITY_ERROR) { + // TODO check whether container has nested projects (at any depth) try { // keep a snapshot to avoid the value to suddenly turn null - final CompletableFuture> severitiesSnapshot = severitiesPerContainer; + final CompletableFuture> severitiesSnapshot = this.severities; if (severitiesSnapshot != null) { - Integer severity = severitiesSnapshot.get(50, TimeUnit.MILLISECONDS).get(resource); + Integer severity = severitiesSnapshot.get(50000000, TimeUnit.MILLISECONDS).get(resource); if (severity != null) { problemSeverity = Math.max(problemSeverity, severity.intValue()); } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui.themes;singleton:=true -Bundle-Version: 1.2.200.qualifier +Bundle-Version: 1.2.300.qualifier Bundle-Vendor: %Plugin.providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.e4.ui.css.swt.theme diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.themes/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.themes/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.themes/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.themes/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -1,24 +1,24 @@ 4.0.0 eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.themes - 1.2.200-SNAPSHOT + 1.2.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views.properties.tabbed/META-INF/MANIFEST.MF eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views.properties.tabbed/META-INF/MANIFEST.MF --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views.properties.tabbed/META-INF/MANIFEST.MF 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views.properties.tabbed/META-INF/MANIFEST.MF 2018-12-05 21:43:06.000000000 +0000 @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui.views.properties.tabbed;singleton:=true -Bundle-Version: 3.8.200.qualifier +Bundle-Version: 3.8.300.qualifier Bundle-Vendor: %Plugin.providerName Bundle-Localization: plugin Export-Package: org.eclipse.ui.internal.views.properties.tabbed;x-internal:=true, diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views.properties.tabbed/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views.properties.tabbed/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views.properties.tabbed/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views.properties.tabbed/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -15,12 +15,12 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui org.eclipse.ui.views.properties.tabbed - 3.8.200-SNAPSHOT + 3.8.300-SNAPSHOT eclipse-plugin diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2015 IBM Corporation and others. + * Copyright (c) 2001, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -31,12 +31,8 @@ import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseMoveListener; import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.TraverseEvent; -import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.FontMetrics; import org.eclipse.swt.graphics.GC; @@ -51,7 +47,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; import org.eclipse.ui.forms.FormColors; import org.eclipse.ui.internal.views.properties.tabbed.l10n.TabbedPropertyMessages; import org.eclipse.ui.views.properties.tabbed.ITabItem; @@ -165,13 +160,7 @@ selected = false; this.index = index; - addPaintListener(new PaintListener() { - - @Override - public void paintControl(PaintEvent e) { - paint(e); - } - }); + addPaintListener(e -> paint(e)); addMouseListener(new MouseAdapter() { @Override @@ -192,14 +181,10 @@ } } }); - addMouseMoveListener(new MouseMoveListener() { - - @Override - public void mouseMove(MouseEvent e) { - if (!hover) { - hover = true; - redraw(); - } + addMouseMoveListener(e -> { + if (!hover) { + hover = true; + redraw(); } }); addMouseTrackListener(new MouseTrackAdapter() { @@ -452,13 +437,7 @@ */ public TopNavigationElement(Composite parent) { super(parent, SWT.NO_FOCUS); - addPaintListener(new PaintListener() { - - @Override - public void paintControl(PaintEvent e) { - paint(e); - } - }); + addPaintListener(e -> paint(e)); addMouseListener(new MouseAdapter() { @Override @@ -541,13 +520,7 @@ */ public BottomNavigationElement(Composite parent) { super(parent, SWT.NO_FOCUS); - addPaintListener(new PaintListener() { - - @Override - public void paintControl(PaintEvent e) { - paint(e); - } - }); + addPaintListener(e -> paint(e)); addMouseListener(new MouseAdapter() { @Override @@ -660,26 +633,21 @@ computeTopAndBottomTab(); } }); - this.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS - || e.detail == SWT.TRAVERSE_ARROW_NEXT) { - int nMax = elements.length - 1; - int nCurrent = getSelectionIndex(); - if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS) { - nCurrent -= 1; - nCurrent = Math.max(0, nCurrent); - } else if (e.detail == SWT.TRAVERSE_ARROW_NEXT) { - nCurrent += 1; - nCurrent = Math.min(nCurrent, nMax); - } - select(nCurrent); - redraw(); - } else { - e.doit = true; + this.addTraverseListener(e -> { + if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS || e.detail == SWT.TRAVERSE_ARROW_NEXT) { + int nMax = elements.length - 1; + int nCurrent = getSelectionIndex(); + if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS) { + nCurrent -= 1; + nCurrent = Math.max(0, nCurrent); + } else if (e.detail == SWT.TRAVERSE_ARROW_NEXT) { + nCurrent += 1; + nCurrent = Math.min(nCurrent, nMax); } + select(nCurrent); + redraw(); + } else { + e.doit = true; } }); } @@ -1306,22 +1274,12 @@ } }); - addListener(SWT.Selection, new Listener() { - - @Override - public void handleEvent(Event event) { - if (isFocusControl()) { - accessible.setFocus(ACC.CHILDID_SELF); - } - } - }); - - addListener(SWT.FocusIn, new Listener() { - - @Override - public void handleEvent(Event event) { + addListener(SWT.Selection, event -> { + if (isFocusControl()) { accessible.setFocus(ACC.CHILDID_SELF); } }); + + addListener(SWT.FocusIn, event -> accessible.setFocus(ACC.CHILDID_SELF)); } } diff -Nru eclipse-platform-ui-4.9/bundles/org.eclipse.ui.win32/pom.xml eclipse-platform-ui-4.10/bundles/org.eclipse.ui.win32/pom.xml --- eclipse-platform-ui-4.9/bundles/org.eclipse.ui.win32/pom.xml 2018-09-06 11:21:18.000000000 +0000 +++ eclipse-platform-ui-4.10/bundles/org.eclipse.ui.win32/pom.xml 2018-12-05 21:43:06.000000000 +0000 @@ -14,7 +14,7 @@ eclipse.platform.ui eclipse.platform.ui - 4.9.0-SNAPSHOT + 4.10.0-SNAPSHOT ../../ org.eclipse.ui @@ -34,7 +34,7 @@ win32 win32 - x86 + x86_64 diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java" 2018-12-05 21:43:06.000000000 +0000 @@ -496,8 +496,7 @@ } MPerspectiveStack getPerspectiveStack() { - List psList = modelService.findElements(window, null, - MPerspectiveStack.class, null); + List psList = modelService.findElements(window, null, MPerspectiveStack.class); if (psList.size() > 0) return psList.get(0); return null; diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/BaseNewWizardMenu.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/BaseNewWizardMenu.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/BaseNewWizardMenu.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/BaseNewWizardMenu.java" 2018-12-05 21:43:06.000000000 +0000 @@ -155,11 +155,11 @@ @Override public void dispose() { if (workbenchWindow != null) { - super.dispose(); unregisterListeners(); showDlgAction.dispose(); showDlgAction = null; workbenchWindow = null; + super.dispose(); } } @@ -255,8 +255,10 @@ * @since 3.1 */ private void unregisterListeners() { - Platform.getExtensionRegistry().removeRegistryChangeListener( - registryListener); - workbenchWindow.getExtensionTracker().unregisterHandler(configListener); + Platform.getExtensionRegistry().removeRegistryChangeListener(registryListener); + IExtensionTracker extensionTracker = workbenchWindow.getExtensionTracker(); + if (extensionTracker != null) { + extensionTracker.unregisterHandler(configListener); + } } } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java" 2018-12-05 21:43:06.000000000 +0000 @@ -210,7 +210,7 @@ * promising perspectives and an "Other" subitem. Selecting * one of the items makes the corresponding perspective active. Should a * new perspective need to be opened, a workbench user preference controls - * whether the prespective is opened in the active window or a new window. + * whether the perspective is opened in the active window or a new window. * This action dynamically maintains the perspectives shortlist. */ public static final ContributionItemFactory PERSPECTIVES_SHORTLIST = new ContributionItemFactory( diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivitiesPreferencePage.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivitiesPreferencePage.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivitiesPreferencePage.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivitiesPreferencePage.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -15,7 +15,6 @@ import java.util.Hashtable; import java.util.Properties; - import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExecutableExtension; import org.eclipse.jface.dialogs.Dialog; @@ -150,7 +149,7 @@ @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) { if (data instanceof Hashtable) { - strings.putAll((Hashtable)data); + strings.putAll((Hashtable) data); } } } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java" 2018-12-05 21:43:06.000000000 +0000 @@ -18,7 +18,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.Hashtable; -import java.util.Iterator; import java.util.Properties; import java.util.Set; import org.eclipse.core.runtime.IConfigurationElement; @@ -198,10 +197,11 @@ } private class CategoryContentProvider implements IStructuredContentProvider { + @SuppressWarnings("unchecked") @Override public Object[] getElements(Object inputElement) { // convert to category objects - return WorkbenchActivityHelper.resolveCategories(workingCopy, (Set) inputElement); + return WorkbenchActivityHelper.resolveCategories(workingCopy, (Set) inputElement); } } @@ -314,7 +314,8 @@ setButtonLayoutData(enableAll); Button disableAll = new Button(composite, SWT.PUSH); - disableAll.addSelectionListener(widgetSelectedAdapter(e -> workingCopy.setEnabledActivityIds(Collections.EMPTY_SET))); + disableAll.addSelectionListener( + widgetSelectedAdapter(e -> workingCopy.setEnabledActivityIds(Collections.emptySet()))); disableAll.setText(ActivityMessages.ActivityEnabler_deselectAll); setButtonLayoutData(disableAll); @@ -375,11 +376,11 @@ e.doit = false; // veto the check return; } - Set activitySet = WorkbenchActivityHelper.getActivityIdsForCategory(category); + Set activitySet = WorkbenchActivityHelper.getActivityIdsForCategory(category); if (tableItem.getChecked()) { activitySet.addAll(workingCopy.getEnabledActivityIds()); } else { - HashSet newSet = new HashSet(workingCopy.getEnabledActivityIds()); + HashSet newSet = new HashSet<>(workingCopy.getEnabledActivityIds()); newSet.removeAll(activitySet); activitySet = newSet; } @@ -441,7 +442,7 @@ clearDetails(); return; } - Set categories = null; + Set categories = null; if (WorkbenchActivityHelper.isEnabled(workingCopy, category.getId())) { categories = WorkbenchActivityHelper.getDisabledCategories( workingCopy, category.getId()); @@ -513,10 +514,9 @@ return; } - Set defaultEnabled = new HashSet(); - Set activityIds = workingCopy.getDefinedActivityIds(); - for (Iterator i = activityIds.iterator(); i.hasNext();) { - String activityId = (String) i.next(); + Set defaultEnabled = new HashSet<>(); + Set activityIds = workingCopy.getDefinedActivityIds(); + for (String activityId : activityIds) { IActivity activity = workingCopy.getActivity(activityId); try { if (activity.isDefaultEnabled()) { @@ -534,7 +534,7 @@ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) { if (data instanceof Hashtable) { - Hashtable table = (Hashtable)data; + Hashtable table = (Hashtable) data; allowAdvanced = Boolean.valueOf((String) table.remove(ALLOW_ADVANCED)).booleanValue(); strings.putAll(table); } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityManagerEvent.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityManagerEvent.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityManagerEvent.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityManagerEvent.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -15,7 +15,6 @@ package org.eclipse.ui.activities; import java.util.Set; - import org.eclipse.ui.internal.util.Util; /** @@ -45,21 +44,21 @@ * change occurred. If the defined activities did not changed, then this * value is null. */ - private final Set previouslyDefinedActivityIds; + private final Set previouslyDefinedActivityIds; /** * The set of category identifiers (strings) that were defined before the * change occurred. If the defined category did not changed, then this value * is null. */ - private final Set previouslyDefinedCategoryIds; + private final Set previouslyDefinedCategoryIds; /** * The set of activity identifiers (strings) that were enabled before the * change occurred. If the enabled activities did not changed, then this * value is null. */ - private final Set previouslyEnabledActivityIds; + private final Set previouslyEnabledActivityIds; /** * Creates a new instance of this class. @@ -101,9 +100,8 @@ boolean definedActivityIdsChanged, boolean definedCategoryIdsChanged, boolean enabledActivityIdsChanged, - final Set previouslyDefinedActivityIds, - final Set previouslyDefinedCategoryIds, - final Set previouslyEnabledActivityIds) { + final Set previouslyDefinedActivityIds, final Set previouslyDefinedCategoryIds, + final Set previouslyEnabledActivityIds) { if (activityManager == null) { throw new NullPointerException(); } @@ -164,7 +162,7 @@ * be empty, but never null. This set will only * contain strings. */ - public Set getPreviouslyDefinedActivityIds() { + public Set getPreviouslyDefinedActivityIds() { return previouslyDefinedActivityIds; } @@ -175,7 +173,7 @@ * be empty, but never null. This set will only * contain strings. */ - public Set getPreviouslyDefinedCategoryIds() { + public Set getPreviouslyDefinedCategoryIds() { return previouslyDefinedCategoryIds; } @@ -186,7 +184,7 @@ * be empty, but never null. This set will only * contain strings. */ - public Set getPreviouslyEnabledActivityIds() { + public Set getPreviouslyEnabledActivityIds() { return previouslyEnabledActivityIds; } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivity.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivity.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivity.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivity.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -15,7 +15,6 @@ package org.eclipse.ui.activities; import java.util.Set; - import org.eclipse.core.expressions.Expression; /** @@ -44,7 +43,7 @@ * @see IActivityManager * @noimplement This interface is not intended to be implemented by clients. */ -public interface IActivity extends Comparable { +public interface IActivity extends Comparable { /** * Registers an instance of IActivityListener to listen for @@ -75,7 +74,7 @@ * IActivityRequirementBinding. * @see IActivityRequirementBinding */ - Set getActivityRequirementBindings(); + Set getActivityRequirementBindings(); /** * Returns the set of activity pattern bindings for this instance. @@ -93,7 +92,7 @@ * empty, it is guaranteed to only contain instances of IActivityPatternBinding. * @see IActivityPatternBinding */ - Set getActivityPatternBindings(); + Set getActivityPatternBindings(); /** * Returns the identifier of this instance. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityManager.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityManager.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityManager.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityManager.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -71,7 +71,7 @@ * set is not empty, it is guaranteed to only contain instances of * String. */ - Set getDefinedActivityIds(); + Set getDefinedActivityIds(); /** * Returns the set of identifiers to defined categories. @@ -85,7 +85,7 @@ * set is not empty, it is guaranteed to only contain instances of * String. */ - Set getDefinedCategoryIds(); + Set getDefinedCategoryIds(); /** * Returns the set of identifiers to enabled activities. @@ -99,7 +99,7 @@ * set is not empty, it is guaranteed to only contain instances of * String. */ - Set getEnabledActivityIds(); + Set getEnabledActivityIds(); /** * Returns an instance of IIdentifier given an identifier. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityPatternBinding.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityPatternBinding.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityPatternBinding.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityPatternBinding.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -31,7 +31,7 @@ * @see IActivityManager#getIdentifier(String) * @noimplement This interface is not intended to be implemented by clients. */ -public interface IActivityPatternBinding extends Comparable { +public interface IActivityPatternBinding extends Comparable { /** * Returns the identifier of the activity represented in this binding. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityRequirementBinding.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityRequirementBinding.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityRequirementBinding.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityRequirementBinding.java" 2018-12-05 21:43:06.000000000 +0000 @@ -28,7 +28,7 @@ * @see IActivity * @noimplement This interface is not intended to be implemented by clients. */ -public interface IActivityRequirementBinding extends Comparable { +public interface IActivityRequirementBinding extends Comparable { /** * Returns the identifier of the activity represented in this diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategoryActivityBinding.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategoryActivityBinding.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategoryActivityBinding.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategoryActivityBinding.java" 2018-12-05 21:43:06.000000000 +0000 @@ -27,7 +27,7 @@ * @see ICategory * @noimplement This interface is not intended to be implemented by clients. */ -public interface ICategoryActivityBinding extends Comparable { +public interface ICategoryActivityBinding extends Comparable { /** * Returns the identifier of the activity represented in this binding. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategory.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategory.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategory.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategory.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -37,7 +37,7 @@ * @see IActivityManager * @noimplement This interface is not intended to be implemented by clients. */ -public interface ICategory extends Comparable { +public interface ICategory extends Comparable { /** * Registers an instance of ICategoryListener to listen for @@ -67,7 +67,7 @@ * not empty, it is guaranteed to only contain instances of ICategoryActivityBinding. * @see ICategoryActivityBinding */ - Set getCategoryActivityBindings(); + Set getCategoryActivityBindings(); /** * Returns the identifier of this instance. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IIdentifier.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IIdentifier.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IIdentifier.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IIdentifier.java" 2018-12-05 21:43:06.000000000 +0000 @@ -38,7 +38,7 @@ * @see IActivityManager#getIdentifier(String) * @noimplement This interface is not intended to be implemented by clients. */ -public interface IIdentifier extends Comparable { +public interface IIdentifier extends Comparable { /** * Registers an instance of IIdentifierListener to listen @@ -66,7 +66,7 @@ * this set is not empty, it is guaranteed to only contain * instances of String. */ - Set getActivityIds(); + Set getActivityIds(); /** * Returns the identifier of this instance. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IMutableActivityManager.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IMutableActivityManager.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IMutableActivityManager.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IMutableActivityManager.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -40,5 +40,5 @@ * empty, but it must not be null. If this set * is not empty, it must only contain instances of String. */ - void setEnabledActivityIds(Set enabledActivityIds); + void setEnabledActivityIds(Set enabledActivityIds); } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointAdvisor.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointAdvisor.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointAdvisor.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointAdvisor.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -52,7 +52,7 @@ * required activities the change should be verified by consulting * {@link IActivityManager#getEnabledActivityIds()}. */ - Set allow(ITriggerPoint triggerPoint, IIdentifier identifier); + Set allow(ITriggerPoint triggerPoint, IIdentifier identifier); /** * Calculate the identifier's enabled state for a combination of activities diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointManager.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointManager.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointManager.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointManager.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -49,5 +49,5 @@ * * @return the defined ids. Never null but may be empty. */ - Set getDefinedTriggerPointIds(); + Set getDefinedTriggerPointIds(); } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IWorkbenchActivitySupport.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IWorkbenchActivitySupport.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IWorkbenchActivitySupport.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IWorkbenchActivitySupport.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2015 IBM Corporation and others. + * Copyright (c) 2003, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -14,7 +14,6 @@ package org.eclipse.ui.activities; import java.util.Set; - import org.eclipse.jface.resource.ImageDescriptor; /** @@ -46,7 +45,7 @@ * empty, but it must not be null. If this set * is not empty, it must only contain instances of String. */ - void setEnabledActivityIds(Set enabledActivityIds); + void setEnabledActivityIds(Set enabledActivityIds); /** * Return the image associated with this activity. diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchActivityHelper.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchActivityHelper.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchActivityHelper.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchActivityHelper.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2015 IBM Corporation and others. + * Copyright (c) 2003, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -21,7 +21,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; - import org.eclipse.ui.IPluginContribution; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.activities.ws.WorkbenchActivitySupport; @@ -146,7 +145,7 @@ ITriggerPointAdvisor advisor = ((WorkbenchActivitySupport) PlatformUI .getWorkbench().getActivitySupport()).getTriggerPointAdvisor(); - Set activitiesToEnable = advisor.allow(triggerPoint, identifier); + Set activitiesToEnable = advisor.allow(triggerPoint, identifier); if (activitiesToEnable == null) { return false; @@ -195,10 +194,10 @@ * @param activities * the activities to enable */ - private static void enableActivities(Collection activities) { + private static void enableActivities(Collection activities) { IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench() .getActivitySupport(); - Set newSet = new HashSet(activitySupport.getActivityManager().getEnabledActivityIds()); + Set newSet = new HashSet<>(activitySupport.getActivityManager().getEnabledActivityIds()); newSet.addAll(activities); activitySupport.setEnabledActivityIds(newSet); } @@ -254,11 +253,11 @@ * given category becomes enabled * @since 3.1 */ - public static Set getEnabledCategories(IActivityManager activityManager, + public static Set getEnabledCategories(IActivityManager activityManager, String categoryId) { ICategory category = activityManager.getCategory(categoryId); if (!category.isDefined()) { - return Collections.EMPTY_SET; + return Collections.emptySet(); } Set activities = expandActivityDependencies(getActivityIdsForCategory(category)); @@ -293,11 +292,10 @@ * @return the expanded activities * @since 3.1 */ - public static Set expandActivityDependencies(Set baseActivities) { - Set extendedActivities = new HashSet<>(); - for (Iterator i = baseActivities.iterator(); i.hasNext();) { - String activityId = (String) i.next(); - Set requiredActivities = getRequiredActivityIds(activityId); + public static Set expandActivityDependencies(Set baseActivities) { + Set extendedActivities = new HashSet<>(); + for (String activityId : baseActivities) { + Set requiredActivities = getRequiredActivityIds(activityId); extendedActivities.addAll(requiredActivities); } extendedActivities.addAll(baseActivities); @@ -312,7 +310,7 @@ * @return the activities required for this activity * @since 3.1 */ - public static Set getRequiredActivityIds(String activityId) { + public static Set getRequiredActivityIds(String activityId) { IActivityManager manager = PlatformUI.getWorkbench() .getActivitySupport().getActivityManager(); IActivity activity = manager.getActivity(activityId); @@ -324,7 +322,7 @@ return Collections.EMPTY_SET; } - Set requiredActivities = new HashSet<>(3); + Set requiredActivities = new HashSet<>(3); for (Object name : requirementBindings) { IActivityRequirementBinding binding = (IActivityRequirementBinding) name; requiredActivities.add(binding.getRequiredActivityId()); @@ -341,8 +339,8 @@ * @return the activities directly required by a given category * @since 3.1 */ - public static Set getActivityIdsForCategory(ICategory category) { - Set bindings = category.getCategoryActivityBindings(); + public static Set getActivityIdsForCategory(ICategory category) { + Set bindings = category.getCategoryActivityBindings(); Set activityIds = new HashSet<>(); for (Object name : bindings) { ICategoryActivityBinding binding = (ICategoryActivityBinding) name; @@ -365,11 +363,11 @@ * given category becomes enabled * @since 3.1 */ - public static Set getDisabledCategories(IActivityManager activityManager, + public static Set getDisabledCategories(IActivityManager activityManager, String categoryId) { ICategory category = activityManager.getCategory(categoryId); if (!category.isDefined()) { - return Collections.EMPTY_SET; + return Collections.emptySet(); } Set activities = expandActivityDependencies(getActivityIdsForCategory(category)); @@ -413,11 +411,11 @@ * given category becomes enabled * @since 3.1 */ - public static Set getContainedCategories( + public static Set getContainedCategories( IActivityManager activityManager, String categoryId) { ICategory category = activityManager.getCategory(categoryId); if (!category.isDefined()) { - return Collections.EMPTY_SET; + return Collections.emptySet(); } Set activities = expandActivityDependencies(getActivityIdsForCategory(category)); @@ -454,12 +452,11 @@ * @return the set of enabled categories. * @since 3.1 */ - public static Set getEnabledCategories(IActivityManager activityManager) { + public static Set getEnabledCategories(IActivityManager activityManager) { - Set definedCategoryIds = activityManager.getDefinedCategoryIds(); + Set definedCategoryIds = activityManager.getDefinedCategoryIds(); Set enabledCategories = new HashSet<>(); - for (Object name : definedCategoryIds) { - String categoryId = (String) name; + for (String categoryId : definedCategoryIds) { if (isEnabled(activityManager, categoryId)) { enabledCategories.add(categoryId); } @@ -475,12 +472,11 @@ * @return the set of partially enabled categories * @since 3.2 */ - public static Set getPartiallyEnabledCategories( + public static Set getPartiallyEnabledCategories( IActivityManager activityManager) { - Set definedCategoryIds = activityManager.getDefinedCategoryIds(); + Set definedCategoryIds = activityManager.getDefinedCategoryIds(); Set partialCategories = new HashSet<>(); - for (Object name : definedCategoryIds) { - String categoryId = (String) name; + for (String categoryId : definedCategoryIds) { if (isPartiallyEnabled(activityManager, categoryId)) { partialCategories.add(categoryId); } @@ -503,7 +499,7 @@ */ public static boolean isPartiallyEnabled(IActivityManager activityManager, String categoryId) { - Set activityIds = getActivityIdsForCategory(activityManager.getCategory(categoryId)); + Set activityIds = getActivityIdsForCategory(activityManager.getCategory(categoryId)); int foundCount = 0; for (Object name : activityIds) { String activityId = (String) name; @@ -525,15 +521,11 @@ * @return the set of enabled category ids that this activity belongs to * @since 3.1 */ - public static Set getEnabledCategoriesForActivity( - IActivityManager activityManager, String activityId) { + public static Set getEnabledCategoriesForActivity(IActivityManager activityManager, String activityId) { Set enabledCategoriesForActivity = new HashSet<>(); - Set enabledCategories = getEnabledCategories(activityManager); - for (Object name : enabledCategories) { - String categoryId = (String) name; - if (getActivityIdsForCategory( - activityManager.getCategory(categoryId)).contains( - activityId)) { + Set enabledCategories = getEnabledCategories(activityManager); + for (String categoryId : enabledCategories) { + if (getActivityIdsForCategory(activityManager.getCategory(categoryId)).contains(activityId)) { enabledCategoriesForActivity.add(categoryId); } } @@ -578,9 +570,9 @@ * @since 3.1 */ public static ICategory[] resolveCategories( - IMutableActivityManager activityManager, Set categoryIds) { + IMutableActivityManager activityManager, Set categoryIds) { ICategory[] categories = new ICategory[categoryIds.size()]; - String[] categoryIdArray = (String[]) categoryIds.toArray(new String[categoryIds.size()]); + String[] categoryIdArray = categoryIds.toArray(new String[categoryIds.size()]); for (int i = 0; i < categoryIdArray.length; i++) { categories[i] = activityManager.getCategory(categoryIdArray[i]); } @@ -597,9 +589,9 @@ * * @since 3.4 */ - public static Collection restrictCollection(Collection toBeFiltered, Collection result) { - for (Iterator iterator = toBeFiltered.iterator(); iterator.hasNext();) { - Object item = iterator.next(); + public static Collection restrictCollection(Collection toBeFiltered, Collection result) { + for (Iterator iterator = toBeFiltered.iterator(); iterator.hasNext();) { + T item = iterator.next(); if (!restrictUseOf(item)) { result.add(item); } @@ -639,9 +631,9 @@ * * @since 3.4 */ - public static Collection filterCollection(Collection toBeFiltered, Collection result) { - for (Iterator iterator = toBeFiltered.iterator(); iterator.hasNext();) { - Object item = iterator.next(); + public static Collection filterCollection(Collection toBeFiltered, Collection result) { + for (Iterator iterator = toBeFiltered.iterator(); iterator.hasNext();) { + T item = iterator.next(); if (!filterItem(item)) { result.add(item); } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchTriggerPointAdvisor.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchTriggerPointAdvisor.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchTriggerPointAdvisor.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchTriggerPointAdvisor.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -18,7 +18,6 @@ import java.util.Iterator; import java.util.Properties; import java.util.Set; - import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExecutableExtension; import org.eclipse.jface.window.Window; @@ -82,14 +81,14 @@ } @Override - public Set allow(ITriggerPoint triggerPoint, IIdentifier identifier) { + public Set allow(ITriggerPoint triggerPoint, IIdentifier identifier) { if (triggerPoint.getBooleanHint(ITriggerPoint.HINT_PRE_UI)) { IActivityManager activityManager = PlatformUI.getWorkbench() .getActivitySupport().getActivityManager(); - Iterator iterator = identifier.getActivityIds().iterator(); + Iterator iterator = identifier.getActivityIds().iterator(); while (iterator.hasNext()) { - String id = (String) iterator.next(); + String id = iterator.next(); IActivity activity = activityManager.getActivity(id); if (activity.getExpression() != null) { if (!activity.isEnabled()) @@ -117,7 +116,7 @@ EnablementDialog dialog = new EnablementDialog(Util.getShellToParentOn(), identifier .getActivityIds(), strings); if (dialog.open() == Window.OK) { - Set activities = dialog.getActivitiesToEnable(); + Set activities = dialog.getActivitiesToEnable(); if (dialog.getDontAsk()) { PrefUtil.getInternalPreferenceStore().setValue( IPreferenceConstants.SHOULD_PROMPT_FOR_ENABLEMENT, @@ -134,7 +133,7 @@ @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) { if (data instanceof Hashtable) { - strings.putAll((Hashtable)data); + strings.putAll((Hashtable) data); } } @@ -190,15 +189,14 @@ */ protected boolean doComputeEnablement(IActivityManager activityManager, IIdentifier identifier, boolean disabledExpressionActivitiesTakePrecedence) { - final Set activityIds = identifier.getActivityIds(); + final Set activityIds = identifier.getActivityIds(); if (activityIds.isEmpty()) { return true; } boolean matchesAtLeastOneEnabled = false; boolean matchesDisabledExpressionActivitiesWithPrecedence = false; - for (Iterator iterator = activityIds.iterator(); iterator.hasNext();) { - String activityId = (String) iterator.next(); + for (String activityId : activityIds) { IActivity activity = activityManager.getActivity(activityId); if (activity.isEnabled()) { diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java" 2018-12-05 21:43:06.000000000 +0000 @@ -3089,12 +3089,14 @@ // See if any are exact matches boolean m1 = filterPattern.equals(getElementName(o1)); boolean m2 = filterPattern.equals(getElementName(o2)); - if (m1 && m2) - return 0; - if (m1 && !m2) - return -1; - if (m2 && !m1) - return 1; + if (!m1 || !m2) { + if (m1 && !m2) { + return -1; + } + if (m2 && !m1) { + return 1; + } + } } boolean h1 = isHistoryElement(o1); @@ -3103,10 +3105,12 @@ return itemsComparator.compare(o1, o2); } - if (h1) + if (h1) { return -2; - if (h2) + } + if (h2) { return +2; + } return 0; } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2014 IBM Corporation and others. + * Copyright (c) 2004, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -24,7 +24,7 @@ * image identity. */ public class AboutFeaturesButtonManager { - private Map providerMap = new HashMap(); + private Map> providerMap = new HashMap<>(); private static class Key { public String providerName; @@ -71,13 +71,13 @@ String providerName = info.getProviderName(); Key key = new Key(providerName, crc); - List infoList = (List) providerMap.get(key); + List infoList = providerMap.get(key); if (infoList != null) { infoList.add(info); return false; } - infoList = new ArrayList(); + infoList = new ArrayList<>(); infoList.add(info); providerMap.put(key, infoList); return true; @@ -97,12 +97,11 @@ String providerName = info.getProviderName(); Key key = new Key(providerName, crc); - List infoList = (List) providerMap.get(key); + List infoList = providerMap.get(key); if (infoList == null) { return new AboutBundleGroupData[0]; } - return (AboutBundleGroupData[]) infoList - .toArray(new AboutBundleGroupData[0]); + return infoList.toArray(new AboutBundleGroupData[0]); } } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesPage.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesPage.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesPage.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesPage.java" 2018-12-05 21:43:06.000000000 +0000 @@ -86,7 +86,7 @@ private Composite infoArea; - private Map cachedImages = new HashMap(); + private Map cachedImages = new HashMap<>(); private AboutBundleGroupData[] bundleGroupInfos; @@ -104,7 +104,7 @@ private Button pluginsButton, moreButton; - private static Map featuresMap; + private static Map featuresMap; public void setBundleGroupInfos(AboutBundleGroupData[] bundleGroupInfos) { this.bundleGroupInfos = bundleGroupInfos; @@ -117,22 +117,19 @@ private void initializeBundleGroupInfos() { if (bundleGroupInfos == null) { - IBundleGroupProvider[] providers = Platform - .getBundleGroupProviders(); + IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); // create a descriptive object for each BundleGroup - LinkedList groups = new LinkedList(); + LinkedList groups = new LinkedList<>(); if (providers != null) { for (IBundleGroupProvider provider : providers) { - IBundleGroup[] bundleGroups = provider - .getBundleGroups(); + IBundleGroup[] bundleGroups = provider.getBundleGroups(); for (IBundleGroup bundleGroup : bundleGroups) { groups.add(new AboutBundleGroupData(bundleGroup)); } } } - bundleGroupInfos = (AboutBundleGroupData[]) groups - .toArray(new AboutBundleGroupData[0]); + bundleGroupInfos = groups.toArray(new AboutBundleGroupData[0]); } else { // the order of the array may be changed due to sorting, so create a // copy, since the client set this value. @@ -318,9 +315,9 @@ } private void disposeImages() { - Iterator iter = cachedImages.values().iterator(); + Iterator iter = cachedImages.values().iterator(); while (iter.hasNext()) { - Image image = (Image) iter.next(); + Image image = iter.next(); image.dispose(); } } @@ -362,7 +359,7 @@ } ImageDescriptor desc = info.getFeatureImage(); - Image image = (Image) cachedImages.get(desc); + Image image = cachedImages.get(desc); if (image == null && desc != null) { image = desc.createImage(); cachedImages.put(desc, image); @@ -477,14 +474,14 @@ info.getVersion(), info.getId() }; } - protected Collection getSelectionValue() { + protected Collection getSelectionValue() { if (table == null || table.isDisposed()) return null; TableItem[] items = table.getSelection(); if (items.length <= 0) { return null; } - ArrayList list = new ArrayList(1); + ArrayList list = new ArrayList<>(1); list.add(items[0].getData()); return list; } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutTextManager.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutTextManager.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutTextManager.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutTextManager.java" 2018-12-05 21:43:06.000000000 +0000 @@ -39,8 +39,8 @@ * @return */ public static AboutItem scan(String s) { - ArrayList linkRanges = new ArrayList(); - ArrayList links = new ArrayList(); + ArrayList linkRanges = new ArrayList<>(); + ArrayList links = new ArrayList<>(); // Slightly modified version of JFace URL detection, // see org.eclipse.jface.text.hyperlink.URLHyperlinkDetector @@ -89,8 +89,8 @@ urlSeparatorOffset= s.indexOf("://", urlOffset+urlLength+1); //$NON-NLS-1$ } - return new AboutItem(s, (int[][]) linkRanges.toArray(new int[linkRanges - .size()][2]), (String[]) links + return new AboutItem(s, linkRanges.toArray(new int[linkRanges + .size()][2]), links .toArray(new String[links.size()])); } private StyledText styledText; diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -22,7 +22,6 @@ import java.net.URL; import java.util.ArrayList; import java.util.StringTokenizer; - import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; @@ -53,8 +52,8 @@ * @return */ public static AboutItem scan(String s) { - ArrayList linkRanges = new ArrayList(); - ArrayList links = new ArrayList(); + ArrayList linkRanges = new ArrayList<>(); + ArrayList links = new ArrayList<>(); // slightly modified version of jface url detection // see org.eclipse.jface.text.hyperlink.URLHyperlinkDetector @@ -104,8 +103,8 @@ urlSeparatorOffset = s.indexOf("://", urlOffset + urlLength + 1); //$NON-NLS-1$ } - return new AboutItem(s, (int[][]) linkRanges.toArray(new int[linkRanges - .size()][2]), (String[]) links + return new AboutItem(s, linkRanges.toArray(new int[linkRanges + .size()][2]), links .toArray(new String[links.size()])); } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java" 2018-12-05 21:43:06.000000000 +0000 @@ -24,7 +24,6 @@ import java.util.Date; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.StringTokenizer; @@ -125,33 +124,19 @@ return; certificate.setText(WorkbenchMessages.BundleSigningTray_Working); date.setText(WorkbenchMessages.BundleSigningTray_Working); - final BundleContext bundleContext = WorkbenchPlugin.getDefault() - .getBundleContext(); - final ServiceReference factoryRef = bundleContext - .getServiceReference(SignedContentFactory.class.getName()); + final BundleContext bundleContext = WorkbenchPlugin.getDefault().getBundleContext(); + final ServiceReference factoryRef = bundleContext + .getServiceReference(SignedContentFactory.class); if (factoryRef == null) { - StatusManager - .getManager() - .handle( - new Status( - IStatus.WARNING, - WorkbenchPlugin.PI_WORKBENCH, - WorkbenchMessages.BundleSigningTray_Cant_Find_Service), - StatusManager.LOG); + StatusManager.getManager().handle(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, + WorkbenchMessages.BundleSigningTray_Cant_Find_Service), StatusManager.LOG); return; } - final SignedContentFactory contentFactory = (SignedContentFactory) bundleContext - .getService(factoryRef); + final SignedContentFactory contentFactory = bundleContext.getService(factoryRef); if (contentFactory == null) { - StatusManager - .getManager() - .handle( - new Status( - IStatus.WARNING, - WorkbenchPlugin.PI_WORKBENCH, - WorkbenchMessages.BundleSigningTray_Cant_Find_Service), - StatusManager.LOG); + StatusManager.getManager().handle(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, + WorkbenchMessages.BundleSigningTray_Cant_Find_Service), StatusManager.LOG); return; } @@ -181,9 +166,9 @@ signerText = WorkbenchMessages.BundleSigningTray_Unknown; else { StringBuilder buffer = new StringBuilder(); - for (Iterator i = certs[0].entrySet().iterator(); i + for (Iterator> i = certs[0].entrySet().iterator(); i .hasNext();) { - Map.Entry entry = (Entry) i.next(); + Entry entry = i.next(); buffer.append(entry.getKey()); buffer.append('='); buffer.append(entry.getValue()); @@ -249,16 +234,15 @@ } private Properties[] parseCerts(Certificate[] chain) { - List certs = new ArrayList(chain.length); + List certs = new ArrayList<>(chain.length); for (int i = 0; i < chain.length; i++) { if (!(chain[i] instanceof X509Certificate)) continue; - Map cert = parseCert(((X509Certificate) chain[i]).getSubjectDN() - .getName()); + Properties cert = parseCert(((X509Certificate) chain[i]).getSubjectDN().getName()); if (cert != null) certs.add(cert); } - return (Properties[]) certs.toArray(new Properties[certs.size()]); + return certs.toArray(new Properties[certs.size()]); } diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2015 IBM Corporation and others. + * Copyright (c) 2003, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -66,13 +66,13 @@ writer.println(); writer.println(WorkbenchMessages.SystemSummary_systemProperties); Properties properties = System.getProperties(); - SortedSet set = new TreeSet((o1, o2) -> { + SortedSet set = new TreeSet<>((o1, o2) -> { String s1 = (String) o1; String s2 = (String) o2; return s1.compareTo(s2); }); set.addAll(properties.keySet()); - Iterator i = set.iterator(); + Iterator i = set.iterator(); while (i.hasNext()) { String key = (String)i.next(); String value = properties.getProperty(key); @@ -109,26 +109,24 @@ writer.println(); writer.println(WorkbenchMessages.SystemSummary_features); - IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); - LinkedList groups = new LinkedList(); - if (providers != null) { + IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); + LinkedList groups = new LinkedList<>(); + if (providers != null) { for (IBundleGroupProvider provider : providers) { - IBundleGroup[] bundleGroups = provider.getBundleGroups(); - for (IBundleGroup bundleGroup : bundleGroups) { + IBundleGroup[] bundleGroups = provider.getBundleGroups(); + for (IBundleGroup bundleGroup : bundleGroups) { groups.add(new AboutBundleGroupData(bundleGroup)); } - } + } } - AboutBundleGroupData[] bundleGroupInfos = (AboutBundleGroupData[]) groups - .toArray(new AboutBundleGroupData[0]); + AboutBundleGroupData[] bundleGroupInfos = groups.toArray(new AboutBundleGroupData[0]); AboutData.sortById(false, bundleGroupInfos); - for (AboutBundleGroupData info : bundleGroupInfos) { - String[] args = new String[] { info.getId(), info.getVersion(), - info.getName() }; - writer.println(NLS.bind(WorkbenchMessages.SystemSummary_featureVersion, args)); - } + for (AboutBundleGroupData info : bundleGroupInfos) { + String[] args = new String[] { info.getId(), info.getVersion(), info.getName() }; + writer.println(NLS.bind(WorkbenchMessages.SystemSummary_featureVersion, args)); + } } /** diff -Nru "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java" "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java" --- "/tmp/tmpT4yEMA/cVOxPz3yDl/eclipse-platform-ui-4.9/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java" 2018-09-06 11:21:18.000000000 +0000 +++ "/tmp/tmpT4yEMA/vPLQJkxV4P/eclipse-platform-ui-4.10/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java" 2018-12-05 21:43:06.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -32,6 +32,8 @@ import org.eclipse.jface.dialogs.TrayDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.FontMetrics; import org.eclipse.swt.graphics.GC; @@ -43,8 +45,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; import org.eclipse.ui.about.IInstallationPageContainer; import org.eclipse.ui.about.InstallationPage; import org.eclipse.ui.internal.ConfigurationInfo; @@ -62,7 +62,7 @@ class ButtonManager { private Composite composite; - HashMap buttonMap = new HashMap(); // page id->Collection of page + HashMap> buttonMap = new HashMap<>(); // page id->Collection of page // buttons @@ -80,7 +80,7 @@ GC metricsGC = new GC(composite); FontMetrics metrics = metricsGC.getFontMetrics(); metricsGC.dispose(); - List buttons = (List) buttonMap.get(currentPageId); + List