From 8f8c2e02b679852087c419a5f8c9531315934b01 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 10 Dec 2014 11:31:47 -0500 Subject: [PATCH 001/198] Initial commit separating the launchbar into it's own git repo. --- .gitignore | 2 + bundles/org.eclipse.launchbar.core/.classpath | 7 + bundles/org.eclipse.launchbar.core/.options | 2 + bundles/org.eclipse.launchbar.core/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 13 + bundles/org.eclipse.launchbar.core/about.html | 24 + .../build.properties | 5 + bundles/org.eclipse.launchbar.core/plugin.xml | 17 + bundles/org.eclipse.launchbar.core/pom.xml | 18 + .../schema/launchBarContributions.exsd | 294 +++++ .../launchbar/core/ILaunchBarManager.java | 68 + .../core/ILaunchConfigurationProvider.java | 62 + .../launchbar/core/ILaunchDescriptor.java | 38 + .../launchbar/core/ILaunchDescriptorType.java | 45 + .../launchbar/core/ILaunchObjectProvider.java | 24 + .../eclipse/launchbar/core/ILaunchTarget.java | 39 + .../launchbar/core/ILaunchTargetType.java | 30 + .../core/LaunchConfigurationProvider.java | 77 ++ .../ProjectLaunchConfigurationProvider.java | 80 ++ .../core/ProjectLaunchDescriptor.java | 48 + .../launchbar/core/internal/Activator.java | 71 ++ .../internal/DefaultLaunchDescriptor.java | 50 + .../internal/DefaultLaunchDescriptorType.java | 41 + .../core/internal/ExecutableExtension.java | 65 + .../core/internal/LaunchBarManager.java | 1122 +++++++++++++++++ .../launchbar/core/internal/LocalTarget.java | 43 + .../core/internal/LocalTargetType.java | 25 + .../launchbar/core/internal/Messages.java | 25 + .../eclipse/launchbar/core/internal/Pair.java | 70 + .../internal/ProjectLaunchObjectProvider.java | 77 ++ .../core/internal/messages.properties | 12 + bundles/org.eclipse.launchbar.ui/.classpath | 7 + bundles/org.eclipse.launchbar.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 29 + bundles/org.eclipse.launchbar.ui/about.html | 24 + .../org.eclipse.launchbar.ui/build.properties | 7 + .../org.eclipse.launchbar.ui/icons/build.png | Bin 0 -> 625 bytes .../icons/config_config.png | Bin 0 -> 1441 bytes .../org.eclipse.launchbar.ui/icons/launch.png | Bin 0 -> 466 bytes .../org.eclipse.launchbar.ui/icons/stop.png | Bin 0 -> 358 bytes .../plugin.properties | 3 + bundles/org.eclipse.launchbar.ui/plugin.xml | 85 ++ bundles/org.eclipse.launchbar.ui/pom.xml | 18 + .../schema/launchBarUIContributions.exsd | 188 +++ .../eclipse/launchbar/ui/IHoverProvider.java | 36 + .../launchbar/ui/ILaunchBarUIConstants.java | 20 + .../launchbar/ui/internal/Activator.java | 155 +++ .../DefaultDescriptorLabelProvider.java | 61 + .../ui/internal/LaunchBarInjector.java | 124 ++ .../LaunchBarPreferenceInitializer.java | 14 + .../ui/internal/LaunchBarPreferencePage.java | 26 + .../ui/internal/LaunchBarUIManager.java | 188 +++ .../ui/internal/LocalTargetLabelProvider.java | 16 + .../launchbar/ui/internal/Messages.java | 27 + .../commands/BuildActiveCommandHandler.java | 194 +++ .../ConfigureActiveLaunchHandler.java | 54 + .../commands/LaunchActiveCommandHandler.java | 59 + .../commands/StopActiveCommandHandler.java | 88 ++ .../ui/internal/controls/CButton.java | 103 ++ .../ui/internal/controls/CSelector.java | 834 ++++++++++++ .../ui/internal/controls/ConfigSelector.java | 290 +++++ .../internal/controls/LaunchBarControl.java | 166 +++ .../ui/internal/controls/ModeSelector.java | 173 +++ .../ui/internal/controls/TargetSelector.java | 255 ++++ .../ui/internal/controls/Transition.java | 56 + .../LaunchConfigurationEditDialog.java | 162 +++ .../dialogs/NewLaunchConfigEditPage.java | 275 ++++ .../dialogs/NewLaunchConfigModePage.java | 114 ++ .../dialogs/NewLaunchConfigTypePage.java | 92 ++ .../dialogs/NewLaunchConfigWizard.java | 102 ++ .../dialogs/NewLaunchTargetTypePage.java | 92 ++ .../dialogs/NewLaunchTargetWizard.java | 42 + .../launchbar/ui/internal/messages.properties | 3 + .../LaunchTargetsActionProvider.java | 26 + .../LaunchTargetsContentProvider.java | 73 ++ .../LaunchTargetsLabelProvider.java | 32 + .../targetsView/LaunchTargetsNavigator.java | 55 + .../targetsView/TargetPropertyPage.java | 51 + features/org.eclipse.launchbar/.project | 24 + .../org.eclipse.launchbar/build.properties | 12 + .../org.eclipse.launchbar/feature.properties | 33 + features/org.eclipse.launchbar/feature.xml | 36 + features/org.eclipse.launchbar/pom.xml | 19 + pom.xml | 353 ++++++ .../.classpath | 7 + .../org.eclipse.launchbar.core.tests/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 16 + .../about.html | 24 + .../build.properties | 4 + .../org.eclipse.launchbar.core.tests/pom.xml | 44 + .../core/internal/LaunchBarManagerTest.java | 832 ++++++++++++ .../launchbar/core/tests/Activator.java | 30 + .../core/tests/AutomatedIntegrationSuite.java | 42 + 96 files changed, 8494 insertions(+) create mode 100644 .gitignore create mode 100644 bundles/org.eclipse.launchbar.core/.classpath create mode 100644 bundles/org.eclipse.launchbar.core/.options create mode 100644 bundles/org.eclipse.launchbar.core/.project create mode 100644 bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF create mode 100644 bundles/org.eclipse.launchbar.core/about.html create mode 100644 bundles/org.eclipse.launchbar.core/build.properties create mode 100644 bundles/org.eclipse.launchbar.core/plugin.xml create mode 100644 bundles/org.eclipse.launchbar.core/pom.xml create mode 100644 bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties create mode 100644 bundles/org.eclipse.launchbar.ui/.classpath create mode 100644 bundles/org.eclipse.launchbar.ui/.project create mode 100644 bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF create mode 100644 bundles/org.eclipse.launchbar.ui/about.html create mode 100644 bundles/org.eclipse.launchbar.ui/build.properties create mode 100755 bundles/org.eclipse.launchbar.ui/icons/build.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/config_config.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/launch.png create mode 100755 bundles/org.eclipse.launchbar.ui/icons/stop.png create mode 100644 bundles/org.eclipse.launchbar.ui/plugin.properties create mode 100644 bundles/org.eclipse.launchbar.ui/plugin.xml create mode 100644 bundles/org.eclipse.launchbar.ui/pom.xml create mode 100644 bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java create mode 100644 features/org.eclipse.launchbar/.project create mode 100644 features/org.eclipse.launchbar/build.properties create mode 100644 features/org.eclipse.launchbar/feature.properties create mode 100644 features/org.eclipse.launchbar/feature.xml create mode 100644 features/org.eclipse.launchbar/pom.xml create mode 100644 pom.xml create mode 100644 tests/org.eclipse.launchbar.core.tests/.classpath create mode 100644 tests/org.eclipse.launchbar.core.tests/.project create mode 100644 tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF create mode 100644 tests/org.eclipse.launchbar.core.tests/about.html create mode 100644 tests/org.eclipse.launchbar.core.tests/build.properties create mode 100644 tests/org.eclipse.launchbar.core.tests/pom.xml create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..c214eb32f59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*/*/target/ +*/*/bin/ diff --git a/bundles/org.eclipse.launchbar.core/.classpath b/bundles/org.eclipse.launchbar.core/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.launchbar.core/.options b/bundles/org.eclipse.launchbar.core/.options new file mode 100644 index 00000000000..e66b4dfa81e --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.options @@ -0,0 +1,2 @@ +org.eclipse.launchbar.core/debug=true +org.eclipse.launchbar.core/debug/launchbar=true diff --git a/bundles/org.eclipse.launchbar.core/.project b/bundles/org.eclipse.launchbar.core/.project new file mode 100644 index 00000000000..6c8a7469162 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..bcf31ac3f87 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: LaunchBar Core +Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.launchbar.core.internal.Activator +Bundle-Vendor: Eclipse CDT +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.debug.core +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Export-Package: org.eclipse.launchbar.core, + org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui" diff --git a/bundles/org.eclipse.launchbar.core/about.html b/bundles/org.eclipse.launchbar.core/about.html new file mode 100644 index 00000000000..d7c511887d6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/about.html @@ -0,0 +1,24 @@ + + +About + + +

About This Content

+ +

June 22, 2007

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/build.properties b/bundles/org.eclipse.launchbar.core/build.properties new file mode 100644 index 00000000000..e9863e281ea --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml new file mode 100644 index 00000000000..db959f92155 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml new file mode 100644 index 00000000000..8603ddf64b9 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.core + 1.0.0-SNAPSHOT + + eclipse-plugin + diff --git a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd new file mode 100644 index 00000000000..c565272a88f --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd @@ -0,0 +1,294 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A descriptor represents an object that can be converted into a launch configuration. The typical example is IProject. Launch configurations can be created that launch the build output of the project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A target is the machine you launch on. Typical examples include the local machine we are running on, or remote embedded or server targets. + + + + + + + + + + + + + + + + + + + + + + + + + + + Descriptor types and target types map to a launch configuration type. Configurations of that type knows how to launch for the desciptor on targets of that type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Is this the default target type for this descriptor type. + + + + + + + + + + The config provider knows how to create launch configurations from descriptors. It tracks which configs it has created so that they don't show up as descriptors on their own. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The default config provider is brought in when no other config providers claim a given launch configuration. This entry associates a target type with the launch configuration so that it can be launched on targets of that type. + + + + + + + + + + + + + + + + + + + + + + + + + + + Is this the default target type for this descriptor type. + + + + + + + + + + Object providers pump launch objects into the model as they are created and removed. These are used to create descriptors for these objects. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java new file mode 100644 index 00000000000..9059e089ac2 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; + +public interface ILaunchBarManager { + + /** + * A launch object has been added. Create a matching launch descriptor if available. + * + * @param element launch object + * @return the launch descriptor that got created, null of none was + * @throws CoreException + */ + ILaunchDescriptor launchObjectAdded(Object launchObject) throws CoreException; + + /** + * A launch object has been removed. Remove the associated launch descriptor if there is one. + * + * @param element launch object + * @throws CoreException + */ + void launchObjectRemoved(Object launchObject) throws CoreException; + + /** + * A launch object has changed in some way that affects the launch bar. + * + * @param launchObject + * @throws CoreException + */ + void launchObjectChanged(Object launchObject) throws CoreException; + + /** + * A new launch target has been added. + * + * @param target launch target + * @throws CoreException + */ + void launchTargetAdded(ILaunchTarget target) throws CoreException; + + /** + * A launch target has been removed. + * + * @param target launch target + * @throws CoreException + */ + void launchTargetRemoved(ILaunchTarget target) throws CoreException; + + /** + * The launch target has changed in some way that affects the + * launch bar. + * + * @param target launch target + */ + void launchTargetChanged(ILaunchTarget target); + + // TODO API for adding and removing types. + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java new file mode 100644 index 00000000000..01472f13e9d --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchManager; + +/** + * The provider of launch configurations of a given type for a given descriptor type + * and a given target type. + */ +public interface ILaunchConfigurationProvider { + + /** + * Does this provider own this launch configuration. If so, make sure the launch descriptor + * is properly constructed by sending in a launch object to the launch manager. + * And return that object. + * + * @param configuration + * @return launch object that relates to this config + * @throws CoreException + */ + Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; + + /** + * A launch configuration has been removed. + * + * @param configuration + * @return was the launch configuration removed by this provider? + * @throws CoreException + */ + boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException; + + /** + * Returns the launch configuration type for configurations created by this provider. + * + * @return launch configuration type + * @throws CoreException + */ + ILaunchConfigurationType getLaunchConfigurationType() throws CoreException; + + /** + * Create a launch configuration for the descriptor to launch on the target. + * + * @param descriptor + * @param target + * @return launch configuration + * @throws CoreException + */ + ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException; + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java new file mode 100644 index 00000000000..de457386e68 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.IAdaptable; + + +/** + * Represents a thing that can be launched. + * It is good practice that the descriptor is adaptable to the launch object + * it is representing. + */ +public interface ILaunchDescriptor extends IAdaptable { + + /** + * Name to show in the launch descriptor selector. + * Names must be unique for all descriptors of a given type. + * + * @return name of the launch descriptor + */ + String getName(); + + /** + * The type of launch descriptor. + * + * @return provider + */ + ILaunchDescriptorType getType(); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java new file mode 100644 index 00000000000..0b3fad90502 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; + +/** + * Provides mapping between launch objects and launch descriptors. + * + * It is strongly recommended to extend AbstarctLaunchDescriptorType instead of implementing this directly + */ +public interface ILaunchDescriptorType { + + /** + * Does this type own this launch object? + * + * @deprecated this needs to be replaced by enablement to avoid plug-in loading. + * + * @param element + * @return owns element + * @throws CoreException + */ + boolean ownsLaunchObject(Object launchObject) throws CoreException; + + /** + * Return a descriptor for the given launch object. + * + * May return null to essentially eat the element so no other types + * create a descriptor for it. + * + * @param descriptor launch object for descriptor + * @return the best descriptor + * @throws CoreException + */ + ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException; + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java new file mode 100644 index 00000000000..4d77c944a07 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java @@ -0,0 +1,24 @@ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; + +/** + * An extension that serves up objects to feed launch descriptors. + * + */ +public interface ILaunchObjectProvider { + + /** + * Add initial launch descriptors and set up for new ones. + * + * @param launchbar manager + * @throws CoreException + */ + void init(ILaunchBarManager manager) throws CoreException; + + /** + * Shutting down, remove any listeners. + */ + void dispose(); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java new file mode 100644 index 00000000000..0c6328e9007 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.IAdaptable; + +public interface ILaunchTarget extends IAdaptable { + + /** + * Returns the name of this target. + * Names must be unique across all targets of a given type. + * + * @return name of the target + */ + String getName(); + + /** + * Returns the type for this target. + * + * @return type of the target + */ + ILaunchTargetType getType(); + + /** + * The active state of this target has changed. + * + * @param active active state of the target + */ + void setActive(boolean active); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java new file mode 100644 index 00000000000..8e705620e15 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; + +public interface ILaunchTargetType { + + /** + * Add initial targets and set up any listeners. + * + * @param manager + * @throws CoreException + */ + void init(ILaunchBarManager manager) throws CoreException; + + /** + * Shutting down, remove any listeners + */ + void dispose(); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java new file mode 100644 index 00000000000..f95a82f7892 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.launchbar.core.internal.Activator; + +/** + * A root class for launch configuration providers. Provides the ability to detect launch + * configurations that it has created. + */ +public abstract class LaunchConfigurationProvider implements ILaunchConfigurationProvider { + + // Used to make sure this is the config we've created + protected static final String ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; + + @Override + public ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException { + String name = launchManager.generateLaunchConfigurationName(getConfigurationName(descriptor)); + ILaunchConfigurationWorkingCopy wc = getLaunchConfigurationType().newInstance(null, name); + wc.setAttribute(ORIGINAL_NAME, name); + populateConfiguration(wc, descriptor); + return wc.doSave(); + } + + /** + * Potential name for new configurations. Names are still put through the launch manager + * to ensure they are unique. + * + * @param descriptor the launch descriptor triggering the configuration creation + * @return candidate configuration name + */ + protected String getConfigurationName(ILaunchDescriptor descriptor) { + // by default, use the descriptor name + return descriptor.getName(); + } + + /** + * Populate the new configuration with attributes and resources. + * + * @param workingCopy working copy for the new configuration + * @param descriptor the launch descriptor that triggered the new configuration + * @throws CoreException + */ + protected void populateConfiguration(ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor) throws CoreException { + // by default, nothing to add + } + + /** + * Determines if we created this launch configuration. Generally used by the launch configuration + * add handler to determine if the incoming launch configuration is ours. + * + * @param configuration + * @return do we own this launch configuration + * @throws CoreException + */ + protected boolean ownsConfiguration(ILaunchConfiguration configuration) throws CoreException { + // must be the same config type + if (!configuration.getType().equals(getLaunchConfigurationType())) + return false; + + // we created it if it has the same name we created it with + return configuration.getAttribute(ORIGINAL_NAME, "").equals(configuration.getName()); + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java new file mode 100644 index 00000000000..30f0f143127 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; + +/** + * A root launch configuration provider that can be used with project launch descriptors. + * Takes ownership of configurations we've created that map to the the project. + */ +public abstract class ProjectLaunchConfigurationProvider extends LaunchConfigurationProvider { + + @Override + protected void populateConfiguration(ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor) throws CoreException { + super.populateConfiguration(workingCopy, descriptor); + + // Add our project to the mapped resources + IProject project = (IProject) descriptor.getAdapter(IProject.class); + IResource[] mappedResources = workingCopy.getMappedResources(); + if (mappedResources == null || mappedResources.length == 0) { + workingCopy.setMappedResources(new IResource[] { project }); + } else { + IResource[] newResources = new IResource[mappedResources.length + 1]; + System.arraycopy(mappedResources, 0, newResources, 0, mappedResources.length); + newResources[mappedResources.length] = project; + workingCopy.setMappedResources(newResources); + } + } + + /** + * Extract the project from the launch configuration. Used when checking if we own it. + * + * @param configuration + * @return project for launch configuration. + * @throws CoreException + */ + protected IProject getProject(ILaunchConfiguration configuration) throws CoreException { + // by default return the first project in the mapped resources + for (IResource resource : configuration.getMappedResources()) { + if (resource instanceof IProject) { + return (IProject) resource; + } + } + + return null; + } + + @Override + public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + if (!ownsConfiguration(configuration)) { + return null; + } + + IProject project = getProject(configuration); + if (project == null) { + // The user must have changed project. We don't own it any more in that case. + return null; + } + + return project; + } + + @Override + public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + return ownsConfiguration(configuration); + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java new file mode 100644 index 00000000000..e8474fe19fd --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.PlatformObject; + +/** + * A reusable descriptor for wrapping projects that can be used by descriptor types + * that map to projects. + */ +public class ProjectLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { + + private final ILaunchDescriptorType type; + private final IProject project; + + public ProjectLaunchDescriptor(ILaunchDescriptorType type, IProject project) { + this.type = type; + this.project = project; + } + + @Override + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + if (IProject.class.equals(adapter)) { + return project; + } + return super.getAdapter(adapter); + } + + @Override + public String getName() { + return project.getName(); + } + + @Override + public ILaunchDescriptorType getType() { + return type; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java new file mode 100644 index 00000000000..0ab019740c3 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.osgi.framework.BundleContext; + +public class Activator extends Plugin { + + public static final String PLUGIN_ID = "org.eclipse.launchbar.core"; + private static Activator plugin; + private LaunchBarManager launchBarManager; + + public void start(BundleContext bundleContext) throws Exception { + super.start(bundleContext); + plugin = this; + launchBarManager = new LaunchBarManager(); + bundleContext.registerService(ILaunchBarManager.class, launchBarManager, null); + } + + public void stop(BundleContext bundleContext) throws Exception { + super.stop(bundleContext); + plugin = null; + launchBarManager.dispose(); + launchBarManager = null; + } + + public static Activator getDefault() { + return plugin; + } + + public LaunchBarManager getLaunchBarManager() { + return launchBarManager; + } + + public static void throwCoreException(Exception e) throws CoreException { + throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e)); + } + + public static void log(IStatus status) { + if (plugin != null) + plugin.getLog().log(status); + else + System.err.println(status.getMessage()); + } + + public static void log(Exception exception) { + log(new Status(IStatus.ERROR, PLUGIN_ID, exception.getLocalizedMessage(), exception)); + } + + private static final String DEBUG_ONE = + PLUGIN_ID + "/debug/launchbar"; + + public static void trace(String str) { + if (plugin == null || (plugin.isDebugging() && "true".equalsIgnoreCase(Platform.getDebugOption(DEBUG_ONE)))) + System.out.println("launchbar: " + str); + } +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java new file mode 100644 index 00000000000..b1789b8209e --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchDescriptorType; + +/** + * A special launch descriptor that managed configurations that aren't owned by other + * descriptors. + */ +public class DefaultLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { + + private final DefaultLaunchDescriptorType type; + private final ILaunchConfiguration configuration; + + public DefaultLaunchDescriptor(DefaultLaunchDescriptorType type, ILaunchConfiguration configuration) { + this.type = type; + this.configuration = configuration; + } + + @Override + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + if (ILaunchConfiguration.class.equals(adapter)) { + return configuration; + } + return super.getAdapter(adapter); + } + + @Override + public String getName() { + return configuration.getName(); + } + + @Override + public ILaunchDescriptorType getType() { + return type; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java new file mode 100644 index 00000000000..6467ae5c6f4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -0,0 +1,41 @@ +package org.eclipse.launchbar.core.internal; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchDescriptorType; + +/** + * A special descriptor type that managed configurations that aren't owned + * by other descriptor types. + */ +public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { + + public static final String ID = Activator.PLUGIN_ID + ".descriptorType.default"; + + private Map descriptors = new HashMap<>(); + + @Override + public boolean ownsLaunchObject(Object element) { + // This descriptor type doesn't own any launch objects + return false; + } + + @Override + public ILaunchDescriptor getDescriptor(Object element) { + if (element instanceof ILaunchConfiguration) { + ILaunchConfiguration config = (ILaunchConfiguration) element; + DefaultLaunchDescriptor descriptor = descriptors.get(config); + if (descriptor == null) { + descriptor = new DefaultLaunchDescriptor(this, config); + descriptors.put(config, descriptor); + } + return descriptor; + } + + return null; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java new file mode 100644 index 00000000000..b8ad5a63b0c --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; + +/** + * A wrapper class that delays instantiation of classes until they're needed + * to prevent early plug-in loading. + * + * @param the type of the object created + */ +public class ExecutableExtension { + + private IConfigurationElement element; + private String propertyName; + private T object; + + public ExecutableExtension(IConfigurationElement element, String propertyName) { + this.element = element; + this.propertyName = propertyName; + } + + // For testing, pre-populate the object + public ExecutableExtension(T object) { + this.object = object; + } + + /** + * Get the object instantiating it if necessary. + * @return object + * @throws CoreException + */ + @SuppressWarnings("unchecked") + public T get() throws CoreException { + if (element != null) { + object = (T) element.createExecutableExtension(propertyName); + element = null; + propertyName = null; + } + return object; + } + + /** + * Creates a new object. Can't be done if you've done a get already. + * @return a new object from the extension or null if get was called earlier + * @throws CoreException + */ + @SuppressWarnings("unchecked") + public T create() throws CoreException { + if (element != null) { + return (T) element.createExecutableExtension(propertyName); + } + return null; + } +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java new file mode 100644 index 00000000000..8caadb6cb93 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -0,0 +1,1122 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.ISafeRunnable; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.SafeRunner; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationListener; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.ILaunchConfigurationProvider; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchDescriptorType; +import org.eclipse.launchbar.core.ILaunchObjectProvider; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.ILaunchTargetType; +import org.osgi.service.prefs.BackingStoreException; +import org.osgi.service.prefs.Preferences; + +/** + * The brains of the launch bar. + */ +public class LaunchBarManager implements ILaunchBarManager, ILaunchConfigurationListener { + + // TODO make these more fine grained or break them into more focused listeners + public interface Listener { + void activeLaunchDescriptorChanged(); + void activeLaunchModeChanged(); + void activeLaunchTargetChanged(); + void launchDescriptorRemoved(ILaunchDescriptor descriptor); + void launchTargetsChanged(); + } + + public static class LaunchTargetTypeInfo { + private final ILaunchTargetType type; + private final String id; + + public LaunchTargetTypeInfo(String id, ILaunchTargetType type) { + this.type = type; + this.id = id; + } + + public String getId() { + return id; + } + + public ILaunchTargetType getType() { + return type; + } + } + + public static class LaunchDescriptorTypeInfo { + private final String id; + private final int priority; + private IConfigurationElement element; + private ILaunchDescriptorType type; + + public LaunchDescriptorTypeInfo(String id, int priority, IConfigurationElement element) { + this.id = id; + this.priority = priority; + this.element = element; + } + + // Used for testing + public LaunchDescriptorTypeInfo(String id, int priority, ILaunchDescriptorType type) { + this.id = id; + this.priority = priority; + this.type = type; + } + + public String getId() { + return id; + } + + public int getPriority() { + return priority; + } + + public ILaunchDescriptorType getType() throws CoreException { + if (type == null) { + type = (ILaunchDescriptorType) element.createExecutableExtension("class"); + element = null; + } + return type; + } + } + + public static class LaunchConfigProviderInfo { + private final String launchConfigTypeId; + private IConfigurationElement element; + private ILaunchConfigurationProvider provider; + + public LaunchConfigProviderInfo(String launchConfigTypeId, IConfigurationElement element) { + this.launchConfigTypeId = launchConfigTypeId; + this.element = element; + } + + // For testing + public LaunchConfigProviderInfo(String launchConfigTypeId, ILaunchConfigurationProvider provider) { + this.launchConfigTypeId = launchConfigTypeId; + this.provider = provider; + } + + public String getLaunchConfigTypeId() { + return launchConfigTypeId; + } + + public ILaunchConfigurationProvider getProvider() throws CoreException { + if (provider == null) { + provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); + element = null; + } + return provider; + } + } + + public static class LaunchConfigTypeInfo { + private final String descriptorTypeId; + private final String targetTypeId; + private final String launchConfigTypeId; + + public LaunchConfigTypeInfo(String descriptorTypeId, String targetTypeId, String launchConfigTypeId) { + this.descriptorTypeId = descriptorTypeId; + this.targetTypeId = targetTypeId; + this.launchConfigTypeId = launchConfigTypeId; + } + + public String getDescriptorTypeId() { + return descriptorTypeId; + } + + public String getTargetTypeId() { + return targetTypeId; + } + + public String getLaunchConfigTypeId() { + return launchConfigTypeId; + } + } + + private final List listeners = new LinkedList<>(); + + // The launch object providers + private final List objectProviders = new ArrayList<>(); + + // The target types by id - doesn't need to be an executablExtension since it runs right away + private final Map targetTypes = new HashMap<>(); + + // The extended info for the target types as specified in the extension + private final Map targetTypeInfo = new HashMap<>(); + + // The descriptor types + private final Map descriptorTypes = new HashMap<>(); + + // the extended info for loaded descriptor types + private final Map descriptorTypeInfo = new HashMap<>(); + + // Descriptor types ordered from highest priority to lowest + private final List orderedDescriptorTypes = new LinkedList<>(); + + // The mapping from descriptor type to target type to config type info + private final Map> configTypes = new HashMap<>(); + + // Map descriptor type to target type so we can build when no targets have been added + private final Map defaultTargetTypes = new HashMap<>(); + + // The launch config providers + private final Map configProviders = new HashMap<>(); + + // Map from launch config type id to target type id for default config descriptor + private final Map> defaultConfigTargetTypes = new HashMap<>(); + + // Map from launch config type Id to target type id for default config descriptor for null target + private final Map defaultConfigDefaultTargetTypes = new HashMap<>(); + + // Descriptors in MRU order, key is desc type id and desc name. + private final Map, ILaunchDescriptor> descriptors = new LinkedHashMap<>(); + + // Map of launch objects to launch descriptors + private final Map objectDescriptorMap = new HashMap<>(); + + // Targets, key is target type id and target name. + private final Map, ILaunchTarget> targets = new HashMap<>(); + + // The created launch configurations + private final Map> configs = new HashMap<>(); + + private ILaunchDescriptor activeLaunchDesc; + private ILaunchMode activeLaunchMode; + private ILaunchTarget activeLaunchTarget; + + // The default launch descriptor type used to wrap unclaimed launch configs + private DefaultLaunchDescriptorType defaultDescriptorType = new DefaultLaunchDescriptorType(); + + // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; + private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; + private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; + private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; + + public LaunchBarManager() { + new Job("Launch Bar Initialization") { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + init(); + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } + } + }.schedule(); + } + + public void init() throws CoreException { + // Fetch the desc order before the init messes it up + IEclipsePreferences store = getPreferenceStore(); + String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); + + // Load up the types + loadExtensions(); + + // Add in the default descriptor type + LaunchDescriptorTypeInfo defaultInfo = new LaunchDescriptorTypeInfo(DefaultLaunchDescriptorType.ID, + 0, defaultDescriptorType); + addDescriptorType(defaultInfo); + + // Hook up the existing launch configurations and listen + ILaunchManager launchManager = getLaunchManager(); + for (ILaunchConfiguration configuration : launchManager.getLaunchConfigurations()) { + launchConfigurationAdded(configuration); + } + launchManager.addLaunchConfigurationListener(this); + + // Reorder the descriptors based on the preference + if (!configDescIds.isEmpty()) { + String[] split = configDescIds.split(","); + ILaunchDescriptor last = null; + for (String id : split) { + Pair key = toId(id); + ILaunchDescriptor desc = descriptors.get(key); + if (desc != null) { + descriptors.remove(key); + descriptors.put(key, desc); + last = desc; + } + } + // Set the active desc, with MRU, it should be the last one + if (last != null) { + setActiveLaunchDescriptor(last); + } + } + } + + // To allow override by tests + protected IExtensionPoint getExtensionPoint() throws CoreException { + return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); + } + + // To allow override by tests + protected ILaunchManager getLaunchManager() { + return DebugPlugin.getDefault().getLaunchManager(); + } + + protected void loadExtensions() throws CoreException { + IExtensionPoint point = getExtensionPoint(); + IExtension[] extensions = point.getExtensions(); + + // Load up the types + for (IExtension extension : extensions) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + try { + String elementName = element.getName(); + if (elementName.equals("descriptorType")) { + String id = element.getAttribute("id"); + String priorityStr = element.getAttribute("priority"); + int priority = 1; + if (priorityStr != null) { + try { + priority = Integer.parseInt(priorityStr); + } catch (NumberFormatException e) { + // Log it but keep going with the default + Activator.log(e); + } + } + LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(id, priority, element); + addDescriptorType(typeInfo); + } else if (elementName.equals("targetType")) { + String id = element.getAttribute("id"); + ILaunchTargetType targetType = (ILaunchTargetType) element.createExecutableExtension("class"); + LaunchTargetTypeInfo info = new LaunchTargetTypeInfo(id, targetType); + addTargetType(info); + } else if (elementName.equals("configProvider")) { + String configTypeId = element.getAttribute("launchConfigurationType"); + LaunchConfigProviderInfo info = new LaunchConfigProviderInfo(configTypeId, element); + addConfigProvider(info); + } else if (elementName.equals("configType")) { + String descriptorTypeId = element.getAttribute("descriptorType"); + String targetTypeId = element.getAttribute("targetType"); + String configTypeId = element.getAttribute("launchConfigurationType"); + String isDefault = element.getAttribute("isDefault"); + LaunchConfigTypeInfo info = new LaunchConfigTypeInfo(descriptorTypeId, targetTypeId, configTypeId); + addConfigType(info, Boolean.valueOf(isDefault)); + // also assume that the target type works for the config type + addDefaultConfigTargetType(configTypeId, targetTypeId, Boolean.valueOf(isDefault)); + } else if (elementName.equals("defaultConfigTarget")) { + String configTypeId = element.getAttribute("launchConfigurationType"); + String targetTypeId = element.getAttribute("targetType"); + String isDefault = element.getAttribute("isDefault"); + addDefaultConfigTargetType(configTypeId, targetTypeId, Boolean.valueOf(isDefault)); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + } + + // Now that all the types are loaded, the object providers which now populate the descriptors + for (IExtension extension : extensions) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + try { + String elementName = element.getName(); + if (elementName.equals("objectProvider")) { + ILaunchObjectProvider objectProvider = (ILaunchObjectProvider) element.createExecutableExtension("class"); + addObjectProvider(objectProvider); + } + } catch (Exception e) { + Activator.log(e); // exceptions during extension loading, log and move on + } + } + } + } + + public void addDescriptorType(LaunchDescriptorTypeInfo typeInfo) throws CoreException { + descriptorTypes.put(typeInfo.getId(), typeInfo); + // TODO figure out a better place to set the id so we don't load the type object until needed + descriptorTypeInfo.put(typeInfo.getType(), typeInfo); + + Iterator iterator = orderedDescriptorTypes.iterator(); + boolean inserted = false; + for (int i = 0; i < orderedDescriptorTypes.size(); ++i) { + if (iterator.next().getPriority() < typeInfo.getPriority()) { + orderedDescriptorTypes.add(i, typeInfo); + inserted = true; + break; + } + } + + if (!inserted) { + orderedDescriptorTypes.add(typeInfo); + } + + Activator.trace("registered descriptor type " + typeInfo.getId()); + } + + public void addTargetType(final LaunchTargetTypeInfo info) { + targetTypes.put(info.getId(), info.getType()); + targetTypeInfo.put(info.getType(), info); + SafeRunner.run(new ISafeRunnable() { + @Override + public void run() throws Exception { + info.getType().init(LaunchBarManager.this); + } + @Override + public void handleException(Throwable exception) { + Activator.trace("target runner init exception " + info.getId()); + } + }); + Activator.trace("registered target " + info.getId()); + } + + public void addConfigType(LaunchConfigTypeInfo info, boolean isDefault) { + Map targetMap = configTypes.get(info.getDescriptorTypeId()); + if (targetMap == null) { + targetMap = new HashMap<>(); + configTypes.put(info.getDescriptorTypeId(), targetMap); + } + targetMap.put(info.getTargetTypeId(), info); + + if (isDefault) { + defaultTargetTypes.put(info.getDescriptorTypeId(), info.getTargetTypeId()); + } + } + + public void addConfigProvider(LaunchConfigProviderInfo info) { + configProviders.put(info.getLaunchConfigTypeId(), info); + } + + public void addDefaultConfigTargetType(String configTypeId, String targetTypeId, boolean isDefault) { + Set targetTypes = defaultConfigTargetTypes.get(configTypeId); + if (targetTypes == null) { + targetTypes = new HashSet<>(); + defaultConfigTargetTypes.put(configTypeId, targetTypes); + } + targetTypes.add(targetTypeId); + + if (isDefault) { + defaultConfigDefaultTargetTypes.put(configTypeId, targetTypeId); + } + } + + public void addObjectProvider(ILaunchObjectProvider objectProvider) { + objectProviders.add(objectProvider); + try { + objectProvider.init(this); + } catch (Exception e) { + Activator.log(e); + } + } + + private void addDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { + descriptors.put(getDescriptorId(descriptor), descriptor); + objectDescriptorMap.put(launchObject, descriptor); + setActiveLaunchDescriptor(descriptor); + } + + private void removeDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { + objectDescriptorMap.remove(launchObject); // remove launch object unconditionally + if (descriptor != null) { + descriptors.remove(getDescriptorId(descriptor)); + if (descriptor.equals(activeLaunchDesc)) { + setActiveLaunchDescriptor(getLastUsedDescriptor()); + } + // Also delete any configs created for this descriptor + Map configMap = configs.get(descriptor); + if (configMap != null) { + configs.remove(descriptor); + for (ILaunchConfiguration config : configMap.values()) { + config.delete(); + } + } + } + } + + public ILaunchDescriptorType getLaunchDescriptorType(String id) throws CoreException { + return descriptorTypes.get(id).getType(); + } + + public ILaunchDescriptor getLaunchDescriptor(Pair id) { + return descriptors.get(id); + } + + public ILaunchDescriptor getLaunchDescriptor(Object launchObject) { + return objectDescriptorMap.get(launchObject); + } + + public String getDescriptorTypeId(ILaunchDescriptorType type) { + return descriptorTypeInfo.get(type).getId(); + } + + public Pair getDescriptorId(ILaunchDescriptor descriptor) { + return new Pair(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); + } + + public ILaunchTargetType getLaunchTargetType(String id) { + return targetTypes.get(id); + } + + public String getTargetTypeId(ILaunchTargetType type) { + return targetTypeInfo.get(type).getId(); + } + + private Pair getTargetId(ILaunchTarget target) { + return new Pair(getTargetTypeId(target.getType()), target.getName()); + } + + public String toString(Pair key) { + return key.getFirst() + ":" + key.getSecond(); + } + + protected Pair toId(String key) { + int i = key.indexOf(':'); + if (i < 0) { + return null; + } + + return new Pair(key.substring(0, i), key.substring(i + 1)); + } + + private ILaunchConfigurationProvider getConfigProvider(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + if (descriptor == null) { + return null; + } + + ILaunchDescriptorType descriptorType = descriptor.getType(); + + ILaunchTargetType targetType = null; + if (target != null) { + targetType = target.getType(); + } else { + String targetTypeId = defaultTargetTypes.get(getDescriptorTypeId(descriptorType)); + if (targetTypeId != null) { + targetType = targetTypes.get(targetTypeId); + } + } + + if (targetType == null) { + return null; + } + + Map targetMap = configTypes.get(getDescriptorTypeId(descriptorType)); + if (targetMap != null) { + LaunchConfigTypeInfo typeInfo = targetMap.get(getTargetTypeId(targetType)); + if (typeInfo != null) { + LaunchConfigProviderInfo providerInfo = configProviders.get(typeInfo.getLaunchConfigTypeId()); + if (providerInfo != null) { + return providerInfo.getProvider(); + } + } + } + + return null; + } + + private ILaunchDescriptorType ownsLaunchObject(Object launchObject) throws CoreException { + // TODO use enablement to find out what descriptor types to ask + // to prevent unnecessary plug-in loading + for (LaunchDescriptorTypeInfo descriptorInfo : orderedDescriptorTypes) { + ILaunchDescriptorType descriptorType = descriptorInfo.getType(); + if (descriptorType.ownsLaunchObject(launchObject)) { + return descriptorType; + } + } + return null; + } + + @Override + public ILaunchDescriptor launchObjectAdded(Object launchObject) { + Activator.trace("launch object added " + launchObject); + ILaunchDescriptor desc = objectDescriptorMap.get(launchObject); + if (desc != null) + return desc; + + try { + ILaunchDescriptorType type = ownsLaunchObject(launchObject); + if (type != null) { + desc = type.getDescriptor(launchObject); + if (desc != null) { + addDescriptor(launchObject, desc); + } + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + + return desc; + } + + @Override + public void launchObjectRemoved(Object launchObject) throws CoreException { + Activator.trace("launch object removed " + launchObject); + ILaunchDescriptor desc = objectDescriptorMap.get(launchObject); + removeDescriptor(launchObject, desc); + } + + @Override + public void launchObjectChanged(Object launchObject) throws CoreException { + // TODO deal with object renames here, somehow + + // check if a new descriptor wants to take over + ILaunchDescriptor origDesc = objectDescriptorMap.get(launchObject); + ILaunchDescriptorType newDescType = ownsLaunchObject(launchObject); + + if (newDescType != null) { + if (origDesc == null || !origDesc.getType().equals(newDescType)) { + // we have a take over + if (origDesc != null) { + removeDescriptor(launchObject, origDesc); + } + + ILaunchDescriptor newDesc = newDescType.getDescriptor(launchObject); + if (newDesc != null) { + addDescriptor(launchObject, newDesc); + } + } + } + } + + protected ILaunchDescriptor getLastUsedDescriptor() { + if (descriptors.size() == 0) + return null; + ILaunchDescriptor[] descs = descriptors.values().toArray(new ILaunchDescriptor[descriptors.size()]); + return descs[descs.length - 1]; + } + + public ILaunchDescriptor[] getLaunchDescriptors() { + // return descriptor in usage order (most used first). UI can sort them later as it wishes + ArrayList values = new ArrayList<>(descriptors.values()); + Collections.reverse(values); + return values.toArray(new ILaunchDescriptor[values.size()]); + } + + public ILaunchDescriptor getActiveLaunchDescriptor() { + return activeLaunchDesc; + } + + public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws CoreException { + Activator.trace("set active descriptor " + descriptor); + if (activeLaunchDesc == descriptor) { + // Sync since targets could be changed since last time (and modes theoretically too) + syncActiveTarget(); + syncActiveMode(); + Activator.trace("resync for " + descriptor); + return; + } + if (descriptor != null && !descriptors.containsValue(descriptor)) + throw new IllegalStateException("Active descriptor must be in the map of descriptors"); + if (descriptor == null) + descriptor = getLastUsedDescriptor(); // do not set to null unless no descriptors + activeLaunchDesc = descriptor; + if (descriptor != null) { // keeps most used descriptor last + Pair id = getDescriptorId(descriptor); + descriptors.remove(id); + descriptors.put(id, descriptor); + } + // store in persistent storage + Activator.trace("new active config is stored " + descriptor); + + // Store the desc order + StringBuffer buff = new StringBuffer(); + for (Pair key : descriptors.keySet()) { + if (buff.length() > 0) { + buff.append(','); + } + buff.append(toString(key)); + } + setPreference(getPreferenceStore(), PREF_CONFIG_DESC_ORDER, buff.toString()); + + // Send notifications + updateLaunchDescriptor(activeLaunchDesc); + // Set active target + syncActiveTarget(); + // Set active mode + syncActiveMode(); + } + + private void syncActiveTarget() throws CoreException { + if (activeLaunchDesc == null) { + setActiveLaunchTarget(null); + return; + } + + // TODO turning off for now since it's buggy. There is thought though that we may want + // to keep the active target when changing descriptors if it's valid for that descriptor. + // If we do that, then the active target should be recorded against the target type. + // The active target is too random at startup for this to work as coded here. +// if (activeLaunchTarget != null && supportsTargetType(activeLaunchDesc, activeLaunchTarget)) { +// return; // not changing target +// } + + // last stored target from persistent storage + String activeTargetId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_TARGET, null); + if (activeTargetId != null) { + ILaunchTarget storedTarget = getLaunchTarget(toId(activeTargetId)); + if (storedTarget != null && supportsTargetType(activeLaunchDesc, storedTarget)) { + setActiveLaunchTarget(storedTarget); + return; + } + } + // default target for descriptor + setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); + } + + private void syncActiveMode() throws CoreException { + if (activeLaunchDesc == null) { + setActiveLaunchMode(null); + return; + } + ILaunchMode foundMode = null; + String storedModeId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_MODE, null); // last desc mode id + String lastActiveModeId = activeLaunchMode == null ? null : activeLaunchMode.getIdentifier(); + ILaunchMode[] supportedModes = getLaunchModes(); // this is based on active desc and target which are already set + if (supportedModes.length > 0) { // mna, what if no modes are supported? + String modeNames[] = new String[] { + storedModeId, + lastActiveModeId, + "debug", + "run", + supportedModes[0].getIdentifier() + }; + for (int i = 0; i < modeNames.length; i++) { + foundMode = getLaunchManager().getLaunchMode(modeNames[i]); + if (supportsMode(foundMode)) + break; + } + } + setActiveLaunchMode(foundMode); + } + + public boolean supportsMode(ILaunchMode mode) throws CoreException { + // check that active descriptor supports the given mode + if (mode == null) + return false; + ILaunchMode[] supportedModes = getLaunchModes(); + for (int j = 0; j < supportedModes.length; j++) { + ILaunchMode lm = supportedModes[j]; + if (lm.equals(mode)) + return true; + } + return false; + } + + protected void setPreference(Preferences store, String prefId, String value) { + if (value != null) { + store.put(prefId, value); + } else { + store.remove(prefId); + } + try { + store.flush(); + } catch (BackingStoreException e) { + Activator.log(e); + } + } + + protected Preferences getPerDescriptorStore() { + if (activeLaunchDesc == null) + return getPreferenceStore(); + return getPreferenceStore().node(toString(getDescriptorId(activeLaunchDesc))); + } + + protected IEclipsePreferences getPreferenceStore() { + return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + } + + public void updateLaunchDescriptor(ILaunchDescriptor configDesc) { + for (Listener listener : listeners) { + try { + listener.activeLaunchDescriptorChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + } + + public ILaunchMode[] getLaunchModes() throws CoreException { + ILaunchConfigurationType configType = getLaunchConfigurationType(activeLaunchDesc, activeLaunchTarget); + if (configType == null) + return new ILaunchMode[0]; + List modeList = new ArrayList<>(); + ILaunchMode[] modes = getLaunchManager().getLaunchModes(); + for (ILaunchMode mode : modes) { + if (configType.supportsMode(mode.getIdentifier())) { + modeList.add(mode); + } + } + return modeList.toArray(new ILaunchMode[modeList.size()]); + } + + public ILaunchMode getActiveLaunchMode() { + return activeLaunchMode; + } + + public void setActiveLaunchMode(ILaunchMode mode) throws CoreException { + if (activeLaunchMode == mode) + return; + if (activeLaunchDesc != null && mode != null && !supportsMode(mode)) + throw new IllegalStateException("Mode is not supported by descriptor"); + // change mode + activeLaunchMode = mode; + // notify listeners + for (Listener listener : listeners) { + try { + listener.activeLaunchModeChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + if (mode == null) + return; + // store mode + setPreference(getPerDescriptorStore(), PREF_ACTIVE_LAUNCH_MODE, mode.getIdentifier()); // per desc store + } + + public ILaunchTarget[] getAllLaunchTargets() { + return targets.values().toArray(new ILaunchTarget[targets.size()]); + } + + public ILaunchTarget[] getLaunchTargets() throws CoreException { + return getLaunchTargets(activeLaunchDesc); + } + + public ILaunchTarget[] getLaunchTargets(ILaunchDescriptor descriptor) throws CoreException { + if (descriptor == null) + return new ILaunchTarget[0]; + + // See if there is are targets registered with this descriptor type + Map targetMap = configTypes.get(getDescriptorTypeId(descriptor.getType())); + if (targetMap != null) { + List targetList = new ArrayList<>(); + // Not super fast, but we're assuming there aren't many targets. + for (Entry, ILaunchTarget> targetEntry : targets.entrySet()) { + if (targetMap.containsKey(targetEntry.getKey().getFirst())) { + targetList.add(targetEntry.getValue()); + } + } + return targetList.toArray(new ILaunchTarget[targetList.size()]); + } + + // Nope, see if there are any default config targets + ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + if (config != null) { + Set targetTypeIds = defaultConfigTargetTypes.get(config.getType().getIdentifier()); + if (targetTypeIds != null) { + List targetList = new ArrayList<>(); + // Not super fast, but we're assuming there aren't many targets. + for (Entry, ILaunchTarget> targetEntry : targets.entrySet()) { + if (targetTypeIds.contains(targetEntry.getKey().getFirst())) { + targetList.add(targetEntry.getValue()); + } + } + return targetList.toArray(new ILaunchTarget[targetList.size()]); + } + } + + // Nope, return the local target + for (Entry, ILaunchTarget> targetEntry : targets.entrySet()) { + if (LocalTargetType.ID.equals(targetEntry.getKey().getFirst())) { + return new ILaunchTarget[] { targetEntry.getValue() }; + } + } + + // Not found, weird + return new ILaunchTarget[0]; + } + + public ILaunchTarget getActiveLaunchTarget() { + return activeLaunchTarget; + } + + public void setActiveLaunchTarget(ILaunchTarget target) throws CoreException { + if (activeLaunchTarget == target) { + return; + } + + if (activeLaunchTarget != null) { + activeLaunchTarget.setActive(false); + } + + activeLaunchTarget = target; + launchTargetChanged(activeLaunchTarget); + if (target == null) { + return; // no point storing null, if stored id is invalid it won't be used anyway + } + + target.setActive(true); + if (activeLaunchDesc == null) + return; + // per desc store + if (supportsTargetType(activeLaunchDesc, target)) + setPreference(getPerDescriptorStore(), + PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); + } + + @Override + public void launchTargetChanged(ILaunchTarget target) { + for (Listener listener : listeners) { + try { + listener.activeLaunchTargetChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + } + + @Override + public void launchTargetAdded(ILaunchTarget target) throws CoreException { + targets.put(getTargetId(target), target); + for (Listener listener : listeners) { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + if (activeLaunchDesc != null && activeLaunchTarget == null && supportsTargetType(activeLaunchDesc, target)) { + setActiveLaunchTarget(target); + } + } + + @Override + public void launchTargetRemoved(ILaunchTarget target) throws CoreException { + targets.remove(getTargetId(target)); + for (Listener listener : listeners) { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + if (activeLaunchTarget == target) { + setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); + } + } + + private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) throws CoreException { + ILaunchTarget[] targets = getLaunchTargets(descriptor); + if (targets.length > 0) { + return targets[0]; + } + return null; + } + + public ILaunchTarget getLaunchTarget(Pair targetId) { + if (targetId == null) + return null; + return targets.get(targetId); + } + + public ILaunchTargetType[] getAllLaunchTargetTypes() { + return targetTypes.values().toArray(new ILaunchTargetType[targetTypes.values().size()]); + } + + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + if (descriptor == null) + return null; + + String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); + + String targetTypeId = null; + if (target != null) { + targetTypeId = getTargetTypeId(target.getType()); + } else { + targetTypeId = defaultTargetTypes.get(getDescriptorTypeId(descriptor.getType())); + } + + if (targetTypeId != null) { + Map targetMap = configTypes.get(descriptorTypeId); + if (targetMap != null) { + LaunchConfigTypeInfo typeInfo = targetMap.get(targetTypeId); + return getLaunchManager().getLaunchConfigurationType(typeInfo.getLaunchConfigTypeId()); + } + } + + ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + if (config != null) + return config.getType(); + + return null; + } + + private boolean supportsTargetType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + return getConfigProvider(descriptor, target) != null; + } + + public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { + return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); + } + + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + if (descriptor == null) { + return null; + } + + ILaunchConfigurationProvider configProvider = getConfigProvider(descriptor, target); + if (configProvider != null) { + // First see if it exists yet + Map configMap = configs.get(descriptor); + if (configMap != null) { + ILaunchConfiguration config = configMap.get(configProvider); + if (config != null) { + return config; + } + } else { + // we'll need this in a minute + configMap = new HashMap<>(); + configs.put(descriptor, configMap); + } + + // Not found, create, store and return it + ILaunchConfiguration config = configProvider.createLaunchConfiguration(getLaunchManager(), descriptor); + if (config != null) { + configMap.put(configProvider, config); + return config; + } + } + + return (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + } + + public void addListener(Listener listener) { + listeners.add(listener); + } + + public void removeListener(Listener listener) { + listeners.remove(listener); + } + + @Override + public void launchConfigurationAdded(ILaunchConfiguration configuration) { + Activator.trace("launch config added " + configuration); + try { + LaunchConfigProviderInfo info = configProviders.get(configuration.getType().getIdentifier()); + if (info != null) { + ILaunchConfigurationProvider provider = info.getProvider(); + Object launchObject = provider.launchConfigurationAdded(configuration); + if (launchObject != null) { + ILaunchDescriptor descriptor = objectDescriptorMap.get(launchObject); + if (descriptor != null) { + Map configMap = configs.get(descriptor); + if (configMap == null) { + configMap = new HashMap<>(); + configs.put(descriptor, configMap); + } + configMap.put(provider, configuration); + } + Activator.trace("launch config claimed by " + provider); + return; + } + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + + Activator.trace("launch config not claimed"); + try { + ILaunchDescriptor desc = defaultDescriptorType.getDescriptor(configuration); + addDescriptor(configuration, desc); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + + @Override + public void launchConfigurationRemoved(ILaunchConfiguration configuration) { + Activator.trace("launch config removed " + configuration); + + // Is there any way this method is called when a LC still exists??? This may be dead code. + // configuration.getType() will fail when !configuration.exists() + if (configuration.exists()) { + try { + LaunchConfigProviderInfo info = configProviders.get(configuration.getType().getIdentifier()); + if (info != null) { + ILaunchConfigurationProvider provider = info.getProvider(); + if (provider.launchConfigurationRemoved(configuration)) { + Activator.trace("launch config removed by " + provider); + return; + } + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + + Activator.trace("launch config not claimed"); + ILaunchDescriptor desc = objectDescriptorMap.get(configuration); + if (desc == null) { + /* WARNING: This is slow. Call only as a last resort */ + Iterator>> iter = configs.entrySet().iterator(); + while (iter.hasNext()) { + Entry> e1 = iter.next(); + if (e1.getValue().containsValue(configuration)) { + Iterator> iter2 = e1.getValue().entrySet().iterator(); + while (iter2.hasNext()) { + Entry e2 = iter2.next(); + if (e2.getValue().equals(configuration)) { + e1.getValue().remove((ILaunchConfigurationProvider) e2.getKey()); + return; + } + } + break; + } + } + } + try { + removeDescriptor(configuration, desc); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + + @Override + public void launchConfigurationChanged(ILaunchConfiguration configuration) { + // Nothing to do on changes + } + + public void dispose() { + ILaunchManager launchManager = getLaunchManager(); + launchManager.removeLaunchConfigurationListener(this); + for (ILaunchObjectProvider o : objectProviders) { + try { + o.dispose(); + } catch (Exception e) { + Activator.log(e); + } + } + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java new file mode 100644 index 00000000000..c0e7088dd83 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.ILaunchTargetType; + +/** + * The launch target representing the machine we're running on. + */ +public class LocalTarget extends PlatformObject implements ILaunchTarget { + + private final LocalTargetType type; + + public LocalTarget(LocalTargetType type) { + this.type = type; + } + + @Override + public String getName() { + return Messages.LocalTarget_name; + } + + @Override + public ILaunchTargetType getType() { + return type; + } + + @Override + public void setActive(boolean active) { + // nothing to do, we have no active state + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java new file mode 100644 index 00000000000..7b0d12ccdba --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java @@ -0,0 +1,25 @@ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.ILaunchTargetType; + +/** + * The target type that creates the local target. + */ +public class LocalTargetType implements ILaunchTargetType { + + public static final String ID = Activator.PLUGIN_ID + ".targetType.local"; + + @Override + public void init(ILaunchBarManager manager) throws CoreException { + // create the local target + manager.launchTargetAdded(new LocalTarget(this)); + } + + @Override + public void dispose() { + // nothing to do + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java new file mode 100644 index 00000000000..b1b6d9bb67f --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.launchbar.core.internal.messages"; //$NON-NLS-1$ + public static String LocalTarget_name; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java new file mode 100644 index 00000000000..27491501d0b --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +/** + * Yet another implementation for Pair. You'd figure Java would have this out of the box. + * Used in the launch bar mainly for modeling descriptor and target id's which includ both + * type id and the object name. + * + * @param first element + * @param second element + */ +public class Pair { + + private final S first; + private final T second; + + public Pair(S first, T second) { + this.first = first; + this.second = second; + } + + public S getFirst() { + return first; + } + + public T getSecond() { + return second; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((first == null) ? 0 : first.hashCode()); + result = prime * result + ((second == null) ? 0 : second.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + @SuppressWarnings("unchecked") Pair other = (Pair) obj; + if (first == null) { + if (other.first != null) + return false; + } else if (!first.equals(other.first)) + return false; + if (second == null) { + if (other.second != null) + return false; + } else if (!second.equals(other.second)) + return false; + return true; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java new file mode 100644 index 00000000000..c706cf46a25 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer - Initial API and implementation + * Alena Laskavaia + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.ILaunchObjectProvider; + +/** + * Injects IProject objects from platform resources into the launch bar model for potential + * project descriptors. + */ +public class ProjectLaunchObjectProvider implements ILaunchObjectProvider, IResourceChangeListener { + private ILaunchBarManager manager; + + @Override + public void init(ILaunchBarManager manager) throws CoreException { + this.manager = manager; + for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { + manager.launchObjectAdded(project); + } + ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); + } + + @Override + public void dispose() { + ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); + } + + @Override + public void resourceChanged(IResourceChangeEvent event) { + try { + event.getDelta().accept(new IResourceDeltaVisitor() { + @Override + public boolean visit(IResourceDelta delta) throws CoreException { + IResource res = delta.getResource(); + if (res instanceof IProject) { + IProject project = (IProject) res; + int kind = delta.getKind(); + if ((kind & IResourceDelta.ADDED) != 0) { + manager.launchObjectAdded(project); + } else if ((kind & IResourceDelta.REMOVED) != 0) { + manager.launchObjectRemoved(project); + } else if ((kind & IResourceDelta.CHANGED) != 0) { + // TODO may need to be more concise as to what changes we're looking for + manager.launchObjectChanged(project); + } + return false; + } else if (res instanceof IFile || res instanceof IFolder) { + return false; + } + return true; + } + }); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties new file mode 100644 index 00000000000..2f8d25fcb68 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties @@ -0,0 +1,12 @@ +################################################################################ +# Copyright (c) 2014 QNX Software Systems 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: +# Doug Schaefer +################################################################################ + +LocalTarget_name=Local Machine diff --git a/bundles/org.eclipse.launchbar.ui/.classpath b/bundles/org.eclipse.launchbar.ui/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.launchbar.ui/.project b/bundles/org.eclipse.launchbar.ui/.project new file mode 100644 index 00000000000..2fc4d3a8356 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..2635343e499 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: LaunchBar UI +Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator +Bundle-Vendor: Eclipse CDT +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.e4.ui.workbench, + org.eclipse.e4.ui.model.workbench, + org.eclipse.e4.core.di, + org.eclipse.e4.core.services, + org.eclipse.osgi.services, + org.eclipse.launchbar.core, + org.eclipse.debug.ui, + org.eclipse.ui.workbench, + org.eclipse.ui.ide, + org.eclipse.swt, + org.eclipse.ui.navigator +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Bundle-Localization: plugin +Export-Package: org.eclipse.launchbar.ui, + org.eclipse.launchbar.ui.internal;x-internal:=true, + org.eclipse.launchbar.ui.internal.commands;x-internal:=true, + org.eclipse.launchbar.ui.internal.controls;x-internal:=true, + org.eclipse.launchbar.ui.internal.dialogs;x-internal:=true +Import-Package: javax.inject diff --git a/bundles/org.eclipse.launchbar.ui/about.html b/bundles/org.eclipse.launchbar.ui/about.html new file mode 100644 index 00000000000..d7c511887d6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/about.html @@ -0,0 +1,24 @@ + + +About + + +

About This Content

+ +

June 22, 2007

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.ui/build.properties b/bundles/org.eclipse.launchbar.ui/build.properties new file mode 100644 index 00000000000..6b4afb7a5a7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + plugin.properties diff --git a/bundles/org.eclipse.launchbar.ui/icons/build.png b/bundles/org.eclipse.launchbar.ui/icons/build.png new file mode 100755 index 0000000000000000000000000000000000000000..110cb3a631506768c99c7088c7b089e2cf3d6f77 GIT binary patch literal 625 zcmV-%0*?KOP)Xz!oA$QKP*XgA^|}eH;J+Ux2>GNGIB=MC)gv#Bz0E0ft^zYphWN0-J9?AebhY zD6xE&whUI~7D3+&f-49ND$Z6u)=dWN))hGZZ zGGA3h*#)y4=JT`9U%`VNS)5`AfP9NBNQ?IzMX?0L23ZVaQza4Nvb-Kx@L&sKVk{=w z0kD(~D)ErP%yU=CEq;l20H{DgPU$cJ%3dG`Py^u21)wq>-EvR@Lr&>5bpWWS1^E^| z#ZwayOan0Af~sFoZAVH1Bh~>22(<~Q8RY1F1}12yVW7YRCTNdkpujcnt=dRppeGV0W!M~W;sUhcp$px009O7F-+U2g%Q7o00000 LNkvXXu0mjfN*?yv literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/config_config.png b/bundles/org.eclipse.launchbar.ui/icons/config_config.png new file mode 100644 index 0000000000000000000000000000000000000000..c3b2ddc88876a8634746b80069ce521f20b8e7f6 GIT binary patch literal 1441 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#XveAgc(0By5r2i!0eM5 z5>XQ2>tmIipR1RclAn~SSCLx)RKdVtQ(*;U=BAb;Dpcg=MLA$wQj+ykb5e6t^Gb^K4fPE5;f4eC+N2~~6=kMploW%V z4L1$!e#e{=R8f!ykOOiuLH@GJNz6;PRjSZUNli;E%_&i`3n)#>$xK#o$lc7^q<}T(+vr0KN3|3pis}{{eGGR)lpzHb z%oMPTk;DlFAu!_MVF+|CBw+v@uV0Z^01Q6^)bInUwsHpfFuy1yKR?F~6uX&u*~Q6; z1*ssf+UTRJfW{it+*^{FhDcl}4hG3!x)>yCT(-FVRae~}WHwgG7 zZ8p=?36k*RoT1b-K_o6+Fz`c%D_6Hb$!cRp?nnU>*C<_A9lmwqLT4t{8lQV}&)R&J z16$kQv}d#9^V?lm)K5;I+nVWKk#8t=CT92EeYHa8S)VWea`4CVx$S2YCcBhA<5{E`X+2|U$vO&x~CCaFG@f87xR68 zN@vx*FY^x_({;Z%ar=F{d1XzzEL5x>-FIivmA%kE-EEJ;bTQUVVv|ZP_DE<7|GILw zO2|z5sOT5Ai{HCFKb@Ox?EBu$wEpMvL!6se3%%|L{T)&xrJr`h_)*~X`ExVMA`%bD z#zy*F-V$+egZRp_^9oafmT0$l`wYt#-~`luCa-`5Gd)7ZG!X5Q6q zgNUigor(`;PU&9cV0iG^>~!C>pDX-qcNuqDxSKzJr#rp<%j*Z<<-E7NKH4dFvP<1Z z>s*N8l`}Q2K9HFvM~UgLco!~Lp0H{kEtgAe}1 zt-gB8y!s29v-`xHMw{h!ft4$i?wHT_%m|1&AnzE@c45t|o#CKD)YH|^Wt~$(69C-` B1)2Z= literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch.png b/bundles/org.eclipse.launchbar.ui/icons/launch.png new file mode 100644 index 0000000000000000000000000000000000000000..d704b703b719540e5a5740679d068bf92ea6d307 GIT binary patch literal 466 zcmV;@0WJQCP)*h(c5wcsGR{!(9}Lqz@7=3)dmVEFi|0& zQvw`Vh*inYt-~NC=)v&q=VOM4uUAsd1w=c*PHPEOMts(8wGtD#p}|DWJVj1uFwr7& zv$F7mF;%l6F#uFXoCRjj*Po72zZ@V0?!1`IaQ#US!|y*IX;TnU)7MmU0J**<%K^Xt zeu9^Vl=_-12OPQ<1h0&qz28BRugP)%sN$hU<%6vpI52?ifdfp?PQyTf2Taf&%RqsH zAO~!KHj(KKKz43mg7(!K2fzWKF4~8|(KQ&r{hX4Qo07*qo IM6N<$f+n-L8vpXcGd2EGJgYpo)S~2aGyk)Bz+p z0943OLk-y_At@!?Xc{2J0S5-q{sT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml new file mode 100644 index 00000000000..1d44fd01db7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.ui + 1.0.0-SNAPSHOT + + eclipse-plugin + diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd new file mode 100644 index 00000000000..215f6b2b879 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd @@ -0,0 +1,188 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used for identifying this launch target type in various UI elements. + + + + + + + + + + Used for identifying this launch target type in various UI elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An INewWizard that creates a target of this type. + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java new file mode 100644 index 00000000000..d7cf839da00 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui; + +/** + * An extension to allow different object types to provide fancy hovers. + * + * TODO this does lead to inconsistency when different types provide different hover UI + * which can confuse users. We should provide good UI out of the box. + */ +public interface IHoverProvider { + + /** + * Display the hover item. + * + * @return true if hover item was displayed, otherwise false + */ + public abstract boolean displayHover(Object element); + + /** + * Dismiss the hover item. + * + * @param immediate + * if true, the hover item will be immediately dismissed, otherwise it may be be dismissed at a later time. + */ + public abstract void dismissHover(Object element, boolean immediate); + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java new file mode 100644 index 00000000000..f5bb4321030 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui; + +public interface ILaunchBarUIConstants { + + /** + * Parameter name for the edit target command. + */ + public static final String TARGET_NAME = "targetName"; + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java new file mode 100644 index 00000000000..bcd1e95ab04 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -0,0 +1,155 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal; + +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.IParameter; +import org.eclipse.core.commands.Parameterization; +import org.eclipse.core.commands.ParameterizedCommand; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Event; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.handlers.IHandlerService; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.launchbar.ui"; //$NON-NLS-1$ + + // Images + public static final String IMG_BUTTON_BUILD = "build"; + public static final String IMG_BUTTON_LAUNCH = "launch"; + public static final String IMG_BUTTON_STOP = "stop"; + + // Command ids + public static final String CMD_BUILD = PLUGIN_ID + ".command.buildActive"; + public static final String CMD_LAUNCH = PLUGIN_ID + ".command.launchActive"; + public static final String CMD_STOP = PLUGIN_ID + ".command.stop"; + public static final String CMD_CONFIG = PLUGIN_ID + ".command.configureActiveLaunch"; + + // Preference ids + public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; + + // The shared instance + private static Activator plugin; + + // The cache of the Launch Bar UI Manager Object + private LaunchBarUIManager launchBarUIManager; + + /** + * The constructor + */ + public Activator() { + } + + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + ImageRegistry imageRegistry = getImageRegistry(); + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); + } + + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + public LaunchBarUIManager getLaunchBarUIManager() { + if (launchBarUIManager == null) { + LaunchBarManager manager = org.eclipse.launchbar.core.internal.Activator.getDefault().getLaunchBarManager(); + launchBarUIManager = new LaunchBarUIManager(manager); + } + return launchBarUIManager; + } + + public Image getImage(String id) { + return getImageRegistry().get(id); + } + + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } + + public static void runCommand(String commandId, String... params) { + final ICommandService commandService = (ICommandService) PlatformUI.getWorkbench() + .getService(ICommandService.class); + Command command = commandService.getCommand(commandId); + final Event trigger = new Event(); + final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench() + .getService(IHandlerService.class); + ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, trigger); + if (params.length == 0) { + try { + command.executeWithChecks(executionEvent); + } catch (OperationCanceledException e) { + // abort + } catch (Exception e) { + log(e); + } + } else { + try { + final Parameterization[] parameterizations = new Parameterization[params.length / 2]; + for (int i = 0; i < params.length; i += 2) { + IParameter param = command.getParameter(params[i]); + Parameterization parm = new Parameterization(param, params[i + 1]); + parameterizations[i / 2] = parm; + } + ParameterizedCommand parmCommand = new ParameterizedCommand(command, parameterizations); + handlerService.executeCommand(parmCommand, null); + } catch (Exception e) { + log(e); + } + } + } + + public static void log(IStatus status) { + plugin.getLog().log(status); + } + + public static void log(Exception e) { + if (e instanceof CoreException) + log(((CoreException) e).getStatus()); + plugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e)); + } + + public static T getService(Class cls) { + BundleContext context = getDefault().getBundle().getBundleContext(); + ServiceReference ref = context.getServiceReference(cls); + return ref != null ? context.getService(ref) : null; + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java new file mode 100644 index 00000000000..191e5c3fb25 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java @@ -0,0 +1,61 @@ +package org.eclipse.launchbar.ui.internal; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.internal.DefaultLaunchDescriptor; +import org.eclipse.swt.graphics.Image; + +public class DefaultDescriptorLabelProvider extends LabelProvider { + + private Map images = new HashMap<>(); + + @Override + public void dispose() { + super.dispose(); + for (Image image : images.values()) { + image.dispose(); + } + } + + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchDescriptor) { + ILaunchConfiguration config = (ILaunchConfiguration) ((ILaunchDescriptor) element).getAdapter(ILaunchConfiguration.class); + if (config != null) { + try { + ILaunchConfigurationType type = config.getType(); + ImageDescriptor imageDescriptor = DebugUITools.getDefaultImageDescriptor(type); + if (imageDescriptor != null) { + Image image = images.get(imageDescriptor); + if (image == null) { + image = imageDescriptor.createImage(); + images.put(imageDescriptor, image); + } + return image; + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + } + return super.getImage(element); + } + + @Override + public String getText(Object element) { + if (element instanceof ILaunchDescriptor) { + return ((ILaunchDescriptor) element).getName(); + } + return super.getText(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java new file mode 100644 index 00000000000..ad697e01050 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java @@ -0,0 +1,124 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal; + +import javax.inject.Inject; + +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.core.services.events.IEventBroker; +import org.eclipse.e4.ui.model.application.MApplication; +import org.eclipse.e4.ui.model.application.ui.SideValue; +import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar; +import org.eclipse.e4.ui.model.application.ui.basic.MTrimElement; +import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; +import org.eclipse.e4.ui.model.application.ui.basic.MWindow; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; +import org.eclipse.e4.ui.model.application.ui.menu.MToolControl; +import org.eclipse.e4.ui.workbench.UIEvents; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.launchbar.ui.internal.controls.LaunchBarControl; +import org.eclipse.swt.widgets.Widget; +import org.osgi.service.event.Event; +import org.osgi.service.event.EventHandler; + +public class LaunchBarInjector { + + @Inject + MApplication application; + + @Inject + IEventBroker eventBroker; + + @Execute + void execute() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); + injectIntoAll(enabled); + + // Watch for new trimmed windows and inject there too. + eventBroker.subscribe(UIEvents.TrimmedWindow.TOPIC_TRIMBARS, new EventHandler() { + @Override + public void handleEvent(Event event) { + if (!UIEvents.isADD(event)) + return; + Object newValue = event.getProperty(UIEvents.EventTags.NEW_VALUE); + if (newValue instanceof MTrimBar) { + MTrimBar trimBar = (MTrimBar) newValue; + if (trimBar.getSide() == SideValue.TOP) { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); + injectLaunchBar(trimBar, enabled); + } + } + } + }); + + // Watch for preference changes + Activator.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent event) { + if (event.getProperty().equals(Activator.PREF_ENABLE_LAUNCHBAR)) { + boolean enabled = Boolean.parseBoolean(event.getNewValue().toString()); + injectIntoAll(enabled); + } + } + }); + } + + private void injectIntoAll(boolean enabled) { + // Inject the toolbar into all top trims + for (MWindow window : application.getChildren()) { + if (window instanceof MTrimmedWindow) { + for (MTrimBar trimBar : ((MTrimmedWindow) window).getTrimBars()) { + if (trimBar.getSide() == SideValue.TOP) { + injectLaunchBar(trimBar, enabled); + } + } + } + } + } + + private void injectLaunchBar(MTrimBar trimBar, boolean enabled) { + // are we enabled or not + + // Search for control in trimbar + MTrimElement launchBarElement = null; + for (MTrimElement trimElement : trimBar.getChildren()) { + if (LaunchBarControl.ID.equals(trimElement.getElementId())) { + launchBarElement = trimElement; + break; + } + } + + if (launchBarElement != null) { + if (!enabled) { + // remove it if we're disabled + trimBar.getChildren().remove(launchBarElement); + // This seems to be a bug in the platform but for now, dispose of the widget + Widget widget = (Widget)launchBarElement.getWidget(); + widget.dispose(); + } + // either way, we're done + return; + } + + if (enabled) { + // Add it + MToolControl launchBar = MMenuFactory.INSTANCE.createToolControl(); + launchBar.setElementId(LaunchBarControl.ID); + launchBar.setContributionURI(LaunchBarControl.CLASS_URI); + trimBar.getChildren().add(0, launchBar); + } + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java new file mode 100644 index 00000000000..1076062a332 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java @@ -0,0 +1,14 @@ +package org.eclipse.launchbar.ui.internal; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; + +public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitializer { + + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java new file mode 100644 index 00000000000..7a8fbb3951f --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java @@ -0,0 +1,26 @@ +package org.eclipse.launchbar.ui.internal; + +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +public class LaunchBarPreferencePage extends FieldEditorPreferencePage implements + IWorkbenchPreferencePage { + + public LaunchBarPreferencePage() { + super(GRID); + } + + @Override + public void init(IWorkbench workbench) { + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("Preferences for the Launch Bar."); + } + + @Override + protected void createFieldEditors() { + addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, "Enable the Launch Bar.", getFieldEditorParent())); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java new file mode 100644 index 00000000000..6198744463c --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -0,0 +1,188 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.ILaunchTargetType; +import org.eclipse.launchbar.core.internal.ExecutableExtension; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.IHoverProvider; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.INewWizard; + +public class LaunchBarUIManager { + + LaunchBarManager manager; + Map> descriptorLabelProviders = new HashMap<>(); + Map targetContributions = new HashMap<>(); + + private final LaunchBarTargetContribution DEFAULT_CONTRIBUTION = new LaunchBarTargetContribution(null, null, null, null, + null, null); + + public LaunchBarUIManager(LaunchBarManager manager) { + this.manager = manager; + + IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); + IExtension[] extensions = point.getExtensions(); + for (IExtension extension : extensions) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String elementName = element.getName(); + if (elementName.equals("descriptorUI")) { + String descriptorTypeId = element.getAttribute("descriptorTypeId"); + ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); + descriptorLabelProviders.put(descriptorTypeId, labelProvider); + } else if (elementName.equals("targetUI")) { + String targetTypeId = element.getAttribute("targetTypeId"); + String targetName = element.getAttribute("name"); + String iconStr = element.getAttribute("icon"); + ExecutableExtension labelProvider = new ExecutableExtension(element, "labelProvider"); + + ExecutableExtension hoverProvider = null; + if (element.getAttribute("hoverProvider") != null) { + hoverProvider = new ExecutableExtension(element, "hoverProvider"); + } + + String editCommandId = element.getAttribute("editCommandId"); + + ExecutableExtension newWizard = null; + if (element.getAttribute("newWizard") != null) { + newWizard = new ExecutableExtension(element, "newWizard"); + } + + targetContributions.put(targetTypeId, new LaunchBarTargetContribution(targetName, iconStr, + labelProvider, hoverProvider, editCommandId, newWizard)); + } + } + } + } + + public LaunchBarManager getManager() { + return manager; + } + + public ILabelProvider getLabelProvider(ILaunchDescriptor descriptor) throws CoreException { + ExecutableExtension provider = descriptorLabelProviders.get(manager.getDescriptorTypeId(descriptor.getType())); + return provider != null ? provider.get() : null; + } + + public String getTargetTypeName(ILaunchTarget target) { + return getTargetTypeName(target.getType()); + } + + public String getTargetTypeName(ILaunchTargetType targetType) { + String typeId = manager.getTargetTypeId(targetType); + String name = targetContributions.get(typeId).name; + return name != null ? name : typeId; + } + + public Image getTargetTypeIcon(ILaunchTargetType targetType) { + String typeId = manager.getTargetTypeId(targetType); + return targetContributions.get(typeId).getIcon(); + } + + public ILabelProvider getLabelProvider(ILaunchTarget target) throws CoreException { + ExecutableExtension provider = getContribution(target).labelProvider; + return provider != null ? provider.get() : null; + } + + public IHoverProvider getHoverProvider(ILaunchTarget target) throws CoreException { + ExecutableExtension hoverProvider = getContribution(target).hoverProvider; + return hoverProvider != null ? hoverProvider.get() : null; + } + + public String getEditCommand(ILaunchTarget target) { + return getContribution(target).editCommandId; + } + + public Map> getNewTargetWizards() { + Map> wizards = new HashMap<>(); + for (Entry contrib : targetContributions.entrySet()) { + if (contrib.getValue().newWizard != null) { + ILaunchTargetType type = manager.getLaunchTargetType(contrib.getKey()); + if (type != null) { + wizards.put(type, contrib.getValue().newWizard); + } + } + } + return wizards; + } + + public Map getTargetIcons() { + Map icons = new HashMap<>(); + for (LaunchBarTargetContribution contribution : targetContributions.values()) { + Image icon = contribution.getIcon(); + if (icon != null) { + icons.put(contribution.name, icon); + } + } + return icons; + } + + private LaunchBarTargetContribution getContribution(ILaunchTarget target) { + LaunchBarTargetContribution c = targetContributions.get(manager.getTargetTypeId(target.getType())); + if (c == null) { + return DEFAULT_CONTRIBUTION; + } + return c; + } + + private class LaunchBarTargetContribution { + String name; + String iconStr; + Image icon; + ExecutableExtension labelProvider; + ExecutableExtension hoverProvider; + String editCommandId; + ExecutableExtension newWizard; + + LaunchBarTargetContribution(String name, String iconStr, + ExecutableExtension labelProvider, + ExecutableExtension hoverProvider, + String editCommand, + ExecutableExtension newWizard) { + this.name = name; + this.iconStr = iconStr; + this.icon = null; + this.labelProvider = labelProvider; + this.hoverProvider = hoverProvider; + this.editCommandId = editCommand; + this.newWizard = newWizard; + } + + Image getIcon() { + if (icon == null) { + if (iconStr != null && !iconStr.isEmpty()) { + try { + icon = ImageDescriptor.createFromURL(new URL(iconStr)).createImage(); + } catch (MalformedURLException e) { + Activator.log(e); + } + } + } + return icon; + } + + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java new file mode 100644 index 00000000000..dcf460c4761 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java @@ -0,0 +1,16 @@ +package org.eclipse.launchbar.ui.internal; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.launchbar.core.ILaunchTarget; + + +public class LocalTargetLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + if (element instanceof ILaunchTarget) { + return ((ILaunchTarget) element).getName(); + } + return super.getText(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java new file mode 100644 index 00000000000..9a432ba18db --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.launchbar.ui.internal.messages"; //$NON-NLS-1$ + public static String LaunchBarControl_Build; + public static String LaunchBarControl_Launch; + public static String LaunchBarControl_Stop; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java new file mode 100644 index 00000000000..171ac471118 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -0,0 +1,194 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.commands; + +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IBuildConfiguration; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IncrementalProjectBuilder; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchDelegate; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; +import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.BuildAction; +import org.eclipse.ui.ide.ResourceUtil; +import org.eclipse.ui.progress.UIJob; + +/** + * Build active project + */ +public class BuildActiveCommandHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + new UIJob(Display.getDefault(), "Building Active Configuration") { + @Override + public boolean belongsTo(Object family) { + return ResourcesPlugin.FAMILY_MANUAL_BUILD.equals(family); + } + + public IStatus runInUIThread(IProgressMonitor monitor) { + try { + final LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + final ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); + + final Collection projects = getProjects(config); + if (BuildAction.isSaveAllSet()) { + saveEditors(projects); + } + + new Job("Building Active Configuration") { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + if (config == null) { + // Default, build the workspace + ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); + return Status.OK_STATUS; + } + + ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + String mode = launchMode.getIdentifier(); + Set modes = new HashSet<>(); + modes.add(mode); + ILaunchDelegate delegate = config.getType().getPreferredDelegate(modes); + if (delegate == null) + delegate = config.getType().getDelegates(modes)[0]; + ILaunchConfigurationDelegate configDel = delegate.getDelegate(); + if (configDel instanceof ILaunchConfigurationDelegate2) { + ILaunchConfigurationDelegate2 configDel2 = (ILaunchConfigurationDelegate2)configDel; + boolean ret; + ret = configDel2.preLaunchCheck(config, mode, monitor); + if (!ret) + return Status.CANCEL_STATUS; + if (!configDel2.buildForLaunch(config, mode, monitor)) + return Status.OK_STATUS; + } + + // Fall through, do a normal build + if (projects.isEmpty()) { + ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); + } else { + Collection buildConfigs = getBuildConfigs(projects); + ResourcesPlugin.getWorkspace().build(buildConfigs.toArray(new IBuildConfiguration[buildConfigs.size()]), + IncrementalProjectBuilder.INCREMENTAL_BUILD, true, monitor); + // TODO, may need to get the buildReferences argument from the descriptor + } + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } + } + }.schedule(); + } catch (CoreException e) { + return e.getStatus(); + } + + return Status.OK_STATUS; + }; + }.schedule(); + + return Status.OK_STATUS; + } + + protected Collection getProjects(ILaunchConfiguration config) { + Set projects = new HashSet<>(); + + if (config != null) { + IResource[] mappedResources; + try { + mappedResources = config.getMappedResources(); + } catch (CoreException e) { + return projects; + } + if (mappedResources != null) { + for (IResource resource : mappedResources) { + IProject project = resource.getProject(); + if (projects.contains(project)) + continue; + projects.add(project); + try { + projects.addAll(Arrays.asList(project.getReferencedProjects())); + } catch (CoreException e) { + // skip + } + } + } + } + + return projects; + } + + protected Collection getBuildConfigs(Collection projects) { + Set configs = new HashSet<>(); + + for (IProject project : projects) { + try { + configs.add(project.getActiveBuildConfig()); + } catch (CoreException e) { + // skip + } + } + + return configs; + } + + protected void saveEditors(final Collection projects) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + for (IWorkbenchWindow window : windows) { + IWorkbenchPage[] pages = window.getPages(); + for (IWorkbenchPage page : pages) { + if (projects.isEmpty()) { + page.saveAllEditors(false); + } else { + IEditorPart[] editors = page.getDirtyEditors(); + for (IEditorPart editor : editors) { + IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); + if (inputFile != null) { + if (projects.contains(inputFile.getProject())) { + page.saveEditor(editor, false); + } + } + } + } + } + } + } + }); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java new file mode 100644 index 00000000000..ea597622fd4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.commands; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.window.Window; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.ui.handlers.HandlerUtil; + +public class ConfigureActiveLaunchHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + try { + LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + ILaunchDescriptor desc = launchBarManager.getActiveLaunchDescriptor(); + ILaunchTarget target = launchBarManager.getActiveLaunchTarget(); + ILaunchConfiguration launchConfiguration = launchBarManager.getLaunchConfiguration(desc, target); + if (launchConfiguration == null) + return Status.OK_STATUS; + ILaunchConfigurationWorkingCopy wc = launchConfiguration.getWorkingCopy(); + + ILaunchMode activeLaunchMode = launchBarManager.getActiveLaunchMode(); + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchConfiguration.getType(), activeLaunchMode.getIdentifier()); + + if (DebugUITools.openLaunchConfigurationPropertiesDialog(HandlerUtil.getActiveShell(event), wc, group.getIdentifier()) == Window.OK) + wc.doSave(); + } catch (CoreException e) { + return e.getStatus(); + } + return Status.OK_STATUS; + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java new file mode 100644 index 00000000000..e206bed4ab5 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.commands; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.progress.UIJob; + +public class LaunchActiveCommandHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + new UIJob(Display.getDefault(), "Launching Active Configuration") { + public IStatus runInUIThread(IProgressMonitor monitor) { + try { + LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + ILaunchDescriptor desc = launchBarManager.getActiveLaunchDescriptor(); + ILaunchTarget target = launchBarManager.getActiveLaunchTarget(); + ILaunchConfiguration config = launchBarManager.getLaunchConfiguration(desc, target); + if (config == null) + return Status.OK_STATUS; + ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + DebugUITools.launch(config, launchMode.getIdentifier()); + } catch (CoreException e) { + return e.getStatus(); + } + return Status.OK_STATUS; + }; + }.schedule(); + + return Status.OK_STATUS; + } + + protected String getMode(ILaunchMode launchMode) { + return launchMode.getIdentifier(); //$NON-NLS-1$ + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java new file mode 100644 index 00000000000..f8ed9272654 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.commands; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.IJobManager; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; + +public class StopActiveCommandHandler extends AbstractHandler { + private ILaunchBarManager launchBarManager; + + public StopActiveCommandHandler() { + launchBarManager = Activator.getService(ILaunchBarManager.class); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + stop(); + return null; + } + + public void stop() { + stopBuild(); + stopActiveLaunches(); + } + + protected void stopActiveLaunches() { + final ILaunch[] activeLaunches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); + if (activeLaunches != null && activeLaunches.length > 0) { + new Job("Stopping launches") { + protected IStatus run(IProgressMonitor monitor) { + // TODO only stop the launches for the active launch descriptor + // Not sure we have the API to map that out yet. + for (ILaunch launch : activeLaunches) { + try { + launch.terminate(); + } catch (DebugException e) { + return e.getStatus(); + } + } + return Status.OK_STATUS; + }; + }.schedule(); + } + } + + protected void stopBuild() { + Job job = new Job("Stopping build") { + @Override + protected IStatus run(IProgressMonitor progress) { + // stops all builds + final IJobManager jobManager = Job.getJobManager(); + Job[] jobs = jobManager.find(ResourcesPlugin.FAMILY_MANUAL_BUILD); + for (int i = 0; i < jobs.length; i++) { + Job job = jobs[i]; + job.cancel(); + } + jobs = jobManager.find(ResourcesPlugin.FAMILY_AUTO_BUILD); + for (int i = 0; i < jobs.length; i++) { + Job job = jobs[i]; + job.cancel(); + } + return Status.OK_STATUS; + } + }; + job.schedule(); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java new file mode 100644 index 00000000000..cc62e1f5e7f --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseTrackAdapter; +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; + +public class CButton extends Canvas { + + private boolean inButton; + private Image hotImage; + private Image coldImage; + + public CButton(Composite parent, int style) { + super(parent, style); + + addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + if (inButton) { + if (hotImage != null) { + e.gc.drawImage(hotImage, 0, 0); + } else if (coldImage != null) { + e.gc.drawImage(coldImage, 0, 0); + } + } else { + if (coldImage != null) { + e.gc.drawImage(coldImage, 0, 0); + } else if (hotImage != null) { + e.gc.drawImage(hotImage, 0, 0); + } + } + } + }); + + addMouseTrackListener(new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + inButton = true; + redraw(); + } + @Override + public void mouseExit(MouseEvent e) { + inButton = false; + redraw(); + } + }); + } + + @Override + public void dispose() { + super.dispose(); + + if (hotImage != null) + hotImage.dispose(); + + if (coldImage != null) + coldImage.dispose(); + } + + @Override + public Point computeSize(int wHint, int hHint, boolean changed) { + int width = 0; + int height = 0; + if (hotImage != null) { + Rectangle bounds = hotImage.getBounds(); + width = bounds.width; + height = bounds.height; + } + if (coldImage != null) { + Rectangle bounds = coldImage.getBounds(); + if (bounds.width > width) + width = bounds.width; + if (bounds.height > height) + height = bounds.height; + } + return new Point(width, height); + } + + public void setHotImage(Image image) { + this.hotImage = image; + } + + public void setColdImage(Image image) { + this.coldImage = image; + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java new file mode 100644 index 00000000000..138db7dd720 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -0,0 +1,834 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import java.util.Arrays; +import java.util.Comparator; + +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.launchbar.ui.IHoverProvider; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseTrackAdapter; +import org.eclipse.swt.events.MouseTrackListener; +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.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.LineAttributes; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +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.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; + +public abstract class CSelector extends Composite { + + private IStructuredContentProvider contentProvider; + private ILabelProvider labelProvider; + private IHoverProvider hoverProvider; + private Comparator sorter; + + private Object input; + + private Composite buttonComposite; + private String toolTipText; + private boolean toolTipWasModified; // Used for the hover provider + + private static final int arrowMax = 2; + private Transition arrowTransition; + + private Object selection; + + protected final Color backgroundColor; + protected final Color outlineColor; + protected final Color highlightColor; + protected final Color white; + + private boolean mouseOver; + + private Image editImage; + private boolean inEditButton; + private Image buttonImage; + private Label currentIcon; + private Label currentLabel; + + private Shell popup; + private ListItem listItems[]; + private int selIndex; + private ScrolledComposite listScrolled; + private final int itemH = 30; + private int scrollBucket; + private final int maxScrollBucket = 7; + private int separatorIndex = -1; + + + private MouseTrackListener mouseTrackListener = new MouseTrackListener() { + @Override + public void mouseEnter(MouseEvent e) { + if (!mouseOver) { + mouseOver = true; + redraw(); + if (toolTipWasModified) { + buttonComposite.setToolTipText(toolTipText); + if (currentLabel != null) { + currentLabel.setToolTipText(toolTipText); + } + if (currentIcon != null) { + currentIcon.setToolTipText(toolTipText); + } + } + } + } + + @Override + public void mouseHover(MouseEvent e) { + if (hoverProvider != null && (popup == null || popup.isDisposed())) { + final Object eventSource = e.getSource(); + if ((eventSource == currentLabel || eventSource == buttonComposite || eventSource == currentIcon)) { + if (hoverProvider.displayHover(selection)) { + buttonComposite.setToolTipText(""); + if (currentLabel != null) { + currentLabel.setToolTipText(""); + } + if (currentIcon != null) { + currentIcon.setToolTipText(""); + } + toolTipWasModified = true; + } + } + } + } + + @Override + public void mouseExit(MouseEvent e) { + if (mouseOver) { + mouseOver = false; + redraw(); + } + } + }; + + private MouseListener mouseListener = new MouseAdapter() { + @Override + public void mouseUp(MouseEvent event) { + if (popup == null || popup.isDisposed()) { + openPopup(); + } else { + closePopup(); + } + } + }; + + private Listener focusOutListener = new Listener() { + @Override + public void handleEvent(Event event) { + switch (event.type) { + case SWT.FocusOut: + Control focusControl = getDisplay().getFocusControl(); + if (focusControl != null && focusControl.getShell() == popup) { + Point loc = getDisplay().getCursorLocation(); + if (!getBounds().contains(toControl(loc))) { + // Don't do it if we're in the selector, we'll deal with that later + closePopup(); + } + } + break; + + case SWT.MouseUp: + if (popup != null && !popup.isDisposed()) { + Point loc = getDisplay().getCursorLocation(); + if (!popup.getBounds().contains(loc) && !getBounds().contains(toControl(loc))) { + closePopup(); + } + } + break; + } + } + + }; + + + public CSelector(Composite parent, int style) { + super(parent, style); + + backgroundColor = new Color(getDisplay(), new RGB(249, 249, 249)); + outlineColor = new Color(getDisplay(), new RGB(189, 195, 200)); + highlightColor = new Color(getDisplay(), new RGB(223, 239, 241)); + white = getDisplay().getSystemColor(SWT.COLOR_WHITE); + + GridLayout mainButtonLayout = new GridLayout(); + setLayout(mainButtonLayout); + + addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + gc.setBackground(backgroundColor); + gc.setForeground(outlineColor); + Point size = getSize(); + final int arc = 3; + gc.fillRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); + gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); + } + }); + + addMouseListener(mouseListener); + addMouseTrackListener(mouseTrackListener); + } + + @Override + public void dispose() { + super.dispose(); + backgroundColor.dispose(); + outlineColor.dispose(); + highlightColor.dispose(); + if (editImage != null) + editImage.dispose(); + if (buttonImage != null) + buttonImage.dispose(); + if (popup != null) + popup.dispose(); + } + + public void setSelection(Object element) { + this.selection = element; + + if (buttonComposite != null) + buttonComposite.dispose(); + + toolTipText = getToolTipText(); + + boolean editable = false; + int columns = 2; + + Image image = labelProvider.getImage(element); + if (image != null) + columns++; + + editable = isEditable(element); + if (editable) + columns++; + + buttonComposite = new Composite(this, SWT.NONE); + GridLayout buttonLayout = new GridLayout(columns, false); + buttonLayout.marginHeight = buttonLayout.marginWidth = 0; + buttonComposite.setLayout(buttonLayout); + buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + buttonComposite.setBackground(backgroundColor); + buttonComposite.addMouseListener(mouseListener); + buttonComposite.addMouseTrackListener(mouseTrackListener); + buttonComposite.setToolTipText(toolTipText); + + if (element != null) { + if (image != null) { + Label icon = createImage(buttonComposite, image); + icon.addMouseListener(mouseListener); + icon.addMouseTrackListener(mouseTrackListener); + currentIcon = icon; + currentIcon.setToolTipText(toolTipText); + } + + Label label = createLabel(buttonComposite, element); + label.addMouseListener(mouseListener); + label.addMouseTrackListener(mouseTrackListener); + currentLabel = label; + currentLabel.setToolTipText(toolTipText); + } else { + Composite blank = new Composite(buttonComposite, SWT.NONE); + blank.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + currentIcon = null; + currentLabel = null; + } + + final Canvas arrow = new Canvas(buttonComposite, SWT.NONE) { + @Override + public Point computeSize(int wHint, int hHint, boolean changed) { + return new Point(12, 16); + } + }; + arrow.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); + arrow.setBackground(backgroundColor); + arrowTransition = new Transition(arrow, arrowMax, 80); + + arrow.addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + final int hPadding = 2; + + GC gc = e.gc; + LineAttributes attributes = new LineAttributes(2); + attributes.cap = SWT.CAP_ROUND; + gc.setLineAttributes(attributes); + + gc.setAlpha(mouseOver ? 255 : 100); + + Rectangle bounds = arrow.getBounds(); + int arrowWidth = bounds.width - hPadding * 2; + int current = arrowTransition.getCurrent(); + gc.drawPolyline(new int[] { hPadding, + bounds.height / 2 - current, + hPadding + (arrowWidth / 2), + bounds.height / 2 + current, hPadding + arrowWidth, + bounds.height / 2 - current }); + } + }); + + arrow.addMouseListener(mouseListener); + arrow.addMouseTrackListener(mouseTrackListener); + + if (editable) { + Control editButton = createEditButton(buttonComposite, element); + editButton.setBackground(backgroundColor); + + editButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + // Need to run this after the current event storm + // Or we get a disposed error. + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (CSelector.this.selection != null) + handleEdit(selection); + } + }); + } + }); + } + + layout(); + } + + protected abstract void fireSelectionChanged(); + + public Object getSelection() { + return selection; + } + + public MouseListener getMouseListener() { + return mouseListener; + } + + public MouseTrackListener getMouseTrackListener() { + return mouseTrackListener; + } + + protected void openPopup() { + Object[] elements = contentProvider.getElements(input); + if (elements.length == 0 && !hasActionArea()) + return; + + arrowTransition.to(-arrowMax); + + if (popup != null && !popup.isDisposed()) { + popup.dispose(); + } + + popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP); + GridLayout layout = new GridLayout(); + layout.marginHeight = layout.marginWidth = 0; + layout.verticalSpacing = 0; + popup.setLayout(layout); + + listScrolled = new ScrolledComposite(popup, SWT.V_SCROLL | SWT.NO_BACKGROUND); + listScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + listScrolled.setExpandHorizontal(true); + Composite listComp = new Composite(listScrolled, SWT.NONE); + listScrolled.setContent(listComp); + layout = new GridLayout(); + layout.marginHeight = layout.marginWidth = 0; + layout.verticalSpacing = 0; + listComp.setLayout(layout); + + for (Control child : listComp.getChildren()) + child.dispose(); + + if (sorter != null) + Arrays.sort(elements, sorter); + + listItems = new ListItem[elements.length]; + + int heightHint = 0; + for (int i = 0; i < elements.length; ++i) { + if (i == separatorIndex) { + Label label = new Label(listComp, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.BORDER); + label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + } + listItems[i] = new ListItem(listComp, SWT.NONE, elements[i], i); + if (i < maxScrollBucket) { // this is how many visible by default + listItems[i].lazyInit(); + if (i == 0) { + heightHint = listItems[0].computeSize(SWT.DEFAULT, SWT.DEFAULT).y; + } + } else { + GridData gd = (GridData) listItems[i].getLayoutData(); + gd.heightHint = heightHint; + } + } + + Point listCompSize = listComp.computeSize(SWT.DEFAULT, SWT.DEFAULT); + listComp.setSize(listCompSize); + + if (hasActionArea()) + createActionArea(popup); + + Rectangle buttonBounds = getBounds(); + Point popupLocation = popup.getDisplay().map(this, null, 0, + buttonBounds.height); + popup.setLocation(popupLocation.x, popupLocation.y + 5); + + Point size = popup.computeSize(SWT.DEFAULT, SWT.DEFAULT); + Point buttonSize = getSize(); + size.x = Math.min(size.x + 16, buttonSize.x * 4 / 3); + size.y = Math.min(size.y, 250); + popup.setSize(size); + + popup.setVisible(true); + popup.setFocus(); + getDisplay().addFilter(SWT.FocusOut, focusOutListener); + getDisplay().addFilter(SWT.MouseUp, focusOutListener); + + popup.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + getDisplay().removeFilter(SWT.FocusOut, focusOutListener); + getDisplay().removeFilter(SWT.MouseUp, focusOutListener); + } + }); + selIndex = -1; + scrollBucket = 0; + if (hoverProvider != null) { + hoverProvider.dismissHover(selection != null ? selection : null, true); + } + } + + private void closePopup() { + arrowTransition.to(arrowMax); + popup.setVisible(false); + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + popup.dispose(); + } + }); + } + + TraverseListener listItemTraverseListener = new TraverseListener() { + @Override + public void keyTraversed(TraverseEvent e) { + final ListItem currItem = selIndex >=0 ? listItems[selIndex] : null; + if (currItem == null && e.keyCode != SWT.ARROW_DOWN) { + return; + } + if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_TAB_NEXT) { + if (inEditButton || e.keyCode == SWT.ARROW_DOWN) { + int maxIdx = listItems.length -1; + if (selIndex < maxIdx) { + inEditButton = false; + if (currItem != null) + currItem.setBackground(white); + // move to next item + selIndex++; + if (scrollBucket < maxScrollBucket) { + scrollBucket++; + } else { + // need to scroll the list up 1 item + int sY = listScrolled.getOrigin().y; + listScrolled.setOrigin(0, sY + itemH); + } + listItems[selIndex].setBackground(highlightColor); + } else if (selIndex == maxIdx && maxIdx > maxScrollBucket) { + // level the scroll for any offset at the bottom of the list + listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket +1)); + } + } else if (currItem.editButton != null) { + // move focus on edit button + inEditButton = true; + currItem.editButton.redraw(); + } + } else if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { + if (!inEditButton || e.keyCode == SWT.ARROW_UP) { + if (selIndex > 0) { + inEditButton = false; + currItem.setBackground(white); + // move to previous item + selIndex--; + if (scrollBucket > 0) { + scrollBucket--; + } else { + // need to scroll the list down 1 item + int sY = listScrolled.getOrigin().y; + listScrolled.setOrigin(0, sY - itemH); + } + listItems[selIndex].setBackground(highlightColor); + } else if (selIndex == 0) { + // level any offset @ beginning + listScrolled.setOrigin(0, 0); + } + } else if (currItem.editButton != null) { + // remove focus from edit button + inEditButton = false; + currItem.editButton.redraw(); + } + } else if (e.detail == SWT.TRAVERSE_RETURN) { + if (inEditButton) { + inEditButton = false; + // edit button in list item was pressed + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (CSelector.this.selection != null) + handleEdit(currItem.element); + } + }); + } else { + // list item was pressed + popup.dispose(); + setSelection(currItem.element); + fireSelectionChanged(); + } + } else if (e.detail == SWT.TRAVERSE_ESCAPE) { + popup.dispose(); + } + } + }; + + private class ListItem extends Composite { + protected final Object element; + private Label icon; + private Label label; + protected Control editButton; + private int index; + + public ListItem(Composite parent, int style, Object _element, int index) { + super(parent, style); + this.element = _element; + this.index = index; + + setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + + Point size = getSize(); + GC gc = e.gc; + gc.setForeground(outlineColor); + gc.drawLine(0, size.y - 1, size.x, size.y - 1); + if (label == null) + lazyInit(); + } + }); + + // lazyInit(); + } // end ListItem(..) + + protected void lazyInit() { + Image image = labelProvider.getImage(element); + boolean editable = isEditable(element); + + int columns = 1; + if (image != null) + columns++; + if (editable) + columns++; + + GridLayout layout = new GridLayout(columns, false); + layout.marginWidth = layout.marginHeight = 7; + setLayout(layout); + + MouseListener listItemMouseListener = new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + popup.dispose(); + setSelection(element); + fireSelectionChanged(); + } + }; + + MouseTrackListener listItemMouseTrackListener = new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + setBackground(highlightColor); + int idx = getIndex(); + if (idx != selIndex) { + if (selIndex >= 0) { + listItems[selIndex].setBackground(white); + scrollBucket = Math.max(Math.min(scrollBucket + idx - selIndex, maxScrollBucket), 0); + } else { // initially + scrollBucket = Math.min(idx, maxScrollBucket); + } + } + selIndex = idx; + } + + @Override + public void mouseExit(MouseEvent e) { + setBackground(white); + } + }; + + addMouseListener(listItemMouseListener); + addMouseTrackListener(listItemMouseTrackListener); + + if (image != null) { + icon = createImage(this, image); + icon.addMouseListener(listItemMouseListener); + icon.addMouseTrackListener(listItemMouseTrackListener); + } + + label = createLabel(this, element); + label.addMouseListener(listItemMouseListener); + label.addMouseTrackListener(listItemMouseTrackListener); + + if (editable) { + editButton = createEditButton(this, element); + editButton.setBackground(white); + editButton.addMouseTrackListener(listItemMouseTrackListener); + + editButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + // Need to run this after the current event storm + // Or we get a disposed error. + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (CSelector.this.selection != null) + handleEdit(element); + } + }); + } + }); + + editButton.addTraverseListener(listItemTraverseListener); + } else { + addTraverseListener(listItemTraverseListener); + } + + setBackground(white); + + layout(true); + } + + @Override + public void setBackground(Color color) { + super.setBackground(color); + + if (icon != null && !icon.isDisposed()) + icon.setBackground(color); + + if (!label.isDisposed()) + label.setBackground(color); + + if (editButton != null && !editButton.isDisposed()) + editButton.setBackground(color); + } + + public void setImage(Image image) { + if (icon != null && !icon.isDisposed()) + icon.setImage(image); + } + + public void setText(String text) { + if (!label.isDisposed()) + label.setText(text); + } + + protected int getIndex() { + return index; + } + } // end ListItem class + + private Label createImage(Composite parent, Image image) { + Rectangle bounds = image.getBounds(); + boolean disposeImage = false; + if (bounds.height > 16 || bounds.width > 16) { + buttonImage = new Image(getDisplay(), 16, 16); + GC gc = new GC(buttonImage); + gc.setAntialias(SWT.ON); + gc.setInterpolation(SWT.HIGH); + gc.drawImage(image, 0, 0, image.getBounds().width, + image.getBounds().height, 0, 0, 16, 16); + gc.dispose(); + image = buttonImage; + } + Label icon = new Label(parent, SWT.NONE); + icon.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); + icon.setImage(image); + if (disposeImage) { + final Image disposableImage = image; + icon.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + disposableImage.dispose(); + } + }); + } + return icon; + } + + private Label createLabel(Composite parent, Object element) { + Label label = new Label(parent, SWT.NONE); + label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); + label.setText(labelProvider.getText(element)); + label.setFont(getDisplay().getSystemFont()); + return label; + } + + private Control createEditButton(Composite parent, Object element) { + if (editImage == null) { + editImage = Activator.getImageDescriptor("icons/config_config.png").createImage(); + } + + final Canvas editButton = new Canvas(parent, SWT.NONE) { + @Override + public Point computeSize(int wHint, int hHint, boolean changed) { + Rectangle bounds = editImage.getBounds(); + return new Point(bounds.width, bounds.height); + }; + }; + + editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); + editButton.setToolTipText("Edit"); + + editButton.addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + gc.setAlpha(inEditButton ? 255 : 64); + gc.drawImage(editImage, 0, 0); + } + }); + + editButton.addMouseTrackListener(new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + inEditButton = true; + editButton.redraw(); + } + + @Override + public void mouseExit(MouseEvent e) { + inEditButton = false; + editButton.redraw(); + } + }); + + return editButton; + } + + public void setContentProvider(IStructuredContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + public IStructuredContentProvider getContentProvider() { + return contentProvider; + } + + public void setLabelProvider(ILabelProvider labelProvider) { + this.labelProvider = labelProvider; + } + + public ILabelProvider getLabelProvider() { + return labelProvider; + } + + public void setHoverProvider(IHoverProvider hoverProvider) { + this.hoverProvider = hoverProvider; + } + + public IHoverProvider getHoverProvider() { + return hoverProvider; + } + + public void setSorter(Comparator sorter) { + this.sorter = sorter; + } + + public void setInput(Object input) { + this.input = input; + } + + public Object getInput() { + return input; + } + + public void refresh() { + // TODO add any new ones to the popup if it's open + } + + public void update(Object element) { + if (selection == element) { + if (currentIcon != null && !currentIcon.isDisposed()) { + currentIcon.setImage(labelProvider.getImage(element)); + } + + if (currentLabel != null && !currentLabel.isDisposed()) { + currentLabel.setText(labelProvider.getText(element)); + } + } + + if (popup != null && !popup.isDisposed()) { + Object[] elements = contentProvider.getElements(input); + int i; + for (i = 0; i < elements.length; ++i) + if (element == elements[i]) + break; + + if (i != elements.length) { + listItems[i].setImage(labelProvider.getImage(element)); + listItems[i].setText(labelProvider.getText(element)); + } + } + } + + protected boolean hasActionArea() { + return false; + } + + protected void createActionArea(Composite parent) { + // empty + } + + protected boolean isEditable(Object element) { + return false; + } + + protected void handleEdit(Object element) { + // nothing to do here + } + + public int getSeparatorIndex() { + return separatorIndex; + } + + public void setSeparatorIndex(int separatorIndex) { + this.separatorIndex = separatorIndex; + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java new file mode 100644 index 00000000000..f50e84ce9fc --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import java.util.Arrays; +import java.util.Comparator; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.window.Window; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; +import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; +import org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog; +import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigWizard; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseTrackAdapter; +import org.eclipse.swt.events.MouseTrackListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; + +@SuppressWarnings("restriction") +public class ConfigSelector extends CSelector { + + private LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); + private DefaultDescriptorLabelProvider defaultProvider; + + private static final String[] noConfigs = new String[] { "No Launch Configurations" }; + private static final int SEPARATOR_INDEX = 3; + + public ConfigSelector(Composite parent, int style) { + super(parent, style); + + setToolTipText("Launch configuration"); + defaultProvider = new DefaultDescriptorLabelProvider(); + + setContentProvider(new IStructuredContentProvider() { + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + @Override + public void dispose() { + } + @Override + public Object[] getElements(Object inputElement) { + ILaunchDescriptor[] descs = uiManager.getManager().getLaunchDescriptors(); + if (descs.length > 0) { + if (descs.length > SEPARATOR_INDEX + 1) { + ILaunchDescriptor[] descsCopy = new ILaunchDescriptor[SEPARATOR_INDEX + descs.length]; + System.arraycopy(descs, 0, descsCopy, 0, SEPARATOR_INDEX); // copy first 3 elements + System.arraycopy(descs, 0, descsCopy, SEPARATOR_INDEX, descs.length); // copy all into rest + // sort rest + Arrays.sort(descsCopy, SEPARATOR_INDEX, descsCopy.length, new Comparator() { + @Override + public int compare(ILaunchDescriptor o1, ILaunchDescriptor o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + return descsCopy; + } else + return descs; + } + return noConfigs; + } + }); + + setLabelProvider(new LabelProvider() { + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchDescriptor) { + try { + ILaunchDescriptor configDesc = (ILaunchDescriptor)element; + ILabelProvider labelProvider = uiManager.getLabelProvider(configDesc); + if (labelProvider != null) { + Image img = labelProvider.getImage(element); + if (img != null) + return img; + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + return defaultProvider.getImage(element); + } + @Override + public String getText(Object element) { + if (element instanceof String) { + return (String)element; + } else if (element instanceof ILaunchDescriptor) { + try { + ILaunchDescriptor configDesc = (ILaunchDescriptor)element; + ILabelProvider labelProvider = uiManager.getLabelProvider(configDesc); + if (labelProvider != null) { + String text = labelProvider.getText(element); + if (text != null) + return text; + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + return defaultProvider.getText(element); + } + }); + // no sorter on view, data is sorted by provider + setSorter(null); + setSeparatorIndex(SEPARATOR_INDEX); + } + + @Override + protected void fireSelectionChanged() { + Object selected = getSelection(); + if (selected instanceof ILaunchDescriptor) { + ILaunchDescriptor configDesc = (ILaunchDescriptor) selected; + try { + uiManager.getManager().setActiveLaunchDescriptor(configDesc); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + } + + @Override + public boolean isEditable(Object element) { + return element instanceof ILaunchDescriptor; + } + + @Override + public void handleEdit(Object element) { + try { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + LaunchBarManager manager = uiManager.getManager(); + ILaunchDescriptor desc = (ILaunchDescriptor) element; + ILaunchMode mode = manager.getActiveLaunchMode(); + ILaunchTarget target = manager.getActiveLaunchTarget(); + if (target == null) { + MessageDialog.openError(shell, "No Active Target", "You must create a target to edit this launch configuration."); + return; + } + ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); + if (configType == null) { + MessageDialog.openError(shell, "No launch configuration type", "Cannot edit this configuration"); + return; + } + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); + if (groupExt != null) { + ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); + if (config == null) { + MessageDialog.openError(shell, "No launch configuration", "Cannot edit this configuration"); + return; + } + if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { + config = ((ILaunchConfigurationWorkingCopy) config).doSave(); + } + final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); + dialog.setInitialStatus(Status.OK_STATUS); + dialog.open(); + } + } catch (CoreException e2) { + Activator.log(e2); + } + } + + @Override + public boolean hasActionArea() { + return true; + } + + @Override + public void createActionArea(Composite parent) { + Composite actionArea = new Composite(parent, SWT.NONE); + GridLayout actionLayout = new GridLayout(); + actionLayout.marginWidth = actionLayout.marginHeight = 0; + actionArea.setLayout(actionLayout); + actionArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + final Composite createButton = new Composite(actionArea, SWT.NONE); + createButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + GridLayout buttonLayout = new GridLayout(); + buttonLayout.marginWidth = buttonLayout.marginHeight = 7; + createButton.setLayout(buttonLayout); + createButton.setBackground(white); + createButton.addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + Point size = createButton.getSize(); + GC gc = e.gc; + gc.setForeground(outlineColor); + gc.drawLine(0, 0, size.x, 0); + } + }); + + final Label createLabel = new Label(createButton, SWT.None); + createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + createLabel.setText("Create New Configuration..."); + createLabel.setBackground(white); + + MouseListener mouseListener = new MouseAdapter() { + public void mouseUp(org.eclipse.swt.events.MouseEvent e) { + final NewLaunchConfigWizard wizard = new NewLaunchConfigWizard(); + WizardDialog dialog = new WizardDialog(getShell(), wizard); + if (dialog.open() == Window.OK) { + new Job("Create Launch Configuration") { + protected IStatus run(IProgressMonitor monitor) { + try { + wizard.getWorkingCopy().doSave(); + ILaunchMode lm = wizard.getLaunchMode(); + uiManager.getManager().setActiveLaunchMode(lm); + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } + }; + }.schedule(); + } + } + }; + + createButton.addMouseListener(mouseListener); + createLabel.addMouseListener(mouseListener); + + MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + createButton.setBackground(highlightColor); + createLabel.setBackground(highlightColor); + } + @Override + public void mouseExit(MouseEvent e) { + createButton.setBackground(white); + createLabel.setBackground(white); + } + }; + createButton.addMouseTrackListener(mouseTrackListener); + createLabel.addMouseTrackListener(mouseTrackListener); + } + + @Override + public Point computeSize(int wHint, int hHint, boolean changed) { + return super.computeSize(250, hHint, changed); + } + + @Override + public void setSelection(Object element) { + if (element == null) + element = noConfigs[0]; + super.setSelection(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java new file mode 100644 index 00000000000..355bd32e501 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -0,0 +1,166 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; + +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +public class LaunchBarControl implements Listener { + + public static final String ID = "org.eclipse.launchbar"; //$NON-NLS-1$ + public static final String CLASS_URI = "bundleclass://" + Activator.PLUGIN_ID + "/" + LaunchBarControl.class.getName(); //$NON-NLS-1$ //$NON-NLS-2$ + + private LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); + + private ConfigSelector configSelector; + private ModeSelector modeSelector; + private TargetSelector targetSelector; + + @PostConstruct + public void createControl(Composite parent) { + manager.addListener(this); + + Composite container = new Composite(parent, SWT.NONE); + container.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + GridLayout layout = new GridLayout(7, false); + layout.marginHeight = 8; + layout.marginWidth = 8; + container.setLayout(layout); + container.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + LaunchBarControl.this.dispose(); + } + }); + + createButton(container, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + createButton(container, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); + createButton(container, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); + + modeSelector = new ModeSelector(container, SWT.NONE); + modeSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + modeSelector.setInput(manager); + + configSelector = new ConfigSelector(container, SWT.NONE); + configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + configSelector.setInput(manager); + + Label label = new Label(container, SWT.NONE); + label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + label.setText("on" + ":"); + + targetSelector = new TargetSelector(container, SWT.NONE); + targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + targetSelector.setInput(manager); + + ILaunchDescriptor configDesc = manager.getActiveLaunchDescriptor(); + configSelector.setSelection(configDesc == null ? null : configDesc); + + ILaunchMode mode = manager.getActiveLaunchMode(); + modeSelector.setSelection(mode == null ? null : mode); + + ILaunchTarget target = manager.getActiveLaunchTarget(); + targetSelector.setSelection(target == null ? null : target); + } + + @PreDestroy + public void dispose() { + manager.removeListener(this); + } + + private void createButton(Composite parent, String imageName, String toolTipText, final String command) { + CButton button = new CButton(parent, SWT.NONE); + button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); + Image srcImage = Activator.getDefault().getImage(imageName); + Image image = new Image(parent.getDisplay(), srcImage, SWT.IMAGE_COPY); + button.setHotImage(image); + button.setToolTipText(toolTipText); + button.addMouseListener(new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + Activator.runCommand(command); + } + }); + } + + @Override + public void activeLaunchDescriptorChanged() { + if (configSelector != null && !configSelector.isDisposed()) { + final ILaunchDescriptor configDesc = manager.getActiveLaunchDescriptor(); + configSelector.getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (!configSelector.isDisposed()) + configSelector.setSelection(configDesc == null ? null : configDesc); + } + }); + } + } + + @Override + public void activeLaunchModeChanged() { + if (modeSelector != null && !modeSelector.isDisposed()) { + final ILaunchMode mode = manager.getActiveLaunchMode(); + modeSelector.getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (!modeSelector.isDisposed()) + modeSelector.setSelection(mode == null ? null : mode); + } + }); + } + } + + @Override + public void activeLaunchTargetChanged() { + if (targetSelector != null && !targetSelector.isDisposed()) { + final ILaunchTarget target = manager.getActiveLaunchTarget(); + targetSelector.getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (!targetSelector.isDisposed()) + targetSelector.setSelection(target == null ? null : target); + } + }); + } + } + + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) { + // TODO Auto-generated method stub + + } + + @Override + public void launchTargetsChanged() { + // TODO Auto-generated method stub + + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java new file mode 100644 index 00000000000..da087b23b36 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -0,0 +1,173 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; + +@SuppressWarnings("restriction") +public class ModeSelector extends CSelector { + + private static final String[] noModes = new String[] { "---" }; + + private final LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); + + public ModeSelector(Composite parent, int style) { + super(parent, style); + + setToolTipText("Launch configuration"); + + setContentProvider(new IStructuredContentProvider() { + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + @Override + public void dispose() { + } + @Override + public Object[] getElements(Object inputElement) { + try { + ILaunchMode[] modes = manager.getLaunchModes(); + if (modes.length > 0) + return modes; + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + return noModes; + } + }); + + setLabelProvider(new LabelProvider() { + private Map images = new HashMap<>(); + @Override + public void dispose() { + super.dispose(); + for (Image image : images.values()) { + image.dispose(); + } + } + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchMode) { + ILaunchMode mode = (ILaunchMode) element; + try { + ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); + if (group != null) { + ImageDescriptor imageDesc = group.getImageDescriptor(); + Image image = images.get(imageDesc); + if (image == null) { + image = imageDesc.createImage(); + images.put(imageDesc, image); + } + return image; + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + return super.getImage(element); + } + @Override + public String getText(Object element) { + if (element instanceof ILaunchMode) { + ILaunchMode mode = (ILaunchMode) element; + try { + ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); + if (group != null) { + return group.getLabel().replace("&", ""); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + return super.getText(element); + } + }); + + setSorter(new Comparator() { + @Override + public int compare(Object o1, Object o2) { + if (o1 instanceof ILaunchMode && o2 instanceof ILaunchMode) { + String mode1 = ((ILaunchMode)o1).getIdentifier(); + String mode2 = ((ILaunchMode)o2).getIdentifier(); + // run comes first, then debug, then the rest + if (mode1.equals("run")) { + if (mode2.equals("run")) + return 0; + else + return -1; + } + if (mode2.equals("run")) + return 1; + if (mode1.equals("debug")) { + if (mode2.equals("debug")) + return 0; + else + return -1; + } + if (mode2.equals("debug")) + return 1; + } + return 0; + } + }); + } + + + protected ILaunchGroup getLaunchGroup(String mode) throws CoreException { + ILaunchConfigurationType type = manager.getLaunchConfigurationType(manager.getActiveLaunchDescriptor(), manager.getActiveLaunchTarget()); + if (type == null) + return null; + return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(type, mode); + } + + @Override + protected void fireSelectionChanged() { + Object selected = getSelection(); + if (selected instanceof ILaunchMode) { + ILaunchMode mode = (ILaunchMode) selected; + try { + manager.setActiveLaunchMode(mode); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + } + + @Override + public Point computeSize(int wHint, int hHint, boolean changed) { + return super.computeSize(150, hHint, changed); + } + + @Override + public void setSelection(Object element) { + if (element == null) + element = noModes[0]; + super.setSelection(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java new file mode 100644 index 00000000000..38b468b6b87 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -0,0 +1,255 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import java.util.Comparator; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.ui.IHoverProvider; +import org.eclipse.launchbar.ui.ILaunchBarUIConstants; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; +import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchTargetWizard; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseTrackAdapter; +import org.eclipse.swt.events.MouseTrackListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +public class TargetSelector extends CSelector { + + private final LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); + + private static final String[] noTargets = new String[] { "---" }; + + public TargetSelector(Composite parent, int style) { + super(parent, style); + + setContentProvider(new IStructuredContentProvider() { + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + @Override + public void dispose() { + } + + @Override + public Object[] getElements(Object inputElement) { + try { + ILaunchTarget[] targets = uiManager.getManager().getLaunchTargets(); + if (targets.length > 0) + return targets; + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + return noTargets; + } + }); + + setLabelProvider(new LabelProvider() { + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchTarget) { + try { + ILaunchTarget target = (ILaunchTarget) element; + ILabelProvider labelProvider = uiManager.getLabelProvider(target); + if (labelProvider != null) { + return labelProvider.getImage(element); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + return super.getImage(element); + } + + @Override + public String getText(Object element) { + if (element instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) element; + try { + ILabelProvider labelProvider = uiManager.getLabelProvider(target); + if (labelProvider != null) { + return labelProvider.getText(element); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + return target.getName(); + } + return super.getText(element); + } + }); + + setSorter(new Comparator() { + @Override + public int compare(Object o1, Object o2) { + // Sort by name + return 0; + } + }); + + setHoverProvider(new IHoverProvider() { + @Override + public boolean displayHover(Object element) { + if (element instanceof ILaunchTarget) { + try { + ILaunchTarget target = (ILaunchTarget) element; + IHoverProvider hoverProvider = uiManager.getHoverProvider(target); + if (hoverProvider != null) { + return hoverProvider.displayHover(element); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + return false; + } + + @Override + public void dismissHover(Object element, boolean immediate) { + if (element instanceof ILaunchTarget) { + try { + ILaunchTarget target = (ILaunchTarget) element; + IHoverProvider hoverProvider = uiManager.getHoverProvider(target); + if (hoverProvider != null) { + hoverProvider.dismissHover(element, immediate); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + } + }); + } + + @Override + public boolean isEditable(Object element) { + if (element instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) element; + return uiManager.getEditCommand(target) != null; + } + return false; + } + + @Override + public void handleEdit(Object element) { + if (element instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) element; + String commandId = uiManager.getEditCommand(target); + Activator.runCommand(commandId, ILaunchBarUIConstants.TARGET_NAME, target.getName()); + } + } + + @Override + public boolean hasActionArea() { + return !uiManager.getNewTargetWizards().isEmpty(); + } + + @Override + public void createActionArea(final Composite parent) { + Composite actionArea = new Composite(parent, SWT.NONE); + GridLayout actionLayout = new GridLayout(); + actionLayout.marginWidth = actionLayout.marginHeight = 0; + actionArea.setLayout(actionLayout); + actionArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + final Composite createButton = new Composite(actionArea, SWT.NONE); + createButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + GridLayout buttonLayout = new GridLayout(); + buttonLayout.marginWidth = buttonLayout.marginHeight = 7; + createButton.setLayout(buttonLayout); + createButton.setBackground(white); + createButton.addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + Point size = createButton.getSize(); + GC gc = e.gc; + gc.setForeground(outlineColor); + gc.drawLine(0, 0, size.x, 0); + } + }); + + final Label createLabel = new Label(createButton, SWT.None); + createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + createLabel.setText("Create New Target..."); + createLabel.setBackground(white); + + MouseListener mouseListener = new MouseAdapter() { + public void mouseUp(org.eclipse.swt.events.MouseEvent e) { + NewLaunchTargetWizard wizard = new NewLaunchTargetWizard(uiManager); + WizardDialog dialog = new WizardDialog(getShell(), wizard); + dialog.open(); + } + }; + + createButton.addMouseListener(mouseListener); + createLabel.addMouseListener(mouseListener); + + MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + createButton.setBackground(highlightColor); + createLabel.setBackground(highlightColor); + } + @Override + public void mouseExit(MouseEvent e) { + createButton.setBackground(white); + createLabel.setBackground(white); + } + }; + createButton.addMouseTrackListener(mouseTrackListener); + createLabel.addMouseTrackListener(mouseTrackListener); + } + + @Override + protected void fireSelectionChanged() { + Object selection = getSelection(); + if (selection instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) selection; + try { + uiManager.getManager().setActiveLaunchTarget(target); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + } + + @Override + public Point computeSize(int wHint, int hHint, boolean changed) { + return super.computeSize(200, hHint, changed); + } + + @Override + public void setSelection(Object element) { + if (element == null) + element = noTargets[0]; + super.setSelection(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java new file mode 100644 index 00000000000..63c01d0c2a8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; + +public class Transition implements Runnable { + + private final Control control; + private final int tick; + private int current; + private int to; + private int incr; + + public Transition(Control control, int current, int tick) { + this.control = control; + this.current = current; + this.tick = tick; + } + + @Override + public void run() { + current += incr; + if (!control.isDisposed()) + control.redraw(); + if (!done()) + Display.getCurrent().timerExec(tick, this); + } + + public void to(int to) { + if (current == to) + return; + + this.to = to; + this.incr = current > to ? -1 : 1; + Display.getCurrent().timerExec(tick, this); + } + + public int getCurrent() { + return current; + } + + public boolean done() { + return current == to; + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java new file mode 100644 index 00000000000..281cc8be798 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java @@ -0,0 +1,162 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; + +@SuppressWarnings("restriction") +public class LaunchConfigurationEditDialog extends LaunchConfigurationPropertiesDialog { + + private static final int DELETE_ID = 64; + private static final int DUPLICATE_ID = 65; + private static final int LAUNCH_ID = 66; + + public LaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group) { + super(shell, launchConfiguration, group); + } + + @Override + public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { + PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable); + } + + @Override + protected Control createButtonBar(Composite parent) { + // Clone super's implementation, removes the monitor since we don't run from here + // And adds in the left button bar. + Font font = parent.getFont(); + Composite composite = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); + layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); + layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); + layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + composite.setFont(font); + + // create help control if needed + if (isHelpAvailable()) { + createHelpControl(composite); + } + + Composite leftButtonComp = new Composite(composite, SWT.NULL); + layout = new GridLayout(); + layout.marginHeight = 0; + layout.marginWidth = 0; + layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); + layout.numColumns = 0; + leftButtonComp.setLayout(layout); + leftButtonComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + leftButtonComp.setFont(parent.getFont()); + + createButton(leftButtonComp, DELETE_ID, "Delete", false); + createButton(leftButtonComp, DUPLICATE_ID, "Duplicate", false); + createButton(leftButtonComp, LAUNCH_ID, "Launch", false); + + Composite mainButtonComp = new Composite(composite, SWT.NONE); + layout = new GridLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); + layout.numColumns = 0; + mainButtonComp.setLayout(layout); + mainButtonComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); + mainButtonComp.setFont(parent.getFont()); + + createButton(mainButtonComp, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); + createButton(mainButtonComp, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); + + return composite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + // Do nothing since we now have the buttons created above. + } + + @Override + public void launchConfigurationAdded(ILaunchConfiguration configuration) { + // update the dialog with the new config + getTabViewer().setInput(configuration); + } + + @Override + protected void buttonPressed(int buttonId) { + switch (buttonId) { + case DELETE_ID: + ILaunchConfiguration c = getLaunchConfiguration(); + if (c.isWorkingCopy()) + c = ((ILaunchConfigurationWorkingCopy)c).getOriginal(); + final ILaunchConfiguration config = c; + if (MessageDialog.openConfirm(getShell(), "Confirm Delete", + "Are you sure you want to delete " + config.getName())) { + new Job("Deleting launch configuration") { + protected IStatus run(IProgressMonitor monitor) { + try { + config.delete(); + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } + }; + }.schedule(); + cancelPressed(); + } + break; + case DUPLICATE_ID: + final ILaunchConfiguration original = getLaunchConfiguration(); + final String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(original.getName()); + new Job("Duplicating launch configuration") { + protected IStatus run(IProgressMonitor monitor) { + try { + ILaunchConfigurationWorkingCopy newWorkingCopy = original.copy(newName); + newWorkingCopy.doSave(); + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } + }; + }.schedule(); + break; + case LAUNCH_ID: + okPressed(); + Activator.runCommand(Activator.CMD_LAUNCH); + break; + default: + super.buttonPressed(buttonId); + } + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java new file mode 100644 index 00000000000..f17e4cf0b9f --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -0,0 +1,275 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.internal.core.LaunchManager; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.ui.ILaunchConfigurationTab; +import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.resource.ColorRegistry; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.custom.CTabItem; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +public class NewLaunchConfigEditPage extends WizardPage { + ILaunchConfigurationWorkingCopy workingCopy; + ILaunchConfigurationTabGroup tabGroup; + private Text nameText; + private CTabFolder tabFolder; + private LaunchConfigurationDialog launchConfigurationDialog = new LaunchConfigurationDialog(); + private LaunchConfigurationManager launchConfigurationMgr = DebugUIPlugin.getDefault().getLaunchConfigurationManager(); + + public NewLaunchConfigEditPage() { + super("NewLaunchConfigEditPage"); + setTitle("Launch Configuration Properties"); + setDescription("Edit the new launch configuration properties"); + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout(2, false)); + Label label = new Label(comp, SWT.NONE); + label.setLayoutData(new GridData()); + label.setText("Name:"); + nameText = new Text(comp, SWT.BORDER); + nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + ColorRegistry reg = JFaceResources.getColorRegistry(); + Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$ + c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$ + tabFolder = new CTabFolder(comp, SWT.BORDER | SWT.NO_REDRAW_RESIZE | SWT.FLAT); + GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); + gridData.horizontalSpan = 2; + tabFolder.setLayoutData(gridData); + tabFolder.setSimple(false); + tabFolder.setSelectionBackground(new Color[] { c1, c2 }, new int[] { 100 }, true); + tabFolder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$ + + setControl(comp); + nameText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + String name = nameText.getText().trim(); + workingCopy.rename(name); + + String errMessage = checkName(name); + if (errMessage == null) { + validateFields(); + } else { + setErrorMessage(errMessage); + } + } + }); + validateFields(); + } + + private String checkName(String name) { + try { + if (name.isEmpty()) { + return "Name can not be empty"; + } + + ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); + if (manager.isExistingLaunchConfigurationName(name)) { + ILaunchConfiguration config = ((LaunchManager) manager).findLaunchConfiguration(name); + if (config != workingCopy.getOriginal()) { + return ("A configuration with this name already exists"); + } + } + } catch (Exception e) { + Activator.log(e); + return (e.getLocalizedMessage()); + } + return null; + } + + + void changeLaunchConfigType(ILaunchConfigurationType type) { + if (type == null) + return; + try { + String initialMode = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); + workingCopy = type.newInstance(null, "New Configuration"); + tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, initialMode); + for (CTabItem item : tabFolder.getItems()) + item.dispose(); + tabGroup.createTabs(launchConfigurationDialog, initialMode); + boolean firstTab = true; + for (ILaunchConfigurationTab tab : tabGroup.getTabs()) { + tab.setLaunchConfigurationDialog(launchConfigurationDialog); + tab.createControl(tabFolder); + tab.setDefaults(workingCopy); + if (firstTab) { + firstTab = false; + } + } + + // Do this after all the tabs have their controls created + for (ILaunchConfigurationTab tab : tabGroup.getTabs()) { + tab.initializeFrom(workingCopy); + + CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); + tabItem.setText(tab.getName()); + tabItem.setImage(!tab.isValid(workingCopy) && tab.getErrorMessage() != null ? + launchConfigurationMgr.getErrorTabImage(tab) : tab.getImage()); + tabItem.setControl(tab.getControl()); + } + + // Clean up any created configs before we set the name and trigger + // any validation + ((NewLaunchConfigWizard) getWizard()).cleanUpConfigs(); + + tabFolder.setSelection(0); + nameText.setText(workingCopy.getName()); + } catch (CoreException e) { + Activator.log(e); + return; + } + } + + boolean performFinish() { + if (workingCopy == null) + return false; + for (ILaunchConfigurationTab tab : tabGroup.getTabs()) + tab.performApply(workingCopy); + return true; + } + + public void validateFields() { + if (workingCopy == null) + return; + String message = null; + String old_msg = getErrorMessage(); + setErrorMessage(null); + message = checkName(workingCopy.getName()); + if (message == null) { + ILaunchConfigurationTab[] tabs = tabGroup.getTabs(); + int tLen = tabs.length; + int tfLen = tabFolder.getItems().length; + for (int i = 0; i < tLen; i++) { + ILaunchConfigurationTab tab = tabs[i]; + try { + tab.isValid(workingCopy); + message = tab.getErrorMessage(); + } catch (Exception e) { + // if createControl hasn't been called yet can throw exception.. + // like the NPE issue in CTestingTab + message = e.getMessage(); + } + // this is similar to what LaunchConfigurationTabGroupViewer.refresh() does, which is not available in this case + if (tLen == tfLen && + (old_msg == null && message != null || old_msg != null && message == null)) { + CTabItem item = tabFolder.getItem(i); + if (item != null) { + item.setImage(message != null ? launchConfigurationMgr.getErrorTabImage(tab) + : tab.getImage()); + } + } + if (message != null) { + break; + } + } + } + setErrorMessage(message); + if (getErrorMessage() != null) { + setPageComplete(false); + } else { + setPageComplete(true); + } + } + + private class LaunchConfigurationDialog implements ILaunchConfigurationDialog { + @Override + public void run(boolean fork, boolean cancelable, + IRunnableWithProgress runnable) + throws InvocationTargetException, InterruptedException { + // TODO Auto-generated method stub + } + + @Override + public void updateButtons() { + } + + @Override + public void updateMessage() { + validateFields(); + } + + @Override + public void setName(String name) { + // TODO Auto-generated method stub + } + + @Override + public String generateName(String name) { + if (name == null) + return ""; + return DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(name); + } + + @Override + public ILaunchConfigurationTab[] getTabs() { + return tabGroup.getTabs(); + } + + @Override + public ILaunchConfigurationTab getActiveTab() { + int i = tabFolder.getSelectionIndex(); + return tabGroup.getTabs()[i]; + } + + @Override + public String getMode() { + return ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); + } + + @Override + public void setActiveTab(ILaunchConfigurationTab tab) { + ILaunchConfigurationTab[] tabs = tabGroup.getTabs(); + int tLen = tabs.length; + for (int i = 0; i < tLen; i++) { + ILaunchConfigurationTab tabi = tabs[i]; + if (tabi.equals(tab)) { + setActiveTab(i); + break; + } + } + } + + @Override + public void setActiveTab(int index) { + tabFolder.setSelection(index); + } + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java new file mode 100644 index 00000000000..20c6e7a2760 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; + +public class NewLaunchConfigModePage extends WizardPage { + + private Table table; + ILaunchGroup selectedGroup; + + public NewLaunchConfigModePage() { + super("Select Initial Launch Mode"); + setTitle("Initial Launch Mode"); + setDescription("Select initial launch mode."); + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout(1, false)); + + table = new Table(comp, SWT.SINGLE | SWT.BORDER); + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + table.setLayoutData(data); + + Set done = new HashSet<>(); + + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { + if (group.getMode().equals("run")) { + createModeItem(group); + done.add(group); + } + } + + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { + if (group.getMode().equals("debug")) { + createModeItem(group); + done.add(group); + } + } + + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { + if (!done.contains(group)) { + createModeItem(group); + } + } + + if (table.getItemCount() > 0) { + // Select debug as default + int i = 0; + boolean hasDebug = false; + for (TableItem item : table.getItems()) { + if ("debug".equals(((ILaunchGroup) item.getData()).getMode())) { + hasDebug = true; + table.select(i); + break; + } + i++; + } + + if (!hasDebug) { + table.select(0); + } + selectedGroup = (ILaunchGroup) table.getSelection()[0].getData(); + } + + table.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + selectedGroup = (ILaunchGroup)table.getSelection()[0].getData(); + ((NewLaunchConfigWizard)getWizard()).typePage.populateItems(); + } + }); + + setControl(comp); + } + + private void createModeItem(ILaunchGroup group) { + if (group.getCategory() != null || !group.isPublic()) + return; + + TableItem item = new TableItem(table, SWT.NONE); + item.setText(group.getLabel().replace("&", "")); + ImageDescriptor imageDesc = group.getImageDescriptor(); + if (imageDesc != null) { + item.setImage(imageDesc.createImage()); + } + item.setData(group); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java new file mode 100644 index 00000000000..af37da741c7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; + +public class NewLaunchConfigTypePage extends WizardPage { + + private Table table; + + public NewLaunchConfigTypePage() { + super("Select Launch Configuration Type"); + setTitle("Launch Configuration Type"); + setDescription("Select the type of launch configuration to create."); + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout(1, false)); + + table = new Table(comp, SWT.SINGLE | SWT.BORDER); + GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); + data.heightHint = 500; + table.setLayoutData(data); + + populateItems(); + + setControl(comp); + } + + void populateItems() { + ILaunchGroup group = ((NewLaunchConfigWizard)getWizard()).modePage.selectedGroup; + if (group == null) + return; + + table.removeAll(); + + boolean haveItems = false; + for (ILaunchConfigurationType type : DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes()) { + if (!type.isPublic() || type.getCategory() != null || !type.supportsMode(group.getMode())) + continue; + + haveItems = true; + TableItem item = new TableItem(table, SWT.NONE); + item.setText(type.getName()); + ImageDescriptor imageDesc = DebugUITools.getDefaultImageDescriptor(type); + if (imageDesc != null) + item.setImage(imageDesc.createImage()); + item.setData(type); + } + + if (haveItems) { + table.select(0); + } + setPageComplete(haveItems); + } + + @Override + public boolean canFlipToNextPage() { + return isPageComplete(); + } + + @Override + public IWizardPage getNextPage() { + ILaunchConfigurationType type = (ILaunchConfigurationType)table.getSelection()[0].getData(); + NewLaunchConfigEditPage editPage = ((NewLaunchConfigWizard)getWizard()).editPage; + editPage.changeLaunchConfigType(type); + return editPage; + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java new file mode 100644 index 00000000000..29bbe5fdfaf --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationListener; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.launchbar.ui.internal.Activator; + +public class NewLaunchConfigWizard extends Wizard implements ILaunchConfigurationListener { + + NewLaunchConfigModePage modePage = new NewLaunchConfigModePage(); + NewLaunchConfigTypePage typePage = new NewLaunchConfigTypePage(); + NewLaunchConfigEditPage editPage = new NewLaunchConfigEditPage(); + + private List configsToDelete = new ArrayList<>(); + + public NewLaunchConfigWizard() { + setWindowTitle("Create Launch Configuration"); + initListeners(); + } + + @Override + public void addPages() { + addPage(modePage); + addPage(typePage); + addPage(editPage); + } + + public ILaunchConfigurationWorkingCopy getWorkingCopy() { + return editPage.workingCopy; + } + + public ILaunchMode getLaunchMode() { + String initMode = modePage.selectedGroup.getMode(); + return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(initMode); + } + + @Override + public boolean performFinish() { + cleanUpConfigs(); + return editPage.performFinish(); + } + + @Override + public boolean performCancel() { + cleanUpConfigs(); + return super.performCancel(); + } + + private void initListeners() { + // while the wizard is open, some ill behaved launch config tabs save the working copy. + // We need to make sure those saves are deleted when the dialog is finished. + // We also need to turn off listening in the tool bar manager so that we don't treat these + // as real launch configs. + DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this); + } + + void cleanUpConfigs() { + DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this); + for (ILaunchConfiguration config : configsToDelete) { + try { + config.delete(); + } catch (CoreException e) { + Activator.log(e); + } + } + } + + @Override + public void launchConfigurationAdded(ILaunchConfiguration configuration) { + if (!configuration.isWorkingCopy()) + configsToDelete.add(configuration); + } + + @Override + public void launchConfigurationChanged(ILaunchConfiguration configuration) { + // Nothing to do + } + + @Override + public void launchConfigurationRemoved(ILaunchConfiguration configuration) { + if (!configuration.isWorkingCopy()) + configsToDelete.remove(configuration); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java new file mode 100644 index 00000000000..86cca279a66 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java @@ -0,0 +1,92 @@ +package org.eclipse.launchbar.ui.internal.dialogs; + +import java.util.Map.Entry; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.core.ILaunchTargetType; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.internal.ExecutableExtension; +import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.PlatformUI; + +public class NewLaunchTargetTypePage extends WizardPage { + + private final LaunchBarUIManager uiManager; + private Table table; + private ExecutableExtension currentExtension; + private INewWizard nextWizard; + + public NewLaunchTargetTypePage(LaunchBarUIManager uiManager) { + super("NewLaunchTargetTypePage"); + setTitle("Launch Target Type"); + setDescription("Select type of launch target to create."); + this.uiManager = uiManager; + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout()); + + table = new Table(comp, SWT.SINGLE | SWT.BORDER); + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + table.setLayoutData(data); + + setPageComplete(false); + for (Entry> entry : uiManager.getNewTargetWizards().entrySet()) { + TableItem item = new TableItem(table, SWT.NONE); + ILaunchTargetType targetType = entry.getKey(); + item.setText(uiManager.getTargetTypeName(targetType)); + Image icon = uiManager.getTargetTypeIcon(targetType); + if (icon != null) { + item.setImage(icon); + } + item.setData(entry.getValue()); + table.select(0); + setPageComplete(true); + } + + setControl(comp); + } + + @Override + public boolean canFlipToNextPage() { + return isPageComplete(); + } + + @Override + public IWizardPage getNextPage() { + @SuppressWarnings("unchecked") + ExecutableExtension extension = (ExecutableExtension) table.getSelection()[0].getData(); + if (extension != currentExtension) { + try { + nextWizard = extension.create(); + nextWizard.init(PlatformUI.getWorkbench(), null); + nextWizard.addPages(); + currentExtension = extension; + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } + + if (nextWizard != null) { + IWizardPage [] pages = nextWizard.getPages(); + if (pages.length > 0) { + return pages[0]; + } + } + + return super.getNextPage(); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java new file mode 100644 index 00000000000..55ca6be46d4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; + +public class NewLaunchTargetWizard extends Wizard { + + private final NewLaunchTargetTypePage typePage; + + public NewLaunchTargetWizard(LaunchBarUIManager uiManager) { + setWindowTitle("Launch Target Type"); + typePage = new NewLaunchTargetTypePage(uiManager); + setForcePreviousAndNextButtons(true); + } + + @Override + public void addPages() { + addPage(typePage); + } + + @Override + public boolean performFinish() { + return true; + } + + @Override + public boolean canFinish() { + // Need to move onto the new target wizard + return false; + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties new file mode 100644 index 00000000000..52dfb3cfd9c --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -0,0 +1,3 @@ +LaunchBarControl_Build=Build +LaunchBarControl_Launch=Launch +LaunchBarControl_Stop=Stop diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java new file mode 100644 index 00000000000..3b20c60d84c --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.targetsView; + +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.window.SameShellProvider; +import org.eclipse.ui.dialogs.PropertyDialogAction; +import org.eclipse.ui.navigator.CommonActionProvider; + +public class LaunchTargetsActionProvider extends CommonActionProvider { + + @Override + public void fillContextMenu(IMenuManager menu) { + menu.add(new PropertyDialogAction(new SameShellProvider(getActionSite().getViewSite().getShell()), + getActionSite().getStructuredViewer())); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java new file mode 100644 index 00000000000..8fe4a8ff3d4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.targetsView; + +import java.util.Arrays; +import java.util.Comparator; + +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.internal.LaunchBarManager; + +public class LaunchTargetsContentProvider implements ITreeContentProvider { + + private LaunchBarManager manager; + + @Override + public Object[] getElements(Object inputElement) { + if (inputElement instanceof LaunchBarManager) { + ILaunchTarget[] targets = ((LaunchBarManager) inputElement).getAllLaunchTargets(); + Arrays.sort(targets, new Comparator() { + @Override + public int compare(ILaunchTarget o1, ILaunchTarget o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + return targets; + } + return null; + } + + @Override + public Object[] getChildren(Object parentElement) { + return new Object[0]; + } + + @Override + public Object getParent(Object element) { + if (element instanceof ILaunchTarget) { + return manager; + } + return null; + } + + @Override + public boolean hasChildren(Object element) { + if (element instanceof LaunchBarManager) + return true; + else if (element instanceof ILaunchTarget) + return false; + return false; + } + + @Override + public void dispose() { + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + if (newInput instanceof LaunchBarManager) { + manager = (LaunchBarManager) newInput; + } + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java new file mode 100644 index 00000000000..2a067b429d3 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.targetsView; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.swt.graphics.Image; + +public class LaunchTargetsLabelProvider extends LabelProvider { + + @Override + public Image getImage(Object element) { + return super.getImage(element); + } + + @Override + public String getText(Object element) { + if (element instanceof ILaunchTarget) { + return ((ILaunchTarget) element).getName(); + } + return super.getText(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java new file mode 100644 index 00000000000..b45f1f39516 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.targetsView; + +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; +import org.eclipse.ui.navigator.CommonNavigator; + +public class LaunchTargetsNavigator extends CommonNavigator { + + private final LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); + + public LaunchTargetsNavigator() { + uiManager.getManager().addListener(new LaunchBarManager.Listener() { + @Override + public void launchTargetsChanged() { + getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + getCommonViewer().refresh(); + } + }); + } + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) { + } + @Override + public void activeLaunchTargetChanged() { + } + @Override + public void activeLaunchModeChanged() { + } + @Override + public void activeLaunchDescriptorChanged() { + } + }); + + } + + @Override + protected Object getInitialInput() { + return uiManager.getManager(); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java new file mode 100644 index 00000000000..315f13b1830 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.targetsView; + +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.PropertyPage; + +public class TargetPropertyPage extends PropertyPage { + + private Text nameText; + + @Override + protected Control createContents(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(2, false); + comp.setLayout(layout); + + ILaunchTarget target = (ILaunchTarget) getElement().getAdapter(ILaunchTarget.class); + + Label nameLabel = new Label(comp, SWT.NONE); + nameLabel.setText("Target Name:"); + + nameText = new Text(comp, SWT.BORDER); + nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + nameText.setText(target.getName()); + + return comp; + } + + @Override + public boolean performOk() { + System.out.println("Would change name to " + nameText.getText()); + return true; + } + +} diff --git a/features/org.eclipse.launchbar/.project b/features/org.eclipse.launchbar/.project new file mode 100644 index 00000000000..f852f2b73be --- /dev/null +++ b/features/org.eclipse.launchbar/.project @@ -0,0 +1,24 @@ + + + org.eclipse.launchbar-feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + + + parent-pom.xml + 1 + PARENT-2-PROJECT_LOC/pom.xml + + + diff --git a/features/org.eclipse.launchbar/build.properties b/features/org.eclipse.launchbar/build.properties new file mode 100644 index 00000000000..6c8e6da2e2e --- /dev/null +++ b/features/org.eclipse.launchbar/build.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2014 QNX 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: +# QNX - initial API and implementation +############################################################################### +bin.includes = feature.xml,\ + feature.properties diff --git a/features/org.eclipse.launchbar/feature.properties b/features/org.eclipse.launchbar/feature.properties new file mode 100644 index 00000000000..414020faabc --- /dev/null +++ b/features/org.eclipse.launchbar/feature.properties @@ -0,0 +1,33 @@ +############################################################################### +# Copyright (c) 2005, 2010 IBM Corporation 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: +# IBM Corporation - initial API and implementation +############################################################################### +# features.properties +# contains externalized strings for feature.xml +# "%foo" in feature.xml corresponds to the key "foo" in this file +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file should be translated. + +# "featureName" property - name of the feature +featureName=LaunchBar + +# "providerName" property - name of the company that provides the feature +providerName=Eclipse CDT + +# "description" property - description of the feature +description=A Tool Control that sits in the TOP trim bar that controls build and launch. + +# copyright +copyright=\ +Copyright (c) 2014 QNX Software Systems and others\n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html + diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml new file mode 100644 index 00000000000..0e845c9f992 --- /dev/null +++ b/features/org.eclipse.launchbar/feature.xml @@ -0,0 +1,36 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml new file mode 100644 index 00000000000..7ee094fdfe7 --- /dev/null +++ b/features/org.eclipse.launchbar/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.features + org.eclipse.launchbar + 8.5.0-SNAPSHOT + + eclipse-feature + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000000..9e90803f60f --- /dev/null +++ b/pom.xml @@ -0,0 +1,353 @@ + + + 4.0.0 + + + 3.0.5 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + pom + + + 0.22.0 + 0.22.0 + jacoco + reuseReports + ${project.basedir}/../../target/jacoco.exec + cdt-e4.4 + http://download.eclipse.org/eclipse/updates/4.4 + + + + + Eclipse Public License v1.0 + + 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.htm + + + + + + bundles/org.eclipse.launchbar.core + bundles/org.eclipse.launchbar.ui + + + + + cbi + https://repo.eclipse.org/content/repositories/cbi-releases/ + + + + + cdtRepo + + + cdt.repo + ${cdt-site} + p2 + + + + + macosx + + + mac + + + + -XstartOnFirstThread + + + + other-os + + + !mac + + + + + + + + production + + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + false + + + + org.eclipse.tycho.extras + tycho-pack200a-plugin + ${tycho-version} + + + pack200-normalize + + normalize + + verify + + + + + org.eclipse.cbi.maven.plugins + eclipse-jarsigner-plugin + 1.1.1 + + + sign + verify + + sign + + + + + + org.eclipse.tycho.extras + tycho-pack200b-plugin + ${tycho-version} + + + pack200-pack + + pack + + verify + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + p2-metadata + + p2-metadata + + verify + + + + false + + + + + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + p2 + consider + + + linux + gtk + x86 + + + linux + gtk + x86_64 + + + linux + gtk + ppc64 + + + win32 + win32 + x86 + + + win32 + win32 + x86_64 + + + macosx + cocoa + x86 + + + macosx + cocoa + x86_64 + + + aix + gtk + ppc + + + solaris + gtk + sparc + + + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + UTF-8 + + + + attach-source + + plugin-source + + + + + + + + + org.eclipse.tycho + tycho-compiler-plugin + ${tycho-version} + + UTF-8 + + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + plugin-source + + plugin-source + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.4.1 + + ISO-8859-1 + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + org.codehaus.mojo + findbugs-maven-plugin + 2.3.2 + + true + false + + + + + check + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 2.5 + + utf-8 + 100 + 1.6 + xml + false + + + + + cpd-check + + + + + + org.eclipse.tycho.extras + tycho-eclipserun-plugin + ${tycho-extras-version} + + -application org.eclipse.ant.core.antRunner -buildfile customBuildCallbacks.xml build.index + + + org.apache.ant + eclipse-plugin + + + org.eclipse.help.base + eclipse-plugin + + + org.eclipse.ant.core + eclipse-plugin + + + + + + platform + p2 + ${help-docs-eclipserun-repo} + + + + + + + eclipse-run + + compile + + + + + + + diff --git a/tests/org.eclipse.launchbar.core.tests/.classpath b/tests/org.eclipse.launchbar.core.tests/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/org.eclipse.launchbar.core.tests/.project b/tests/org.eclipse.launchbar.core.tests/.project new file mode 100644 index 00000000000..b553de43630 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..5879f5a2dc7 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Launch Bar Core Tests +Bundle-SymbolicName: org.eclipse.launchbar.core.tests +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.launchbar.core.tests.Activator +Require-Bundle: org.eclipse.core.runtime, + org.junit;bundle-version="4.11.0", + org.mockito, + org.eclipse.launchbar.core;bundle-version="1.0.0", + org.eclipse.debug.core, + org.eclipse.core.filesystem, + org.hamcrest.core +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Export-Package: org.eclipse.launchbar.core.tests diff --git a/tests/org.eclipse.launchbar.core.tests/about.html b/tests/org.eclipse.launchbar.core.tests/about.html new file mode 100644 index 00000000000..d7c511887d6 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/about.html @@ -0,0 +1,24 @@ + + +About + + +

About This Content

+ +

June 22, 2007

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + \ No newline at end of file diff --git a/tests/org.eclipse.launchbar.core.tests/build.properties b/tests/org.eclipse.launchbar.core.tests/build.properties new file mode 100644 index 00000000000..34d2e4d2dad --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml new file mode 100644 index 00000000000..fdc0bfe274d --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.core.tests + 1.0.0-SNAPSHOT + + eclipse-test-plugin + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + + true + ${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m + -Xmx512m -XX:MaxPermSize=256M + + **/AutomatedIntegrationSuite.* + + true + + + org.eclipse.platform.feature.group + p2-installable-unit + + + + + + + diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java new file mode 100644 index 00000000000..0baf820665f --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -0,0 +1,832 @@ +/******************************************************************************* +> * Copyright (c) 2014 QNX Software Systems. All Rights Reserved. + * + * You must obtain a written license from and pay applicable license fees to QNX + * Software Systems before you may reproduce, modify or distribute this software, + * or any work that includes all or part of this software. Free development + * licenses are available for evaluation and non-commercial purposes. For more + * information visit [http://licensing.qnx.com] or email licensing@qnx.com. + * + * This file may contain contributions from others. Please review this entire + * file for other proprietary rights or license notices, as well as the QNX + * Development Suite License Guide at [http://licensing.qnx.com/license-guide/] + * for other information. + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import static org.junit.Assert.assertNotEquals; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import java.util.ArrayList; +import java.util.List; + +import junit.framework.TestCase; + +import org.eclipse.core.internal.preferences.EclipsePreferences; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchDescriptorType; +import org.eclipse.launchbar.core.ILaunchObjectProvider; +import org.eclipse.launchbar.core.ILaunchTarget; +import org.eclipse.launchbar.core.ILaunchTargetType; +import org.eclipse.launchbar.core.LaunchConfigurationProvider; +import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.internal.LocalTargetType; +import org.eclipse.launchbar.core.internal.Pair; +import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; +import org.junit.Test; + +/** + * @author elaskavaia + * + */ +public class LaunchBarManagerTest extends TestCase { + + // default type ids + private static final String DEFAULT_CONFIG_TYPE_ID = "configType.test"; + private static final String DEFAULT_TARGET_TYPE_ID = "targetType.test"; + private static final String DEFAULT_DESCRIPTOR_TYPE_ID = "descriptorType.test"; + + private IEclipsePreferences prefs; + private ILaunchManager launchManager; + + public class TestLaunchBarManager extends LaunchBarManager { + private ILaunchMode[] defaultLaunchModes; + boolean done; + + public TestLaunchBarManager() throws CoreException { + super(); + // For the tests, need to wait until the init is done + synchronized (this) { + while (!done) { + try { + wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } + + @Override + public void init() throws CoreException { + super.init(); + synchronized (this) { + done = true; + notify(); + } + } + + @Override + public IExtensionPoint getExtensionPoint() throws CoreException { + // default things + IExtensionPoint point = mock(IExtensionPoint.class); + + IExtension extension = mock(IExtension.class); + doReturn(new IExtension[] { extension }).when(point).getExtensions(); + + List elements = new ArrayList<>(); + + IConfigurationElement element; + + // The local target + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("targetType").when(element).getName(); + doReturn(LocalTargetType.ID).when(element).getAttribute("id"); + doReturn(new LocalTargetType()).when(element).createExecutableExtension("class"); + + // Test targets + for (TestLaunchTargetType targetType : getTestTargetTypes()) { + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("targetType").when(element).getName(); + doReturn(targetType.id).when(element).getAttribute("id"); + doReturn(targetType).when(element).createExecutableExtension("class"); + } + + // Test descriptors + for (TestLaunchDescriptorType descType : getTestDescriptorTypes()) { + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("descriptorType").when(element).getName(); + doReturn(descType.id).when(element).getAttribute("id"); + doReturn(Integer.toString(descType.priority)).when(element).getAttribute("priority"); + doReturn(descType).when(element).createExecutableExtension("class"); + } + + // Test config types + for (TestLaunchConfigurationProvider provider : getTestConfigProviders()) { + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("configType").when(element).getName(); + doReturn(provider.descTypeId).when(element).getAttribute("descriptorType"); + doReturn(provider.targetTypeId).when(element).getAttribute("targetType"); + doReturn(provider.configType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); + doReturn(Boolean.toString(provider.isDefault)).when(element).getAttribute("isDefault"); + + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("configProvider").when(element).getName(); + doReturn(provider.configType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); + doReturn(provider).when(element).createExecutableExtension("class"); + } + + // test object providers + for (TestLaunchObjectProvider objectProvider : getTestObjectProviders()) { + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("objectProvider").when(element).getName(); + doReturn(objectProvider).when(element).createExecutableExtension("class"); + } + + doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); + + return point; + } + + protected TestLaunchTargetType[] getTestTargetTypes() { + return new TestLaunchTargetType[] { + new TestLaunchTargetType(DEFAULT_TARGET_TYPE_ID) + }; + } + + protected TestLaunchDescriptorType[] getTestDescriptorTypes() { + return new TestLaunchDescriptorType[] { + new TestLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID, 5) + }; + } + + protected TestLaunchConfigurationProvider[] getTestConfigProviders() { + ILaunchConfigurationType configType = mockLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + return new TestLaunchConfigurationProvider[] { + new TestLaunchConfigurationProvider(DEFAULT_DESCRIPTOR_TYPE_ID, DEFAULT_TARGET_TYPE_ID, configType, true, this) + }; + } + + protected TestLaunchObjectProvider[] getTestObjectProviders() { + return new TestLaunchObjectProvider[0]; + } + + @Override + protected ILaunchManager getLaunchManager() { + return launchManager; + } + + @Override + protected IEclipsePreferences getPreferenceStore() { + return prefs; + } + }; + + public static class TestLaunchTargetType implements ILaunchTargetType { + final String id; + + public TestLaunchTargetType(String id) { + this.id = id; + } + + @Override + public void init(ILaunchBarManager manager) throws CoreException { + // override if you want to add targets + } + + @Override + public void dispose() { + } + } + + public static class TestLaunchTarget extends PlatformObject implements ILaunchTarget { + private ILaunchTargetType type; + private String name; + + public TestLaunchTarget(String name, ILaunchTargetType type) { + this.name = name; + this.type = type; + } + + public ILaunchTargetType getType() { + return type; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setActive(boolean active) { + } + } + + public static class TestLaunchObject { + final String name; + final ILaunchDescriptorType descType; + + public TestLaunchObject(String name, ILaunchDescriptorType descType) { + this.name = name; + this.descType = descType; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof TestLaunchObject) { + return name.equals(((TestLaunchObject) obj).name); + } + return super.equals(obj); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + } + + public static class TestLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { + private final TestLaunchObject object; + private final TestLaunchDescriptorType type; + + public TestLaunchDescriptor(TestLaunchDescriptorType type, TestLaunchObject object) { + this.object = object; + this.type = type; + } + + @Override + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + if (TestLaunchObject.class.equals(adapter)) { + return object; + } + return super.getAdapter(adapter); + } + + @Override + public String getName() { + return object.name; + } + + @Override + public ILaunchDescriptorType getType() { + return type; + } + } + + public static class TestLaunchDescriptorType implements ILaunchDescriptorType { + final String id; + final int priority; + + public TestLaunchDescriptorType(String id, int priority) { + this.id = id; + this.priority = priority; + } + + @Override + public boolean ownsLaunchObject(Object launchObject) throws CoreException { + if (!(launchObject instanceof TestLaunchObject)) { + return false; + } + return ((TestLaunchObject) launchObject).descType.equals(this); + } + + @Override + public ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException { + return new TestLaunchDescriptor(this, (TestLaunchObject) launchObject); + } + } + + public static class TestLaunchConfigurationProvider extends LaunchConfigurationProvider { + final String descTypeId; + final String targetTypeId; + final ILaunchConfigurationType configType; + final boolean isDefault; + final LaunchBarManager manager; + + private static final String OBJECT_NAME = "testObject.objectName"; + private static final String DESC_TYPE = "testObject.descType"; + + public TestLaunchConfigurationProvider(String descTypeId, String targetTypeId, ILaunchConfigurationType configType, boolean isDefault, LaunchBarManager manager) { + this.descTypeId = descTypeId; + this.targetTypeId = targetTypeId; + this.configType = configType; + this.isDefault = isDefault; + this.manager = manager; + } + + @Override + public ILaunchConfigurationType getLaunchConfigurationType() throws CoreException { + return configType; + } + + @Override + public ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException { + String name = launchManager.generateLaunchConfigurationName(getConfigurationName(descriptor)); + ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfigurationType().newInstance(null, name); + doReturn(name).when(workingCopy).getAttribute(ORIGINAL_NAME, ""); + + TestLaunchObject launchObject = (TestLaunchObject) descriptor.getAdapter(TestLaunchObject.class); + doReturn(launchObject.name).when(workingCopy).getAttribute(OBJECT_NAME, ""); + doReturn(manager.getDescriptorTypeId(launchObject.descType)).when(workingCopy).getAttribute(DESC_TYPE, ""); + return workingCopy.doSave(); + } + + @Override + protected void populateConfiguration(ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor) throws CoreException { + super.populateConfiguration(workingCopy, descriptor); + + } + + @Override + public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + if (ownsConfiguration(configuration)) { + String objectName = configuration.getAttribute(OBJECT_NAME, ""); + String descTypeId = configuration.getAttribute(DESC_TYPE, ""); + if (!objectName.isEmpty() && !descTypeId.isEmpty()) { + return new TestLaunchObject(objectName, manager.getLaunchDescriptorType(descTypeId)); + } + } + return null; + } + + @Override + public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + if (ownsConfiguration(configuration)) { + return true; + } + return false; + } + + } + + public abstract class TestLaunchObjectProvider implements ILaunchObjectProvider { + @Override + public void dispose() { + // nothing by default + } + } + + protected ILaunchConfigurationType mockLaunchConfigurationType(String id) { + return mockLaunchConfigurationType(id, launchManager.getLaunchModes()); + } + + protected ILaunchConfigurationType mockLaunchConfigurationType(String id, ILaunchMode[] modes) { + ILaunchConfigurationType type = mock(ILaunchConfigurationType.class); + doReturn(id).when(type).getIdentifier(); + doReturn(type).when(launchManager).getLaunchConfigurationType(id); + + // mock for supportsMode + for (ILaunchMode mode : modes) { + String modeid = mode.getIdentifier(); + doReturn(true).when(type).supportsMode(modeid); + } + + return type; + } + + protected ILaunchConfigurationWorkingCopy mockLaunchConfiguration(String name, ILaunchConfigurationType type) throws CoreException { + ILaunchConfigurationWorkingCopy wc = mock(ILaunchConfigurationWorkingCopy.class); + doReturn(name).when(wc).getName(); + doReturn(type).when(wc).getType(); + doReturn(wc).when(wc).doSave(); + doReturn(name).when(launchManager).generateLaunchConfigurationName(name); + doReturn(wc).when(type).newInstance(null, name); + return wc; + } + + // + // Now that we have all the setup, + // Actual tests :) + // + + @Override + protected void setUp() throws Exception { + // Prefs are shared across an entire test + prefs = new EclipsePreferences(); + + // launch manager and default modes + launchManager = mock(ILaunchManager.class); + try { + doReturn(new ILaunchConfiguration[] {}).when(launchManager).getLaunchConfigurations(); + } catch (CoreException e) { + fail(e.getMessage()); + } + + ILaunchMode runMode = mock(ILaunchMode.class); + doReturn("run").when(runMode).getIdentifier(); + doReturn("Run").when(runMode).getLabel(); + doReturn("Run As...").when(runMode).getLaunchAsLabel(); + doReturn(runMode).when(launchManager).getLaunchMode("run"); + + ILaunchMode debugMode = mock(ILaunchMode.class); + doReturn("debug").when(debugMode).getIdentifier(); + doReturn("Debug").when(debugMode).getLabel(); + doReturn("Debug As...").when(debugMode).getLaunchAsLabel(); + doReturn(debugMode).when(launchManager).getLaunchMode("debug"); + + doReturn(new ILaunchMode[] { runMode, debugMode }).when(launchManager).getLaunchModes(); + } + + @Test + public void testLaunchBarManager() throws Exception { + TestLaunchBarManager manager = new TestLaunchBarManager(); + assertNull(manager.getActiveLaunchDescriptor()); + assertNull(manager.getActiveLaunchTarget()); + assertNull(manager.getActiveLaunchMode()); + } + + @Test + public void testSuccessPath() throws Exception { + TestLaunchBarManager manager = new TestLaunchBarManager(); + + // mock out the launch config that will be created + String name = "testConfig"; + ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + assertNotNull(configType); + ILaunchConfigurationWorkingCopy wc = mockLaunchConfiguration(name, configType); + + // fire in launch object and target + ILaunchDescriptorType descType = manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID); + assertNotNull(descType); + TestLaunchObject launchObject = new TestLaunchObject(name, descType); + manager.launchObjectAdded(launchObject); + + // check our state + assertEquals(manager.getLaunchDescriptor(launchObject), manager.getActiveLaunchDescriptor()); + assertNull(manager.getActiveLaunchTarget()); + assertNotNull(manager.getActiveLaunchMode()); + + ILaunchTargetType targetType = manager.getLaunchTargetType(DEFAULT_TARGET_TYPE_ID); + assertNotNull(targetType); + ILaunchTarget testTarget = new TestLaunchTarget("testTarget", targetType); + manager.launchTargetAdded(testTarget); + + // verify that our launch config got created and saved + assertNotNull(manager.getActiveLaunchMode()); + assertEquals(wc, manager.getActiveLaunchConfiguration()); + verify(wc).doSave(); + + // now remove the launch object and make sure everything resets + manager.launchObjectRemoved(launchObject); + assertNull(manager.getActiveLaunchDescriptor()); + assertNull(manager.getActiveLaunchTarget()); + assertNull(manager.getActiveLaunchMode()); + verify(wc).delete(); + + // remove the target and make sure it's gone. + manager.launchTargetRemoved(testTarget); + ILaunchTarget[] allTargets = manager.getAllLaunchTargets(); + assertEquals(1, allTargets.length); + assertNotEquals(testTarget, allTargets[0]); + } + + @Test + public void testWrongObject() throws Exception { + TestLaunchBarManager manager = new TestLaunchBarManager(); + + // mock out the launch config that will be created + String name = "testConfig"; + ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + mockLaunchConfiguration(name, configType); + + // fire in launch target but object with no descriptor + manager.launchObjectAdded(new Object()); + manager.launchTargetAdded(new TestLaunchTarget("testTarget", manager.getLaunchTargetType(DEFAULT_TARGET_TYPE_ID))); + + // verify that there are no launch configs + assertNull(manager.getActiveLaunchConfiguration()); + } + + @Test + public void testNoTarget() throws Exception { + TestLaunchBarManager manager = new TestLaunchBarManager(); + + // mock out the launch config that will be created + String name = "testConfig"; + ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + ILaunchConfigurationWorkingCopy wc = mockLaunchConfiguration(name, configType); + + // create descriptor and target + manager.launchObjectAdded(new TestLaunchObject(name, manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); + + // verify that our launch config got created and saved even though the default config type + assertEquals(wc, manager.getActiveLaunchConfiguration()); + verify(wc).doSave(); + } + + @Test + public void testDefaultDescriptor() throws Exception { + TestLaunchBarManager manager = new TestLaunchBarManager(); + + ILaunchConfigurationType configType = mockLaunchConfigurationType("configType.default"); + ILaunchConfiguration config = mockLaunchConfiguration("defaultConfig", configType); + manager.launchConfigurationAdded(config); + assertEquals(config, manager.getActiveLaunchConfiguration()); + + manager.launchConfigurationRemoved(config); + assertNull(manager.getActiveLaunchConfiguration()); + } + + @Test + public void testSetActiveDescriptor() throws Exception { + final TestLaunchBarManager manager = new TestLaunchBarManager(); + ILaunchMode runMode = launchManager.getLaunchMode("run"); + ILaunchMode debugMode = launchManager.getLaunchMode("debug"); + + // descriptor for the test descriptor + String name = "test1"; + ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + ILaunchConfigurationWorkingCopy wc = mockLaunchConfiguration(name, configType); + + ILaunchDescriptorType descType = manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID); + TestLaunchObject testObject1 = new TestLaunchObject(name, descType); + manager.launchObjectAdded(testObject1); + ILaunchDescriptor test1 = manager.getLaunchDescriptor(testObject1); + assertNotNull(test1); + + final ILaunchMode[] testActiveMode = new ILaunchMode[1]; + final ILaunchDescriptor[] testActiveDesc = new ILaunchDescriptor[1]; + Listener listener = new Listener() { + @Override + public void launchTargetsChanged() { + } + + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) { + } + + @Override + public void activeLaunchTargetChanged() { + } + + @Override + public void activeLaunchModeChanged() { + testActiveMode[0] = manager.getActiveLaunchMode(); + } + + @Override + public void activeLaunchDescriptorChanged() { + testActiveDesc[0] = manager.getActiveLaunchDescriptor(); + } + }; + manager.addListener(listener); + + // descriptor for the default descriptor + ILaunchConfigurationType defaultConfigType = mockLaunchConfigurationType("configType.default"); + ILaunchConfiguration config = mockLaunchConfiguration("test2", defaultConfigType); + manager.launchConfigurationAdded(config); + ILaunchDescriptor test2 = manager.getLaunchDescriptor(config); + assertNotNull(test2); + assertNotSame(test1, test2); + manager.setActiveLaunchMode(runMode); + + // test2 should be active by default since it was created last + assertEquals(test2, manager.getActiveLaunchDescriptor()); + assertEquals(test2, testActiveDesc[0]); + assertEquals(config, manager.getActiveLaunchConfiguration()); + assertEquals(runMode, manager.getActiveLaunchMode()); + assertEquals(runMode, testActiveMode[0]); + + // flip to test1 + testActiveMode[0] = null; + testActiveDesc[0] = null; + manager.setActiveLaunchDescriptor(test1); + manager.setActiveLaunchMode(debugMode); + assertEquals(test1, manager.getActiveLaunchDescriptor()); + assertEquals(test1, testActiveDesc[0]); + assertEquals(wc, manager.getActiveLaunchConfiguration()); + assertEquals(debugMode, manager.getActiveLaunchMode()); + assertEquals(debugMode, testActiveMode[0]); + + // and back to test2 + testActiveMode[0] = null; + testActiveDesc[0] = null; + manager.setActiveLaunchDescriptor(test2); + assertEquals(test2, manager.getActiveLaunchDescriptor()); + assertEquals(test2, testActiveDesc[0]); + assertEquals(config, manager.getActiveLaunchConfiguration()); + assertEquals(runMode, manager.getActiveLaunchMode()); + assertEquals(runMode, testActiveMode[0]); + } + + @Test + public void testSetActiveMode() throws Exception { + TestLaunchBarManager manager = new TestLaunchBarManager(); + ILaunchMode runMode = launchManager.getLaunchMode("run"); + ILaunchMode debugMode = launchManager.getLaunchMode("debug"); + + String name = "test"; + ILaunchConfigurationType testConfigType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + mockLaunchConfiguration(name, testConfigType); + + ILaunchDescriptorType descType = manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID); + TestLaunchObject testObject = new TestLaunchObject(name, descType); + manager.launchObjectAdded(testObject); + assertNotNull(manager.getActiveLaunchConfiguration()); + + // The default launch mode is debug (that may change) + assertEquals(debugMode, manager.getActiveLaunchMode()); + + // Set to run + manager.setActiveLaunchMode(runMode); + assertEquals(runMode, manager.getActiveLaunchMode()); + + // and back to debug + manager.setActiveLaunchMode(debugMode); + assertEquals(debugMode, manager.getActiveLaunchMode()); + } + + @Test + public void testSetActiveTarget() throws Exception { + // create separate target types and provider types for each one + final ILaunchConfigurationType configType1 = mockLaunchConfigurationType("configType.test1"); + final ILaunchConfigurationType configType2 = mockLaunchConfigurationType("configType.test2"); + final TestLaunchTargetType targetType1 = new TestLaunchTargetType("targetType.test1"); + final TestLaunchTargetType targetType2 = new TestLaunchTargetType("targetType.test2"); + + TestLaunchBarManager manager = new TestLaunchBarManager() { + @Override + protected TestLaunchTargetType[] getTestTargetTypes() { + return new TestLaunchTargetType[] { targetType1, targetType2 }; + } + @Override + protected TestLaunchConfigurationProvider[] getTestConfigProviders() { + TestLaunchConfigurationProvider provider1 = new TestLaunchConfigurationProvider( + DEFAULT_DESCRIPTOR_TYPE_ID, targetType1.id, configType1, true, this); + TestLaunchConfigurationProvider provider2 = new TestLaunchConfigurationProvider( + DEFAULT_DESCRIPTOR_TYPE_ID, targetType2.id, configType2, true, this); + return new TestLaunchConfigurationProvider[] { provider1, provider2 }; + } + }; + + // Target 1 + ILaunchConfiguration config1 = mockLaunchConfiguration("test1", configType1); + TestLaunchTarget target1 = new TestLaunchTarget("testTarget1", targetType1); + manager.launchTargetAdded(target1); + + // add in our object + manager.launchObjectAdded(new TestLaunchObject("test1", manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); + + // launch config and target should be the default one + assertEquals(target1, manager.getActiveLaunchTarget()); + assertEquals(config1, manager.getActiveLaunchConfiguration()); + + // switching to second target type should create a new config, but it needs a new name + ILaunchManager launchManager = manager.getLaunchManager(); + doReturn("test2").when(launchManager).generateLaunchConfigurationName("test1"); + ILaunchConfiguration config2 = mockLaunchConfiguration("test2", configType2); + TestLaunchTarget target2 = new TestLaunchTarget("testTarget2", targetType2); + manager.setActiveLaunchTarget(target2); + + assertEquals(target2, manager.getActiveLaunchTarget()); + assertEquals(config2, manager.getActiveLaunchConfiguration()); + assertEquals("test2", manager.getActiveLaunchConfiguration().getName()); + } + + public class TestRestartLaunchBarManager extends TestLaunchBarManager { + public TestRestartLaunchBarManager() throws CoreException { + super(); + } + + @Override + protected TestLaunchTargetType[] getTestTargetTypes() { + TestLaunchTargetType targetType = new TestLaunchTargetType(DEFAULT_TARGET_TYPE_ID) { + public void init(ILaunchBarManager manager) throws CoreException { + manager.launchTargetAdded(new TestLaunchTarget("testTarget1", this)); + manager.launchTargetAdded(new TestLaunchTarget("testTarget2", this)); + } + }; + return new TestLaunchTargetType[] { targetType }; + } + + @Override + protected TestLaunchObjectProvider[] getTestObjectProviders() { + TestLaunchObjectProvider provider = new TestLaunchObjectProvider() { + @Override + public void init(ILaunchBarManager manager) throws CoreException { + mockLaunchConfiguration("test1", launchManager.getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID)); + manager.launchObjectAdded(new TestLaunchObject("test1", getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); + mockLaunchConfiguration("test2", launchManager.getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID)); + manager.launchObjectAdded(new TestLaunchObject("test2", getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); + } + }; + return new TestLaunchObjectProvider[] { provider }; + } + } + + @Test + public void testRestart() throws Exception { + // create two over everything, set second active, and make sure it's remembered in a second manager + TestLaunchBarManager manager = new TestRestartLaunchBarManager(); + ILaunchMode runMode = launchManager.getLaunchMode("run"); + ILaunchMode debugMode = launchManager.getLaunchMode("debug"); + assertNotNull(runMode); + + // get our targets + ILaunchTarget target1 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget1")); + assertNotNull(target1); + ILaunchTarget target2 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget2")); + assertNotNull(target2); + + // get our descriptors + ILaunchDescriptor desc1 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test1")); + assertNotNull(desc1); + ILaunchDescriptor desc2 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test2")); + assertNotNull(desc2); + + // Set the actives one way + manager.setActiveLaunchDescriptor(desc1); + manager.setActiveLaunchTarget(target1); + manager.setActiveLaunchMode(runMode); + + // Create a new manager and check they are the same + manager = new TestRestartLaunchBarManager(); + desc1 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test1")); + assertNotNull(desc1); + desc2 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test2")); + assertNotNull(desc2); + assertEquals(desc1, manager.getActiveLaunchDescriptor()); + + target1 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget1")); + assertNotNull(target1); + target2 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget2")); + assertNotNull(target2); + assertEquals(target1, manager.getActiveLaunchTarget()); + assertEquals(runMode, manager.getActiveLaunchMode()); + + // Set them the other way + manager.setActiveLaunchDescriptor(desc2); + manager.setActiveLaunchTarget(target2); + manager.setActiveLaunchMode(debugMode); + + // Create a new manager and check they stuck + manager = new TestRestartLaunchBarManager(); + desc2 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test2")); + assertNotNull(desc2); + assertEquals(desc2, manager.getActiveLaunchDescriptor()); + target2 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget2")); + assertNotNull(target2); + assertEquals(target2, manager.getActiveLaunchTarget()); + assertEquals(debugMode, manager.getActiveLaunchMode()); + } + + @Test + public void testLaunchConfigCapture() throws Exception { + final ILaunchConfigurationType configType = mockLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); + TestLaunchBarManager manager = new TestLaunchBarManager() { + protected TestLaunchConfigurationProvider[] getTestConfigProviders() { + return new TestLaunchConfigurationProvider[] { + new TestLaunchConfigurationProvider(DEFAULT_DESCRIPTOR_TYPE_ID, DEFAULT_TARGET_TYPE_ID, configType, true, this) + }; + } + }; + + ILaunchConfiguration config = mockLaunchConfiguration("test", configType); + manager.launchObjectAdded(new TestLaunchObject("test", manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); + String activeDescId = manager.toString(manager.getDescriptorId(manager.getActiveLaunchDescriptor())); + assertEquals(manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID), manager.getActiveLaunchDescriptor().getType()); + assertEquals(config, manager.getActiveLaunchConfiguration()); + + // restart and make sure the same descriptor is selected and new one new ones created + doReturn(new ILaunchConfiguration[] { config }).when(launchManager).getLaunchConfigurations(); + manager = new TestLaunchBarManager() { + protected TestLaunchConfigurationProvider[] getTestConfigProviders() { + return new TestLaunchConfigurationProvider[] { + new TestLaunchConfigurationProvider(DEFAULT_DESCRIPTOR_TYPE_ID, DEFAULT_TARGET_TYPE_ID, configType, true, this) + }; + } + @Override + protected TestLaunchObjectProvider[] getTestObjectProviders() { + return new TestLaunchObjectProvider[] { + new TestLaunchObjectProvider() { + @Override + public void init(ILaunchBarManager manager) throws CoreException { + manager.launchObjectAdded( + new TestLaunchObject("test", + getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID)));; + } + } + }; + } + }; + String newActiveDescId = manager.toString(manager.getDescriptorId(manager.getActiveLaunchDescriptor())); + assertEquals(activeDescId, newActiveDescId); + assertEquals(1, manager.getLaunchDescriptors().length); + } + + // TODO - test that two target types that map to the same desc type and config type share configs + // TODO - test duplicating a config. make sure it's default desc and same targets + // TODO - test project descriptors and stuff + // TODO - test descriptor takeovers (new descriptors on launchObjectChange + +} diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java new file mode 100644 index 00000000000..e54db88b80a --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java @@ -0,0 +1,30 @@ +package org.eclipse.launchbar.core.tests; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java new file mode 100644 index 00000000000..381c96d2087 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2004, 2011 QNX Software Systems 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: + * QNX Software Systems - initial API and implementation + * Markus Schorn (Wind River Systems) + *******************************************************************************/ +package org.eclipse.launchbar.core.tests; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.eclipse.launchbar.core.internal.LaunchBarManagerTest; + +public class AutomatedIntegrationSuite extends TestSuite { + public AutomatedIntegrationSuite() { + } + + public AutomatedIntegrationSuite(Class theClass, String name) { + super(theClass, name); + } + + public AutomatedIntegrationSuite(Class theClass) { + super(theClass); + } + + public AutomatedIntegrationSuite(String name) { + super(name); + } + + public static Test suite() { + final AutomatedIntegrationSuite suite = new AutomatedIntegrationSuite(); + // tests + suite.addTestSuite(LaunchBarManagerTest.class); + return suite; + } +} From 74797fe6e337f1065da7e6375dfe951480716cc7 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 11 Dec 2014 10:56:27 -0500 Subject: [PATCH 002/198] Start of new remote interface. Change-Id: I078456841dd4b6ddec3852178c307dbd2cf465f5 --- .../META-INF/MANIFEST.MF | 4 +- .../remote/core/api2/IRemoteConnection.java | 337 ++++++++++++++++++ .../api2/IRemoteConnectionChangeEvent.java | 54 +++ .../api2/IRemoteConnectionChangeListener.java | 29 ++ .../core/api2/IRemoteConnectionManager.java | 92 +++++ .../core/api2/IRemoteConnectionService.java | 25 ++ .../api2/IRemoteConnectionWorkingCopy.java | 85 +++++ .../remote/core/api2/IRemoteFileManager.java | 79 ++++ .../core/api2/IRemoteLaunchConfigService.java | 29 ++ .../remote/core/api2/IRemoteService.java | 15 + .../remote/core/api2/IRemoteServices.java | 56 +++ .../core/api2/IRemoteServicesDescriptor.java | 38 ++ pom.xml | 8 + 13 files changed, 850 insertions(+), 1 deletion(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index bcf31ac3f87..f7a9bb41e62 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -6,7 +6,9 @@ Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, - org.eclipse.debug.core + org.eclipse.debug.core, + org.eclipse.remote.core;bundle-version="[1.1.0,2.0.0)";visibility:=reexport, + org.eclipse.core.filesystem Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java new file mode 100644 index 00000000000..6b5983863c0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java @@ -0,0 +1,337 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.remote.core.IRemoteProcess; +import org.eclipse.remote.core.IRemoteProcessBuilder; +import org.eclipse.remote.core.exception.RemoteConnectionException; + +/** + * Abstraction of a connection to a remote system. Clients should use the set methods to provide information on the remote system, + * then call the {{@link #open(IProgressMonitor)} method. Once the connection is completed, call the {@link #close()} method to + * terminate the connection. + */ +public interface IRemoteConnection extends Comparable { + public final static String OS_NAME_PROPERTY = "os.name"; //$NON-NLS-1$ + public final static String OS_VERSION_PROPERTY = "os.version"; //$NON-NLS-1$ + public final static String OS_ARCH_PROPERTY = "os.arch"; //$NON-NLS-1$ + /** + * @since 6.0 + */ + public final static String FILE_SEPARATOR_PROPERTY = "file.separator"; //$NON-NLS-1$ + /** + * @since 6.0 + */ + public final static String PATH_SEPARATOR_PROPERTY = "path.separator"; //$NON-NLS-1$ + /** + * @since 6.0 + */ + public final static String LINE_SEPARATOR_PROPERTY = "line.separator"; //$NON-NLS-1$ + /** + * @since 4.0 + */ + public final static String USER_HOME_PROPERTY = "user.home"; //$NON-NLS-1$ + + /** + * Return the specified service. + * + * @param service interface + * @return service + */ + public T getService(Class service); + + /** + * Register a listener that will be notified when this connection's status changes. + * + * @param listener + */ + public void addConnectionChangeListener(IRemoteConnectionChangeListener listener); + + /** + * Close the connection. Must be called to terminate the connection. + */ + public void close(); + + /** + * Notify all listeners when this connection's status changes. See {{@link IRemoteConnectionChangeEvent} for a list of event + * types. + * + * @param event + * event type indicating the nature of the event + */ + public void fireConnectionChangeEvent(int type); + + /** + * Forward local port localPort to remote port fwdPort on remote machine fwdAddress. If this IRemoteConnection is not to + * fwdAddress, the port will be routed via the connection machine to fwdAddress. + * + * @param localPort + * local port to forward + * @param fwdAddress + * address of remote machine + * @param fwdPort + * remote port on remote machine + * @throws RemoteConnectionException + */ + public void forwardLocalPort(int localPort, String fwdAddress, int fwdPort) throws RemoteConnectionException; + + /** + * Forward a local port to remote port fwdPort on remote machine fwdAddress. The local port is chosen dynamically and returned + * by the method. If this IRemoteConnection is not to fwdAddress, the port will be routed via the connection machine to + * fwdAddress. + * + * @param fwdAddress + * @param fwdPort + * @param monitor + * @return local port number + * @throws RemoteConnectionException + */ + public int forwardLocalPort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException; + + /** + * Forward remote port remotePort to port fwdPort on machine fwdAddress. When a connection is made to remotePort on the remote + * machine, it is forwarded via this IRemoteConnection to fwdPort on machine fwdAddress. + * + * @param remotePort + * remote port to forward + * @param fwdAddress + * address of recipient machine + * @param fwdPort + * port on recipient machine + * @throws RemoteConnectionException + */ + public void forwardRemotePort(int remotePort, String fwdAddress, int fwdPort) throws RemoteConnectionException; + + /** + * Forward a remote port to port fwdPort on remote machine fwdAddress. The remote port is chosen dynamically and returned by the + * method. When a connection is made to this port on the remote machine, it is forwarded via this IRemoteConnection to fwdPort + * on machine fwdAddress. + * + * If fwdAddress is the empty string ("") then the fwdPort will be bound to any address on all interfaces. Note that this + * requires enabling the GatewayPort sshd option on some systems. + * + * @param fwdAddress + * @param fwdPort + * @param monitor + * @return remote port number + * @throws RemoteConnectionException + */ + public int forwardRemotePort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException; + + /** + * Gets the implementation dependent address for this connection + * + * return address + */ + public String getAddress(); + + /** + * Get the implementation specific attributes for the connection. + * + * NOTE: the attributes do not include any security related information (e.g. passwords, keys, etc.) + * + * @return a map containing the connection attribute keys and values + */ + public Map getAttributes(); + + /** + * Get a remote process that runs a command shell on the remote system. The shell will be the user's default shell on the remote + * system. The flags may be used to modify behavior of the remote process. These flags may only be supported by specific types + * of remote service providers. Clients can use {@link IRemoteProcessBuilder#getSupportedFlags()} to find out the flags + * supported by the service provider. + * + *
+	 * Current flags are:
+	 *   {@link IRemoteProcessBuilder#NONE}			- disable any flags
+	 *   {@link IRemoteProcessBuilder#ALLOCATE_PTY}	- allocate a pseudo-terminal for the process (RFC-4254 Sec. 6.2)
+	 *   {@link IRemoteProcessBuilder#FORWARD_X11}	- enable X11 forwarding (RFC-4254 Sec. 6.3)
+	 * 
+ * + * @param flags + * bitwise-or of flags + * @return remote process object + * @throws IOException + * @since 7.0 + */ + public IRemoteProcess getCommandShell(int flags) throws IOException; + + /** + * Returns an unmodifiable string map view of the remote environment. The connection must be open prior to calling this method. + * + * @return the remote environment + * @since 5.0 + */ + public Map getEnv(); + + /** + * Returns the value of an environment variable. The connection must be open prior to calling this method. + * + * @param name + * name of the environment variable + * @return value of the environment variable or null if the variable is not defined + */ + public String getEnv(String name); + + /** + * Get a file manager for managing remote files + * + * @return file manager or null if connection is not open + */ + public IRemoteFileManager getFileManager(); + + /** + * Get unique name for this connection. + * + * @return connection name + */ + public String getName(); + + /** + * Gets the port for this connection. Only valid if supported by the service provider. + * + * return port number + * + * @since 5.0 + */ + public int getPort(); + + /** + * Get a process builder for creating remote processes + * + * @return process builder or null if connection is not open + */ + public IRemoteProcessBuilder getProcessBuilder(List command); + + /** + * Get a process builder for creating remote processes + * + * @return process builder or null if connection is not open + */ + public IRemoteProcessBuilder getProcessBuilder(String... command); + + /** + * Gets the remote system property indicated by the specified key. The connection must be open prior to calling this method. + * + * The following keys are supported: + * + *
+	 * os.name			Operating system name 
+	 * os.arch			Operating system architecture
+	 * os.version		Operating system version
+	 * file.separator	File separator ("/" on UNIX)
+	 * path.separator	Path separator (":" on UNIX)
+	 * line.separator	Line separator ("\n" on UNIX)
+	 * user.home		Home directory
+	 * 
+ * + * @param key + * the name of the property + * @return the string value of the property, or null if no property has that key + */ + public String getProperty(String key); + + /** + * Get the remote services provider for this connection. + * + * @return remote services provider + * @since 4.0 + */ + public IRemoteServices getRemoteServices(); + + /** + * Gets the username for this connection + * + * return username + */ + public String getUsername(); + + public IRemoteConnectionWorkingCopy getWorkingCopy(); + + /** + * Get the working directory. Relative paths will be resolved using this path. + * + * The remote connection does not need to be open to use this method, however a default directory path, rather than the actual + * working directory, may be returned in this case. + * + * @return String representing the current working directory + * @since 4.0 + */ + public String getWorkingDirectory(); + + /** + * Test if the connection is open. + * + * @return true if connection is open. + */ + public boolean isOpen(); + + /** + * Open the connection. Must be called before the connection can be used. + * + * @param monitor + * the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() + * on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot + * be cancelled. + * @throws RemoteConnectionException + */ + public void open(IProgressMonitor monitor) throws RemoteConnectionException; + + /** + * Remove a listener that will be notified when this connection's status changes. + * + * @param listener + */ + public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener); + + /** + * Remove the local port forwarding associated with the given port. + * + * @param port + * forwarded port + * @throws RemoteConnectionException + * @since 7.0 + */ + public void removeLocalPortForwarding(int port) throws RemoteConnectionException; + + /** + * Remove the remote port forwarding associated with the given port. + * + * @param port + * forwarded port + * @throws RemoteConnectionException + * @since 7.0 + */ + public void removeRemotePortForwarding(int port) throws RemoteConnectionException; + + /** + * Set the working directory while the connection is open. The working directory will revert to the default when the connection + * is closed then subsequently reopened. + * + * Relative paths will be resolved using this path. The path must be valid and absolute for any changes to be made. + * + * @param path + * String representing the current working directory + * @since 4.0 + */ + public void setWorkingDirectory(String path); + + /** + * Test if this connection supports forwarding of TCP connections + * + * @return true if TCP port forwarding is supported + */ + public boolean supportsTCPPortForwarding(); +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java new file mode 100644 index 00000000000..a21eb5bd521 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +/** + * Event representing a change in connection status. The {@link #getType()} method can be used to obtain information about the type + * of event that occurred. + */ +public interface IRemoteConnectionChangeEvent { + /** + * Event indicating that the connection was closed. + */ + public static final int CONNECTION_CLOSED = 1 << 0; + + /** + * Event indicating that the connection was opened. + */ + public static final int CONNECTION_OPENED = 1 << 1; + + /** + * Event indicating that the connection was closed abnormally. + */ + public static final int CONNECTION_ABORTED = 1 << 2; + + /** + * Event indicating that the connection name was changed. + */ + public static final int CONNECTION_RENAMED = 1 << 3; + + /** + * Get the connection that has changed. + * + * @return IRemoteConnection + */ + public IRemoteConnection getConnection(); + + /** + * Returns the type of event being reported. This type + * is obtained by bitwise OR'ing the event types together. + * + * {@link #CONNECTION_CLOSED} {@link #CONNECTION_OPENED} {@link #CONNECTION_ABORTED} {@link #CONNECTION_RENAMED} + * + * @return a bitwise OR of event type constants + */ + public int getType(); +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java new file mode 100644 index 00000000000..6820ce7434d --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +import java.util.EventListener; + +/** + * Listener used to register for notification of connection status changes. Clients should register a listener using the + * {@link IRemoteConnection#addConnectionChangeListener(IRemoteConnectionChangeListener)} method. + */ +public interface IRemoteConnectionChangeListener extends EventListener { + + /** + * Notifies this listener that the status of a connection has changed. + * + * @param event + * the connection change event + */ + + public void connectionChanged(IRemoteConnectionChangeEvent event); +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java new file mode 100644 index 00000000000..046fbb13fd4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +import java.net.URI; +import java.util.List; + +import org.eclipse.remote.core.IUserAuthenticator; +import org.eclipse.remote.core.exception.RemoteConnectionException; + +/** + * Interface for managing connections to remote systems. + */ +public interface IRemoteConnectionManager { + /** + * The name of the connection for local services. There is only one connection for local services. + * + * @since 7.0 + */ + public static String LOCAL_CONNECTION_NAME = "Local"; //$NON-NLS-1$ + + /** + * Gets the remote connection corresponding to the supplied name. + * + * @param name + * name of the connection (as returned by {@link IRemoteConnection#getName()}) + * @return remote connection or null if no connection exists + */ + public IRemoteConnection getConnection(String name); + + /** + * Gets the remote connection corresponding to the supplied URI. + * + * @param uri + * URI containing a schema for this remote connection + * @return remote connection or null if no connection exists or the schema + * is incorrect + * @since 4.0 + */ + public IRemoteConnection getConnection(URI uri); + + /** + * Get all the connections for this service provider. + * + * @return connections that we know about + */ + public List getConnections(); + + /** + * Get the user authenticator that will be used when opening connections. The user authenticator is specified using the + * org.eclipse.remote.core.authenticator extension point. + * + * @param connection + * connection that will use this authenticator + * @return user authenticator + */ + public IUserAuthenticator getUserAuthenticator(IRemoteConnection connection); + + /** + * Creates a new remote connection named with supplied name. The connection attributes will be the default for the + * implementation. + * + * Returns a working copy of the remote connection. Callers must call {@link IRemoteConnectionWorkingCopy#save()} before the + * connection can be used. + * + * @param name + * name of the connection + * @return a new connection working copy with the supplied name + * @throws RemoteConnectionException + * if connection creation failed + * @since 5.0 + */ + public IRemoteConnectionWorkingCopy newConnection(String name) throws RemoteConnectionException; + + /** + * Remove a connection and all resources associated with it. + * + * @param connection + * connection to remove + * @throws RemoteConnectionException + * if the connection could not be removed + */ + public void removeConnection(IRemoteConnection connection) throws RemoteConnectionException; +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java new file mode 100644 index 00000000000..83237a43fdf --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer (QNX) - initial + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +/** + * Root interface for all services available from a connection. + */ +public interface IRemoteConnectionService { + + /** + * Return the connection this service applies to. + * + * @return connection + */ + IRemoteConnection getConnection(); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java new file mode 100644 index 00000000000..f522fb8536a --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +public interface IRemoteConnectionWorkingCopy extends IRemoteConnection { + /** + * Returns the original connection this working copy was created from. + * + * @return original connection + */ + public IRemoteConnection getOriginal(); + + /** + * Returns whether this connection has been modified since it was last saved or created. + * + * @return true if the connection has been modified + */ + public boolean isDirty(); + + /** + * Saves this working copy to its original connection and returns a handle to the resulting connection. Has no effect if this + * connection does not need saving. + * + * @return saved connection + */ + public IRemoteConnection save(); + + /** + * Set the address for this connection + * + * @param address + */ + public void setAddress(String address); + + /** + * Set an implementation dependent attribute for the connection. Attributes keys supported by the connection can be obtained + * using {@link #getAttributes()}. Attributes are persisted along with connection information. + * + * @param key + * attribute key + * @param value + * attribute value + * @since 5.0 + */ + public void setAttribute(String key, String value); + + /** + * Set the name for this connection + * + * @param name + */ + public void setName(String name); + + /** + * Set the password for this connection + * + * @param password + * @since 5.0 + */ + public void setPassword(String password); + + /** + * Set the port used for this connection. Only valid if supported by the underlying service provider. + * + * @param port + * port number for the connection + * @since 5.0 + */ + public void setPort(int port); + + /** + * Set the username for this connection + * + * @param username + */ + public void setUsername(String username); +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java new file mode 100644 index 00000000000..328537a38c9 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +import java.net.URI; + +import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.core.runtime.IPath; + +/** + * Interface for managing resources on a remote system. + */ +public interface IRemoteFileManager { + /** + * Get the resource associated with path. IFileStore can then be used to + * perform operations on the file. + * + * The remote connection does not need to be open to use this method, but + * subsequent operations on the IFileStore that access the underlying remote + * filesystem may require the connection to be open. + * + * @param path + * path to resource + * @return the file store representing the remote path + */ + public IFileStore getResource(String path); + + /** + * Gets the directory separator on the target system. + * + * @return String + * @since 4.0 + */ + public String getDirectorySeparator(); + + /** + * Convert URI to a remote path. This path is suitable for direct file + * operations on the remote system. + * + * The remote connection does not need to be open to use this method. + * + * @return IPath representing the remote path + */ + public String toPath(URI uri); + + /** + * Convert remote path to equivalent URI. This URI is suitable for EFS + * operations on the local system. + * + * The remote connection does not need to be open to use this method. + * + * @param path + * path on remote system + * @return URI representing path on remote system, or null if the path is + * invalid + */ + public URI toURI(IPath path); + + /** + * Convert string representation of a remote path to equivalent URI. This + * URI is suitable for EFS operations on the local system. + * + * The remote connection does not need to be open to use this method. + * + * @param path + * path on remote system + * @return URI representing path on remote system, or null if the path is + * invalid + */ + public URI toURI(String path); +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java new file mode 100644 index 00000000000..34810f223e6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer (QNX) - initial + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +import org.eclipse.debug.core.ILaunchConfigurationType; + +/** + * Service that supports setting up launch configurations for + * launching over the remote connection. + */ +public interface IRemoteLaunchConfigService extends IRemoteService { + + /** + * Does this remote service support launching on this launch config type. + * + * @param launchConfigType + * @return boolean supports launching on this connection + */ + boolean supportsType(ILaunchConfigurationType launchConfigType); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java new file mode 100644 index 00000000000..36c85fde2e7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java @@ -0,0 +1,15 @@ +package org.eclipse.remote.core.api2; + +/** + * The root interface for a service provided by a remote services provider. + */ +public interface IRemoteService { + + /** + * Return the remote services provider object. + * + * @return remote services provider. + */ + IRemoteServices getRemoteServices(); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java new file mode 100644 index 00000000000..34143197392 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2013 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * Abstraction of a remote services provider. Clients obtain this interface using one of the static methods in + * {@link RemoteServices}. The methods on this interface can then be used to access the full range of remote services provided. + */ +public interface IRemoteServices extends IRemoteServicesDescriptor { + public static final int CAPABILITY_ADD_CONNECTIONS = 0x01; + public static final int CAPABILITY_EDIT_CONNECTIONS = 0x02; + public static final int CAPABILITY_REMOVE_CONNECTIONS = 0x04; + public static final int CAPABILITY_SUPPORTS_TCP_PORT_FORWARDING = 0x08; + public static final int CAPABILITY_SUPPORTS_X11_FORWARDING = 0x10; + public static final int CAPABILITY_SUPPORTS_COMMAND_SHELL = 0x20; + + /** + * Return one of the remote services that this provider provides. + * + * @param service interface + * @return the service + */ + public T getService(Class service); + + /** + * Get a connection manager for managing remote connections. + * + * @return connection manager or null if services are not initialized + */ + public IRemoteConnectionManager getConnectionManager(); + + /** + * Initialize the remote service. Clients should not call this method (it is called internally.) + * + * @return true if the initialization was successful, false otherwise + * @since 7.0 + */ + public boolean initialize(IProgressMonitor monitor); + + /** + * Gets the capabilities of the remote service. + * + * @return bit-wise or of capability flag constants + */ + public int getCapabilities(); +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java new file mode 100644 index 00000000000..a3198910c46 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation 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: + * IBM Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.core.api2; + +/** + * Interface representing a remote services provider extension. Clients can use this to find out information about the extension + * without loading it. + */ +public interface IRemoteServicesDescriptor extends Comparable { + /** + * Get unique ID of this service. Can be used as a lookup key. + * + * @return unique ID + */ + public String getId(); + + /** + * Get display name of this service. + * + * @return display name + */ + public String getName(); + + /** + * Get the EFS scheme provided by this service. + * + * @return display name + */ + public String getScheme(); +} diff --git a/pom.xml b/pom.xml index 9e90803f60f..26674dfc6f3 100644 --- a/pom.xml +++ b/pom.xml @@ -37,6 +37,14 @@ + + + eclipse + http://download.eclipse.org/releases/luna + p2 + + + bundles/org.eclipse.launchbar.core bundles/org.eclipse.launchbar.ui From 24244f8469710c86d15299237f4ff22617c8c60d Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 11 Dec 2014 11:48:00 -0500 Subject: [PATCH 003/198] Added the p2 repo and finished the poms. --- .../META-INF/MANIFEST.MF | 2 +- features/org.eclipse.launchbar/.project | 7 ------ pom.xml | 9 ++++++- repo/.gitignore | 1 + repo/.project | 24 +++++++++++++++++++ repo/category.xml | 7 ++++++ repo/pom.xml | 14 +++++++++++ 7 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 repo/.gitignore create mode 100644 repo/.project create mode 100644 repo/category.xml create mode 100644 repo/pom.xml diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index f7a9bb41e62..8c9b6a932a9 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -7,7 +7,7 @@ Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, - org.eclipse.remote.core;bundle-version="[1.1.0,2.0.0)";visibility:=reexport, + org.eclipse.remote.core;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, org.eclipse.core.filesystem Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy diff --git a/features/org.eclipse.launchbar/.project b/features/org.eclipse.launchbar/.project index f852f2b73be..493b389be33 100644 --- a/features/org.eclipse.launchbar/.project +++ b/features/org.eclipse.launchbar/.project @@ -14,11 +14,4 @@ org.eclipse.pde.FeatureNature - - - parent-pom.xml - 1 - PARENT-2-PROJECT_LOC/pom.xml - - diff --git a/pom.xml b/pom.xml index 26674dfc6f3..95190e95616 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,12 @@ eclipse - http://download.eclipse.org/releases/luna + http://download.eclipse.org/releases/luna/ + p2 + + + license + http://download.eclipse.org/cbi/updates/license/ p2 @@ -48,6 +53,8 @@ bundles/org.eclipse.launchbar.core bundles/org.eclipse.launchbar.ui + features/org.eclipse.launchbar + repo diff --git a/repo/.gitignore b/repo/.gitignore new file mode 100644 index 00000000000..b83d22266ac --- /dev/null +++ b/repo/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/repo/.project b/repo/.project new file mode 100644 index 00000000000..a73ac2695be --- /dev/null +++ b/repo/.project @@ -0,0 +1,24 @@ + + + org.eclipse.launchbar-repo + + + + + + + + + + parent-pom.xml + 1 + PARENT-1-PROJECT_LOC/pom.xml + + + + + copy_PARENT + $%7BPARENT-1-PROJECT_LOC%7D + + + diff --git a/repo/category.xml b/repo/category.xml new file mode 100644 index 00000000000..348ed2527d8 --- /dev/null +++ b/repo/category.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/repo/pom.xml b/repo/pom.xml new file mode 100644 index 00000000000..f0d452be228 --- /dev/null +++ b/repo/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../pom.xml + + + repo + eclipse-repository + From a3cf9db1ce89756644ec950207ea6f373f5a072e Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 11 Dec 2014 20:26:31 -0500 Subject: [PATCH 004/198] Fix feature version. --- features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 0e845c9f992..2e413fd1721 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index 7ee094fdfe7..73646980c7b 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 8.5.0-SNAPSHOT + 1.0.0-SNAPSHOT eclipse-feature From ac02204fdeb0cd4151403c1700e2c0f0d00c6fc5 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 6 Jan 2015 16:50:24 -0500 Subject: [PATCH 005/198] launchBar: sash for increasing recently used size launch element drop down has hardcoded list of 3 elements of recent history, sometimes it is too many, sometimes not enought. added sash so user can resize it save this as preference, but no ui to edit this preference in pref pages for now --- .../launchbar/ui/internal/Activator.java | 1 + .../LaunchBarPreferenceInitializer.java | 1 + .../ui/internal/controls/CSelector.java | 193 +++++++----------- .../ui/internal/controls/ConfigSelector.java | 30 ++- 4 files changed, 101 insertions(+), 124 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index bcd1e95ab04..2782da9f952 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -52,6 +52,7 @@ public class Activator extends AbstractUIPlugin { // Preference ids public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; + public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; // The shared instance private static Activator plugin; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java index 1076062a332..c74b8511e13 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java @@ -9,6 +9,7 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true); + store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 138db7dd720..cfa3aeb8781 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -13,6 +13,8 @@ package org.eclipse.launchbar.ui.internal.controls; import java.util.Arrays; import java.util.Comparator; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.launchbar.ui.IHoverProvider; @@ -42,42 +44,35 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Sash; import org.eclipse.swt.widgets.Shell; public abstract class CSelector extends Composite { - private IStructuredContentProvider contentProvider; private ILabelProvider labelProvider; private IHoverProvider hoverProvider; private Comparator sorter; - private Object input; - private Composite buttonComposite; private String toolTipText; private boolean toolTipWasModified; // Used for the hover provider - private static final int arrowMax = 2; private Transition arrowTransition; - private Object selection; - protected final Color backgroundColor; protected final Color outlineColor; protected final Color highlightColor; protected final Color white; - private boolean mouseOver; - private Image editImage; private boolean inEditButton; private Image buttonImage; private Label currentIcon; private Label currentLabel; - private Shell popup; private ListItem listItems[]; private int selIndex; @@ -86,8 +81,6 @@ public abstract class CSelector extends Composite { private int scrollBucket; private final int maxScrollBucket = 7; private int separatorIndex = -1; - - private MouseTrackListener mouseTrackListener = new MouseTrackListener() { @Override public void mouseEnter(MouseEvent e) { @@ -133,7 +126,6 @@ public abstract class CSelector extends Composite { } } }; - private MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(MouseEvent event) { @@ -144,7 +136,6 @@ public abstract class CSelector extends Composite { } } }; - private Listener focusOutListener = new Listener() { @Override public void handleEvent(Event event) { @@ -159,7 +150,6 @@ public abstract class CSelector extends Composite { } } break; - case SWT.MouseUp: if (popup != null && !popup.isDisposed()) { Point loc = getDisplay().getCursorLocation(); @@ -170,21 +160,16 @@ public abstract class CSelector extends Composite { break; } } - }; - public CSelector(Composite parent, int style) { super(parent, style); - backgroundColor = new Color(getDisplay(), new RGB(249, 249, 249)); outlineColor = new Color(getDisplay(), new RGB(189, 195, 200)); highlightColor = new Color(getDisplay(), new RGB(223, 239, 241)); white = getDisplay().getSystemColor(SWT.COLOR_WHITE); - GridLayout mainButtonLayout = new GridLayout(); setLayout(mainButtonLayout); - addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { @@ -197,7 +182,6 @@ public abstract class CSelector extends Composite { gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); } }); - addMouseListener(mouseListener); addMouseTrackListener(mouseTrackListener); } @@ -218,23 +202,17 @@ public abstract class CSelector extends Composite { public void setSelection(Object element) { this.selection = element; - if (buttonComposite != null) buttonComposite.dispose(); - toolTipText = getToolTipText(); - boolean editable = false; int columns = 2; - Image image = labelProvider.getImage(element); if (image != null) columns++; - editable = isEditable(element); if (editable) columns++; - buttonComposite = new Composite(this, SWT.NONE); GridLayout buttonLayout = new GridLayout(columns, false); buttonLayout.marginHeight = buttonLayout.marginWidth = 0; @@ -244,7 +222,6 @@ public abstract class CSelector extends Composite { buttonComposite.addMouseListener(mouseListener); buttonComposite.addMouseTrackListener(mouseTrackListener); buttonComposite.setToolTipText(toolTipText); - if (element != null) { if (image != null) { Label icon = createImage(buttonComposite, image); @@ -253,7 +230,6 @@ public abstract class CSelector extends Composite { currentIcon = icon; currentIcon.setToolTipText(toolTipText); } - Label label = createLabel(buttonComposite, element); label.addMouseListener(mouseListener); label.addMouseTrackListener(mouseTrackListener); @@ -265,7 +241,6 @@ public abstract class CSelector extends Composite { currentIcon = null; currentLabel = null; } - final Canvas arrow = new Canvas(buttonComposite, SWT.NONE) { @Override public Point computeSize(int wHint, int hHint, boolean changed) { @@ -275,19 +250,15 @@ public abstract class CSelector extends Composite { arrow.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); arrow.setBackground(backgroundColor); arrowTransition = new Transition(arrow, arrowMax, 80); - arrow.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { final int hPadding = 2; - GC gc = e.gc; LineAttributes attributes = new LineAttributes(2); attributes.cap = SWT.CAP_ROUND; gc.setLineAttributes(attributes); - gc.setAlpha(mouseOver ? 255 : 100); - Rectangle bounds = arrow.getBounds(); int arrowWidth = bounds.width - hPadding * 2; int current = arrowTransition.getCurrent(); @@ -298,14 +269,11 @@ public abstract class CSelector extends Composite { bounds.height / 2 - current }); } }); - arrow.addMouseListener(mouseListener); arrow.addMouseTrackListener(mouseTrackListener); - if (editable) { Control editButton = createEditButton(buttonComposite, element); editButton.setBackground(backgroundColor); - editButton.addMouseListener(new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { @@ -321,7 +289,6 @@ public abstract class CSelector extends Composite { } }); } - layout(); } @@ -343,77 +310,53 @@ public abstract class CSelector extends Composite { Object[] elements = contentProvider.getElements(input); if (elements.length == 0 && !hasActionArea()) return; - arrowTransition.to(-arrowMax); - if (popup != null && !popup.isDisposed()) { popup.dispose(); } - popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP); - GridLayout layout = new GridLayout(); - layout.marginHeight = layout.marginWidth = 0; - layout.verticalSpacing = 0; - popup.setLayout(layout); - + popup.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); listScrolled = new ScrolledComposite(popup, SWT.V_SCROLL | SWT.NO_BACKGROUND); listScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); listScrolled.setExpandHorizontal(true); - Composite listComp = new Composite(listScrolled, SWT.NONE); + final Composite listComp = new Composite(listScrolled, SWT.NONE); listScrolled.setContent(listComp); - layout = new GridLayout(); - layout.marginHeight = layout.marginWidth = 0; - layout.verticalSpacing = 0; - listComp.setLayout(layout); - - for (Control child : listComp.getChildren()) - child.dispose(); - + listComp.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); if (sorter != null) Arrays.sort(elements, sorter); - listItems = new ListItem[elements.length]; - - int heightHint = 0; - for (int i = 0; i < elements.length; ++i) { - if (i == separatorIndex) { - Label label = new Label(listComp, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.BORDER); - label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - } - listItems[i] = new ListItem(listComp, SWT.NONE, elements[i], i); - if (i < maxScrollBucket) { // this is how many visible by default - listItems[i].lazyInit(); - if (i == 0) { - heightHint = listItems[0].computeSize(SWT.DEFAULT, SWT.DEFAULT).y; + if (elements.length > 0) { + listItems[0] = new ListItem(listComp, SWT.NONE, elements[0], 0); + listItems[0].lazyInit(); + final int hHint = Math.max(listItems[0].computeSize(SWT.DEFAULT, SWT.DEFAULT).y, 16); + for (int i = 1; i < elements.length; ++i) { + ListItem item = new ListItem(listComp, SWT.NONE, elements[i], i); + if (i < maxScrollBucket) { // this is how many visible by default + item.lazyInit(); + } else { + ((GridData) item.getLayoutData()).heightHint = hHint; } - } else { - GridData gd = (GridData) listItems[i].getLayoutData(); - gd.heightHint = heightHint; + listItems[i] = item; } + createSash(listComp, hHint); } - Point listCompSize = listComp.computeSize(SWT.DEFAULT, SWT.DEFAULT); listComp.setSize(listCompSize); - if (hasActionArea()) createActionArea(popup); - Rectangle buttonBounds = getBounds(); Point popupLocation = popup.getDisplay().map(this, null, 0, buttonBounds.height); popup.setLocation(popupLocation.x, popupLocation.y + 5); - Point size = popup.computeSize(SWT.DEFAULT, SWT.DEFAULT); Point buttonSize = getSize(); size.x = Math.min(size.x + 16, buttonSize.x * 4 / 3); size.y = Math.min(size.y, 250); popup.setSize(size); - popup.setVisible(true); popup.setFocus(); getDisplay().addFilter(SWT.FocusOut, focusOutListener); getDisplay().addFilter(SWT.MouseUp, focusOutListener); - popup.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { @@ -428,6 +371,51 @@ public abstract class CSelector extends Composite { } } + private void createSash(final Composite listComp, final int hHint) { + if (separatorIndex<0) return; + + final Sash sash = new Sash(listComp, SWT.BORDER | SWT.HORIZONTAL); + sash.setLayoutData(GridDataFactory.fillDefaults().create()); + + if (separatorIndex < listItems.length) + sash.moveAbove(listItems[separatorIndex]); + else + sash.moveBelow(null); + + sash.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event e) { + separatorIndex = (e.y + hHint/2) / hHint; + } + }); + + sash.addMouseListener(new MouseListener() { + @Override + public void mouseUp(MouseEvent e) { + setSeparatorIndex(separatorIndex); // call setter if it was overriden + if (separatorIndex >= 0) { + if (separatorIndex < listItems.length) + sash.moveAbove(listItems[separatorIndex]); + else + sash.moveBelow(null); + listComp.layout(); + } + } + + @Override + public void mouseDown(MouseEvent e) { + sash.moveAbove(null); // keep on top so user see it when moving + } + + @Override + public void mouseDoubleClick(MouseEvent e) { + // ignore + } + }); + + sash.setToolTipText("Increase/Decrease size of recently used elements pane"); + } + private void closePopup() { arrowTransition.to(arrowMax); popup.setVisible(false); @@ -438,17 +426,16 @@ public abstract class CSelector extends Composite { } }); } - TraverseListener listItemTraverseListener = new TraverseListener() { @Override public void keyTraversed(TraverseEvent e) { - final ListItem currItem = selIndex >=0 ? listItems[selIndex] : null; + final ListItem currItem = selIndex >= 0 ? listItems[selIndex] : null; if (currItem == null && e.keyCode != SWT.ARROW_DOWN) { return; } if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_TAB_NEXT) { if (inEditButton || e.keyCode == SWT.ARROW_DOWN) { - int maxIdx = listItems.length -1; + int maxIdx = listItems.length - 1; if (selIndex < maxIdx) { inEditButton = false; if (currItem != null) @@ -465,7 +452,7 @@ public abstract class CSelector extends Composite { listItems[selIndex].setBackground(highlightColor); } else if (selIndex == maxIdx && maxIdx > maxScrollBucket) { // level the scroll for any offset at the bottom of the list - listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket +1)); + listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket + 1)); } } else if (currItem.editButton != null) { // move focus on edit button @@ -530,12 +517,10 @@ public abstract class CSelector extends Composite { super(parent, style); this.element = _element; this.index = index; - setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { - Point size = getSize(); GC gc = e.gc; gc.setForeground(outlineColor); @@ -544,24 +529,20 @@ public abstract class CSelector extends Composite { lazyInit(); } }); - // lazyInit(); - } // end ListItem(..) + } // end ListItem(..) protected void lazyInit() { - Image image = labelProvider.getImage(element); + Image image = labelProvider.getImage(element); boolean editable = isEditable(element); - int columns = 1; if (image != null) columns++; if (editable) columns++; - GridLayout layout = new GridLayout(columns, false); layout.marginWidth = layout.marginHeight = 7; setLayout(layout); - MouseListener listItemMouseListener = new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { @@ -570,7 +551,6 @@ public abstract class CSelector extends Composite { fireSelectionChanged(); } }; - MouseTrackListener listItemMouseTrackListener = new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { @@ -581,7 +561,7 @@ public abstract class CSelector extends Composite { listItems[selIndex].setBackground(white); scrollBucket = Math.max(Math.min(scrollBucket + idx - selIndex, maxScrollBucket), 0); } else { // initially - scrollBucket = Math.min(idx, maxScrollBucket); + scrollBucket = Math.min(idx, maxScrollBucket); } } selIndex = idx; @@ -592,25 +572,20 @@ public abstract class CSelector extends Composite { setBackground(white); } }; - addMouseListener(listItemMouseListener); - addMouseTrackListener(listItemMouseTrackListener); - + // addMouseTrackListener(listItemMouseTrackListener); if (image != null) { icon = createImage(this, image); icon.addMouseListener(listItemMouseListener); icon.addMouseTrackListener(listItemMouseTrackListener); } - label = createLabel(this, element); label.addMouseListener(listItemMouseListener); label.addMouseTrackListener(listItemMouseTrackListener); - if (editable) { editButton = createEditButton(this, element); editButton.setBackground(white); editButton.addMouseTrackListener(listItemMouseTrackListener); - editButton.addMouseListener(new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { @@ -625,27 +600,21 @@ public abstract class CSelector extends Composite { }); } }); - editButton.addTraverseListener(listItemTraverseListener); } else { addTraverseListener(listItemTraverseListener); } - setBackground(white); - layout(true); - } + } @Override public void setBackground(Color color) { super.setBackground(color); - if (icon != null && !icon.isDisposed()) icon.setBackground(color); - - if (!label.isDisposed()) + if (label != null && !label.isDisposed()) label.setBackground(color); - if (editButton != null && !editButton.isDisposed()) editButton.setBackground(color); } @@ -663,7 +632,7 @@ public abstract class CSelector extends Composite { protected int getIndex() { return index; } - } // end ListItem class + } // end ListItem class private Label createImage(Composite parent, Image image) { Rectangle bounds = image.getBounds(); @@ -705,18 +674,15 @@ public abstract class CSelector extends Composite { if (editImage == null) { editImage = Activator.getImageDescriptor("icons/config_config.png").createImage(); } - final Canvas editButton = new Canvas(parent, SWT.NONE) { @Override - public Point computeSize(int wHint, int hHint, boolean changed) { + public Point computeSize(int wHint, int hHint, boolean changed) { Rectangle bounds = editImage.getBounds(); return new Point(bounds.width, bounds.height); }; }; - editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); editButton.setToolTipText("Edit"); - editButton.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { @@ -725,7 +691,6 @@ public abstract class CSelector extends Composite { gc.drawImage(editImage, 0, 0); } }); - editButton.addMouseTrackListener(new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { @@ -739,7 +704,6 @@ public abstract class CSelector extends Composite { editButton.redraw(); } }); - return editButton; } @@ -788,19 +752,16 @@ public abstract class CSelector extends Composite { if (currentIcon != null && !currentIcon.isDisposed()) { currentIcon.setImage(labelProvider.getImage(element)); } - if (currentLabel != null && !currentLabel.isDisposed()) { currentLabel.setText(labelProvider.getText(element)); } } - if (popup != null && !popup.isDisposed()) { Object[] elements = contentProvider.getElements(input); int i; for (i = 0; i < elements.length; ++i) if (element == elements[i]) break; - if (i != elements.length) { listItems[i].setImage(labelProvider.getImage(element)); listItems[i].setText(labelProvider.getText(element)); @@ -811,7 +772,7 @@ public abstract class CSelector extends Composite { protected boolean hasActionArea() { return false; } - + protected void createActionArea(Composite parent) { // empty } @@ -819,7 +780,7 @@ public abstract class CSelector extends Composite { protected boolean isEditable(Object element) { return false; } - + protected void handleEdit(Object element) { // nothing to do here } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index f50e84ce9fc..9437285e1a6 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -26,6 +26,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -60,12 +61,10 @@ import org.eclipse.ui.PlatformUI; @SuppressWarnings("restriction") public class ConfigSelector extends CSelector { - private LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); private DefaultDescriptorLabelProvider defaultProvider; private static final String[] noConfigs = new String[] { "No Launch Configurations" }; - private static final int SEPARATOR_INDEX = 3; public ConfigSelector(Composite parent, int style) { super(parent, style); @@ -84,12 +83,13 @@ public class ConfigSelector extends CSelector { public Object[] getElements(Object inputElement) { ILaunchDescriptor[] descs = uiManager.getManager().getLaunchDescriptors(); if (descs.length > 0) { - if (descs.length > SEPARATOR_INDEX + 1) { - ILaunchDescriptor[] descsCopy = new ILaunchDescriptor[SEPARATOR_INDEX + descs.length]; - System.arraycopy(descs, 0, descsCopy, 0, SEPARATOR_INDEX); // copy first 3 elements - System.arraycopy(descs, 0, descsCopy, SEPARATOR_INDEX, descs.length); // copy all into rest + int separatorIndex = getSeparatorIndex(); + if (descs.length > separatorIndex + 1) { + ILaunchDescriptor[] descsCopy = new ILaunchDescriptor[separatorIndex + descs.length]; + System.arraycopy(descs, 0, descsCopy, 0, separatorIndex); // copy first 3 elements + System.arraycopy(descs, 0, descsCopy, separatorIndex, descs.length); // copy all into rest // sort rest - Arrays.sort(descsCopy, SEPARATOR_INDEX, descsCopy.length, new Comparator() { + Arrays.sort(descsCopy, separatorIndex, descsCopy.length, new Comparator() { @Override public int compare(ILaunchDescriptor o1, ILaunchDescriptor o2) { return o1.getName().compareTo(o2.getName()); @@ -143,7 +143,11 @@ public class ConfigSelector extends CSelector { }); // no sorter on view, data is sorted by provider setSorter(null); - setSeparatorIndex(SEPARATOR_INDEX); + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + int separator = store.getInt(Activator.PREF_LAUNCH_HISTORY_SIZE); + if (separator <= 0) + separator = 1; + setSeparatorIndex(separator); } @Override @@ -159,6 +163,16 @@ public class ConfigSelector extends CSelector { } } + @Override + public void setSeparatorIndex(int separatorIndex) { + super.setSeparatorIndex(separatorIndex); + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + int separator = store.getInt(Activator.PREF_LAUNCH_HISTORY_SIZE); + if (separator != getSeparatorIndex()) { + store.setValue(Activator.PREF_LAUNCH_HISTORY_SIZE, getSeparatorIndex()); + } + } + @Override public boolean isEditable(Object element) { return element instanceof ILaunchDescriptor; From bb7f665007a0e65eaa8d10f974e14bd0c84e3088 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 13 Jan 2015 14:14:56 -0500 Subject: [PATCH 006/198] Add tests and make them run (adding hamcrest properly) Change-Id: Ifc2e5d9cd4289147539d6b90b59f689ffdf69a37 --- bundles/org.eclipse.launchbar.core/.gitignore | 1 + bundles/org.eclipse.launchbar.ui/.gitignore | 1 + pom.xml | 85 ++++++++++--------- .../.gitignore | 1 + .../META-INF/MANIFEST.MF | 4 +- .../org.eclipse.launchbar.core.tests/pom.xml | 25 +++--- 6 files changed, 60 insertions(+), 57 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/.gitignore create mode 100644 bundles/org.eclipse.launchbar.ui/.gitignore create mode 100644 tests/org.eclipse.launchbar.core.tests/.gitignore diff --git a/bundles/org.eclipse.launchbar.core/.gitignore b/bundles/org.eclipse.launchbar.core/.gitignore new file mode 100644 index 00000000000..ae3c1726048 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/bundles/org.eclipse.launchbar.ui/.gitignore b/bundles/org.eclipse.launchbar.ui/.gitignore new file mode 100644 index 00000000000..ae3c1726048 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/pom.xml b/pom.xml index 95190e95616..68f944f7ea0 100644 --- a/pom.xml +++ b/pom.xml @@ -48,21 +48,27 @@ http://download.eclipse.org/cbi/updates/license/ p2 + + orbit + http://download.eclipse.org/tools/orbit/downloads/drops/S20141129202728/repository/ + p2 + bundles/org.eclipse.launchbar.core bundles/org.eclipse.launchbar.ui features/org.eclipse.launchbar + tests/org.eclipse.launchbar.core.tests repo - + cbi https://repo.eclipse.org/content/repositories/cbi-releases/ - + cdtRepo @@ -325,43 +331,44 @@ - org.eclipse.tycho.extras - tycho-eclipserun-plugin - ${tycho-extras-version} - - -application org.eclipse.ant.core.antRunner -buildfile customBuildCallbacks.xml build.index - - - org.apache.ant - eclipse-plugin - - - org.eclipse.help.base - eclipse-plugin - - - org.eclipse.ant.core - eclipse-plugin - - - - - - platform - p2 - ${help-docs-eclipserun-repo} - - - - - - - eclipse-run - - compile - - - + org.eclipse.tycho.extras + tycho-eclipserun-plugin + ${tycho-extras-version} + + -application org.eclipse.ant.core.antRunner -buildfile + customBuildCallbacks.xml build.index + + + org.apache.ant + eclipse-plugin + + + org.eclipse.help.base + eclipse-plugin + + + org.eclipse.ant.core + eclipse-plugin + + + + + + platform + p2 + ${help-docs-eclipserun-repo} + + + + + + + eclipse-run + + compile + + + diff --git a/tests/org.eclipse.launchbar.core.tests/.gitignore b/tests/org.eclipse.launchbar.core.tests/.gitignore new file mode 100644 index 00000000000..ae3c1726048 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF index 5879f5a2dc7..a2e3bac8547 100644 --- a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF @@ -8,9 +8,7 @@ Require-Bundle: org.eclipse.core.runtime, org.junit;bundle-version="4.11.0", org.mockito, org.eclipse.launchbar.core;bundle-version="1.0.0", - org.eclipse.debug.core, - org.eclipse.core.filesystem, - org.hamcrest.core + org.eclipse.debug.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core.tests diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index fdc0bfe274d..b9830dc3ba6 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -20,23 +20,18 @@ org.eclipse.tycho - tycho-surefire-plugin + target-platform-configuration ${tycho-version} - - true - ${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m - -Xmx512m -XX:MaxPermSize=256M - - **/AutomatedIntegrationSuite.* - - true - - - org.eclipse.platform.feature.group - p2-installable-unit - - + + + + eclipse-plugin + org.hamcrest + 0.0.0 + + + From edeec7aaaa0c4fe189ccf54b3602a403838e2751 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 13 Jan 2015 16:48:24 -0500 Subject: [PATCH 007/198] LaunchBar: ui changes in selector - added ability to filter by typing in selector pop-up - refactored list part of selection in its own components which is kind of list viewer - filter is visible by default if we have more than 7 elements in drop down - filter become visible if user start typing, even if it was not visible originally - moving storing of history size into the list viewer itself - hooked up proper focus support and keyboard traversal - modified CButton so we can re-use it for Edit button of selectors and list items - when filtering is activated history list is no longer available Change-Id: I2057ad658f5a5c9f8fbce203748d26d7e4b14dd6 --- .../icons/edit_cold.png | Bin 0 -> 574 bytes .../launchbar/ui/internal/Activator.java | 10 +- .../ui/internal/controls/CButton.java | 60 +- .../ui/internal/controls/CSelector.java | 514 ++++--------- .../ui/internal/controls/ConfigSelector.java | 68 +- .../ui/internal/controls/EditButton.java | 13 + .../ui/internal/controls/FilterControl.java | 472 ++++++++++++ .../controls/LaunchBarListViewer.java | 711 ++++++++++++++++++ .../ui/internal/controls/TargetSelector.java | 4 +- 9 files changed, 1416 insertions(+), 436 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/icons/edit_cold.png create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java diff --git a/bundles/org.eclipse.launchbar.ui/icons/edit_cold.png b/bundles/org.eclipse.launchbar.ui/icons/edit_cold.png new file mode 100644 index 0000000000000000000000000000000000000000..5a49a09fa007e4aaabcec109529e4600d1bed80d GIT binary patch literal 574 zcmV-E0>S->P) zDA9{H0b>yuL*(KFghbM6G0ix+XIUgSf5yKJ8}3m;kSWun} zBLLl#SrzdRqs3UaviTdQlL4RKlm)LR+}GS7zyV})mB7pD@ydT|FRN#Bm0-yO zDbesUmKqy+Y`BU`iN?%>lTUB=9HeC&AQnvI{tx?p2yj6cYl272F9Q=t9!7T3d$;aC z4#)1>m3;no1Q3SL5=npQ3y@hQCjDH+AM1C#q;UHZY0v@8BxKBQ)WR@41Teo*^U~t$ z0oailBa4$5_F7wlkE>GRfs3F)A-}oP1xU_T^sWlO*pXQq0;~#jXG!dJ-^1Qy`doVk5JOB6*EsJboaqpJAZ!&qbp6asU7T M07*qoM6N<$f;l7hEdT%j literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index 2782da9f952..dc0f8931df7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -99,7 +99,15 @@ public class Activator extends AbstractUIPlugin { } public Image getImage(String id) { - return getImageRegistry().get(id); + Image im = getImageRegistry().get(id); + if (im == null) { + ImageDescriptor des = getImageDescriptor(id); + if (des != null) { + im = des.createImage(); + getImageRegistry().put(id, im); + } + } + return im; } public static ImageDescriptor getImageDescriptor(String path) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java index cc62e1f5e7f..df1dbe4443d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java @@ -10,25 +10,27 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.events.SelectionListener; 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.TypedListener; public class CButton extends Canvas { - private boolean inButton; private Image hotImage; private Image coldImage; - + public CButton(Composite parent, int style) { super(parent, style); - addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { @@ -47,17 +49,28 @@ public class CButton extends Canvas { } } }); - addMouseTrackListener(new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { - inButton = true; - redraw(); + setSelected(true); } + @Override public void mouseExit(MouseEvent e) { - inButton = false; - redraw(); + setSelected(false); + } + }); + addMouseListener(new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + setSelected(true); + handleSelection(inButton); + } + + @Override + public void mouseDoubleClick(MouseEvent e) { + setSelected(true); + handleDefaultSelection(inButton); } }); } @@ -65,14 +78,12 @@ public class CButton extends Canvas { @Override public void dispose() { super.dispose(); - if (hotImage != null) hotImage.dispose(); - if (coldImage != null) coldImage.dispose(); } - + @Override public Point computeSize(int wHint, int hHint, boolean changed) { int width = 0; @@ -91,7 +102,7 @@ public class CButton extends Canvas { } return new Point(width, height); } - + public void setHotImage(Image image) { this.hotImage = image; } @@ -100,4 +111,29 @@ public class CButton extends Canvas { this.coldImage = image; } + protected void handleSelection(boolean selection) { + // Send event + notifyListeners(SWT.Selection, null); + } + + protected void handleDefaultSelection(boolean selection) { + // Send event + notifyListeners(SWT.DefaultSelection, null); + } + + public void addSelectionListener(SelectionListener listener) { + checkWidget(); + TypedListener typedListener = new TypedListener(listener); + addListener(SWT.Selection, typedListener); + addListener(SWT.DefaultSelection, typedListener); + } + + public void setSelected(boolean sel) { + inButton = sel; + redraw(); + } + + public boolean isSelected() { + return inButton; + } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index cfa3aeb8781..fb6d6879e60 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -10,52 +10,53 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; -import java.util.Arrays; import java.util.Comparator; -import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.launchbar.ui.IHoverProvider; -import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; 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.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.LineAttributes; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Sash; import org.eclipse.swt.widgets.Shell; public abstract class CSelector extends Composite { private IStructuredContentProvider contentProvider; private ILabelProvider labelProvider; private IHoverProvider hoverProvider; - private Comparator sorter; + private Comparator sorter; + private Comparator sorterTop; private Object input; private Composite buttonComposite; private String toolTipText; @@ -68,19 +69,10 @@ public abstract class CSelector extends Composite { protected final Color highlightColor; protected final Color white; private boolean mouseOver; - private Image editImage; - private boolean inEditButton; - private Image buttonImage; private Label currentIcon; private Label currentLabel; private Shell popup; - private ListItem listItems[]; - private int selIndex; - private ScrolledComposite listScrolled; - private final int itemH = 30; - private int scrollBucket; - private final int maxScrollBucket = 7; - private int separatorIndex = -1; + private LaunchBarListViewer listViewer; private MouseTrackListener mouseTrackListener = new MouseTrackListener() { @Override public void mouseEnter(MouseEvent e) { @@ -130,43 +122,91 @@ public abstract class CSelector extends Composite { @Override public void mouseUp(MouseEvent event) { if (popup == null || popup.isDisposed()) { + setFocus(); openPopup(); } else { closePopup(); } } }; + + protected boolean isFocusAncestor(Control control) { + while (control != null && control != this && !(control instanceof Shell)) { + control = control.getParent(); + } + return control == this; + } private Listener focusOutListener = new Listener() { + private Job closingJob; + @Override public void handleEvent(Event event) { switch (event.type) { - case SWT.FocusOut: - Control focusControl = getDisplay().getFocusControl(); - if (focusControl != null && focusControl.getShell() == popup) { - Point loc = getDisplay().getCursorLocation(); - if (!getBounds().contains(toControl(loc))) { - // Don't do it if we're in the selector, we'll deal with that later - closePopup(); - } + case SWT.FocusIn: + if (closingJob != null) + closingJob.cancel(); + if (event.widget instanceof Control && isFocusAncestor((Control) event.widget)) { + break; // not closing + } + if (!isPopUpInFocus()) { + closePopup(); } break; - case SWT.MouseUp: + case SWT.FocusOut: + if (isPopUpInFocus()) { + // we about to loose focus from popup children, but it may go + // to another child, lets schedule a job to wait before we close + if (closingJob != null) + closingJob.cancel(); + closingJob = new Job("Closing popup") { + @Override + protected IStatus run(IProgressMonitor monitor) { + if (monitor.isCanceled()) + return Status.CANCEL_STATUS; + + closePopup(); + closingJob = null; + return Status.OK_STATUS; + } + }; + closingJob.schedule(300); + } + break; + case SWT.MouseUp: { if (popup != null && !popup.isDisposed()) { Point loc = getDisplay().getCursorLocation(); - if (!popup.getBounds().contains(loc) && !getBounds().contains(toControl(loc))) { + if (!popup.getBounds().contains(loc) && !getBounds().contains(getParent().toControl(loc))) { closePopup(); } } break; } + } + } + + }; + private ICellModifier modifier = new ICellModifier() { + @Override + public void modify(Object element, String property, Object value) { + handleEdit(element); + } + + @Override + public Object getValue(Object element, String property) { + return null; + } + + @Override + public boolean canModify(Object element, String property) { + return isEditable(element); } }; public CSelector(Composite parent, int style) { super(parent, style); - backgroundColor = new Color(getDisplay(), new RGB(249, 249, 249)); - outlineColor = new Color(getDisplay(), new RGB(189, 195, 200)); - highlightColor = new Color(getDisplay(), new RGB(223, 239, 241)); + backgroundColor = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); + outlineColor = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); + highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); white = getDisplay().getSystemColor(SWT.COLOR_WHITE); GridLayout mainButtonLayout = new GridLayout(); setLayout(mainButtonLayout); @@ -186,16 +226,17 @@ public abstract class CSelector extends Composite { addMouseTrackListener(mouseTrackListener); } + private boolean isPopUpInFocus() { + Control focusControl = getDisplay().getFocusControl(); + if (focusControl != null && focusControl.getShell() == popup) { + return true; + } + return false; + } + @Override public void dispose() { super.dispose(); - backgroundColor.dispose(); - outlineColor.dispose(); - highlightColor.dispose(); - if (editImage != null) - editImage.dispose(); - if (buttonImage != null) - buttonImage.dispose(); if (popup != null) popup.dispose(); } @@ -272,11 +313,12 @@ public abstract class CSelector extends Composite { arrow.addMouseListener(mouseListener); arrow.addMouseTrackListener(mouseTrackListener); if (editable) { - Control editButton = createEditButton(buttonComposite, element); + final EditButton editButton = new EditButton(buttonComposite, SWT.NONE); + editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); editButton.setBackground(backgroundColor); - editButton.addMouseListener(new MouseAdapter() { + editButton.addSelectionListener(new SelectionAdapter() { @Override - public void mouseUp(MouseEvent e) { + public void widgetSelected(SelectionEvent e) { // Need to run this after the current event storm // Or we get a disposed error. getDisplay().asyncExec(new Runnable() { @@ -316,32 +358,25 @@ public abstract class CSelector extends Composite { } popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP); popup.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); - listScrolled = new ScrolledComposite(popup, SWT.V_SCROLL | SWT.NO_BACKGROUND); - listScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - listScrolled.setExpandHorizontal(true); - final Composite listComp = new Composite(listScrolled, SWT.NONE); - listScrolled.setContent(listComp); - listComp.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); - if (sorter != null) - Arrays.sort(elements, sorter); - listItems = new ListItem[elements.length]; - if (elements.length > 0) { - listItems[0] = new ListItem(listComp, SWT.NONE, elements[0], 0); - listItems[0].lazyInit(); - final int hHint = Math.max(listItems[0].computeSize(SWT.DEFAULT, SWT.DEFAULT).y, 16); - for (int i = 1; i < elements.length; ++i) { - ListItem item = new ListItem(listComp, SWT.NONE, elements[i], i); - if (i < maxScrollBucket) { // this is how many visible by default - item.lazyInit(); - } else { - ((GridData) item.getLayoutData()).heightHint = hHint; + + + listViewer = new LaunchBarListViewer(popup); + initializeListViewer(listViewer); + listViewer.setFilterVisible(elements.length > 7); + listViewer.setInput(input); + listViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override + public void selectionChanged(SelectionChangedEvent event) { + if (!listViewer.isFinalSelection()) + return; + StructuredSelection ss = (StructuredSelection) event.getSelection(); + if (!ss.isEmpty()) { + setSelection(ss.getFirstElement()); + fireSelectionChanged(); } - listItems[i] = item; + closePopup(); } - createSash(listComp, hHint); - } - Point listCompSize = listComp.computeSize(SWT.DEFAULT, SWT.DEFAULT); - listComp.setSize(listCompSize); + }); if (hasActionArea()) createActionArea(popup); Rectangle buttonBounds = getBounds(); @@ -350,295 +385,53 @@ public abstract class CSelector extends Composite { popup.setLocation(popupLocation.x, popupLocation.y + 5); Point size = popup.computeSize(SWT.DEFAULT, SWT.DEFAULT); Point buttonSize = getSize(); - size.x = Math.min(size.x + 16, buttonSize.x * 4 / 3); - size.y = Math.min(size.y, 250); + size.x = Math.max(size.x, buttonSize.x); + size.y = Math.min(size.y, 300); popup.setSize(size); popup.setVisible(true); popup.setFocus(); + getDisplay().addFilter(SWT.FocusIn, focusOutListener); getDisplay().addFilter(SWT.FocusOut, focusOutListener); getDisplay().addFilter(SWT.MouseUp, focusOutListener); popup.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { + getDisplay().removeFilter(SWT.FocusIn, focusOutListener); getDisplay().removeFilter(SWT.FocusOut, focusOutListener); getDisplay().removeFilter(SWT.MouseUp, focusOutListener); } }); - selIndex = -1; - scrollBucket = 0; if (hoverProvider != null) { hoverProvider.dismissHover(selection != null ? selection : null, true); } } - private void createSash(final Composite listComp, final int hHint) { - if (separatorIndex<0) return; - - final Sash sash = new Sash(listComp, SWT.BORDER | SWT.HORIZONTAL); - sash.setLayoutData(GridDataFactory.fillDefaults().create()); - - if (separatorIndex < listItems.length) - sash.moveAbove(listItems[separatorIndex]); - else - sash.moveBelow(null); - - sash.addListener(SWT.Selection, new Listener() { - @Override - public void handleEvent(Event e) { - separatorIndex = (e.y + hHint/2) / hHint; - } - }); - - sash.addMouseListener(new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - setSeparatorIndex(separatorIndex); // call setter if it was overriden - if (separatorIndex >= 0) { - if (separatorIndex < listItems.length) - sash.moveAbove(listItems[separatorIndex]); - else - sash.moveBelow(null); - listComp.layout(); - } - } - - @Override - public void mouseDown(MouseEvent e) { - sash.moveAbove(null); // keep on top so user see it when moving - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - // ignore - } - }); - - sash.setToolTipText("Increase/Decrease size of recently used elements pane"); + protected void initializeListViewer(LaunchBarListViewer listViewer) { + listViewer.setContentProvider(contentProvider); + listViewer.setLabelProvider(labelProvider); + listViewer.setCellModifier(modifier); + listViewer.setComparator(sorter); + listViewer.setHistoryComparator(sorterTop); } private void closePopup() { - arrowTransition.to(arrowMax); - popup.setVisible(false); getDisplay().asyncExec(new Runnable() { @Override public void run() { + if (popup == null || popup.isDisposed()) + return; + arrowTransition.to(arrowMax); + popup.setVisible(false); popup.dispose(); } }); } - TraverseListener listItemTraverseListener = new TraverseListener() { - @Override - public void keyTraversed(TraverseEvent e) { - final ListItem currItem = selIndex >= 0 ? listItems[selIndex] : null; - if (currItem == null && e.keyCode != SWT.ARROW_DOWN) { - return; - } - if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_TAB_NEXT) { - if (inEditButton || e.keyCode == SWT.ARROW_DOWN) { - int maxIdx = listItems.length - 1; - if (selIndex < maxIdx) { - inEditButton = false; - if (currItem != null) - currItem.setBackground(white); - // move to next item - selIndex++; - if (scrollBucket < maxScrollBucket) { - scrollBucket++; - } else { - // need to scroll the list up 1 item - int sY = listScrolled.getOrigin().y; - listScrolled.setOrigin(0, sY + itemH); - } - listItems[selIndex].setBackground(highlightColor); - } else if (selIndex == maxIdx && maxIdx > maxScrollBucket) { - // level the scroll for any offset at the bottom of the list - listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket + 1)); - } - } else if (currItem.editButton != null) { - // move focus on edit button - inEditButton = true; - currItem.editButton.redraw(); - } - } else if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { - if (!inEditButton || e.keyCode == SWT.ARROW_UP) { - if (selIndex > 0) { - inEditButton = false; - currItem.setBackground(white); - // move to previous item - selIndex--; - if (scrollBucket > 0) { - scrollBucket--; - } else { - // need to scroll the list down 1 item - int sY = listScrolled.getOrigin().y; - listScrolled.setOrigin(0, sY - itemH); - } - listItems[selIndex].setBackground(highlightColor); - } else if (selIndex == 0) { - // level any offset @ beginning - listScrolled.setOrigin(0, 0); - } - } else if (currItem.editButton != null) { - // remove focus from edit button - inEditButton = false; - currItem.editButton.redraw(); - } - } else if (e.detail == SWT.TRAVERSE_RETURN) { - if (inEditButton) { - inEditButton = false; - // edit button in list item was pressed - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (CSelector.this.selection != null) - handleEdit(currItem.element); - } - }); - } else { - // list item was pressed - popup.dispose(); - setSelection(currItem.element); - fireSelectionChanged(); - } - } else if (e.detail == SWT.TRAVERSE_ESCAPE) { - popup.dispose(); - } - } - }; - - private class ListItem extends Composite { - protected final Object element; - private Label icon; - private Label label; - protected Control editButton; - private int index; - - public ListItem(Composite parent, int style, Object _element, int index) { - super(parent, style); - this.element = _element; - this.index = index; - setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - Point size = getSize(); - GC gc = e.gc; - gc.setForeground(outlineColor); - gc.drawLine(0, size.y - 1, size.x, size.y - 1); - if (label == null) - lazyInit(); - } - }); - // lazyInit(); - } // end ListItem(..) - - protected void lazyInit() { - Image image = labelProvider.getImage(element); - boolean editable = isEditable(element); - int columns = 1; - if (image != null) - columns++; - if (editable) - columns++; - GridLayout layout = new GridLayout(columns, false); - layout.marginWidth = layout.marginHeight = 7; - setLayout(layout); - MouseListener listItemMouseListener = new MouseAdapter() { - @Override - public void mouseUp(MouseEvent e) { - popup.dispose(); - setSelection(element); - fireSelectionChanged(); - } - }; - MouseTrackListener listItemMouseTrackListener = new MouseTrackAdapter() { - @Override - public void mouseEnter(MouseEvent e) { - setBackground(highlightColor); - int idx = getIndex(); - if (idx != selIndex) { - if (selIndex >= 0) { - listItems[selIndex].setBackground(white); - scrollBucket = Math.max(Math.min(scrollBucket + idx - selIndex, maxScrollBucket), 0); - } else { // initially - scrollBucket = Math.min(idx, maxScrollBucket); - } - } - selIndex = idx; - } - - @Override - public void mouseExit(MouseEvent e) { - setBackground(white); - } - }; - addMouseListener(listItemMouseListener); - // addMouseTrackListener(listItemMouseTrackListener); - if (image != null) { - icon = createImage(this, image); - icon.addMouseListener(listItemMouseListener); - icon.addMouseTrackListener(listItemMouseTrackListener); - } - label = createLabel(this, element); - label.addMouseListener(listItemMouseListener); - label.addMouseTrackListener(listItemMouseTrackListener); - if (editable) { - editButton = createEditButton(this, element); - editButton.setBackground(white); - editButton.addMouseTrackListener(listItemMouseTrackListener); - editButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseUp(MouseEvent e) { - // Need to run this after the current event storm - // Or we get a disposed error. - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (CSelector.this.selection != null) - handleEdit(element); - } - }); - } - }); - editButton.addTraverseListener(listItemTraverseListener); - } else { - addTraverseListener(listItemTraverseListener); - } - setBackground(white); - layout(true); - } - - @Override - public void setBackground(Color color) { - super.setBackground(color); - if (icon != null && !icon.isDisposed()) - icon.setBackground(color); - if (label != null && !label.isDisposed()) - label.setBackground(color); - if (editButton != null && !editButton.isDisposed()) - editButton.setBackground(color); - } - - public void setImage(Image image) { - if (icon != null && !icon.isDisposed()) - icon.setImage(image); - } - - public void setText(String text) { - if (!label.isDisposed()) - label.setText(text); - } - - protected int getIndex() { - return index; - } - } // end ListItem class private Label createImage(Composite parent, Image image) { Rectangle bounds = image.getBounds(); boolean disposeImage = false; if (bounds.height > 16 || bounds.width > 16) { - buttonImage = new Image(getDisplay(), 16, 16); + Image buttonImage = new Image(getDisplay(), 16, 16); GC gc = new GC(buttonImage); gc.setAntialias(SWT.ON); gc.setInterpolation(SWT.HIGH); @@ -646,6 +439,7 @@ public abstract class CSelector extends Composite { image.getBounds().height, 0, 0, 16, 16); gc.dispose(); image = buttonImage; + disposeImage = true; } Label icon = new Label(parent, SWT.NONE); icon.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); @@ -670,43 +464,6 @@ public abstract class CSelector extends Composite { return label; } - private Control createEditButton(Composite parent, Object element) { - if (editImage == null) { - editImage = Activator.getImageDescriptor("icons/config_config.png").createImage(); - } - final Canvas editButton = new Canvas(parent, SWT.NONE) { - @Override - public Point computeSize(int wHint, int hHint, boolean changed) { - Rectangle bounds = editImage.getBounds(); - return new Point(bounds.width, bounds.height); - }; - }; - editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); - editButton.setToolTipText("Edit"); - editButton.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - GC gc = e.gc; - gc.setAlpha(inEditButton ? 255 : 64); - gc.drawImage(editImage, 0, 0); - } - }); - editButton.addMouseTrackListener(new MouseTrackAdapter() { - @Override - public void mouseEnter(MouseEvent e) { - inEditButton = true; - editButton.redraw(); - } - - @Override - public void mouseExit(MouseEvent e) { - inEditButton = false; - editButton.redraw(); - } - }); - return editButton; - } - public void setContentProvider(IStructuredContentProvider contentProvider) { this.contentProvider = contentProvider; } @@ -731,10 +488,24 @@ public abstract class CSelector extends Composite { return hoverProvider; } - public void setSorter(Comparator sorter) { + /** + * Set sorter for the bottom part of the selector + * + * @param sorter + */ + public void setSorter(Comparator sorter) { this.sorter = sorter; } + /** + * Set sorter for the "history" part of the selector + * + * @param sorter + */ + public void setHistorySortComparator(Comparator sorter) { + this.sorterTop = sorter; + } + public void setInput(Object input) { this.input = input; } @@ -757,15 +528,7 @@ public abstract class CSelector extends Composite { } } if (popup != null && !popup.isDisposed()) { - Object[] elements = contentProvider.getElements(input); - int i; - for (i = 0; i < elements.length; ++i) - if (element == elements[i]) - break; - if (i != elements.length) { - listItems[i].setImage(labelProvider.getImage(element)); - listItems[i].setText(labelProvider.getText(element)); - } + listViewer.update(element, null); } } @@ -785,11 +548,4 @@ public abstract class CSelector extends Composite { // nothing to do here } - public int getSeparatorIndex() { - return separatorIndex; - } - - public void setSeparatorIndex(int separatorIndex) { - this.separatorIndex = separatorIndex; - } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 9437285e1a6..05705bb8302 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; -import java.util.Arrays; import java.util.Comparator; import org.eclipse.core.runtime.CoreException; @@ -26,7 +25,6 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -79,27 +77,13 @@ public class ConfigSelector extends CSelector { @Override public void dispose() { } + @Override public Object[] getElements(Object inputElement) { ILaunchDescriptor[] descs = uiManager.getManager().getLaunchDescriptors(); - if (descs.length > 0) { - int separatorIndex = getSeparatorIndex(); - if (descs.length > separatorIndex + 1) { - ILaunchDescriptor[] descsCopy = new ILaunchDescriptor[separatorIndex + descs.length]; - System.arraycopy(descs, 0, descsCopy, 0, separatorIndex); // copy first 3 elements - System.arraycopy(descs, 0, descsCopy, separatorIndex, descs.length); // copy all into rest - // sort rest - Arrays.sort(descsCopy, separatorIndex, descsCopy.length, new Comparator() { - @Override - public int compare(ILaunchDescriptor o1, ILaunchDescriptor o2) { - return o1.getName().compareTo(o2.getName()); - } - }); - return descsCopy; - } else - return descs; - } - return noConfigs; + if (descs.length == 0) + return noConfigs; + return descs; } }); @@ -141,13 +125,23 @@ public class ConfigSelector extends CSelector { return defaultProvider.getText(element); } }); - // no sorter on view, data is sorted by provider - setSorter(null); - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - int separator = store.getInt(Activator.PREF_LAUNCH_HISTORY_SIZE); - if (separator <= 0) - separator = 1; - setSeparatorIndex(separator); + // no sorter for top, data is sorted by provider in historical order + setHistorySortComparator(null); + // alphabetic sorter + setSorter(new Comparator() { + @Override + public int compare(ILaunchDescriptor o1, ILaunchDescriptor o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + + } + + @Override + protected void initializeListViewer(LaunchBarListViewer listViewer) { + listViewer.setHistorySupported(true); + listViewer.setHistoryPreferenceName(Activator.PREF_LAUNCH_HISTORY_SIZE); + super.initializeListViewer(listViewer); } @Override @@ -162,17 +156,7 @@ public class ConfigSelector extends CSelector { } } } - - @Override - public void setSeparatorIndex(int separatorIndex) { - super.setSeparatorIndex(separatorIndex); - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - int separator = store.getInt(Activator.PREF_LAUNCH_HISTORY_SIZE); - if (separator != getSeparatorIndex()) { - store.setValue(Activator.PREF_LAUNCH_HISTORY_SIZE, getSeparatorIndex()); - } - } - + @Override public boolean isEditable(Object element) { return element instanceof ILaunchDescriptor; @@ -233,7 +217,7 @@ public class ConfigSelector extends CSelector { GridLayout buttonLayout = new GridLayout(); buttonLayout.marginWidth = buttonLayout.marginHeight = 7; createButton.setLayout(buttonLayout); - createButton.setBackground(white); + createButton.setBackground(backgroundColor); createButton.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { @@ -247,7 +231,7 @@ public class ConfigSelector extends CSelector { final Label createLabel = new Label(createButton, SWT.None); createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); createLabel.setText("Create New Configuration..."); - createLabel.setBackground(white); + createLabel.setBackground(backgroundColor); MouseListener mouseListener = new MouseAdapter() { public void mouseUp(org.eclipse.swt.events.MouseEvent e) { @@ -281,8 +265,8 @@ public class ConfigSelector extends CSelector { } @Override public void mouseExit(MouseEvent e) { - createButton.setBackground(white); - createLabel.setBackground(white); + createButton.setBackground(backgroundColor); + createLabel.setBackground(backgroundColor); } }; createButton.addMouseTrackListener(mouseTrackListener); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java new file mode 100644 index 00000000000..1c95f414533 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java @@ -0,0 +1,13 @@ +package org.eclipse.launchbar.ui.internal.controls; + +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.widgets.Composite; + +public class EditButton extends CButton { + public EditButton(Composite parent, int style) { + super(parent, style); + setHotImage(Activator.getDefault().getImage("icons/config_config.png")); + setColdImage(Activator.getDefault().getImage("icons/edit_cold.png")); + setToolTipText("Edit"); + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java new file mode 100644 index 00000000000..2ef11dfb141 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java @@ -0,0 +1,472 @@ +package org.eclipse.launchbar.ui.internal.controls; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleAdapter; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TraverseEvent; +import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.internal.WorkbenchMessages; +import org.eclipse.ui.progress.WorkbenchJob; + +/** + * A simple control that provides a text widget and controls a list viewer + */ +public class FilterControl extends Composite { + /** + * The filter text widget to be used by this tree. This value may be null if there is no filter widget, or if the + * controls have not yet been created. + */ + protected Text filterText; + /** + * The viewer for the filtered tree. This value should never be null after the widget creation methods are + * complete. + */ + protected LaunchBarListViewer listViewer; + + protected ViewerFilter patternFilter; + /** + * The text to initially show in the filter text control. + */ + protected String initialText = ""; //$NON-NLS-1$ + protected String patternText = null; + /** + * The job used to refresh the tree. + */ + private Job refreshJob; + /** + * The parent composite this control. + */ + protected Composite parent; + + /** + * Creates a filter control, to be fully function attachListViewer must be called shortly after + * + * @param parent + */ + public FilterControl(Composite parent) { + super(parent, SWT.NONE); + this.parent = parent; + patternFilter = new ViewerFilter() { + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) { + String text = ((ILabelProvider) listViewer.getLabelProvider()).getText(element); + if (patternText == null) + return true; + String trim = patternText.trim(); + if (trim.isEmpty()) + return true; + if (text == null) + return false; + if (text.contains(trim)) + return true; + if (text.toLowerCase().contains(trim.toLowerCase())) + return true; + return false; + } + }; + init(); + } + + /** + * Create the filtered list. + */ + protected void init() { + createControl(this, SWT.NONE); + createRefreshJob(); + setInitialText(WorkbenchMessages.FilteredTree_FilterMessage); + setFont(parent.getFont()); + } + + /** + * Create the filtered tree's controls. Subclasses should override. + * + * @param parent + * @param treeStyle + */ + protected void createControl(Composite parent, int treeStyle) { + setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); + if (parent.getLayout() instanceof GridLayout) { + setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); + } + Composite fc = createFilterControls(parent); + fc.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); + } + + /** + * Create the filter controls. By default, a text and corresponding tool bar button that clears the contents of the text is + * created. Subclasses may override. + * + * @param parent + * parent Composite of the filter controls + * @return the Composite that contains the filter controls + */ + protected Composite createFilterControls(Composite parent) { + createFilterText(parent); + return parent; + } + + public Control attachListViewer(LaunchBarListViewer listViewer) { + this.listViewer = listViewer; + // listViewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); + listViewer.getControl().addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + refreshJob.cancel(); + } + }); + listViewer.addFilter(patternFilter); + return listViewer.getControl(); + } + + /** + * Create the refresh job for the receiver. + * + */ + private void createRefreshJob() { + refreshJob = doCreateRefreshJob(); + refreshJob.setSystem(true); + } + + @Override + public void setVisible(boolean visible) { + boolean oldVisible = getVisible(); + if (oldVisible == true && visible == false && listViewer != null && filterText.isFocusControl()) { + listViewer.setFocus(); + } + if (getLayoutData() instanceof GridData) { + ((GridData) getLayoutData()).heightHint = visible ? SWT.DEFAULT : 0; + } + super.setVisible(visible); + } + + /** + * Creates a workbench job that will refresh the tree based on the current filter text. Subclasses may override. + * + * @return a workbench job that can be scheduled to refresh the tree + * + * @since 3.4 + */ + protected WorkbenchJob doCreateRefreshJob() { + return new WorkbenchJob("Refresh Filter") {//$NON-NLS-1$ + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + if (listViewer == null) + return Status.CANCEL_STATUS; + if (listViewer.getControl().isDisposed()) { + return Status.CANCEL_STATUS; + } + updatePatternText(); + if (patternText == null) { + return Status.OK_STATUS; + } + Control redrawControl = listViewer.getControl(); + try { + // don't want the user to see updates that will be made to + // the tree + // we are setting redraw(false) on the composite to avoid + // dancing scrollbar + redrawControl.setRedraw(false); + listViewer.setHistorySupported(patternText == null || patternText.isEmpty()); + listViewer.refresh(true); + updateListSelection(false); + } finally { + redrawControl.setRedraw(true); + } + return Status.OK_STATUS; + } + }; + } + + /** + * Creates the filter text and adds listeners. This method calls {@link #doCreateFilterText(Composite)} to create the text + * control. Subclasses should override {@link #doCreateFilterText(Composite)} instead of overriding this method. + * + * @param parent + * Composite of the filter text + */ + protected void createFilterText(Composite parent) { + filterText = doCreateFilterText(parent); + filterText.getAccessible().addAccessibleListener( + new AccessibleAdapter() { + @Override + public void getName(AccessibleEvent e) { + String filterTextString = filterText.getText(); + if (filterTextString.length() == 0 + || filterTextString.equals(initialText)) { + e.result = initialText; + } else { + e.result = NLS.bind( + WorkbenchMessages.FilteredTree_AccessibleListenerFiltered, + new String[] { + filterTextString, + String.valueOf(getFilteredItemsCount()) }); + } + } + + /** + * Return the number of filtered items + * + * @return int + */ + private int getFilteredItemsCount() { + return listViewer.getItemCount(); + } + }); + filterText.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + } + + @Override + public void focusLost(FocusEvent e) { + if (filterText.getText().equals(initialText)) { + setFilterText(""); //$NON-NLS-1$ + } + } + }); + filterText.addMouseListener(new MouseAdapter() { + @Override + public void mouseDown(MouseEvent e) { + if (filterText.getText().equals(initialText)) { + clearText(); + } + } + }); + // enter key set focus to tree + filterText.addTraverseListener(new TraverseListener() { + @Override + public void keyTraversed(TraverseEvent e) { + if (e.detail == SWT.TRAVERSE_RETURN) { + e.doit = false; + listViewer.setFocus(); + updateListSelection(true); + } else if (e.detail == SWT.TRAVERSE_ARROW_NEXT) { + listViewer.setFocus(); + updateListSelection(false); + } + } + }); + filterText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + textChanged(); + } + }); + // if we're using a field with built in cancel we need to listen for + // default selection changes (which tell us the cancel button has been + // pressed) + if ((filterText.getStyle() & SWT.ICON_CANCEL) != 0) { + filterText.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetDefaultSelected(SelectionEvent e) { + if (e.detail == SWT.ICON_CANCEL) + clearText(); + } + }); + } + filterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + } + + protected void updateListSelection(boolean enter) { + if (listViewer.getItemCount() == 0) { + if (enter) + Display.getCurrent().beep(); + } else { + StructuredSelection sel; + // if the initial filter text hasn't changed, do not try to match + if (patternText != null && !patternText.trim().isEmpty()) { + // select item with triggering event, it may close the popup if list used as combo + sel = new StructuredSelection(listViewer.getTopFilteredElement()); + } else { + sel = new StructuredSelection(listViewer.getTopElement()); + } + if (enter) + listViewer.setDefaultSelection(sel); + else + listViewer.setSelection(sel); + } + } + + protected Text doCreateFilterText(Composite parent) { + return new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.SEARCH + | SWT.ICON_CANCEL); + } + + /** + * Update the receiver after the text has changed. + */ + protected void textChanged() { + String old = patternText; + updatePatternText(); + if (patternText != null && old == null && patternText.isEmpty()) + return;// we changing from initial selection to empty string + if (patternText == old) + return; + // cancel currently running job first, to prevent unnecessary redraw + refreshJob.cancel(); + refreshJob.schedule(getRefreshJobDelay()); + } + + /** + * Return the time delay that should be used when scheduling the filter refresh job. Subclasses may override. + * + * @return a time delay in milliseconds before the job should run + * + */ + protected long getRefreshJobDelay() { + return 200; + } + + /** + * Set the background for the widgets that support the filter text area. + * + * @param background + * background Color to set + */ + @Override + public void setBackground(Color background) { + super.setBackground(background); + // listComposite.setBackground(background); + // filterText.setBackground(background); + } + + /** + * Clears the text in the filter text widget. + */ + protected void clearText() { + setFilterText(""); //$NON-NLS-1$ + // textChanged(); + } + + /** + * Set the text in the filter control. + * + * @param string + */ + protected void setFilterText(String string) { + if (filterText != null) { + filterText.setText(string); + selectAll(); + } + } + + public Text getFilterText() { + return filterText; + } + + /** + * Get the tree viewer of the receiver. + * + * @return the tree viewer + */ + public LaunchBarListViewer getViewer() { + return listViewer; + } + + /** + * Get the filter text for the receiver, if it was created. Otherwise return null. + * + * @return the filter Text, or null if it was not created + */ + public Text getFilterControl() { + return filterText; + } + + /** + * Convenience method to return the text of the filter control. If the text widget is not created, then null is returned. + * + * @return String in the text, or null if the text does not exist + */ + protected String getFilterString() { + return filterText != null ? filterText.getText() : null; + } + + /** + * Set the text that will be shown until the first focus. A default value is provided, so this method only need be called if + * overriding the default initial text is desired. + * + * @param text + * initial text to appear in text field + */ + public void setInitialText(String text) { + initialText = text; + if (filterText != null) { + filterText.setMessage(text); + if (filterText.isFocusControl()) { + setFilterText(initialText); + textChanged(); + } else { + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (!filterText.isDisposed() && filterText.isFocusControl()) { + setFilterText(initialText); + textChanged(); + } + } + }); + } + } else { + setFilterText(initialText); + textChanged(); + } + } + + /** + * Select all text in the filter text field. + * + */ + protected void selectAll() { + if (filterText != null) { + filterText.selectAll(); + } + } + + /** + * Get the initial text for the receiver. + * + * @return String + */ + protected String getInitialText() { + return initialText; + } + + private void updatePatternText() { + String text = getFilterString(); + boolean initial = initialText != null + && initialText.equals(text); + if (initial) { + patternText = null; + } else if (text != null) { + patternText = text; + } + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java new file mode 100644 index 00000000000..63157a915b5 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -0,0 +1,711 @@ +package org.eclipse.launchbar.ui.internal.controls; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ICellModifier; +import org.eclipse.jface.viewers.IFontProvider; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseTrackAdapter; +import org.eclipse.swt.events.MouseTrackListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TraverseEvent; +import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.layout.RowLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Sash; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Widget; + +public class LaunchBarListViewer extends StructuredViewer { + private ScrolledComposite listScrolled; + private Composite listComposite; + private ListItem[] listItems; + private int selIndex; + private int itemH = 30; + private int scrollBucket; + private final int maxScrollBucket = 6; + private int separatorIndex = -1; + private boolean historySupported = true; + private ICellModifier modifier; + private ViewerComparator historyComparator; + private boolean finalSelection = false; + private FilterControl filterControl; + private Sash sash; + private String historyPref; + + private static class LaunchBarListViewerComparator extends ViewerComparator { + public LaunchBarListViewerComparator(Comparator comp) { + super(comp); + } + + // have to override it because standard ViewerComparator compares by labels only + @Override + public int compare(Viewer viewer, Object e1, Object e2) { + return getComparator().compare(e1, e2); + } + } + private TraverseListener listItemTraverseListener = new TraverseListener() { + @Override + public void keyTraversed(TraverseEvent e) { + final ListItem currItem = selIndex >= 0 ? listItems[selIndex] : null; + if (currItem == null && e.keyCode != SWT.ARROW_DOWN) { + return; + } + if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_TAB_NEXT) { + if (e.keyCode == SWT.ARROW_DOWN) { + int maxIdx = listItems.length - 1; + if (selIndex < maxIdx) { + // move to next item + listItems[selIndex + 1].setSelected(true); + if (scrollBucket < maxScrollBucket) { + scrollBucket++; + } else { + // need to scroll the list up 1 item + int sY = listScrolled.getOrigin().y; + listScrolled.setOrigin(0, sY + itemH); + } + } else if (selIndex == maxIdx && maxIdx > maxScrollBucket) { + // level the scroll for any offset at the bottom of the list + listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket + 1)); + } + } + } else if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { + if (e.keyCode == SWT.ARROW_UP) { + if (selIndex > 0) { + // move to previous item + if (scrollBucket > 0) { + scrollBucket--; + } else { + // need to scroll the list down 1 item + int sY = listScrolled.getOrigin().y; + listScrolled.setOrigin(0, sY - itemH); + } + listItems[selIndex - 1].setSelected(true); + } else if (selIndex == 0) { + // level any offset @ beginning + listScrolled.setOrigin(0, 0); + } + } else if (currItem.editButton != null) { + // remove focus from edit button + currItem.editButton.setSelected(false); + currItem.editButton.redraw(); + } + } else if (e.detail == SWT.TRAVERSE_RETURN) { + setDefaultSelection(new StructuredSelection(currItem.element)); + } else if (e.detail == SWT.TRAVERSE_ESCAPE) { + setDefaultSelection(new StructuredSelection()); + } + } + }; + + + + + private class ListItem extends Composite { + protected final Object element; + private Label icon; + private Label label; + protected EditButton editButton; + private int index; + private Color backgroundColor = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); + private Color outlineColor = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); + private Color highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); + private ILabelProvider labelProvider; + private ICellModifier modifer; + + @Override + public String toString() { + return "[" + index + "] " + labelProvider.getText(element); + } + public ListItem(Composite parent, int style, Object element, int index, ILabelProvider labelProvider, + ICellModifier modifier) { + super(parent, style); + this.element = element; + this.index = index; + this.labelProvider = labelProvider; + this.modifer = modifier; + setData(element); + addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + Point size = getSize(); + GC gc = e.gc; + gc.setForeground(outlineColor); + gc.drawLine(0, size.y - 1, size.x, size.y - 1); + if (label == null) + lazyInit(); + } + }); + // lazyInit(); + } // end ListItem(..) + + protected void lazyInit() { + Image image = labelProvider.getImage(element); + boolean editable = isEditable(element); + int columns = 1; + if (image != null) + columns++; + if (editable) + columns++; + GridLayout layout = new GridLayout(columns, false); + layout.marginWidth = layout.marginHeight = 7; + setLayout(layout); + MouseListener listItemMouseListener = new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + setDefaultSelection(new StructuredSelection(element)); + } + }; + MouseTrackListener listItemMouseTrackListener = new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + setSelected(true); + } + + @Override + public void mouseExit(MouseEvent e) { + setSelected(false); + } + }; + addMouseListener(listItemMouseListener); + addMouseTrackListener(listItemMouseTrackListener); + if (image != null) { + icon = createImage(this, image); + icon.addMouseListener(listItemMouseListener); + icon.addMouseTrackListener(listItemMouseTrackListener); + } + label = createLabel(this, element); + label.addMouseListener(listItemMouseListener); + label.addMouseTrackListener(listItemMouseTrackListener); + if (editable) { + editButton = new EditButton(this, SWT.NONE); + editButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // Need to run this after the current event storm + // Or we get a disposed error. + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (editButton.isSelected()) + handleEdit(element); + } + }); + } + }); + editButton.setBackground(backgroundColor); + editButton.addMouseTrackListener(listItemMouseTrackListener); + editButton.addTraverseListener(listItemTraverseListener); + } else { + // add traverse listnener to control which will have keyboard focus + addTraverseListener(listItemTraverseListener); + } + addKeyListener(new KeyListener() { + @Override + public void keyReleased(KeyEvent e) { + // ignore + } + + @Override + public void keyPressed(KeyEvent e) { + if (e.character != 0 && !filterControl.isVisible()) { + // enable filter control and send the character there + filterControl.setVisible(true); + filterControl.setFocus(); + filterControl.getParent().layout(true); + filterControl.getFilterText().setText(e.character + ""); + filterControl.getFilterText().setSelection(1); + } + } + }); + setBackground(backgroundColor); + layout(true); + } + + public void setSelected(boolean selected) { + if (selected) { + setBackground(highlightColor); + int idx = getIndex(); + if (idx != selIndex) { + if (selIndex >= 0) { + listItems[selIndex].setBackground(backgroundColor); + scrollBucket = Math.max(Math.min(scrollBucket + idx - selIndex, maxScrollBucket), 0); + } else { // initially + scrollBucket = Math.min(idx, maxScrollBucket); + } + } + selIndex = idx; + } else { + setBackground(backgroundColor); + } + if (editButton != null) { + editButton.setSelected(selected); + } + } + + protected boolean isEditable(Object element) { + if (modifer != null) { + return modifer.canModify(element, null); + } + return false; + } + + protected void handleEdit(Object element) { + if (modifer != null) { + modifer.modify(element, null, null); + } + } + + @Override + public void setBackground(Color color) { + super.setBackground(color); + if (icon != null && !icon.isDisposed()) + icon.setBackground(color); + if (label != null && !label.isDisposed()) + label.setBackground(color); + if (editButton != null && !editButton.isDisposed()) + editButton.setBackground(color); + } + + public void setImage(Image image) { + if (icon != null && !icon.isDisposed()) + icon.setImage(image); + } + + public void setText(String text) { + if (!label.isDisposed()) + label.setText(text); + } + + @Override + public boolean setFocus() { + super.setFocus(); + return true; + } + + protected int getIndex() { + return index; + } + + private Label createImage(Composite parent, Image image) { + Rectangle bounds = image.getBounds(); + boolean disposeImage = false; + if (bounds.height > 16 || bounds.width > 16) { + Image buttonImage = new Image(getDisplay(), 16, 16); + GC gc = new GC(buttonImage); + gc.setAntialias(SWT.ON); + gc.setInterpolation(SWT.HIGH); + // resize to 16 pixels + gc.drawImage(image, 0, 0, image.getBounds().width, + image.getBounds().height, 0, 0, 16, 16); + gc.dispose(); + image = buttonImage; + disposeImage = true; + } + Label icon = new Label(parent, SWT.NONE); + icon.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); + icon.setImage(image); + if (disposeImage) { + final Image disposableImage = image; + icon.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + disposableImage.dispose(); + } + }); + } + return icon; + } + + private Label createLabel(Composite parent, Object element) { + Label label = new Label(parent, SWT.NONE); + label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); + ILabelProvider labelProvider = (ILabelProvider) getLabelProvider(); + label.setText(labelProvider.getText(element)); + if (labelProvider instanceof IFontProvider) { + label.setFont(((IFontProvider) labelProvider).getFont(element)); + } + return label; + } + } // end ListItem class + + public LaunchBarListViewer(Composite parent) { + filterControl = new FilterControl(parent); + listScrolled = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.NO_BACKGROUND); + listScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + listScrolled.setExpandHorizontal(true); + listComposite = new Composite(listScrolled, SWT.NONE); + listScrolled.setContent(listComposite); + listComposite.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); + selIndex = -1; + scrollBucket = 0; + filterControl.attachListViewer(this); + historySupported = false; + setHistoryPreferenceName(getHistoryPreferenceName()); + } + + private void createSash(final Composite listComp) { + if (separatorIndex < 0 || !historySupported) + return; + sash = new Sash(listComp, SWT.BORDER | SWT.HORIZONTAL); + sash.setLayoutData(GridDataFactory.fillDefaults().create()); + if (separatorIndex < listItems.length) + sash.moveAbove(listItems[separatorIndex]); + else + sash.moveBelow(null); + sash.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event e) { + separatorIndex = (e.y + itemH / 2) / itemH; + } + }); + sash.addMouseListener(new MouseListener() { + @Override + public void mouseUp(MouseEvent e) { + setSeparatorIndex(separatorIndex); // call setter if it was overriden + if (separatorIndex >= 0) { + if (separatorIndex < listItems.length) + sash.moveAbove(listItems[separatorIndex]); + else + sash.moveBelow(null); + listComp.layout(); + } + } + + @Override + public void mouseDown(MouseEvent e) { + sash.moveAbove(null); // keep on top so user see it when moving + } + + @Override + public void mouseDoubleClick(MouseEvent e) { + // ignore + } + }); + sash.setToolTipText("Increase/Decrease size of recently used elements pane"); + } + + @Override + public Control getControl() { + return listScrolled; + } + + @Override + protected void inputChanged(Object input, Object oldInput) { + super.inputChanged(input, oldInput); + refreshAll(); + } + + protected void refreshAll() { + selIndex = -1; + Control[] children = listComposite.getChildren(); + for (Control control : children) { + control.dispose(); + } + Object[] origElements = getElements(); + Object[] elements = filterElements(origElements); + listItems = new ListItem[elements.length]; + if (elements.length > 0) { + listItems[0] = createListItem(elements, 0); + itemH = Math.max(listItems[0].computeSize(SWT.DEFAULT, SWT.DEFAULT).y, 16); + for (int i = 1; i < elements.length; ++i) { + listItems[i] = createListItem(elements, i); + } + createSash(listComposite); + } + listComposite.pack(true); + GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); + if (elements.length > maxScrollBucket) { + Rectangle bounds = listItems[maxScrollBucket].getBounds(); + gd.heightHint = Math.max(bounds.y + bounds.height, itemH * (maxScrollBucket + 1)); + } + listScrolled.setLayoutData(gd); + listScrolled.layout(true); + } + + private ListItem createListItem(Object[] elements, int i) { + ListItem item = new ListItem(listComposite, SWT.NONE, elements[i], i, (ILabelProvider) getLabelProvider(), modifier); + GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); + item.setLayoutData(gd); + if (i <= maxScrollBucket) { // this is how many visible by default + item.lazyInit(); + } else { + gd.heightHint = itemH; + } + return item; + } + + @Override + protected Widget doFindInputItem(Object element) { + return doFindItem(element); + } + + @Override + protected Widget doFindItem(Object element) { + if (listItems == null) + return null; + for (ListItem listItem : listItems) { + if (listItem.element.equals(element)) + return listItem; + } + return null; + } + + @Override + protected void doUpdateItem(Widget item, Object element, boolean fullMap) { + if (item instanceof ListItem) { + ((ListItem) item).lazyInit(); + } + } + + @Override + protected List getSelectionFromWidget() { + ArrayList arrayList = new ArrayList<>(); + if (selIndex >= 0) + arrayList.add(listItems[selIndex].element); + return arrayList; + } + + @Override + protected void internalRefresh(Object element) { + if (element == null || element == getRoot()) { + refreshAll(); + return; + } + ListItem item = (ListItem) doFindItem(element); + ILabelProvider lp = (ILabelProvider) getLabelProvider(); + if (lp == null || item == null) + return; + item.setImage(lp.getImage(element)); + item.setText(lp.getText(element)); + } + + private Object[] filterElements(Object[] elements) { + Object[] topElements = elements.clone(); + if (getComparator() != null) + getComparator().sort(this, elements); + if (getTopComparator() != null) + getTopComparator().sort(this, topElements); + // only bottom part will be filtered + Object[] result = elements; + if (getFilters() != null) { + for (ViewerFilter f : getFilters()) { + result = f.filter(this, (Object) null, result); + } + } + if (separatorIndex <= 0 || !historySupported) + return result; + if (separatorIndex >= topElements.length) { + return topElements; // all elements will fit in top elements + } + ILaunchDescriptor[] descsCopy = new ILaunchDescriptor[separatorIndex + result.length]; + System.arraycopy(topElements, 0, descsCopy, 0, separatorIndex); // copy first N elements + System.arraycopy(result, 0, descsCopy, separatorIndex, result.length); // copy all into rest + return descsCopy; + } + + private Object[] getElements() { + IStructuredContentProvider cp = (IStructuredContentProvider) getContentProvider(); + if (cp == null) + return new Object[0]; + Object[] elements = cp.getElements(getInput()); + return elements; + } + + @Override + public void reveal(Object element) { + // TODO Auto-generated method stub + } + + public void setDefaultSelection(StructuredSelection selection) { + finalSelection = true; + setSelection(selection, true); + } + + @Override + protected void setSelectionToWidget(List l, boolean reveal) { + if (l.size() == 0) { + return; + } + Object sel = l.get(0); + Widget wid = doFindItem(sel); + if (wid instanceof ListItem) { + ListItem listItem = (ListItem) wid; + listItem.setSelected(true); + } + } + + public int getSeparatorIndex() { + return separatorIndex; + } + + public void setSeparatorIndex(int separatorIndex) { + this.separatorIndex = separatorIndex; + if (separatorIndex <= 0) + return; + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + String prefName = getHistoryPreferenceName(); + if (prefName != null && store.getInt(prefName) != getSeparatorIndex()) { + store.setValue(prefName, getSeparatorIndex()); + } + } + + protected String getHistoryPreferenceName() { + return historyPref; + } + + public void setCellModifier(ICellModifier modifier) { + this.modifier = modifier; + } + + public int getItemCount() { + return listItems.length; + } + + /** + * Returns top element (provider element) in the begging on non-history list + * + * @return + */ + public Object getTopFilteredElement() { + if (listItems.length > 0) { + if (separatorIndex <= 0 || separatorIndex >= listItems.length || !historySupported) + return listItems[0].element; + else + return listItems[separatorIndex].element; + } + return null; + } + + public Object getTopElement() { + if (listItems.length > 0) { + return listItems[0].element; + } + return null; + } + + public ViewerComparator getTopComparator() { + return historyComparator; + } + + /** + * ViewerComparator comparator labels of elements by default + * + * @param comp + */ + public void setHistoryComparator(ViewerComparator comp) { + historyComparator = comp; + } + + public void setHistoryComparator(Comparator comp) { + historyComparator = comp == null ? null : new LaunchBarListViewerComparator(comp); + } + + public void setComparator(Comparator comp) { + setComparator(comp == null ? null : new LaunchBarListViewerComparator(comp)); + } + + public boolean isHistorySupported() { + return historySupported; + } + + public void setHistorySupported(boolean historySupported) { + this.historySupported = historySupported; + } + + public void setHistoryPreferenceName(String historyPreferenceName) { + this.historyPref = historyPreferenceName; + if (historyPreferenceName != null) { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + int separator = store.getInt(historyPreferenceName); + if (separator <= 0) + separator = 1; + setSeparatorIndex(separator); + } + } + + /** + * final selection will be set to true when user made a final selection in a list for example when double click on entry or + * pressed enter key + */ + public boolean isFinalSelection() { + return finalSelection; + } + + public void setFinalSelection(boolean finalSelection) { + this.finalSelection = finalSelection; + } + + public static void main(String[] args) { + Display display = Display.getDefault(); + Shell shell = new Shell(); + RowLayout rowLayout = new RowLayout(); + shell.setLayout(rowLayout); + (new Label(shell, SWT.NULL)).setText("Hello"); + LaunchBarListViewer v = new LaunchBarListViewer(shell); + v.setContentProvider(new ArrayContentProvider()); + v.setLabelProvider(new LabelProvider()); + v.setInput(new String[] { "aaa", "bbb", "ccc" }); + shell.pack(); + shell.open(); + // textUser.forceFocus(); + // Set up the event loop. + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) { + // If no more entries in event queue + display.sleep(); + } + } + display.dispose(); + } + + public void setFocus() { + if (selIndex >= 0 && listItems != null && listItems.length < selIndex) + listItems[selIndex].setFocus(); + else + getControl().setFocus(); + } + + public void setFilterVisible(boolean vis) { + filterControl.setVisible(vis); + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index 38b468b6b87..1524209925a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -184,7 +184,7 @@ public class TargetSelector extends CSelector { GridLayout buttonLayout = new GridLayout(); buttonLayout.marginWidth = buttonLayout.marginHeight = 7; createButton.setLayout(buttonLayout); - createButton.setBackground(white); + createButton.setBackground(backgroundColor); createButton.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { @@ -198,7 +198,7 @@ public class TargetSelector extends CSelector { final Label createLabel = new Label(createButton, SWT.None); createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); createLabel.setText("Create New Target..."); - createLabel.setBackground(white); + createLabel.setBackground(backgroundColor); MouseListener mouseListener = new MouseAdapter() { public void mouseUp(org.eclipse.swt.events.MouseEvent e) { From d4621c4aa952b0672d6089b875f1f750c487ea31 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 14 Jan 2015 09:27:26 -0500 Subject: [PATCH 008/198] LaunchBar: do not allow to Finish new config wizard prematurely Finish button is active when not all parameters for lauch configuration are set Change-Id: Iae33a1679e043257bb591ae18a7db8310a93cf52 --- .../launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index f17e4cf0b9f..7387e1bb918 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -167,6 +167,8 @@ public class NewLaunchConfigEditPage extends WizardPage { } public void validateFields() { + // page is not complete unless we finish validation successfully + setPageComplete(false); if (workingCopy == null) return; String message = null; From 7983b686f0227299b5c2f1005a5af1226f8bc781 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 14 Jan 2015 11:24:26 -0500 Subject: [PATCH 009/198] LaunchBar: prevent repaint storm during initialization when launch descriptor (and other objects) are changed using API it can create event storm which leaves control changing rapidly. To prevent that added X ms delay if API is used to change launch bar ui (or during initialization) Change-Id: Ic02587cbd89c754abd6020cac2754e971ad50a37 --- .../ui/internal/controls/CSelector.java | 26 ++++++++ .../internal/controls/LaunchBarControl.java | 62 +++++++------------ 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index fb6d6879e60..1dfdf0500f0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -73,6 +73,7 @@ public abstract class CSelector extends Composite { private Label currentLabel; private Shell popup; private LaunchBarListViewer listViewer; + private Job delayJob; private MouseTrackListener mouseTrackListener = new MouseTrackListener() { @Override public void mouseEnter(MouseEvent e) { @@ -202,6 +203,7 @@ public abstract class CSelector extends Composite { } }; + public CSelector(Composite parent, int style) { super(parent, style); backgroundColor = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); @@ -241,6 +243,30 @@ public abstract class CSelector extends Composite { popup.dispose(); } + public void setDelayedSelection(final Object element, long millis) { + if (delayJob != null) + delayJob.cancel(); + delayJob = new Job("Updating launch bar selection") { + @Override + protected IStatus run(final IProgressMonitor monitor) { + if (monitor.isCanceled()) + return Status.CANCEL_STATUS; + if (isDisposed()) + return Status.CANCEL_STATUS; + getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (monitor.isCanceled()) + return; + setSelection(element); + } + }); + return Status.OK_STATUS; + } + }; + delayJob.schedule(millis); + } + public void setSelection(Object element) { this.selection = element; if (buttonComposite != null) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 355bd32e501..6df2016dbbe 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -23,8 +23,7 @@ import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -32,7 +31,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; public class LaunchBarControl implements Listener { - public static final String ID = "org.eclipse.launchbar"; //$NON-NLS-1$ public static final String CLASS_URI = "bundleclass://" + Activator.PLUGIN_ID + "/" + LaunchBarControl.class.getName(); //$NON-NLS-1$ //$NON-NLS-2$ @@ -42,6 +40,8 @@ public class LaunchBarControl implements Listener { private ModeSelector modeSelector; private TargetSelector targetSelector; + private static final int SELECTION_DELAY = 200; + @PostConstruct public void createControl(Composite parent) { manager.addListener(this); @@ -79,14 +79,16 @@ public class LaunchBarControl implements Listener { targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); targetSelector.setInput(manager); - ILaunchDescriptor configDesc = manager.getActiveLaunchDescriptor(); - configSelector.setSelection(configDesc == null ? null : configDesc); + syncSelectors(); + } - ILaunchMode mode = manager.getActiveLaunchMode(); - modeSelector.setSelection(mode == null ? null : mode); - - ILaunchTarget target = manager.getActiveLaunchTarget(); - targetSelector.setSelection(target == null ? null : target); + protected void syncSelectors() { + if (configSelector != null) + configSelector.setSelection(manager.getActiveLaunchDescriptor()); + if (modeSelector != null) + modeSelector.setSelection(manager.getActiveLaunchMode()); + if (targetSelector != null) + targetSelector.setSelection(manager.getActiveLaunchTarget()); } @PreDestroy @@ -101,53 +103,34 @@ public class LaunchBarControl implements Listener { Image image = new Image(parent.getDisplay(), srcImage, SWT.IMAGE_COPY); button.setHotImage(image); button.setToolTipText(toolTipText); - button.addMouseListener(new MouseAdapter() { - @Override - public void mouseUp(MouseEvent e) { + button.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { Activator.runCommand(command); - } + }; }); } @Override public void activeLaunchDescriptorChanged() { - if (configSelector != null && !configSelector.isDisposed()) { - final ILaunchDescriptor configDesc = manager.getActiveLaunchDescriptor(); - configSelector.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (!configSelector.isDisposed()) - configSelector.setSelection(configDesc == null ? null : configDesc); - } - }); + if (configSelector != null) { + final ILaunchDescriptor descriptor = manager.getActiveLaunchDescriptor(); + configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); } } @Override public void activeLaunchModeChanged() { - if (modeSelector != null && !modeSelector.isDisposed()) { + if (modeSelector != null) { final ILaunchMode mode = manager.getActiveLaunchMode(); - modeSelector.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (!modeSelector.isDisposed()) - modeSelector.setSelection(mode == null ? null : mode); - } - }); + modeSelector.setDelayedSelection(mode, SELECTION_DELAY); } } @Override public void activeLaunchTargetChanged() { - if (targetSelector != null && !targetSelector.isDisposed()) { + if (targetSelector != null) { final ILaunchTarget target = manager.getActiveLaunchTarget(); - targetSelector.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (!targetSelector.isDisposed()) - targetSelector.setSelection(target == null ? null : target); - } - }); + targetSelector.setDelayedSelection(target, SELECTION_DELAY); } } @@ -162,5 +145,4 @@ public class LaunchBarControl implements Listener { // TODO Auto-generated method stub } - } From faf222b8f266cb1c11acf00ad8a053f52df34937 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 19 Jan 2015 15:59:53 -0500 Subject: [PATCH 010/198] Launch Bar: ui tweaks for proper re-sizing and keyboard events - fixed issues when list is not drawn properly - fixed that Esc does not work to close pop up sometimes - fixed filtering for list with edit button - fixed layout issues when only one item in the list and filter becomes visible (filter is disabled in this case) Change-Id: I562f12df8326b4efecf75150b57b699c53d398da --- .../ui/internal/controls/FilterControl.java | 3 ++ .../controls/LaunchBarListViewer.java | 42 +++++++++++-------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java index 2ef11dfb141..9b1cdb45223 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java @@ -271,6 +271,9 @@ public class FilterControl extends Composite { } else if (e.detail == SWT.TRAVERSE_ARROW_NEXT) { listViewer.setFocus(); updateListSelection(false); + } else if (e.detail == SWT.TRAVERSE_ESCAPE) { + listViewer.setDefaultSelection(new StructuredSelection()); + e.doit = false; } } }); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 63157a915b5..947dfcc10b5 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -137,7 +137,28 @@ public class LaunchBarListViewer extends StructuredViewer { } }; + private KeyListener lisItemKeyListener = new KeyListener() { + @Override + public void keyReleased(KeyEvent e) { + // ignore + } + @Override + public void keyPressed(KeyEvent e) { + if (e.character != 0 && e.character >= 0x20 && !filterControl.isVisible()) { + if (listItems.length <= 1) + return; // no filter for 1 item! + // enable filter control and send the character there + filterControl.setVisible(true); + filterControl.setFocus(); + filterControl.getParent().layout(true); + filterControl.getFilterText().setText(e.character + ""); + filterControl.getFilterText().setSelection(1); + } else if (e.character == SWT.ESC) { + setDefaultSelection(new StructuredSelection()); + } + } + }; private class ListItem extends Composite { @@ -171,6 +192,7 @@ public class LaunchBarListViewer extends StructuredViewer { GC gc = e.gc; gc.setForeground(outlineColor); gc.drawLine(0, size.y - 1, size.x, size.y - 1); + System.out.println(ListItem.this.index); if (label == null) lazyInit(); } @@ -235,28 +257,13 @@ public class LaunchBarListViewer extends StructuredViewer { editButton.setBackground(backgroundColor); editButton.addMouseTrackListener(listItemMouseTrackListener); editButton.addTraverseListener(listItemTraverseListener); + editButton.addKeyListener(lisItemKeyListener); } else { // add traverse listnener to control which will have keyboard focus addTraverseListener(listItemTraverseListener); + addKeyListener(lisItemKeyListener); } - addKeyListener(new KeyListener() { - @Override - public void keyReleased(KeyEvent e) { - // ignore - } - @Override - public void keyPressed(KeyEvent e) { - if (e.character != 0 && !filterControl.isVisible()) { - // enable filter control and send the character there - filterControl.setVisible(true); - filterControl.setFocus(); - filterControl.getParent().layout(true); - filterControl.getFilterText().setText(e.character + ""); - filterControl.getFilterText().setSelection(1); - } - } - }); setBackground(backgroundColor); layout(true); } @@ -453,6 +460,7 @@ public class LaunchBarListViewer extends StructuredViewer { createSash(listComposite); } listComposite.pack(true); + listComposite.layout(true, true); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); if (elements.length > maxScrollBucket) { Rectangle bounds = listItems[maxScrollBucket].getBounds(); From 3487f9e9e2f3e433fd8c45497c04a341704f2259 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 20 Jan 2015 15:45:14 -0500 Subject: [PATCH 011/198] LaunchBar: prevent widget is disposed exception on shutdown Change-Id: I79afcded38a64a9c2f2ce0190eee1766a9d4265e --- .../org/eclipse/launchbar/ui/internal/controls/CSelector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 1dfdf0500f0..6ede13f173c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -268,6 +268,8 @@ public abstract class CSelector extends Composite { } public void setSelection(Object element) { + if (isDisposed()) + return; this.selection = element; if (buttonComposite != null) buttonComposite.dispose(); From 457fd76f5df49457131f0d80e2f1973495f81a89 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 21 Jan 2015 13:57:22 -0500 Subject: [PATCH 012/198] remove debug output Change-Id: If587d17f8670a6f9bc2623a72c0395f921495eee --- .../launchbar/ui/internal/controls/LaunchBarListViewer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 947dfcc10b5..042ba36b0df 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -192,7 +192,6 @@ public class LaunchBarListViewer extends StructuredViewer { GC gc = e.gc; gc.setForeground(outlineColor); gc.drawLine(0, size.y - 1, size.x, size.y - 1); - System.out.println(ListItem.this.index); if (label == null) lazyInit(); } From 5f3b1af3f103b8bad7df65a24f73ee972ba0cb80 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 27 Jan 2015 20:27:19 -0500 Subject: [PATCH 013/198] Remove the o.e.remote proposal. It's going live now at home. Not sure why this stuff was on master anyway. It was supposed to be on the oeremote branch. At any rate, I've started to contribute the new API to o.e.remote properly so this is no longer needed. Change-Id: I83409423ee5d5ad1295efadabb9d686b4d0fce4f --- .../META-INF/MANIFEST.MF | 1 - .../remote/core/api2/IRemoteConnection.java | 337 ------------------ .../api2/IRemoteConnectionChangeEvent.java | 54 --- .../api2/IRemoteConnectionChangeListener.java | 29 -- .../core/api2/IRemoteConnectionManager.java | 92 ----- .../core/api2/IRemoteConnectionService.java | 25 -- .../api2/IRemoteConnectionWorkingCopy.java | 85 ----- .../remote/core/api2/IRemoteFileManager.java | 79 ---- .../core/api2/IRemoteLaunchConfigService.java | 29 -- .../remote/core/api2/IRemoteService.java | 15 - .../remote/core/api2/IRemoteServices.java | 56 --- .../core/api2/IRemoteServicesDescriptor.java | 38 -- 12 files changed, 840 deletions(-) delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 8c9b6a932a9..559691cc512 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -7,7 +7,6 @@ Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, - org.eclipse.remote.core;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, org.eclipse.core.filesystem Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java deleted file mode 100644 index 6b5983863c0..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnection.java +++ /dev/null @@ -1,337 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.remote.core.IRemoteProcess; -import org.eclipse.remote.core.IRemoteProcessBuilder; -import org.eclipse.remote.core.exception.RemoteConnectionException; - -/** - * Abstraction of a connection to a remote system. Clients should use the set methods to provide information on the remote system, - * then call the {{@link #open(IProgressMonitor)} method. Once the connection is completed, call the {@link #close()} method to - * terminate the connection. - */ -public interface IRemoteConnection extends Comparable { - public final static String OS_NAME_PROPERTY = "os.name"; //$NON-NLS-1$ - public final static String OS_VERSION_PROPERTY = "os.version"; //$NON-NLS-1$ - public final static String OS_ARCH_PROPERTY = "os.arch"; //$NON-NLS-1$ - /** - * @since 6.0 - */ - public final static String FILE_SEPARATOR_PROPERTY = "file.separator"; //$NON-NLS-1$ - /** - * @since 6.0 - */ - public final static String PATH_SEPARATOR_PROPERTY = "path.separator"; //$NON-NLS-1$ - /** - * @since 6.0 - */ - public final static String LINE_SEPARATOR_PROPERTY = "line.separator"; //$NON-NLS-1$ - /** - * @since 4.0 - */ - public final static String USER_HOME_PROPERTY = "user.home"; //$NON-NLS-1$ - - /** - * Return the specified service. - * - * @param service interface - * @return service - */ - public T getService(Class service); - - /** - * Register a listener that will be notified when this connection's status changes. - * - * @param listener - */ - public void addConnectionChangeListener(IRemoteConnectionChangeListener listener); - - /** - * Close the connection. Must be called to terminate the connection. - */ - public void close(); - - /** - * Notify all listeners when this connection's status changes. See {{@link IRemoteConnectionChangeEvent} for a list of event - * types. - * - * @param event - * event type indicating the nature of the event - */ - public void fireConnectionChangeEvent(int type); - - /** - * Forward local port localPort to remote port fwdPort on remote machine fwdAddress. If this IRemoteConnection is not to - * fwdAddress, the port will be routed via the connection machine to fwdAddress. - * - * @param localPort - * local port to forward - * @param fwdAddress - * address of remote machine - * @param fwdPort - * remote port on remote machine - * @throws RemoteConnectionException - */ - public void forwardLocalPort(int localPort, String fwdAddress, int fwdPort) throws RemoteConnectionException; - - /** - * Forward a local port to remote port fwdPort on remote machine fwdAddress. The local port is chosen dynamically and returned - * by the method. If this IRemoteConnection is not to fwdAddress, the port will be routed via the connection machine to - * fwdAddress. - * - * @param fwdAddress - * @param fwdPort - * @param monitor - * @return local port number - * @throws RemoteConnectionException - */ - public int forwardLocalPort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException; - - /** - * Forward remote port remotePort to port fwdPort on machine fwdAddress. When a connection is made to remotePort on the remote - * machine, it is forwarded via this IRemoteConnection to fwdPort on machine fwdAddress. - * - * @param remotePort - * remote port to forward - * @param fwdAddress - * address of recipient machine - * @param fwdPort - * port on recipient machine - * @throws RemoteConnectionException - */ - public void forwardRemotePort(int remotePort, String fwdAddress, int fwdPort) throws RemoteConnectionException; - - /** - * Forward a remote port to port fwdPort on remote machine fwdAddress. The remote port is chosen dynamically and returned by the - * method. When a connection is made to this port on the remote machine, it is forwarded via this IRemoteConnection to fwdPort - * on machine fwdAddress. - * - * If fwdAddress is the empty string ("") then the fwdPort will be bound to any address on all interfaces. Note that this - * requires enabling the GatewayPort sshd option on some systems. - * - * @param fwdAddress - * @param fwdPort - * @param monitor - * @return remote port number - * @throws RemoteConnectionException - */ - public int forwardRemotePort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException; - - /** - * Gets the implementation dependent address for this connection - * - * return address - */ - public String getAddress(); - - /** - * Get the implementation specific attributes for the connection. - * - * NOTE: the attributes do not include any security related information (e.g. passwords, keys, etc.) - * - * @return a map containing the connection attribute keys and values - */ - public Map getAttributes(); - - /** - * Get a remote process that runs a command shell on the remote system. The shell will be the user's default shell on the remote - * system. The flags may be used to modify behavior of the remote process. These flags may only be supported by specific types - * of remote service providers. Clients can use {@link IRemoteProcessBuilder#getSupportedFlags()} to find out the flags - * supported by the service provider. - * - *
-	 * Current flags are:
-	 *   {@link IRemoteProcessBuilder#NONE}			- disable any flags
-	 *   {@link IRemoteProcessBuilder#ALLOCATE_PTY}	- allocate a pseudo-terminal for the process (RFC-4254 Sec. 6.2)
-	 *   {@link IRemoteProcessBuilder#FORWARD_X11}	- enable X11 forwarding (RFC-4254 Sec. 6.3)
-	 * 
- * - * @param flags - * bitwise-or of flags - * @return remote process object - * @throws IOException - * @since 7.0 - */ - public IRemoteProcess getCommandShell(int flags) throws IOException; - - /** - * Returns an unmodifiable string map view of the remote environment. The connection must be open prior to calling this method. - * - * @return the remote environment - * @since 5.0 - */ - public Map getEnv(); - - /** - * Returns the value of an environment variable. The connection must be open prior to calling this method. - * - * @param name - * name of the environment variable - * @return value of the environment variable or null if the variable is not defined - */ - public String getEnv(String name); - - /** - * Get a file manager for managing remote files - * - * @return file manager or null if connection is not open - */ - public IRemoteFileManager getFileManager(); - - /** - * Get unique name for this connection. - * - * @return connection name - */ - public String getName(); - - /** - * Gets the port for this connection. Only valid if supported by the service provider. - * - * return port number - * - * @since 5.0 - */ - public int getPort(); - - /** - * Get a process builder for creating remote processes - * - * @return process builder or null if connection is not open - */ - public IRemoteProcessBuilder getProcessBuilder(List command); - - /** - * Get a process builder for creating remote processes - * - * @return process builder or null if connection is not open - */ - public IRemoteProcessBuilder getProcessBuilder(String... command); - - /** - * Gets the remote system property indicated by the specified key. The connection must be open prior to calling this method. - * - * The following keys are supported: - * - *
-	 * os.name			Operating system name 
-	 * os.arch			Operating system architecture
-	 * os.version		Operating system version
-	 * file.separator	File separator ("/" on UNIX)
-	 * path.separator	Path separator (":" on UNIX)
-	 * line.separator	Line separator ("\n" on UNIX)
-	 * user.home		Home directory
-	 * 
- * - * @param key - * the name of the property - * @return the string value of the property, or null if no property has that key - */ - public String getProperty(String key); - - /** - * Get the remote services provider for this connection. - * - * @return remote services provider - * @since 4.0 - */ - public IRemoteServices getRemoteServices(); - - /** - * Gets the username for this connection - * - * return username - */ - public String getUsername(); - - public IRemoteConnectionWorkingCopy getWorkingCopy(); - - /** - * Get the working directory. Relative paths will be resolved using this path. - * - * The remote connection does not need to be open to use this method, however a default directory path, rather than the actual - * working directory, may be returned in this case. - * - * @return String representing the current working directory - * @since 4.0 - */ - public String getWorkingDirectory(); - - /** - * Test if the connection is open. - * - * @return true if connection is open. - */ - public boolean isOpen(); - - /** - * Open the connection. Must be called before the connection can be used. - * - * @param monitor - * the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() - * on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot - * be cancelled. - * @throws RemoteConnectionException - */ - public void open(IProgressMonitor monitor) throws RemoteConnectionException; - - /** - * Remove a listener that will be notified when this connection's status changes. - * - * @param listener - */ - public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener); - - /** - * Remove the local port forwarding associated with the given port. - * - * @param port - * forwarded port - * @throws RemoteConnectionException - * @since 7.0 - */ - public void removeLocalPortForwarding(int port) throws RemoteConnectionException; - - /** - * Remove the remote port forwarding associated with the given port. - * - * @param port - * forwarded port - * @throws RemoteConnectionException - * @since 7.0 - */ - public void removeRemotePortForwarding(int port) throws RemoteConnectionException; - - /** - * Set the working directory while the connection is open. The working directory will revert to the default when the connection - * is closed then subsequently reopened. - * - * Relative paths will be resolved using this path. The path must be valid and absolute for any changes to be made. - * - * @param path - * String representing the current working directory - * @since 4.0 - */ - public void setWorkingDirectory(String path); - - /** - * Test if this connection supports forwarding of TCP connections - * - * @return true if TCP port forwarding is supported - */ - public boolean supportsTCPPortForwarding(); -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java deleted file mode 100644 index a21eb5bd521..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeEvent.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -/** - * Event representing a change in connection status. The {@link #getType()} method can be used to obtain information about the type - * of event that occurred. - */ -public interface IRemoteConnectionChangeEvent { - /** - * Event indicating that the connection was closed. - */ - public static final int CONNECTION_CLOSED = 1 << 0; - - /** - * Event indicating that the connection was opened. - */ - public static final int CONNECTION_OPENED = 1 << 1; - - /** - * Event indicating that the connection was closed abnormally. - */ - public static final int CONNECTION_ABORTED = 1 << 2; - - /** - * Event indicating that the connection name was changed. - */ - public static final int CONNECTION_RENAMED = 1 << 3; - - /** - * Get the connection that has changed. - * - * @return IRemoteConnection - */ - public IRemoteConnection getConnection(); - - /** - * Returns the type of event being reported. This type - * is obtained by bitwise OR'ing the event types together. - * - * {@link #CONNECTION_CLOSED} {@link #CONNECTION_OPENED} {@link #CONNECTION_ABORTED} {@link #CONNECTION_RENAMED} - * - * @return a bitwise OR of event type constants - */ - public int getType(); -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java deleted file mode 100644 index 6820ce7434d..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionChangeListener.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -import java.util.EventListener; - -/** - * Listener used to register for notification of connection status changes. Clients should register a listener using the - * {@link IRemoteConnection#addConnectionChangeListener(IRemoteConnectionChangeListener)} method. - */ -public interface IRemoteConnectionChangeListener extends EventListener { - - /** - * Notifies this listener that the status of a connection has changed. - * - * @param event - * the connection change event - */ - - public void connectionChanged(IRemoteConnectionChangeEvent event); -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java deleted file mode 100644 index 046fbb13fd4..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionManager.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -import java.net.URI; -import java.util.List; - -import org.eclipse.remote.core.IUserAuthenticator; -import org.eclipse.remote.core.exception.RemoteConnectionException; - -/** - * Interface for managing connections to remote systems. - */ -public interface IRemoteConnectionManager { - /** - * The name of the connection for local services. There is only one connection for local services. - * - * @since 7.0 - */ - public static String LOCAL_CONNECTION_NAME = "Local"; //$NON-NLS-1$ - - /** - * Gets the remote connection corresponding to the supplied name. - * - * @param name - * name of the connection (as returned by {@link IRemoteConnection#getName()}) - * @return remote connection or null if no connection exists - */ - public IRemoteConnection getConnection(String name); - - /** - * Gets the remote connection corresponding to the supplied URI. - * - * @param uri - * URI containing a schema for this remote connection - * @return remote connection or null if no connection exists or the schema - * is incorrect - * @since 4.0 - */ - public IRemoteConnection getConnection(URI uri); - - /** - * Get all the connections for this service provider. - * - * @return connections that we know about - */ - public List getConnections(); - - /** - * Get the user authenticator that will be used when opening connections. The user authenticator is specified using the - * org.eclipse.remote.core.authenticator extension point. - * - * @param connection - * connection that will use this authenticator - * @return user authenticator - */ - public IUserAuthenticator getUserAuthenticator(IRemoteConnection connection); - - /** - * Creates a new remote connection named with supplied name. The connection attributes will be the default for the - * implementation. - * - * Returns a working copy of the remote connection. Callers must call {@link IRemoteConnectionWorkingCopy#save()} before the - * connection can be used. - * - * @param name - * name of the connection - * @return a new connection working copy with the supplied name - * @throws RemoteConnectionException - * if connection creation failed - * @since 5.0 - */ - public IRemoteConnectionWorkingCopy newConnection(String name) throws RemoteConnectionException; - - /** - * Remove a connection and all resources associated with it. - * - * @param connection - * connection to remove - * @throws RemoteConnectionException - * if the connection could not be removed - */ - public void removeConnection(IRemoteConnection connection) throws RemoteConnectionException; -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java deleted file mode 100644 index 83237a43fdf..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionService.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer (QNX) - initial - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -/** - * Root interface for all services available from a connection. - */ -public interface IRemoteConnectionService { - - /** - * Return the connection this service applies to. - * - * @return connection - */ - IRemoteConnection getConnection(); - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java deleted file mode 100644 index f522fb8536a..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteConnectionWorkingCopy.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -public interface IRemoteConnectionWorkingCopy extends IRemoteConnection { - /** - * Returns the original connection this working copy was created from. - * - * @return original connection - */ - public IRemoteConnection getOriginal(); - - /** - * Returns whether this connection has been modified since it was last saved or created. - * - * @return true if the connection has been modified - */ - public boolean isDirty(); - - /** - * Saves this working copy to its original connection and returns a handle to the resulting connection. Has no effect if this - * connection does not need saving. - * - * @return saved connection - */ - public IRemoteConnection save(); - - /** - * Set the address for this connection - * - * @param address - */ - public void setAddress(String address); - - /** - * Set an implementation dependent attribute for the connection. Attributes keys supported by the connection can be obtained - * using {@link #getAttributes()}. Attributes are persisted along with connection information. - * - * @param key - * attribute key - * @param value - * attribute value - * @since 5.0 - */ - public void setAttribute(String key, String value); - - /** - * Set the name for this connection - * - * @param name - */ - public void setName(String name); - - /** - * Set the password for this connection - * - * @param password - * @since 5.0 - */ - public void setPassword(String password); - - /** - * Set the port used for this connection. Only valid if supported by the underlying service provider. - * - * @param port - * port number for the connection - * @since 5.0 - */ - public void setPort(int port); - - /** - * Set the username for this connection - * - * @param username - */ - public void setUsername(String username); -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java deleted file mode 100644 index 328537a38c9..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteFileManager.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -import java.net.URI; - -import org.eclipse.core.filesystem.IFileStore; -import org.eclipse.core.runtime.IPath; - -/** - * Interface for managing resources on a remote system. - */ -public interface IRemoteFileManager { - /** - * Get the resource associated with path. IFileStore can then be used to - * perform operations on the file. - * - * The remote connection does not need to be open to use this method, but - * subsequent operations on the IFileStore that access the underlying remote - * filesystem may require the connection to be open. - * - * @param path - * path to resource - * @return the file store representing the remote path - */ - public IFileStore getResource(String path); - - /** - * Gets the directory separator on the target system. - * - * @return String - * @since 4.0 - */ - public String getDirectorySeparator(); - - /** - * Convert URI to a remote path. This path is suitable for direct file - * operations on the remote system. - * - * The remote connection does not need to be open to use this method. - * - * @return IPath representing the remote path - */ - public String toPath(URI uri); - - /** - * Convert remote path to equivalent URI. This URI is suitable for EFS - * operations on the local system. - * - * The remote connection does not need to be open to use this method. - * - * @param path - * path on remote system - * @return URI representing path on remote system, or null if the path is - * invalid - */ - public URI toURI(IPath path); - - /** - * Convert string representation of a remote path to equivalent URI. This - * URI is suitable for EFS operations on the local system. - * - * The remote connection does not need to be open to use this method. - * - * @param path - * path on remote system - * @return URI representing path on remote system, or null if the path is - * invalid - */ - public URI toURI(String path); -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java deleted file mode 100644 index 34810f223e6..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteLaunchConfigService.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer (QNX) - initial - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -import org.eclipse.debug.core.ILaunchConfigurationType; - -/** - * Service that supports setting up launch configurations for - * launching over the remote connection. - */ -public interface IRemoteLaunchConfigService extends IRemoteService { - - /** - * Does this remote service support launching on this launch config type. - * - * @param launchConfigType - * @return boolean supports launching on this connection - */ - boolean supportsType(ILaunchConfigurationType launchConfigType); - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java deleted file mode 100644 index 36c85fde2e7..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteService.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.remote.core.api2; - -/** - * The root interface for a service provided by a remote services provider. - */ -public interface IRemoteService { - - /** - * Return the remote services provider object. - * - * @return remote services provider. - */ - IRemoteServices getRemoteServices(); - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java deleted file mode 100644 index 34143197392..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServices.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Abstraction of a remote services provider. Clients obtain this interface using one of the static methods in - * {@link RemoteServices}. The methods on this interface can then be used to access the full range of remote services provided. - */ -public interface IRemoteServices extends IRemoteServicesDescriptor { - public static final int CAPABILITY_ADD_CONNECTIONS = 0x01; - public static final int CAPABILITY_EDIT_CONNECTIONS = 0x02; - public static final int CAPABILITY_REMOVE_CONNECTIONS = 0x04; - public static final int CAPABILITY_SUPPORTS_TCP_PORT_FORWARDING = 0x08; - public static final int CAPABILITY_SUPPORTS_X11_FORWARDING = 0x10; - public static final int CAPABILITY_SUPPORTS_COMMAND_SHELL = 0x20; - - /** - * Return one of the remote services that this provider provides. - * - * @param service interface - * @return the service - */ - public T getService(Class service); - - /** - * Get a connection manager for managing remote connections. - * - * @return connection manager or null if services are not initialized - */ - public IRemoteConnectionManager getConnectionManager(); - - /** - * Initialize the remote service. Clients should not call this method (it is called internally.) - * - * @return true if the initialization was successful, false otherwise - * @since 7.0 - */ - public boolean initialize(IProgressMonitor monitor); - - /** - * Gets the capabilities of the remote service. - * - * @return bit-wise or of capability flag constants - */ - public int getCapabilities(); -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java deleted file mode 100644 index a3198910c46..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/remote/core/api2/IRemoteServicesDescriptor.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation 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: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.remote.core.api2; - -/** - * Interface representing a remote services provider extension. Clients can use this to find out information about the extension - * without loading it. - */ -public interface IRemoteServicesDescriptor extends Comparable { - /** - * Get unique ID of this service. Can be used as a lookup key. - * - * @return unique ID - */ - public String getId(); - - /** - * Get display name of this service. - * - * @return display name - */ - public String getName(); - - /** - * Get the EFS scheme provided by this service. - * - * @return display name - */ - public String getScheme(); -} From 9c7de822381e76960a1c24f360f50b0ebe027625 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 16 Feb 2015 02:17:27 -0500 Subject: [PATCH 014/198] Bug 459972 - Update LaunchBar to use IRemoteConnection for targets. ILaunchTarget is removed and replaced with IRemoteConnection. You still have to declare a launch target type to point at a connection type. It uses os and arch to help decide what toolchains to use for builds. Change-Id: I8f21b4e5043ccd8af85be91c643f58ad301c3ac4 --- .../META-INF/MANIFEST.MF | 3 +- bundles/org.eclipse.launchbar.core/plugin.xml | 2 +- .../schema/launchBarContributions.exsd | 18 +- .../launchbar/core/ILaunchBarManager.java | 24 - .../eclipse/launchbar/core/ILaunchTarget.java | 39 - .../launchbar/core/ILaunchTargetType.java | 30 - .../launchbar/core/internal/Activator.java | 25 +- .../core/internal/LaunchBarManager.java | 729 ++++++-------- .../internal/LaunchConfigProviderInfo.java | 28 + .../core/internal/LaunchConfigTypeInfo.java | 27 + .../internal/LaunchDescriptorTypeInfo.java | 50 + .../core/internal/LaunchTargetTypeInfo.java | 57 ++ .../launchbar/core/internal/LocalTarget.java | 43 - .../core/internal/LocalTargetType.java | 25 - .../META-INF/MANIFEST.MF | 4 +- bundles/org.eclipse.launchbar.ui/plugin.xml | 18 - .../schema/launchBarUIContributions.exsd | 76 -- .../launchbar/ui/internal/Activator.java | 3 +- .../ui/internal/LaunchBarUIManager.java | 64 -- .../ui/internal/LocalTargetLabelProvider.java | 16 - .../ConfigureActiveLaunchHandler.java | 8 +- .../commands/LaunchActiveCommandHandler.java | 6 +- .../ui/internal/controls/ConfigSelector.java | 4 +- .../internal/controls/LaunchBarControl.java | 4 +- .../ui/internal/controls/TargetSelector.java | 101 +- .../dialogs/NewLaunchTargetTypePage.java | 92 -- .../dialogs/NewLaunchTargetWizard.java | 42 - .../LaunchTargetsActionProvider.java | 26 - .../LaunchTargetsContentProvider.java | 73 -- .../LaunchTargetsLabelProvider.java | 32 - .../targetsView/LaunchTargetsNavigator.java | 55 - .../targetsView/TargetPropertyPage.java | 51 - pom.xml | 16 +- .../META-INF/MANIFEST.MF | 11 +- .../core/internal/LaunchBarManagerTest.java | 938 +++--------------- .../launchbar/core/tests/Activator.java | 30 - .../core/tests/AutomatedIntegrationSuite.java | 42 - 37 files changed, 693 insertions(+), 2119 deletions(-) delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java delete mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java delete mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 559691cc512..b84817037d6 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -7,7 +7,8 @@ Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, - org.eclipse.core.filesystem + org.eclipse.core.filesystem, + org.eclipse.remote.core;bundle-version="2.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index db959f92155..28ce28378c3 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -5,7 +5,7 @@ - + - + + + + + The osname property for the connection, i.e. the operating system name, e.g. win32, linux. If not specified, matches all. + + + + + + + The osarch property for the connection, i.e. the CPU architecture such as x86, armv7. If not specified, matches all. + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index 9059e089ac2..e81a0a5ea43 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -39,30 +39,6 @@ public interface ILaunchBarManager { */ void launchObjectChanged(Object launchObject) throws CoreException; - /** - * A new launch target has been added. - * - * @param target launch target - * @throws CoreException - */ - void launchTargetAdded(ILaunchTarget target) throws CoreException; - - /** - * A launch target has been removed. - * - * @param target launch target - * @throws CoreException - */ - void launchTargetRemoved(ILaunchTarget target) throws CoreException; - - /** - * The launch target has changed in some way that affects the - * launch bar. - * - * @param target launch target - */ - void launchTargetChanged(ILaunchTarget target); - // TODO API for adding and removing types. } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java deleted file mode 100644 index 0c6328e9007..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTarget.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.core; - -import org.eclipse.core.runtime.IAdaptable; - -public interface ILaunchTarget extends IAdaptable { - - /** - * Returns the name of this target. - * Names must be unique across all targets of a given type. - * - * @return name of the target - */ - String getName(); - - /** - * Returns the type for this target. - * - * @return type of the target - */ - ILaunchTargetType getType(); - - /** - * The active state of this target has changed. - * - * @param active active state of the target - */ - void setActive(boolean active); - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java deleted file mode 100644 index 8e705620e15..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchTargetType.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.core; - -import org.eclipse.core.runtime.CoreException; - -public interface ILaunchTargetType { - - /** - * Add initial targets and set up any listeners. - * - * @param manager - * @throws CoreException - */ - void init(ILaunchBarManager manager) throws CoreException; - - /** - * Shutting down, remove any listeners - */ - void dispose(); - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index 0ab019740c3..2e72396d0d4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -17,33 +17,38 @@ import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.launchbar.core.ILaunchBarManager; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; public class Activator extends Plugin { public static final String PLUGIN_ID = "org.eclipse.launchbar.core"; private static Activator plugin; - private LaunchBarManager launchBarManager; public void start(BundleContext bundleContext) throws Exception { super.start(bundleContext); plugin = this; - launchBarManager = new LaunchBarManager(); - bundleContext.registerService(ILaunchBarManager.class, launchBarManager, null); + bundleContext.registerService(ILaunchBarManager.class, new LaunchBarManager(), null); } public void stop(BundleContext bundleContext) throws Exception { super.stop(bundleContext); plugin = null; - launchBarManager.dispose(); - launchBarManager = null; } public static Activator getDefault() { return plugin; } - public LaunchBarManager getLaunchBarManager() { - return launchBarManager; + /** + * Return the OSGi service with the given service interface. + * + * @param service service interface + * @return the specified service or null if it's not registered + */ + public static T getService(Class service) { + BundleContext context = plugin.getBundle().getBundleContext(); + ServiceReference ref = context.getServiceReference(service); + return ref != null ? context.getService(ref) : null; } public static void throwCoreException(Exception e) throws CoreException { @@ -58,7 +63,11 @@ public class Activator extends Plugin { } public static void log(Exception exception) { - log(new Status(IStatus.ERROR, PLUGIN_ID, exception.getLocalizedMessage(), exception)); + if (exception instanceof CoreException) { + log(((CoreException) exception).getStatus()); + } else { + log(new Status(IStatus.ERROR, PLUGIN_ID, exception.getLocalizedMessage(), exception)); + } } private static final String DEBUG_ONE = diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 8caadb6cb93..b4547a7778e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -13,24 +13,20 @@ package org.eclipse.launchbar.core.internal; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Set; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IEclipsePreferences; @@ -46,15 +42,19 @@ import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ILaunchObjectProvider; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.launchbar.core.ILaunchTargetType; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionChangeListener; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.remote.core.RemoteConnectionChangeEvent; +import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; /** * The brains of the launch bar. */ -public class LaunchBarManager implements ILaunchBarManager, ILaunchConfigurationListener { +public class LaunchBarManager implements ILaunchBarManager, ILaunchConfigurationListener, IRemoteConnectionChangeListener { // TODO make these more fine grained or break them into more focused listeners public interface Listener { @@ -65,124 +65,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration void launchTargetsChanged(); } - public static class LaunchTargetTypeInfo { - private final ILaunchTargetType type; - private final String id; - - public LaunchTargetTypeInfo(String id, ILaunchTargetType type) { - this.type = type; - this.id = id; - } - - public String getId() { - return id; - } - - public ILaunchTargetType getType() { - return type; - } - } - - public static class LaunchDescriptorTypeInfo { - private final String id; - private final int priority; - private IConfigurationElement element; - private ILaunchDescriptorType type; - - public LaunchDescriptorTypeInfo(String id, int priority, IConfigurationElement element) { - this.id = id; - this.priority = priority; - this.element = element; - } - - // Used for testing - public LaunchDescriptorTypeInfo(String id, int priority, ILaunchDescriptorType type) { - this.id = id; - this.priority = priority; - this.type = type; - } - - public String getId() { - return id; - } - - public int getPriority() { - return priority; - } - - public ILaunchDescriptorType getType() throws CoreException { - if (type == null) { - type = (ILaunchDescriptorType) element.createExecutableExtension("class"); - element = null; - } - return type; - } - } - - public static class LaunchConfigProviderInfo { - private final String launchConfigTypeId; - private IConfigurationElement element; - private ILaunchConfigurationProvider provider; - - public LaunchConfigProviderInfo(String launchConfigTypeId, IConfigurationElement element) { - this.launchConfigTypeId = launchConfigTypeId; - this.element = element; - } - - // For testing - public LaunchConfigProviderInfo(String launchConfigTypeId, ILaunchConfigurationProvider provider) { - this.launchConfigTypeId = launchConfigTypeId; - this.provider = provider; - } - - public String getLaunchConfigTypeId() { - return launchConfigTypeId; - } - - public ILaunchConfigurationProvider getProvider() throws CoreException { - if (provider == null) { - provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); - element = null; - } - return provider; - } - } - - public static class LaunchConfigTypeInfo { - private final String descriptorTypeId; - private final String targetTypeId; - private final String launchConfigTypeId; - - public LaunchConfigTypeInfo(String descriptorTypeId, String targetTypeId, String launchConfigTypeId) { - this.descriptorTypeId = descriptorTypeId; - this.targetTypeId = targetTypeId; - this.launchConfigTypeId = launchConfigTypeId; - } - - public String getDescriptorTypeId() { - return descriptorTypeId; - } - - public String getTargetTypeId() { - return targetTypeId; - } - - public String getLaunchConfigTypeId() { - return launchConfigTypeId; - } - } - private final List listeners = new LinkedList<>(); // The launch object providers private final List objectProviders = new ArrayList<>(); - // The target types by id - doesn't need to be an executablExtension since it runs right away - private final Map targetTypes = new HashMap<>(); - - // The extended info for the target types as specified in the extension - private final Map targetTypeInfo = new HashMap<>(); - // The descriptor types private final Map descriptorTypes = new HashMap<>(); @@ -192,20 +79,29 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // Descriptor types ordered from highest priority to lowest private final List orderedDescriptorTypes = new LinkedList<>(); - // The mapping from descriptor type to target type to config type info - private final Map> configTypes = new HashMap<>(); + // The target types by id + private final Map targetTypes = new HashMap<>(); + + // The list of target types for a given descriptor type + private final Map> descriptorTargets = new HashMap<>(); + + // The mapping from descriptor type to target type to launch config type + private final Map> configTypes = new HashMap<>(); // Map descriptor type to target type so we can build when no targets have been added private final Map defaultTargetTypes = new HashMap<>(); + // Map from launch config type id to target type ids for default descriptors + private final Map> configTargetTypes = new HashMap<>(); + + // Map from launch config type Id to target type id for default descriptor for null target + private final Map defaultConfigTargetTypes = new HashMap<>(); + // The launch config providers private final Map configProviders = new HashMap<>(); - // Map from launch config type id to target type id for default config descriptor - private final Map> defaultConfigTargetTypes = new HashMap<>(); - - // Map from launch config type Id to target type id for default config descriptor for null target - private final Map defaultConfigDefaultTargetTypes = new HashMap<>(); + // The default launch descriptor type used to wrap unclaimed launch configs + private DefaultLaunchDescriptorType defaultDescriptorType = new DefaultLaunchDescriptorType(); // Descriptors in MRU order, key is desc type id and desc name. private final Map, ILaunchDescriptor> descriptors = new LinkedHashMap<>(); @@ -213,18 +109,15 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // Map of launch objects to launch descriptors private final Map objectDescriptorMap = new HashMap<>(); - // Targets, key is target type id and target name. - private final Map, ILaunchTarget> targets = new HashMap<>(); - // The created launch configurations private final Map> configs = new HashMap<>(); + private final IRemoteServicesManager remoteServicesManager = getRemoteServicesManager(); + private final IRemoteLaunchConfigService remoteLaunchConfigService = getRemoteLaunchConfigService(); + private ILaunchDescriptor activeLaunchDesc; private ILaunchMode activeLaunchMode; - private ILaunchTarget activeLaunchTarget; - - // The default launch descriptor type used to wrap unclaimed launch configs - private DefaultLaunchDescriptorType defaultDescriptorType = new DefaultLaunchDescriptorType(); + private IRemoteConnection activeLaunchTarget; // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; @@ -232,20 +125,49 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; public LaunchBarManager() { - new Job("Launch Bar Initialization") { - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - init(); - return Status.OK_STATUS; - } catch (CoreException e) { - return e.getStatus(); - } - } - }.schedule(); + this(true); } - - public void init() throws CoreException { + + // called from unit tests to ensure everything is inited + LaunchBarManager(boolean doInit) { + remoteServicesManager.addRemoteConnectionChangeListener(this); + + if (doInit) { + new Job("Launch Bar Initialization") { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + init(); + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } + } + }.schedule(); + } + } + + // To allow override by tests + IRemoteServicesManager getRemoteServicesManager() { + return Activator.getService(IRemoteServicesManager.class); + } + + IRemoteLaunchConfigService getRemoteLaunchConfigService() { + return Activator.getService(IRemoteLaunchConfigService.class); + } + + // To allow override by tests + IExtensionPoint getExtensionPoint() throws CoreException { + return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); + } + + // To allow override by tests + ILaunchManager getLaunchManager() { + return DebugPlugin.getDefault().getLaunchManager(); + } + + // When testing, call this after setting up the mocks. + void init() throws CoreException { // Fetch the desc order before the init messes it up IEclipsePreferences store = getPreferenceStore(); String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); @@ -285,17 +207,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - // To allow override by tests - protected IExtensionPoint getExtensionPoint() throws CoreException { - return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); - } - - // To allow override by tests - protected ILaunchManager getLaunchManager() { - return DebugPlugin.getDefault().getLaunchManager(); - } - - protected void loadExtensions() throws CoreException { + private void loadExtensions() throws CoreException { IExtensionPoint point = getExtensionPoint(); IExtension[] extensions = point.getExtensions(); @@ -305,42 +217,50 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration try { String elementName = element.getName(); if (elementName.equals("descriptorType")) { - String id = element.getAttribute("id"); - String priorityStr = element.getAttribute("priority"); - int priority = 1; - if (priorityStr != null) { - try { - priority = Integer.parseInt(priorityStr); - } catch (NumberFormatException e) { - // Log it but keep going with the default - Activator.log(e); - } - } - LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(id, priority, element); + LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(element); addDescriptorType(typeInfo); } else if (elementName.equals("targetType")) { - String id = element.getAttribute("id"); - ILaunchTargetType targetType = (ILaunchTargetType) element.createExecutableExtension("class"); - LaunchTargetTypeInfo info = new LaunchTargetTypeInfo(id, targetType); - addTargetType(info); - } else if (elementName.equals("configProvider")) { - String configTypeId = element.getAttribute("launchConfigurationType"); - LaunchConfigProviderInfo info = new LaunchConfigProviderInfo(configTypeId, element); - addConfigProvider(info); + LaunchTargetTypeInfo info = new LaunchTargetTypeInfo(element); + targetTypes.put(info.getId(), info); } else if (elementName.equals("configType")) { String descriptorTypeId = element.getAttribute("descriptorType"); String targetTypeId = element.getAttribute("targetType"); - String configTypeId = element.getAttribute("launchConfigurationType"); - String isDefault = element.getAttribute("isDefault"); - LaunchConfigTypeInfo info = new LaunchConfigTypeInfo(descriptorTypeId, targetTypeId, configTypeId); - addConfigType(info, Boolean.valueOf(isDefault)); + String launchConfigTypeId = element.getAttribute("launchConfigurationType"); + String isDefaultStr = element.getAttribute("isDefault"); + boolean isDefault = isDefaultStr != null ? Boolean.parseBoolean(isDefaultStr) : false; + + // add to desc type -> target type mapping + List targetTypes = descriptorTargets.get(descriptorTypeId); + if (targetTypes == null) { + targetTypes = new ArrayList<>(); + descriptorTargets.put(descriptorTypeId, targetTypes); + } + targetTypes.add(targetTypeId); + + // Add to desc type -> target type -> config type mapping + Map targetConfigMap = configTypes.get(descriptorTypeId); + if (targetConfigMap == null) { + targetConfigMap = new HashMap<>(); + configTypes.put(descriptorTypeId, targetConfigMap); + } + targetConfigMap.put(targetTypeId, launchConfigTypeId); + + // If default, add to defaults list + if (isDefault) { + defaultTargetTypes.put(descriptorTypeId, targetTypeId); + } + // also assume that the target type works for the config type - addDefaultConfigTargetType(configTypeId, targetTypeId, Boolean.valueOf(isDefault)); + addDefaultConfigTargetType(launchConfigTypeId, targetTypeId, isDefault); + } else if (elementName.equals("configProvider")) { + LaunchConfigProviderInfo info = new LaunchConfigProviderInfo(element); + configProviders.put(info.getLaunchConfigTypeId(), info); } else if (elementName.equals("defaultConfigTarget")) { String configTypeId = element.getAttribute("launchConfigurationType"); String targetTypeId = element.getAttribute("targetType"); - String isDefault = element.getAttribute("isDefault"); - addDefaultConfigTargetType(configTypeId, targetTypeId, Boolean.valueOf(isDefault)); + String isDefaultStr = element.getAttribute("isDefault"); + boolean isDefault = isDefaultStr != null ? Boolean.parseBoolean(isDefaultStr) : false; + addDefaultConfigTargetType(configTypeId, targetTypeId, isDefault); } } catch (CoreException e) { Activator.log(e.getStatus()); @@ -364,7 +284,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - public void addDescriptorType(LaunchDescriptorTypeInfo typeInfo) throws CoreException { + private void addDescriptorType(LaunchDescriptorTypeInfo typeInfo) throws CoreException { descriptorTypes.put(typeInfo.getId(), typeInfo); // TODO figure out a better place to set the id so we don't load the type object until needed descriptorTypeInfo.put(typeInfo.getType(), typeInfo); @@ -386,53 +306,20 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.trace("registered descriptor type " + typeInfo.getId()); } - public void addTargetType(final LaunchTargetTypeInfo info) { - targetTypes.put(info.getId(), info.getType()); - targetTypeInfo.put(info.getType(), info); - SafeRunner.run(new ISafeRunnable() { - @Override - public void run() throws Exception { - info.getType().init(LaunchBarManager.this); - } - @Override - public void handleException(Throwable exception) { - Activator.trace("target runner init exception " + info.getId()); - } - }); - Activator.trace("registered target " + info.getId()); - } - - public void addConfigType(LaunchConfigTypeInfo info, boolean isDefault) { - Map targetMap = configTypes.get(info.getDescriptorTypeId()); - if (targetMap == null) { - targetMap = new HashMap<>(); - configTypes.put(info.getDescriptorTypeId(), targetMap); - } - targetMap.put(info.getTargetTypeId(), info); - - if (isDefault) { - defaultTargetTypes.put(info.getDescriptorTypeId(), info.getTargetTypeId()); - } - } - - public void addConfigProvider(LaunchConfigProviderInfo info) { - configProviders.put(info.getLaunchConfigTypeId(), info); - } - - public void addDefaultConfigTargetType(String configTypeId, String targetTypeId, boolean isDefault) { - Set targetTypes = defaultConfigTargetTypes.get(configTypeId); + private void addDefaultConfigTargetType(String configTypeId, String targetTypeId, boolean isDefault) { + List targetTypes = configTargetTypes.get(configTypeId); if (targetTypes == null) { - targetTypes = new HashSet<>(); - defaultConfigTargetTypes.put(configTypeId, targetTypes); + targetTypes = new ArrayList<>(); + configTargetTypes.put(configTypeId, targetTypes); } targetTypes.add(targetTypeId); if (isDefault) { - defaultConfigDefaultTargetTypes.put(configTypeId, targetTypeId); + defaultConfigTargetTypes.put(configTypeId, targetTypeId); } } - public void addObjectProvider(ILaunchObjectProvider objectProvider) { + private void addObjectProvider(ILaunchObjectProvider objectProvider) { objectProviders.add(objectProvider); try { objectProvider.init(this); @@ -465,43 +352,23 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - public ILaunchDescriptorType getLaunchDescriptorType(String id) throws CoreException { - return descriptorTypes.get(id).getType(); - } - - public ILaunchDescriptor getLaunchDescriptor(Pair id) { - return descriptors.get(id); - } - - public ILaunchDescriptor getLaunchDescriptor(Object launchObject) { - return objectDescriptorMap.get(launchObject); - } - public String getDescriptorTypeId(ILaunchDescriptorType type) { return descriptorTypeInfo.get(type).getId(); } - public Pair getDescriptorId(ILaunchDescriptor descriptor) { + private Pair getDescriptorId(ILaunchDescriptor descriptor) { return new Pair(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); } - public ILaunchTargetType getLaunchTargetType(String id) { - return targetTypes.get(id); + private Pair getTargetId(IRemoteConnection target) { + return new Pair(target.getConnectionType().getId(), target.getName()); } - public String getTargetTypeId(ILaunchTargetType type) { - return targetTypeInfo.get(type).getId(); - } - - private Pair getTargetId(ILaunchTarget target) { - return new Pair(getTargetTypeId(target.getType()), target.getName()); - } - - public String toString(Pair key) { + private String toString(Pair key) { return key.getFirst() + ":" + key.getSecond(); } - protected Pair toId(String key) { + private Pair toId(String key) { int i = key.indexOf(':'); if (i < 0) { return null; @@ -510,41 +377,81 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return new Pair(key.substring(0, i), key.substring(i + 1)); } - private ILaunchConfigurationProvider getConfigProvider(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + private LaunchTargetTypeInfo getTargetTypeInfo(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + // Figure out what our target type is. + // Any target types registered with this descriptor type? + List targetTypeIds = descriptorTargets.get(getDescriptorTypeId(descriptor.getType())); + if (targetTypeIds == null) { + // Nope, how about with the config type + ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + if (config != null) { + targetTypeIds = configTargetTypes.get(config.getType().getIdentifier()); + } + } + + LaunchTargetTypeInfo targetTypeInfo = null; + if (targetTypeIds != null) { + for (String targetTypeId : targetTypeIds) { + LaunchTargetTypeInfo info = targetTypes.get(targetTypeId); + if (info != null && info.matches(target)) { + if (targetTypeInfo == null) { + targetTypeInfo = info; + } else { + // Is it a better match? i.e. doesn't rely on wild cards + if ((targetTypeInfo.getOsName().isEmpty() && !info.getOsName().isEmpty()) + || (targetTypeInfo.getOsArch().isEmpty() && !info.getOsArch().isEmpty())) { + targetTypeInfo = info; + } + } + } + } + } + + return targetTypeInfo; + } + + private ILaunchConfigurationProvider getConfigProvider(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { if (descriptor == null) { return null; } - ILaunchDescriptorType descriptorType = descriptor.getType(); - - ILaunchTargetType targetType = null; - if (target != null) { - targetType = target.getType(); - } else { - String targetTypeId = defaultTargetTypes.get(getDescriptorTypeId(descriptorType)); - if (targetTypeId != null) { - targetType = targetTypes.get(targetTypeId); - } - } - - if (targetType == null) { + LaunchTargetTypeInfo targetTypeInfo = getTargetTypeInfo(descriptor, target); + if (targetTypeInfo == null) { return null; } - Map targetMap = configTypes.get(getDescriptorTypeId(descriptorType)); + Map targetMap = configTypes.get(getDescriptorTypeId(descriptor.getType())); if (targetMap != null) { - LaunchConfigTypeInfo typeInfo = targetMap.get(getTargetTypeId(targetType)); - if (typeInfo != null) { - LaunchConfigProviderInfo providerInfo = configProviders.get(typeInfo.getLaunchConfigTypeId()); - if (providerInfo != null) { - return providerInfo.getProvider(); - } + String configProviderId = targetMap.get(targetTypeInfo.getId()); + LaunchConfigProviderInfo providerInfo = configProviders.get(configProviderId); + if (providerInfo != null) { + return providerInfo.getProvider(); } } return null; } + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + if (descriptor == null) + return null; + + LaunchTargetTypeInfo targetTypeInfo = getTargetTypeInfo(descriptor, target); + if (targetTypeInfo != null) { + Map targetMap = configTypes.get(getDescriptorTypeId(descriptor.getType())); + if (targetMap != null) { + String configTypeId = targetMap.get(targetTypeInfo.getId()); + return getLaunchManager().getLaunchConfigurationType(configTypeId); + } + } + + ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + if (config != null) + return config.getType(); + + return null; + } + private ILaunchDescriptorType ownsLaunchObject(Object launchObject) throws CoreException { // TODO use enablement to find out what descriptor types to ask // to prevent unnecessary plug-in loading @@ -556,7 +463,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } return null; } - + @Override public ILaunchDescriptor launchObjectAdded(Object launchObject) { Activator.trace("launch object added " + launchObject); @@ -593,7 +500,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // check if a new descriptor wants to take over ILaunchDescriptor origDesc = objectDescriptorMap.get(launchObject); ILaunchDescriptorType newDescType = ownsLaunchObject(launchObject); - + if (newDescType != null) { if (origDesc == null || !origDesc.getType().equals(newDescType)) { // we have a take over @@ -673,21 +580,17 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return; } - // TODO turning off for now since it's buggy. There is thought though that we may want - // to keep the active target when changing descriptors if it's valid for that descriptor. - // If we do that, then the active target should be recorded against the target type. - // The active target is too random at startup for this to work as coded here. -// if (activeLaunchTarget != null && supportsTargetType(activeLaunchDesc, activeLaunchTarget)) { -// return; // not changing target -// } - // last stored target from persistent storage String activeTargetId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_TARGET, null); if (activeTargetId != null) { - ILaunchTarget storedTarget = getLaunchTarget(toId(activeTargetId)); - if (storedTarget != null && supportsTargetType(activeLaunchDesc, storedTarget)) { - setActiveLaunchTarget(storedTarget); - return; + Pair id = toId(activeTargetId); + IRemoteConnectionType remoteServices = remoteServicesManager.getConnectionType(id.getFirst()); + if (remoteServices != null) { + IRemoteConnection storedTarget = remoteServices.getConnection(id.getSecond()); + if (storedTarget != null && supportsTargetType(activeLaunchDesc, storedTarget)) { + setActiveLaunchTarget(storedTarget); + return; + } } } // default target for descriptor @@ -707,8 +610,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration String modeNames[] = new String[] { storedModeId, lastActiveModeId, - "debug", "run", + "debug", supportedModes[0].getIdentifier() }; for (int i = 0; i < modeNames.length; i++) { @@ -720,7 +623,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration setActiveLaunchMode(foundMode); } - public boolean supportsMode(ILaunchMode mode) throws CoreException { + private boolean supportsMode(ILaunchMode mode) throws CoreException { // check that active descriptor supports the given mode if (mode == null) return false; @@ -733,7 +636,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return false; } - protected void setPreference(Preferences store, String prefId, String value) { + private void setPreference(Preferences store, String prefId, String value) { if (value != null) { store.put(prefId, value); } else { @@ -746,17 +649,17 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - protected Preferences getPerDescriptorStore() { + private Preferences getPerDescriptorStore() { if (activeLaunchDesc == null) return getPreferenceStore(); return getPreferenceStore().node(toString(getDescriptorId(activeLaunchDesc))); } - protected IEclipsePreferences getPreferenceStore() { + private IEclipsePreferences getPreferenceStore() { return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); } - public void updateLaunchDescriptor(ILaunchDescriptor configDesc) { + private void updateLaunchDescriptor(ILaunchDescriptor configDesc) { for (Listener listener : listeners) { try { listener.activeLaunchDescriptorChanged(); @@ -767,6 +670,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } public ILaunchMode[] getLaunchModes() throws CoreException { + if (activeLaunchTarget == null) { + return new ILaunchMode[0]; + } ILaunchConfigurationType configType = getLaunchConfigurationType(activeLaunchDesc, activeLaunchTarget); if (configType == null) return new ILaunchMode[0]; @@ -805,88 +711,64 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration setPreference(getPerDescriptorStore(), PREF_ACTIVE_LAUNCH_MODE, mode.getIdentifier()); // per desc store } - public ILaunchTarget[] getAllLaunchTargets() { - return targets.values().toArray(new ILaunchTarget[targets.size()]); - } - - public ILaunchTarget[] getLaunchTargets() throws CoreException { - return getLaunchTargets(activeLaunchDesc); - } - - public ILaunchTarget[] getLaunchTargets(ILaunchDescriptor descriptor) throws CoreException { + public List getLaunchTargets(ILaunchDescriptor descriptor) throws CoreException { if (descriptor == null) - return new ILaunchTarget[0]; + return Collections.emptyList(); - // See if there is are targets registered with this descriptor type - Map targetMap = configTypes.get(getDescriptorTypeId(descriptor.getType())); - if (targetMap != null) { - List targetList = new ArrayList<>(); - // Not super fast, but we're assuming there aren't many targets. - for (Entry, ILaunchTarget> targetEntry : targets.entrySet()) { - if (targetMap.containsKey(targetEntry.getKey().getFirst())) { - targetList.add(targetEntry.getValue()); - } - } - return targetList.toArray(new ILaunchTarget[targetList.size()]); + // Any target types registered with this descriptor type? + List targetTypeIds = descriptorTargets.get(getDescriptorTypeId(descriptor.getType())); + if (targetTypeIds == null) { + // Nope, how about with the config type + ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + if (config != null) { + targetTypeIds = configTargetTypes.get(config.getType().getIdentifier()); + } } - // Nope, see if there are any default config targets - ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); - if (config != null) { - Set targetTypeIds = defaultConfigTargetTypes.get(config.getType().getIdentifier()); - if (targetTypeIds != null) { - List targetList = new ArrayList<>(); - // Not super fast, but we're assuming there aren't many targets. - for (Entry, ILaunchTarget> targetEntry : targets.entrySet()) { - if (targetTypeIds.contains(targetEntry.getKey().getFirst())) { - targetList.add(targetEntry.getValue()); + if (targetTypeIds != null) { + List targetList = new ArrayList<>(); + for (IRemoteConnection connection : remoteServicesManager.getAllRemoteConnections()) { + for (String targetTypeId : targetTypeIds) { + LaunchTargetTypeInfo info = targetTypes.get(targetTypeId); + if (info != null && info.matches(connection)) { + targetList.add(connection); + break; } } - return targetList.toArray(new ILaunchTarget[targetList.size()]); } + return targetList; } - // Nope, return the local target - for (Entry, ILaunchTarget> targetEntry : targets.entrySet()) { - if (LocalTargetType.ID.equals(targetEntry.getKey().getFirst())) { - return new ILaunchTarget[] { targetEntry.getValue() }; - } - } - - // Not found, weird - return new ILaunchTarget[0]; + // Nope, return the local target, the default default + IRemoteConnectionType localServices = remoteServicesManager.getLocalConnectionType(); + return localServices.getConnections(); } - public ILaunchTarget getActiveLaunchTarget() { + public IRemoteConnection getActiveLaunchTarget() { return activeLaunchTarget; } - public void setActiveLaunchTarget(ILaunchTarget target) throws CoreException { + public void setActiveLaunchTarget(IRemoteConnection target) throws CoreException { if (activeLaunchTarget == target) { return; } - if (activeLaunchTarget != null) { - activeLaunchTarget.setActive(false); - } - activeLaunchTarget = target; launchTargetChanged(activeLaunchTarget); if (target == null) { return; // no point storing null, if stored id is invalid it won't be used anyway } - target.setActive(true); if (activeLaunchDesc == null) return; + // per desc store if (supportsTargetType(activeLaunchDesc, target)) setPreference(getPerDescriptorStore(), PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); } - @Override - public void launchTargetChanged(ILaunchTarget target) { + private void launchTargetChanged(IRemoteConnection target) { for (Listener listener : listeners) { try { listener.activeLaunchTargetChanged(); @@ -896,91 +778,27 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - @Override - public void launchTargetAdded(ILaunchTarget target) throws CoreException { - targets.put(getTargetId(target), target); - for (Listener listener : listeners) { - try { - listener.launchTargetsChanged(); - } catch (Exception e) { - Activator.log(e); - } - } - if (activeLaunchDesc != null && activeLaunchTarget == null && supportsTargetType(activeLaunchDesc, target)) { - setActiveLaunchTarget(target); - } + private IRemoteConnection getDefaultLaunchTarget(ILaunchDescriptor descriptor) throws CoreException { + List targets = getLaunchTargets(descriptor); + return targets.isEmpty() ? null : targets.get(0); } - @Override - public void launchTargetRemoved(ILaunchTarget target) throws CoreException { - targets.remove(getTargetId(target)); - for (Listener listener : listeners) { - try { - listener.launchTargetsChanged(); - } catch (Exception e) { - Activator.log(e); - } - } - if (activeLaunchTarget == target) { - setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); - } - } - - private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) throws CoreException { - ILaunchTarget[] targets = getLaunchTargets(descriptor); - if (targets.length > 0) { - return targets[0]; - } - return null; - } - - public ILaunchTarget getLaunchTarget(Pair targetId) { - if (targetId == null) - return null; - return targets.get(targetId); - } - - public ILaunchTargetType[] getAllLaunchTargetTypes() { - return targetTypes.values().toArray(new ILaunchTargetType[targetTypes.values().size()]); - } - - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { - if (descriptor == null) - return null; - - String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); - - String targetTypeId = null; - if (target != null) { - targetTypeId = getTargetTypeId(target.getType()); - } else { - targetTypeId = defaultTargetTypes.get(getDescriptorTypeId(descriptor.getType())); - } - - if (targetTypeId != null) { - Map targetMap = configTypes.get(descriptorTypeId); - if (targetMap != null) { - LaunchConfigTypeInfo typeInfo = targetMap.get(targetTypeId); - return getLaunchManager().getLaunchConfigurationType(typeInfo.getLaunchConfigTypeId()); - } - } - - ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); - if (config != null) - return config.getType(); - - return null; - } - - private boolean supportsTargetType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + private boolean supportsTargetType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { return getConfigProvider(descriptor, target) != null; } public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { - return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); + ILaunchConfiguration activeConfig = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); + if (activeConfig != null) { + // Save the config -> target mapping + remoteLaunchConfigService.setActiveConnection(activeConfig, activeLaunchTarget); + } + return activeConfig; } - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { + // Don't call this to get the active launch config. Use getActiveLaunchConfiguration(). It ensures that config -> target + // mapping is saved. + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { if (descriptor == null) { return null; } @@ -1057,7 +875,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public void launchConfigurationRemoved(ILaunchConfiguration configuration) { Activator.trace("launch config removed " + configuration); - + // Is there any way this method is called when a LC still exists??? This may be dead code. // configuration.getType() will fail when !configuration.exists() if (configuration.exists()) { @@ -1079,21 +897,21 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration ILaunchDescriptor desc = objectDescriptorMap.get(configuration); if (desc == null) { /* WARNING: This is slow. Call only as a last resort */ - Iterator>> iter = configs.entrySet().iterator(); - while (iter.hasNext()) { - Entry> e1 = iter.next(); - if (e1.getValue().containsValue(configuration)) { - Iterator> iter2 = e1.getValue().entrySet().iterator(); - while (iter2.hasNext()) { - Entry e2 = iter2.next(); - if (e2.getValue().equals(configuration)) { + Iterator>> iter = configs.entrySet().iterator(); + while (iter.hasNext()) { + Entry> e1 = iter.next(); + if (e1.getValue().containsValue(configuration)) { + Iterator> iter2 = e1.getValue().entrySet().iterator(); + while (iter2.hasNext()) { + Entry e2 = iter2.next(); + if (e2.getValue().equals(configuration)) { e1.getValue().remove((ILaunchConfigurationProvider) e2.getKey()); return; - } - } - break; - } - } + } + } + break; + } + } } try { removeDescriptor(configuration, desc); @@ -1119,4 +937,51 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } + @Override + public void connectionChanged(RemoteConnectionChangeEvent event) { + switch (event.getType()) { + case RemoteConnectionChangeEvent.CONNECTION_ADDED: + try { + launchTargetAdded(event.getConnection()); + } catch (CoreException e) { + Activator.log(e); + } + break; + + case RemoteConnectionChangeEvent.CONNECTION_REMOVED: + case RemoteConnectionChangeEvent.CONNECTION_RENAMED: + try { + launchTargetRemoved(event.getConnection()); + } catch (CoreException e) { + Activator.log(e); + } + } + } + + private void launchTargetAdded(IRemoteConnection target) throws CoreException { + for (Listener listener : listeners) { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + if (activeLaunchDesc != null && activeLaunchTarget == null && supportsTargetType(activeLaunchDesc, target)) { + setActiveLaunchTarget(target); + } + } + + private void launchTargetRemoved(IRemoteConnection target) throws CoreException { + for (Listener listener : listeners) { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); + } + } + if (activeLaunchTarget == target) { + setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); + } + } + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java new file mode 100644 index 00000000000..87b0bf244d1 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -0,0 +1,28 @@ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.launchbar.core.ILaunchConfigurationProvider; + +public class LaunchConfigProviderInfo { + private final String launchConfigTypeId; + private IConfigurationElement element; + private ILaunchConfigurationProvider provider; + + public LaunchConfigProviderInfo(IConfigurationElement element) { + this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); + this.element = element; + } + + public String getLaunchConfigTypeId() { + return launchConfigTypeId; + } + + public ILaunchConfigurationProvider getProvider() throws CoreException { + if (provider == null) { + provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); + element = null; + } + return provider; + } +} \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java new file mode 100644 index 00000000000..c124378ef01 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java @@ -0,0 +1,27 @@ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.IConfigurationElement; + +public class LaunchConfigTypeInfo { + private final String descriptorTypeId; + private final String targetTypeId; + private final String launchConfigTypeId; + + public LaunchConfigTypeInfo(IConfigurationElement element) { + this.descriptorTypeId = element.getAttribute("descriptorType"); + this.targetTypeId = element.getAttribute("targetType"); + this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); + } + + public String getDescriptorTypeId() { + return descriptorTypeId; + } + + public String getTargetTypeId() { + return targetTypeId; + } + + public String getLaunchConfigTypeId() { + return launchConfigTypeId; + } +} \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java new file mode 100644 index 00000000000..20ed22b6985 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -0,0 +1,50 @@ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.launchbar.core.ILaunchDescriptorType; + +public class LaunchDescriptorTypeInfo { + private final String id; + private int priority; + private IConfigurationElement element; + private ILaunchDescriptorType type; + + public LaunchDescriptorTypeInfo(IConfigurationElement element) { + this.id = element.getAttribute("id"); + String priorityStr = element.getAttribute("priority"); + this.priority = 1; + if (priorityStr != null) { + try { + priority = Integer.parseInt(priorityStr); + } catch (NumberFormatException e) { + // Log it but keep going with the default + Activator.log(e); + } + } + this.element = element; + } + + // Used for testing + public LaunchDescriptorTypeInfo(String id, int priority, ILaunchDescriptorType type) { + this.id = id; + this.priority = priority; + this.type = type; + } + + public String getId() { + return id; + } + + public int getPriority() { + return priority; + } + + public ILaunchDescriptorType getType() throws CoreException { + if (type == null) { + type = (ILaunchDescriptorType) element.createExecutableExtension("class"); + element = null; + } + return type; + } +} \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java new file mode 100644 index 00000000000..42e27cfaa7d --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java @@ -0,0 +1,57 @@ +package org.eclipse.launchbar.core.internal; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.remote.core.IRemoteConnection; + +class LaunchTargetTypeInfo { + public static final String SEP = "|"; + private final String id; + private final String connectionTypeId; + private String osname; + private String osarch; + + public LaunchTargetTypeInfo(IConfigurationElement ce) { + id = ce.getAttribute("id"); + connectionTypeId = ce.getAttribute("connectionTypeId"); + osname = ce.getAttribute("osname"); + if (osname != null && osname.isEmpty()) { + osname = null; + } + osarch = ce.getAttribute("osarch"); + if (osarch != null && osarch.isEmpty()) { + osarch = null; + } + } + + public String getId() { + return id; + } + + public String getRemoteServicesId() { + return connectionTypeId; + } + + public String getOsName() { + return osname; + } + + public String getOsArch() { + return osarch; + } + + public boolean matches(IRemoteConnection connection) { + if (!connectionTypeId.equals(connection.getConnectionType().getId())) { + return false; + } + + if (osname != null && !osname.equals(connection.getProperty(IRemoteConnection.OS_NAME_PROPERTY))) { + return false; + } + + if (osarch != null && !osarch.equals(connection.getProperty(IRemoteConnection.OS_ARCH_PROPERTY))) { + return false; + } + + return true; + } +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java deleted file mode 100644 index c0e7088dd83..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTarget.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.core.internal; - -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.launchbar.core.ILaunchTargetType; - -/** - * The launch target representing the machine we're running on. - */ -public class LocalTarget extends PlatformObject implements ILaunchTarget { - - private final LocalTargetType type; - - public LocalTarget(LocalTargetType type) { - this.type = type; - } - - @Override - public String getName() { - return Messages.LocalTarget_name; - } - - @Override - public ILaunchTargetType getType() { - return type; - } - - @Override - public void setActive(boolean active) { - // nothing to do, we have no active state - } - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java deleted file mode 100644 index 7b0d12ccdba..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LocalTargetType.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.launchbar.core.internal; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.launchbar.core.ILaunchBarManager; -import org.eclipse.launchbar.core.ILaunchTargetType; - -/** - * The target type that creates the local target. - */ -public class LocalTargetType implements ILaunchTargetType { - - public static final String ID = Activator.PLUGIN_ID + ".targetType.local"; - - @Override - public void init(ILaunchBarManager manager) throws CoreException { - // create the local target - manager.launchTargetAdded(new LocalTarget(this)); - } - - @Override - public void dispose() { - // nothing to do - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 2635343e499..d8805c9e61e 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -17,7 +17,9 @@ Require-Bundle: org.eclipse.ui, org.eclipse.ui.workbench, org.eclipse.ui.ide, org.eclipse.swt, - org.eclipse.ui.navigator + org.eclipse.ui.navigator, + org.eclipse.remote.core;bundle-version="2.0.0", + org.eclipse.remote.ui;bundle-version="1.1.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/bundles/org.eclipse.launchbar.ui/plugin.xml index da9cc467bcc..b71b2ecdb12 100644 --- a/bundles/org.eclipse.launchbar.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.ui/plugin.xml @@ -62,24 +62,6 @@ descriptorTypeId="org.eclipse.launchbar.core.descriptor.default" labelProvider="org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider"> - - - - - - - - - - diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd index 215f6b2b879..4e96a6c92e8 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd @@ -19,7 +19,6 @@ - @@ -73,81 +72,6 @@ - - - - - - - - - - - - - - - - Used for identifying this launch target type in various UI elements. - - - - - - - - - - Used for identifying this launch target type in various UI elements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An INewWizard that creates a target of this type. - - - - - - - - - diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index dc0f8931df7..bc27da5b71b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Event; @@ -92,7 +93,7 @@ public class Activator extends AbstractUIPlugin { public LaunchBarUIManager getLaunchBarUIManager() { if (launchBarUIManager == null) { - LaunchBarManager manager = org.eclipse.launchbar.core.internal.Activator.getDefault().getLaunchBarManager(); + LaunchBarManager manager = (LaunchBarManager) getService(ILaunchBarManager.class); launchBarUIManager = new LaunchBarUIManager(manager); } return launchBarUIManager; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 6198744463c..68e5a5f7bec 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -14,7 +14,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.Map; -import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -24,8 +23,6 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.launchbar.core.ILaunchTargetType; import org.eclipse.launchbar.core.internal.ExecutableExtension; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.IHoverProvider; @@ -87,67 +84,6 @@ public class LaunchBarUIManager { return provider != null ? provider.get() : null; } - public String getTargetTypeName(ILaunchTarget target) { - return getTargetTypeName(target.getType()); - } - - public String getTargetTypeName(ILaunchTargetType targetType) { - String typeId = manager.getTargetTypeId(targetType); - String name = targetContributions.get(typeId).name; - return name != null ? name : typeId; - } - - public Image getTargetTypeIcon(ILaunchTargetType targetType) { - String typeId = manager.getTargetTypeId(targetType); - return targetContributions.get(typeId).getIcon(); - } - - public ILabelProvider getLabelProvider(ILaunchTarget target) throws CoreException { - ExecutableExtension provider = getContribution(target).labelProvider; - return provider != null ? provider.get() : null; - } - - public IHoverProvider getHoverProvider(ILaunchTarget target) throws CoreException { - ExecutableExtension hoverProvider = getContribution(target).hoverProvider; - return hoverProvider != null ? hoverProvider.get() : null; - } - - public String getEditCommand(ILaunchTarget target) { - return getContribution(target).editCommandId; - } - - public Map> getNewTargetWizards() { - Map> wizards = new HashMap<>(); - for (Entry contrib : targetContributions.entrySet()) { - if (contrib.getValue().newWizard != null) { - ILaunchTargetType type = manager.getLaunchTargetType(contrib.getKey()); - if (type != null) { - wizards.put(type, contrib.getValue().newWizard); - } - } - } - return wizards; - } - - public Map getTargetIcons() { - Map icons = new HashMap<>(); - for (LaunchBarTargetContribution contribution : targetContributions.values()) { - Image icon = contribution.getIcon(); - if (icon != null) { - icons.put(contribution.name, icon); - } - } - return icons; - } - - private LaunchBarTargetContribution getContribution(ILaunchTarget target) { - LaunchBarTargetContribution c = targetContributions.get(manager.getTargetTypeId(target.getType())); - if (c == null) { - return DEFAULT_CONTRIBUTION; - } - return c; - } - private class LaunchBarTargetContribution { String name; String iconStr; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java deleted file mode 100644 index dcf460c4761..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LocalTargetLabelProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.launchbar.ui.internal; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.launchbar.core.ILaunchTarget; - - -public class LocalTargetLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - if (element instanceof ILaunchTarget) { - return ((ILaunchTarget) element).getName(); - } - return super.getText(element); - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index ea597622fd4..0b188280b89 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -22,8 +22,6 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.window.Window; -import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchTarget; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.ui.handlers.HandlerUtil; @@ -34,16 +32,14 @@ public class ConfigureActiveLaunchHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { try { LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - ILaunchDescriptor desc = launchBarManager.getActiveLaunchDescriptor(); - ILaunchTarget target = launchBarManager.getActiveLaunchTarget(); - ILaunchConfiguration launchConfiguration = launchBarManager.getLaunchConfiguration(desc, target); + ILaunchConfiguration launchConfiguration = launchBarManager.getActiveLaunchConfiguration(); if (launchConfiguration == null) return Status.OK_STATUS; ILaunchConfigurationWorkingCopy wc = launchConfiguration.getWorkingCopy(); ILaunchMode activeLaunchMode = launchBarManager.getActiveLaunchMode(); ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchConfiguration.getType(), activeLaunchMode.getIdentifier()); - + if (DebugUITools.openLaunchConfigurationPropertiesDialog(HandlerUtil.getActiveShell(event), wc, group.getIdentifier()) == Window.OK) wc.doSave(); } catch (CoreException e) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java index e206bed4ab5..3373ce19dfc 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -20,8 +20,6 @@ import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchTarget; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.swt.widgets.Display; @@ -35,9 +33,7 @@ public class LaunchActiveCommandHandler extends AbstractHandler { public IStatus runInUIThread(IProgressMonitor monitor) { try { LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - ILaunchDescriptor desc = launchBarManager.getActiveLaunchDescriptor(); - ILaunchTarget target = launchBarManager.getActiveLaunchTarget(); - ILaunchConfiguration config = launchBarManager.getLaunchConfiguration(desc, target); + ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); if (config == null) return Status.OK_STATUS; ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 05705bb8302..65416182f7e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -32,13 +32,13 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.Window; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchTarget; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; import org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog; import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigWizard; +import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -169,7 +169,7 @@ public class ConfigSelector extends CSelector { LaunchBarManager manager = uiManager.getManager(); ILaunchDescriptor desc = (ILaunchDescriptor) element; ILaunchMode mode = manager.getActiveLaunchMode(); - ILaunchTarget target = manager.getActiveLaunchTarget(); + IRemoteConnection target = manager.getActiveLaunchTarget(); if (target == null) { MessageDialog.openError(shell, "No Active Target", "You must create a target to edit this launch configuration."); return; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 6df2016dbbe..3993dfc3ba8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -15,11 +15,11 @@ import javax.annotation.PreDestroy; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchTarget; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; @@ -129,7 +129,7 @@ public class LaunchBarControl implements Listener { @Override public void activeLaunchTargetChanged() { if (targetSelector != null) { - final ILaunchTarget target = manager.getActiveLaunchTarget(); + final IRemoteConnection target = manager.getActiveLaunchTarget(); targetSelector.setDelayedSelection(target, SELECTION_DELAY); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index 1524209925a..911044c12f0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -11,19 +11,16 @@ package org.eclipse.launchbar.ui.internal.controls; import java.util.Comparator; +import java.util.List; import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.launchbar.ui.IHoverProvider; -import org.eclipse.launchbar.ui.ILaunchBarUIConstants; +import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; -import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchTargetWizard; +import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -60,12 +57,14 @@ public class TargetSelector extends CSelector { @Override public Object[] getElements(Object inputElement) { + LaunchBarManager manager = uiManager.getManager(); try { - ILaunchTarget[] targets = uiManager.getManager().getLaunchTargets(); - if (targets.length > 0) - return targets; + List targets; + targets = manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); + if (!targets.isEmpty()) { + return targets.toArray(); + } } catch (CoreException e) { - Activator.log(e.getStatus()); } return noTargets; } @@ -74,32 +73,17 @@ public class TargetSelector extends CSelector { setLabelProvider(new LabelProvider() { @Override public Image getImage(Object element) { - if (element instanceof ILaunchTarget) { - try { - ILaunchTarget target = (ILaunchTarget) element; - ILabelProvider labelProvider = uiManager.getLabelProvider(target); - if (labelProvider != null) { - return labelProvider.getImage(element); - } - } catch (CoreException e) { - Activator.log(e.getStatus()); - } + if (element instanceof IRemoteConnection) { + IRemoteConnection target = (IRemoteConnection) element; + // TODO need to get icon form ui service } return super.getImage(element); } @Override public String getText(Object element) { - if (element instanceof ILaunchTarget) { - ILaunchTarget target = (ILaunchTarget) element; - try { - ILabelProvider labelProvider = uiManager.getLabelProvider(target); - if (labelProvider != null) { - return labelProvider.getText(element); - } - } catch (CoreException e) { - Activator.log(e.getStatus()); - } + if (element instanceof IRemoteConnection) { + IRemoteConnection target = (IRemoteConnection) element; return target.getName(); } return super.getText(element); @@ -113,62 +97,22 @@ public class TargetSelector extends CSelector { return 0; } }); - - setHoverProvider(new IHoverProvider() { - @Override - public boolean displayHover(Object element) { - if (element instanceof ILaunchTarget) { - try { - ILaunchTarget target = (ILaunchTarget) element; - IHoverProvider hoverProvider = uiManager.getHoverProvider(target); - if (hoverProvider != null) { - return hoverProvider.displayHover(element); - } - } catch (CoreException e) { - Activator.log(e.getStatus()); - } - } - return false; - } - - @Override - public void dismissHover(Object element, boolean immediate) { - if (element instanceof ILaunchTarget) { - try { - ILaunchTarget target = (ILaunchTarget) element; - IHoverProvider hoverProvider = uiManager.getHoverProvider(target); - if (hoverProvider != null) { - hoverProvider.dismissHover(element, immediate); - } - } catch (CoreException e) { - Activator.log(e.getStatus()); - } - } - } - }); } @Override public boolean isEditable(Object element) { - if (element instanceof ILaunchTarget) { - ILaunchTarget target = (ILaunchTarget) element; - return uiManager.getEditCommand(target) != null; - } + // TODO return false; } @Override public void handleEdit(Object element) { - if (element instanceof ILaunchTarget) { - ILaunchTarget target = (ILaunchTarget) element; - String commandId = uiManager.getEditCommand(target); - Activator.runCommand(commandId, ILaunchBarUIConstants.TARGET_NAME, target.getName()); - } + // TODO } @Override public boolean hasActionArea() { - return !uiManager.getNewTargetWizards().isEmpty(); + return true; } @Override @@ -202,9 +146,10 @@ public class TargetSelector extends CSelector { MouseListener mouseListener = new MouseAdapter() { public void mouseUp(org.eclipse.swt.events.MouseEvent e) { - NewLaunchTargetWizard wizard = new NewLaunchTargetWizard(uiManager); - WizardDialog dialog = new WizardDialog(getShell(), wizard); - dialog.open(); + // TODO + // NewLaunchTargetWizard wizard = new NewLaunchTargetWizard(uiManager); + // WizardDialog dialog = new WizardDialog(getShell(), wizard); + // dialog.open(); } }; @@ -230,8 +175,8 @@ public class TargetSelector extends CSelector { @Override protected void fireSelectionChanged() { Object selection = getSelection(); - if (selection instanceof ILaunchTarget) { - ILaunchTarget target = (ILaunchTarget) selection; + if (selection instanceof IRemoteConnection) { + IRemoteConnection target = (IRemoteConnection) selection; try { uiManager.getManager().setActiveLaunchTarget(target); } catch (CoreException e) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java deleted file mode 100644 index 86cca279a66..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetTypePage.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.eclipse.launchbar.ui.internal.dialogs; - -import java.util.Map.Entry; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.launchbar.core.ILaunchTargetType; -import org.eclipse.launchbar.core.internal.Activator; -import org.eclipse.launchbar.core.internal.ExecutableExtension; -import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.PlatformUI; - -public class NewLaunchTargetTypePage extends WizardPage { - - private final LaunchBarUIManager uiManager; - private Table table; - private ExecutableExtension currentExtension; - private INewWizard nextWizard; - - public NewLaunchTargetTypePage(LaunchBarUIManager uiManager) { - super("NewLaunchTargetTypePage"); - setTitle("Launch Target Type"); - setDescription("Select type of launch target to create."); - this.uiManager = uiManager; - } - - @Override - public void createControl(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - comp.setLayout(new GridLayout()); - - table = new Table(comp, SWT.SINGLE | SWT.BORDER); - GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); - table.setLayoutData(data); - - setPageComplete(false); - for (Entry> entry : uiManager.getNewTargetWizards().entrySet()) { - TableItem item = new TableItem(table, SWT.NONE); - ILaunchTargetType targetType = entry.getKey(); - item.setText(uiManager.getTargetTypeName(targetType)); - Image icon = uiManager.getTargetTypeIcon(targetType); - if (icon != null) { - item.setImage(icon); - } - item.setData(entry.getValue()); - table.select(0); - setPageComplete(true); - } - - setControl(comp); - } - - @Override - public boolean canFlipToNextPage() { - return isPageComplete(); - } - - @Override - public IWizardPage getNextPage() { - @SuppressWarnings("unchecked") - ExecutableExtension extension = (ExecutableExtension) table.getSelection()[0].getData(); - if (extension != currentExtension) { - try { - nextWizard = extension.create(); - nextWizard.init(PlatformUI.getWorkbench(), null); - nextWizard.addPages(); - currentExtension = extension; - } catch (CoreException e) { - Activator.log(e.getStatus()); - } - } - - if (nextWizard != null) { - IWizardPage [] pages = nextWizard.getPages(); - if (pages.length > 0) { - return pages[0]; - } - } - - return super.getNextPage(); - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java deleted file mode 100644 index 55ca6be46d4..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchTargetWizard.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.dialogs; - -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; - -public class NewLaunchTargetWizard extends Wizard { - - private final NewLaunchTargetTypePage typePage; - - public NewLaunchTargetWizard(LaunchBarUIManager uiManager) { - setWindowTitle("Launch Target Type"); - typePage = new NewLaunchTargetTypePage(uiManager); - setForcePreviousAndNextButtons(true); - } - - @Override - public void addPages() { - addPage(typePage); - } - - @Override - public boolean performFinish() { - return true; - } - - @Override - public boolean canFinish() { - // Need to move onto the new target wizard - return false; - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java deleted file mode 100644 index 3b20c60d84c..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsActionProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.targetsView; - -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.window.SameShellProvider; -import org.eclipse.ui.dialogs.PropertyDialogAction; -import org.eclipse.ui.navigator.CommonActionProvider; - -public class LaunchTargetsActionProvider extends CommonActionProvider { - - @Override - public void fillContextMenu(IMenuManager menu) { - menu.add(new PropertyDialogAction(new SameShellProvider(getActionSite().getViewSite().getShell()), - getActionSite().getStructuredViewer())); - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java deleted file mode 100644 index 8fe4a8ff3d4..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsContentProvider.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.targetsView; - -import java.util.Arrays; -import java.util.Comparator; - -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.launchbar.core.internal.LaunchBarManager; - -public class LaunchTargetsContentProvider implements ITreeContentProvider { - - private LaunchBarManager manager; - - @Override - public Object[] getElements(Object inputElement) { - if (inputElement instanceof LaunchBarManager) { - ILaunchTarget[] targets = ((LaunchBarManager) inputElement).getAllLaunchTargets(); - Arrays.sort(targets, new Comparator() { - @Override - public int compare(ILaunchTarget o1, ILaunchTarget o2) { - return o1.getName().compareTo(o2.getName()); - } - }); - return targets; - } - return null; - } - - @Override - public Object[] getChildren(Object parentElement) { - return new Object[0]; - } - - @Override - public Object getParent(Object element) { - if (element instanceof ILaunchTarget) { - return manager; - } - return null; - } - - @Override - public boolean hasChildren(Object element) { - if (element instanceof LaunchBarManager) - return true; - else if (element instanceof ILaunchTarget) - return false; - return false; - } - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - if (newInput instanceof LaunchBarManager) { - manager = (LaunchBarManager) newInput; - } - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java deleted file mode 100644 index 2a067b429d3..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsLabelProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.targetsView; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.swt.graphics.Image; - -public class LaunchTargetsLabelProvider extends LabelProvider { - - @Override - public Image getImage(Object element) { - return super.getImage(element); - } - - @Override - public String getText(Object element) { - if (element instanceof ILaunchTarget) { - return ((ILaunchTarget) element).getName(); - } - return super.getText(element); - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java deleted file mode 100644 index b45f1f39516..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/LaunchTargetsNavigator.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.targetsView; - -import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; -import org.eclipse.ui.navigator.CommonNavigator; - -public class LaunchTargetsNavigator extends CommonNavigator { - - private final LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); - - public LaunchTargetsNavigator() { - uiManager.getManager().addListener(new LaunchBarManager.Listener() { - @Override - public void launchTargetsChanged() { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - getCommonViewer().refresh(); - } - }); - } - @Override - public void launchDescriptorRemoved(ILaunchDescriptor descriptor) { - } - @Override - public void activeLaunchTargetChanged() { - } - @Override - public void activeLaunchModeChanged() { - } - @Override - public void activeLaunchDescriptorChanged() { - } - }); - - } - - @Override - protected Object getInitialInput() { - return uiManager.getManager(); - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java deleted file mode 100644 index 315f13b1830..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/targetsView/TargetPropertyPage.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.targetsView; - -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.PropertyPage; - -public class TargetPropertyPage extends PropertyPage { - - private Text nameText; - - @Override - protected Control createContents(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(2, false); - comp.setLayout(layout); - - ILaunchTarget target = (ILaunchTarget) getElement().getAdapter(ILaunchTarget.class); - - Label nameLabel = new Label(comp, SWT.NONE); - nameLabel.setText("Target Name:"); - - nameText = new Text(comp, SWT.BORDER); - nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - nameText.setText(target.getName()); - - return comp; - } - - @Override - public boolean performOk() { - System.out.println("Would change name to " + nameText.getText()); - return true; - } - -} diff --git a/pom.xml b/pom.xml index 68f944f7ea0..d87c22f2e7b 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,12 @@ eclipse - http://download.eclipse.org/releases/luna/ + http://download.eclipse.org/releases/mars/ + p2 + + + platform + http://download.eclipse.org/eclipse/updates/4.5milestones p2 @@ -50,7 +55,12 @@ orbit - http://download.eclipse.org/tools/orbit/downloads/drops/S20141129202728/repository/ + http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/ + p2 + + + remote + http://download.eclipse.org/tools/ptp/builds/remote/2.0.0 p2 @@ -59,7 +69,7 @@ bundles/org.eclipse.launchbar.core bundles/org.eclipse.launchbar.ui features/org.eclipse.launchbar - tests/org.eclipse.launchbar.core.tests + repo diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF index a2e3bac8547..c3a97cb2e66 100644 --- a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF @@ -3,12 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Launch Bar Core Tests Bundle-SymbolicName: org.eclipse.launchbar.core.tests Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.launchbar.core.tests.Activator -Require-Bundle: org.eclipse.core.runtime, - org.junit;bundle-version="4.11.0", - org.mockito, - org.eclipse.launchbar.core;bundle-version="1.0.0", - org.eclipse.debug.core +Fragment-Host: org.eclipse.launchbar.core;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.launchbar.core.tests +Require-Bundle: org.junit;bundle-version="4.11.0", + org.mockito;bundle-version="1.9.5" diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 0baf820665f..605a3487211 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -1,829 +1,185 @@ -/******************************************************************************* -> * Copyright (c) 2014 QNX Software Systems. All Rights Reserved. - * - * You must obtain a written license from and pay applicable license fees to QNX - * Software Systems before you may reproduce, modify or distribute this software, - * or any work that includes all or part of this software. Free development - * licenses are available for evaluation and non-commercial purposes. For more - * information visit [http://licensing.qnx.com] or email licensing@qnx.com. - * - * This file may contain contributions from others. Please review this entire - * file for other proprietary rights or license notices, as well as the QNX - * Development Suite License Guide at [http://licensing.qnx.com/license-guide/] - * for other information. - *******************************************************************************/ package org.eclipse.launchbar.core.internal; -import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; - -import org.eclipse.core.internal.preferences.EclipsePreferences; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; -import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; -import org.eclipse.launchbar.core.ILaunchObjectProvider; -import org.eclipse.launchbar.core.ILaunchTarget; -import org.eclipse.launchbar.core.ILaunchTargetType; -import org.eclipse.launchbar.core.LaunchConfigurationProvider; -import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.core.internal.LocalTargetType; -import org.eclipse.launchbar.core.internal.Pair; -import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteServicesManager; import org.junit.Test; -/** - * @author elaskavaia - * - */ -public class LaunchBarManagerTest extends TestCase { - // default type ids - private static final String DEFAULT_CONFIG_TYPE_ID = "configType.test"; - private static final String DEFAULT_TARGET_TYPE_ID = "targetType.test"; - private static final String DEFAULT_DESCRIPTOR_TYPE_ID = "descriptorType.test"; - - private IEclipsePreferences prefs; - private ILaunchManager launchManager; - - public class TestLaunchBarManager extends LaunchBarManager { - private ILaunchMode[] defaultLaunchModes; - boolean done; - - public TestLaunchBarManager() throws CoreException { - super(); - // For the tests, need to wait until the init is done - synchronized (this) { - while (!done) { - try { - wait(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - } - - @Override - public void init() throws CoreException { - super.init(); - synchronized (this) { - done = true; - notify(); - } - } - - @Override - public IExtensionPoint getExtensionPoint() throws CoreException { - // default things - IExtensionPoint point = mock(IExtensionPoint.class); - - IExtension extension = mock(IExtension.class); - doReturn(new IExtension[] { extension }).when(point).getExtensions(); - - List elements = new ArrayList<>(); - - IConfigurationElement element; - - // The local target - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("targetType").when(element).getName(); - doReturn(LocalTargetType.ID).when(element).getAttribute("id"); - doReturn(new LocalTargetType()).when(element).createExecutableExtension("class"); - - // Test targets - for (TestLaunchTargetType targetType : getTestTargetTypes()) { - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("targetType").when(element).getName(); - doReturn(targetType.id).when(element).getAttribute("id"); - doReturn(targetType).when(element).createExecutableExtension("class"); - } - - // Test descriptors - for (TestLaunchDescriptorType descType : getTestDescriptorTypes()) { - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("descriptorType").when(element).getName(); - doReturn(descType.id).when(element).getAttribute("id"); - doReturn(Integer.toString(descType.priority)).when(element).getAttribute("priority"); - doReturn(descType).when(element).createExecutableExtension("class"); - } - - // Test config types - for (TestLaunchConfigurationProvider provider : getTestConfigProviders()) { - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("configType").when(element).getName(); - doReturn(provider.descTypeId).when(element).getAttribute("descriptorType"); - doReturn(provider.targetTypeId).when(element).getAttribute("targetType"); - doReturn(provider.configType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); - doReturn(Boolean.toString(provider.isDefault)).when(element).getAttribute("isDefault"); - - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("configProvider").when(element).getName(); - doReturn(provider.configType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); - doReturn(provider).when(element).createExecutableExtension("class"); - } - - // test object providers - for (TestLaunchObjectProvider objectProvider : getTestObjectProviders()) { - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("objectProvider").when(element).getName(); - doReturn(objectProvider).when(element).createExecutableExtension("class"); - } - - doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); - - return point; - } - - protected TestLaunchTargetType[] getTestTargetTypes() { - return new TestLaunchTargetType[] { - new TestLaunchTargetType(DEFAULT_TARGET_TYPE_ID) - }; - } - - protected TestLaunchDescriptorType[] getTestDescriptorTypes() { - return new TestLaunchDescriptorType[] { - new TestLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID, 5) - }; - } - - protected TestLaunchConfigurationProvider[] getTestConfigProviders() { - ILaunchConfigurationType configType = mockLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - return new TestLaunchConfigurationProvider[] { - new TestLaunchConfigurationProvider(DEFAULT_DESCRIPTOR_TYPE_ID, DEFAULT_TARGET_TYPE_ID, configType, true, this) - }; - } - - protected TestLaunchObjectProvider[] getTestObjectProviders() { - return new TestLaunchObjectProvider[0]; - } - - @Override - protected ILaunchManager getLaunchManager() { - return launchManager; - } - - @Override - protected IEclipsePreferences getPreferenceStore() { - return prefs; - } - }; - - public static class TestLaunchTargetType implements ILaunchTargetType { - final String id; - - public TestLaunchTargetType(String id) { - this.id = id; - } - - @Override - public void init(ILaunchBarManager manager) throws CoreException { - // override if you want to add targets - } - - @Override - public void dispose() { - } - } - - public static class TestLaunchTarget extends PlatformObject implements ILaunchTarget { - private ILaunchTargetType type; - private String name; - - public TestLaunchTarget(String name, ILaunchTargetType type) { - this.name = name; - this.type = type; - } - - public ILaunchTargetType getType() { - return type; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setActive(boolean active) { - } - } - - public static class TestLaunchObject { - final String name; - final ILaunchDescriptorType descType; - - public TestLaunchObject(String name, ILaunchDescriptorType descType) { - this.name = name; - this.descType = descType; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof TestLaunchObject) { - return name.equals(((TestLaunchObject) obj).name); - } - return super.equals(obj); - } - - @Override - public int hashCode() { - return name.hashCode(); - } - } - - public static class TestLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { - private final TestLaunchObject object; - private final TestLaunchDescriptorType type; - - public TestLaunchDescriptor(TestLaunchDescriptorType type, TestLaunchObject object) { - this.object = object; - this.type = type; - } - - @Override - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { - if (TestLaunchObject.class.equals(adapter)) { - return object; - } - return super.getAdapter(adapter); - } - - @Override - public String getName() { - return object.name; - } - - @Override - public ILaunchDescriptorType getType() { - return type; - } - } - - public static class TestLaunchDescriptorType implements ILaunchDescriptorType { - final String id; - final int priority; - - public TestLaunchDescriptorType(String id, int priority) { - this.id = id; - this.priority = priority; - } - - @Override - public boolean ownsLaunchObject(Object launchObject) throws CoreException { - if (!(launchObject instanceof TestLaunchObject)) { - return false; - } - return ((TestLaunchObject) launchObject).descType.equals(this); - } - - @Override - public ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException { - return new TestLaunchDescriptor(this, (TestLaunchObject) launchObject); - } - } - - public static class TestLaunchConfigurationProvider extends LaunchConfigurationProvider { - final String descTypeId; - final String targetTypeId; - final ILaunchConfigurationType configType; - final boolean isDefault; - final LaunchBarManager manager; - - private static final String OBJECT_NAME = "testObject.objectName"; - private static final String DESC_TYPE = "testObject.descType"; - - public TestLaunchConfigurationProvider(String descTypeId, String targetTypeId, ILaunchConfigurationType configType, boolean isDefault, LaunchBarManager manager) { - this.descTypeId = descTypeId; - this.targetTypeId = targetTypeId; - this.configType = configType; - this.isDefault = isDefault; - this.manager = manager; - } - - @Override - public ILaunchConfigurationType getLaunchConfigurationType() throws CoreException { - return configType; - } - - @Override - public ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException { - String name = launchManager.generateLaunchConfigurationName(getConfigurationName(descriptor)); - ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfigurationType().newInstance(null, name); - doReturn(name).when(workingCopy).getAttribute(ORIGINAL_NAME, ""); - - TestLaunchObject launchObject = (TestLaunchObject) descriptor.getAdapter(TestLaunchObject.class); - doReturn(launchObject.name).when(workingCopy).getAttribute(OBJECT_NAME, ""); - doReturn(manager.getDescriptorTypeId(launchObject.descType)).when(workingCopy).getAttribute(DESC_TYPE, ""); - return workingCopy.doSave(); - } - - @Override - protected void populateConfiguration(ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor) throws CoreException { - super.populateConfiguration(workingCopy, descriptor); - - } - - @Override - public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - if (ownsConfiguration(configuration)) { - String objectName = configuration.getAttribute(OBJECT_NAME, ""); - String descTypeId = configuration.getAttribute(DESC_TYPE, ""); - if (!objectName.isEmpty() && !descTypeId.isEmpty()) { - return new TestLaunchObject(objectName, manager.getLaunchDescriptorType(descTypeId)); - } - } - return null; - } - - @Override - public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - if (ownsConfiguration(configuration)) { - return true; - } - return false; - } - - } - - public abstract class TestLaunchObjectProvider implements ILaunchObjectProvider { - @Override - public void dispose() { - // nothing by default - } - } - - protected ILaunchConfigurationType mockLaunchConfigurationType(String id) { - return mockLaunchConfigurationType(id, launchManager.getLaunchModes()); - } - - protected ILaunchConfigurationType mockLaunchConfigurationType(String id, ILaunchMode[] modes) { - ILaunchConfigurationType type = mock(ILaunchConfigurationType.class); - doReturn(id).when(type).getIdentifier(); - doReturn(type).when(launchManager).getLaunchConfigurationType(id); - - // mock for supportsMode - for (ILaunchMode mode : modes) { - String modeid = mode.getIdentifier(); - doReturn(true).when(type).supportsMode(modeid); - } - - return type; - } - - protected ILaunchConfigurationWorkingCopy mockLaunchConfiguration(String name, ILaunchConfigurationType type) throws CoreException { - ILaunchConfigurationWorkingCopy wc = mock(ILaunchConfigurationWorkingCopy.class); - doReturn(name).when(wc).getName(); - doReturn(type).when(wc).getType(); - doReturn(wc).when(wc).doSave(); - doReturn(name).when(launchManager).generateLaunchConfigurationName(name); - doReturn(wc).when(type).newInstance(null, name); - return wc; - } - - // - // Now that we have all the setup, - // Actual tests :) - // - - @Override - protected void setUp() throws Exception { - // Prefs are shared across an entire test - prefs = new EclipsePreferences(); - - // launch manager and default modes - launchManager = mock(ILaunchManager.class); - try { - doReturn(new ILaunchConfiguration[] {}).when(launchManager).getLaunchConfigurations(); - } catch (CoreException e) { - fail(e.getMessage()); - } - - ILaunchMode runMode = mock(ILaunchMode.class); - doReturn("run").when(runMode).getIdentifier(); - doReturn("Run").when(runMode).getLabel(); - doReturn("Run As...").when(runMode).getLaunchAsLabel(); - doReturn(runMode).when(launchManager).getLaunchMode("run"); - - ILaunchMode debugMode = mock(ILaunchMode.class); - doReturn("debug").when(debugMode).getIdentifier(); - doReturn("Debug").when(debugMode).getLabel(); - doReturn("Debug As...").when(debugMode).getLaunchAsLabel(); - doReturn(debugMode).when(launchManager).getLaunchMode("debug"); - - doReturn(new ILaunchMode[] { runMode, debugMode }).when(launchManager).getLaunchModes(); - } +public class LaunchBarManagerTest { @Test - public void testLaunchBarManager() throws Exception { - TestLaunchBarManager manager = new TestLaunchBarManager(); + public void startupTest() throws Exception { + // Make sure the manager starts up and defaults everything to null + LaunchBarManager manager = new LaunchBarManager(false); + manager.init(); assertNull(manager.getActiveLaunchDescriptor()); - assertNull(manager.getActiveLaunchTarget()); assertNull(manager.getActiveLaunchMode()); + assertNull(manager.getActiveLaunchTarget()); } @Test - public void testSuccessPath() throws Exception { - TestLaunchBarManager manager = new TestLaunchBarManager(); + public void defaultTest() throws Exception { + // Create a launch config, make sure default mode and local target are active + // And that that config is the active config. + + // Mocking + ILaunchConfigurationType launchConfigType = mock(ILaunchConfigurationType.class); + ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); + doReturn(launchConfigType).when(launchConfig).getType(); + doReturn("dummy").when(launchConfigType).getIdentifier(); + doReturn(true).when(launchConfigType).supportsMode("run"); + doReturn(true).when(launchConfigType).supportsMode("debug"); - // mock out the launch config that will be created - String name = "testConfig"; - ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - assertNotNull(configType); - ILaunchConfigurationWorkingCopy wc = mockLaunchConfiguration(name, configType); + // Inject the launch config + LaunchBarManager manager = new LaunchBarManager(false); + manager.init(); + manager.launchConfigurationAdded(launchConfig); - // fire in launch object and target - ILaunchDescriptorType descType = manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID); - assertNotNull(descType); - TestLaunchObject launchObject = new TestLaunchObject(name, descType); + // Verify state + assertNotNull(manager.getActiveLaunchDescriptor()); + assertEquals(launchConfig, manager.getActiveLaunchDescriptor().getAdapter(ILaunchConfiguration.class)); + + IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); + IRemoteConnectionType localServices = remoteManager.getLocalConnectionType(); + IRemoteConnection localConnection = localServices.getConnections().get(0); + assertNotNull(manager.getActiveLaunchTarget()); + assertEquals(localConnection, manager.getActiveLaunchTarget()); + + assertNotNull(manager.getActiveLaunchMode()); + assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); + + assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); + } + + @Test + @SuppressWarnings("deprecation") + public void descriptorTest() throws Exception { + // Create a descriptor type and inject an associated object + // Make sure the descriptor is active with the local target and proper mode + // Make sure the associated launch config is active too + + // Mocking + final IExtensionPoint extensionPoint = mock(IExtensionPoint.class); + IExtension extension = mock(IExtension.class); + doReturn(new IExtension[] { extension }).when(extensionPoint).getExtensions(); + + List elements = new ArrayList<>(); + IConfigurationElement element; + + // local target type + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("targetType").when(element).getName(); + String targetTypeId = "org.eclipse.launchbar.core.targetType.local"; + doReturn(targetTypeId).when(element).getAttribute("id"); + doReturn("org.eclipse.remote.LocalServices").when(element).getAttribute("remoteServicesId"); + + // fake launch object + String launchObject = "fakeObject"; + + // launch descriptor for that object + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("descriptorType").when(element).getName(); + String descriptorTypeId = "fakeDescriptorType"; + doReturn(descriptorTypeId).when(element).getAttribute("id"); + ILaunchDescriptorType descriptorType = mock(ILaunchDescriptorType.class); + doReturn(descriptorType).when(element).createExecutableExtension("class"); + doReturn(true).when(descriptorType).ownsLaunchObject(launchObject); + ILaunchDescriptor descriptor = mock(ILaunchDescriptor.class); + doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); + doReturn(descriptorType).when(descriptor).getType(); + doReturn(launchObject).when(descriptor).getName(); + + // launch config type + final ILaunchManager launchManager = mock(ILaunchManager.class); + ILaunchMode runMode = mock(ILaunchMode.class); + String run = "run"; + doReturn(run).when(runMode).getIdentifier(); + doReturn(runMode).when(launchManager).getLaunchMode(run); + ILaunchMode debugMode = mock(ILaunchMode.class); + String debug = "debug"; + doReturn(debug).when(debugMode).getIdentifier(); + doReturn(debugMode).when(launchManager).getLaunchMode(debug); + doReturn(new ILaunchMode[] { runMode, debugMode }).when(launchManager).getLaunchModes(); + ILaunchConfigurationType launchConfigType = mock(ILaunchConfigurationType.class); + String launchConfigTypeId = "fakeLaunchConfigType"; + doReturn(launchConfigTypeId).when(launchConfigType).getIdentifier(); + doReturn(true).when(launchConfigType).supportsMode(run); + doReturn(true).when(launchConfigType).supportsMode(debug); + doReturn(launchConfigType).when(launchManager).getLaunchConfigurationType(launchConfigTypeId); + // TODO assuming this is only called at init time when there aren't any + doReturn(new ILaunchConfiguration[0]).when(launchManager).getLaunchConfigurations(); + + // configProvider + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("configProvider").when(element).getName(); + doReturn(launchConfigTypeId).when(element).getAttribute("launchConfigurationType"); + ILaunchConfigurationProvider configProvider = mock(ILaunchConfigurationProvider.class); + doReturn(configProvider).when(element).createExecutableExtension("class"); + doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(); + ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); + doReturn(launchConfigType).when(launchConfig).getType(); + doReturn(launchConfig).when(configProvider).createLaunchConfiguration(launchManager, descriptor); + + // configType + element = mock(IConfigurationElement.class); + elements.add(element); + doReturn("configType").when(element).getName(); + doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); + doReturn(targetTypeId).when(element).getAttribute("targetType"); + doReturn(launchConfigTypeId).when(element).getAttribute("launchConfigurationType"); + + doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); + + // Now inject the launch object + LaunchBarManager manager = new LaunchBarManager(false) { + @Override + IExtensionPoint getExtensionPoint() throws CoreException { + return extensionPoint; + } + @Override + ILaunchManager getLaunchManager() { + return launchManager; + } + }; + manager.init(); manager.launchObjectAdded(launchObject); - // check our state - assertEquals(manager.getLaunchDescriptor(launchObject), manager.getActiveLaunchDescriptor()); - assertNull(manager.getActiveLaunchTarget()); - assertNotNull(manager.getActiveLaunchMode()); - - ILaunchTargetType targetType = manager.getLaunchTargetType(DEFAULT_TARGET_TYPE_ID); - assertNotNull(targetType); - ILaunchTarget testTarget = new TestLaunchTarget("testTarget", targetType); - manager.launchTargetAdded(testTarget); - - // verify that our launch config got created and saved - assertNotNull(manager.getActiveLaunchMode()); - assertEquals(wc, manager.getActiveLaunchConfiguration()); - verify(wc).doSave(); - - // now remove the launch object and make sure everything resets - manager.launchObjectRemoved(launchObject); - assertNull(manager.getActiveLaunchDescriptor()); - assertNull(manager.getActiveLaunchTarget()); - assertNull(manager.getActiveLaunchMode()); - verify(wc).delete(); - - // remove the target and make sure it's gone. - manager.launchTargetRemoved(testTarget); - ILaunchTarget[] allTargets = manager.getAllLaunchTargets(); - assertEquals(1, allTargets.length); - assertNotEquals(testTarget, allTargets[0]); - } - - @Test - public void testWrongObject() throws Exception { - TestLaunchBarManager manager = new TestLaunchBarManager(); - - // mock out the launch config that will be created - String name = "testConfig"; - ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - mockLaunchConfiguration(name, configType); - - // fire in launch target but object with no descriptor - manager.launchObjectAdded(new Object()); - manager.launchTargetAdded(new TestLaunchTarget("testTarget", manager.getLaunchTargetType(DEFAULT_TARGET_TYPE_ID))); - - // verify that there are no launch configs - assertNull(manager.getActiveLaunchConfiguration()); - } - - @Test - public void testNoTarget() throws Exception { - TestLaunchBarManager manager = new TestLaunchBarManager(); - - // mock out the launch config that will be created - String name = "testConfig"; - ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - ILaunchConfigurationWorkingCopy wc = mockLaunchConfiguration(name, configType); - - // create descriptor and target - manager.launchObjectAdded(new TestLaunchObject(name, manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); - - // verify that our launch config got created and saved even though the default config type - assertEquals(wc, manager.getActiveLaunchConfiguration()); - verify(wc).doSave(); - } - - @Test - public void testDefaultDescriptor() throws Exception { - TestLaunchBarManager manager = new TestLaunchBarManager(); - - ILaunchConfigurationType configType = mockLaunchConfigurationType("configType.default"); - ILaunchConfiguration config = mockLaunchConfiguration("defaultConfig", configType); - manager.launchConfigurationAdded(config); - assertEquals(config, manager.getActiveLaunchConfiguration()); - - manager.launchConfigurationRemoved(config); - assertNull(manager.getActiveLaunchConfiguration()); - } - - @Test - public void testSetActiveDescriptor() throws Exception { - final TestLaunchBarManager manager = new TestLaunchBarManager(); - ILaunchMode runMode = launchManager.getLaunchMode("run"); - ILaunchMode debugMode = launchManager.getLaunchMode("debug"); - - // descriptor for the test descriptor - String name = "test1"; - ILaunchConfigurationType configType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - ILaunchConfigurationWorkingCopy wc = mockLaunchConfiguration(name, configType); - - ILaunchDescriptorType descType = manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID); - TestLaunchObject testObject1 = new TestLaunchObject(name, descType); - manager.launchObjectAdded(testObject1); - ILaunchDescriptor test1 = manager.getLaunchDescriptor(testObject1); - assertNotNull(test1); - - final ILaunchMode[] testActiveMode = new ILaunchMode[1]; - final ILaunchDescriptor[] testActiveDesc = new ILaunchDescriptor[1]; - Listener listener = new Listener() { - @Override - public void launchTargetsChanged() { - } - - @Override - public void launchDescriptorRemoved(ILaunchDescriptor descriptor) { - } - - @Override - public void activeLaunchTargetChanged() { - } - - @Override - public void activeLaunchModeChanged() { - testActiveMode[0] = manager.getActiveLaunchMode(); - } - - @Override - public void activeLaunchDescriptorChanged() { - testActiveDesc[0] = manager.getActiveLaunchDescriptor(); - } - }; - manager.addListener(listener); - - // descriptor for the default descriptor - ILaunchConfigurationType defaultConfigType = mockLaunchConfigurationType("configType.default"); - ILaunchConfiguration config = mockLaunchConfiguration("test2", defaultConfigType); - manager.launchConfigurationAdded(config); - ILaunchDescriptor test2 = manager.getLaunchDescriptor(config); - assertNotNull(test2); - assertNotSame(test1, test2); - manager.setActiveLaunchMode(runMode); - - // test2 should be active by default since it was created last - assertEquals(test2, manager.getActiveLaunchDescriptor()); - assertEquals(test2, testActiveDesc[0]); - assertEquals(config, manager.getActiveLaunchConfiguration()); + assertEquals(descriptor, manager.getActiveLaunchDescriptor()); assertEquals(runMode, manager.getActiveLaunchMode()); - assertEquals(runMode, testActiveMode[0]); - - // flip to test1 - testActiveMode[0] = null; - testActiveDesc[0] = null; - manager.setActiveLaunchDescriptor(test1); - manager.setActiveLaunchMode(debugMode); - assertEquals(test1, manager.getActiveLaunchDescriptor()); - assertEquals(test1, testActiveDesc[0]); - assertEquals(wc, manager.getActiveLaunchConfiguration()); - assertEquals(debugMode, manager.getActiveLaunchMode()); - assertEquals(debugMode, testActiveMode[0]); - - // and back to test2 - testActiveMode[0] = null; - testActiveDesc[0] = null; - manager.setActiveLaunchDescriptor(test2); - assertEquals(test2, manager.getActiveLaunchDescriptor()); - assertEquals(test2, testActiveDesc[0]); - assertEquals(config, manager.getActiveLaunchConfiguration()); - assertEquals(runMode, manager.getActiveLaunchMode()); - assertEquals(runMode, testActiveMode[0]); - } - - @Test - public void testSetActiveMode() throws Exception { - TestLaunchBarManager manager = new TestLaunchBarManager(); - ILaunchMode runMode = launchManager.getLaunchMode("run"); - ILaunchMode debugMode = launchManager.getLaunchMode("debug"); - - String name = "test"; - ILaunchConfigurationType testConfigType = manager.getLaunchManager().getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - mockLaunchConfiguration(name, testConfigType); - - ILaunchDescriptorType descType = manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID); - TestLaunchObject testObject = new TestLaunchObject(name, descType); - manager.launchObjectAdded(testObject); - assertNotNull(manager.getActiveLaunchConfiguration()); - - // The default launch mode is debug (that may change) - assertEquals(debugMode, manager.getActiveLaunchMode()); - - // Set to run - manager.setActiveLaunchMode(runMode); - assertEquals(runMode, manager.getActiveLaunchMode()); - - // and back to debug - manager.setActiveLaunchMode(debugMode); - assertEquals(debugMode, manager.getActiveLaunchMode()); - } - - @Test - public void testSetActiveTarget() throws Exception { - // create separate target types and provider types for each one - final ILaunchConfigurationType configType1 = mockLaunchConfigurationType("configType.test1"); - final ILaunchConfigurationType configType2 = mockLaunchConfigurationType("configType.test2"); - final TestLaunchTargetType targetType1 = new TestLaunchTargetType("targetType.test1"); - final TestLaunchTargetType targetType2 = new TestLaunchTargetType("targetType.test2"); - - TestLaunchBarManager manager = new TestLaunchBarManager() { - @Override - protected TestLaunchTargetType[] getTestTargetTypes() { - return new TestLaunchTargetType[] { targetType1, targetType2 }; - } - @Override - protected TestLaunchConfigurationProvider[] getTestConfigProviders() { - TestLaunchConfigurationProvider provider1 = new TestLaunchConfigurationProvider( - DEFAULT_DESCRIPTOR_TYPE_ID, targetType1.id, configType1, true, this); - TestLaunchConfigurationProvider provider2 = new TestLaunchConfigurationProvider( - DEFAULT_DESCRIPTOR_TYPE_ID, targetType2.id, configType2, true, this); - return new TestLaunchConfigurationProvider[] { provider1, provider2 }; - } - }; - - // Target 1 - ILaunchConfiguration config1 = mockLaunchConfiguration("test1", configType1); - TestLaunchTarget target1 = new TestLaunchTarget("testTarget1", targetType1); - manager.launchTargetAdded(target1); - - // add in our object - manager.launchObjectAdded(new TestLaunchObject("test1", manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); - - // launch config and target should be the default one - assertEquals(target1, manager.getActiveLaunchTarget()); - assertEquals(config1, manager.getActiveLaunchConfiguration()); - - // switching to second target type should create a new config, but it needs a new name - ILaunchManager launchManager = manager.getLaunchManager(); - doReturn("test2").when(launchManager).generateLaunchConfigurationName("test1"); - ILaunchConfiguration config2 = mockLaunchConfiguration("test2", configType2); - TestLaunchTarget target2 = new TestLaunchTarget("testTarget2", targetType2); - manager.setActiveLaunchTarget(target2); - - assertEquals(target2, manager.getActiveLaunchTarget()); - assertEquals(config2, manager.getActiveLaunchConfiguration()); - assertEquals("test2", manager.getActiveLaunchConfiguration().getName()); - } - - public class TestRestartLaunchBarManager extends TestLaunchBarManager { - public TestRestartLaunchBarManager() throws CoreException { - super(); - } - - @Override - protected TestLaunchTargetType[] getTestTargetTypes() { - TestLaunchTargetType targetType = new TestLaunchTargetType(DEFAULT_TARGET_TYPE_ID) { - public void init(ILaunchBarManager manager) throws CoreException { - manager.launchTargetAdded(new TestLaunchTarget("testTarget1", this)); - manager.launchTargetAdded(new TestLaunchTarget("testTarget2", this)); - } - }; - return new TestLaunchTargetType[] { targetType }; - } - - @Override - protected TestLaunchObjectProvider[] getTestObjectProviders() { - TestLaunchObjectProvider provider = new TestLaunchObjectProvider() { - @Override - public void init(ILaunchBarManager manager) throws CoreException { - mockLaunchConfiguration("test1", launchManager.getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID)); - manager.launchObjectAdded(new TestLaunchObject("test1", getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); - mockLaunchConfiguration("test2", launchManager.getLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID)); - manager.launchObjectAdded(new TestLaunchObject("test2", getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); - } - }; - return new TestLaunchObjectProvider[] { provider }; - } - } - - @Test - public void testRestart() throws Exception { - // create two over everything, set second active, and make sure it's remembered in a second manager - TestLaunchBarManager manager = new TestRestartLaunchBarManager(); - ILaunchMode runMode = launchManager.getLaunchMode("run"); - ILaunchMode debugMode = launchManager.getLaunchMode("debug"); - assertNotNull(runMode); - - // get our targets - ILaunchTarget target1 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget1")); - assertNotNull(target1); - ILaunchTarget target2 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget2")); - assertNotNull(target2); - - // get our descriptors - ILaunchDescriptor desc1 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test1")); - assertNotNull(desc1); - ILaunchDescriptor desc2 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test2")); - assertNotNull(desc2); - - // Set the actives one way - manager.setActiveLaunchDescriptor(desc1); - manager.setActiveLaunchTarget(target1); - manager.setActiveLaunchMode(runMode); - - // Create a new manager and check they are the same - manager = new TestRestartLaunchBarManager(); - desc1 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test1")); - assertNotNull(desc1); - desc2 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test2")); - assertNotNull(desc2); - assertEquals(desc1, manager.getActiveLaunchDescriptor()); - - target1 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget1")); - assertNotNull(target1); - target2 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget2")); - assertNotNull(target2); - assertEquals(target1, manager.getActiveLaunchTarget()); - assertEquals(runMode, manager.getActiveLaunchMode()); - - // Set them the other way - manager.setActiveLaunchDescriptor(desc2); - manager.setActiveLaunchTarget(target2); - manager.setActiveLaunchMode(debugMode); - - // Create a new manager and check they stuck - manager = new TestRestartLaunchBarManager(); - desc2 = manager.getLaunchDescriptor(new Pair(DEFAULT_DESCRIPTOR_TYPE_ID, "test2")); - assertNotNull(desc2); - assertEquals(desc2, manager.getActiveLaunchDescriptor()); - target2 = manager.getLaunchTarget(new Pair(DEFAULT_TARGET_TYPE_ID, "testTarget2")); - assertNotNull(target2); - assertEquals(target2, manager.getActiveLaunchTarget()); - assertEquals(debugMode, manager.getActiveLaunchMode()); - } - - @Test - public void testLaunchConfigCapture() throws Exception { - final ILaunchConfigurationType configType = mockLaunchConfigurationType(DEFAULT_CONFIG_TYPE_ID); - TestLaunchBarManager manager = new TestLaunchBarManager() { - protected TestLaunchConfigurationProvider[] getTestConfigProviders() { - return new TestLaunchConfigurationProvider[] { - new TestLaunchConfigurationProvider(DEFAULT_DESCRIPTOR_TYPE_ID, DEFAULT_TARGET_TYPE_ID, configType, true, this) - }; - } - }; - - ILaunchConfiguration config = mockLaunchConfiguration("test", configType); - manager.launchObjectAdded(new TestLaunchObject("test", manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID))); - String activeDescId = manager.toString(manager.getDescriptorId(manager.getActiveLaunchDescriptor())); - assertEquals(manager.getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID), manager.getActiveLaunchDescriptor().getType()); - assertEquals(config, manager.getActiveLaunchConfiguration()); - - // restart and make sure the same descriptor is selected and new one new ones created - doReturn(new ILaunchConfiguration[] { config }).when(launchManager).getLaunchConfigurations(); - manager = new TestLaunchBarManager() { - protected TestLaunchConfigurationProvider[] getTestConfigProviders() { - return new TestLaunchConfigurationProvider[] { - new TestLaunchConfigurationProvider(DEFAULT_DESCRIPTOR_TYPE_ID, DEFAULT_TARGET_TYPE_ID, configType, true, this) - }; - } - @Override - protected TestLaunchObjectProvider[] getTestObjectProviders() { - return new TestLaunchObjectProvider[] { - new TestLaunchObjectProvider() { - @Override - public void init(ILaunchBarManager manager) throws CoreException { - manager.launchObjectAdded( - new TestLaunchObject("test", - getLaunchDescriptorType(DEFAULT_DESCRIPTOR_TYPE_ID)));; - } - } - }; - } - }; - String newActiveDescId = manager.toString(manager.getDescriptorId(manager.getActiveLaunchDescriptor())); - assertEquals(activeDescId, newActiveDescId); - assertEquals(1, manager.getLaunchDescriptors().length); + IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); + IRemoteConnectionType localServices = remoteManager.getLocalConnectionType(); + IRemoteConnection localConnection = localServices.getConnections().get(0); + assertNotNull(localConnection); + assertEquals(localConnection, manager.getActiveLaunchTarget()); + assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); } + // TODO - test that changing active target type produces a different launch config type + // TODO - test that settings are maintained after a restart // TODO - test that two target types that map to the same desc type and config type share configs // TODO - test duplicating a config. make sure it's default desc and same targets // TODO - test project descriptors and stuff diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java deleted file mode 100644 index e54db88b80a..00000000000 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/Activator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.launchbar.core.tests; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java deleted file mode 100644 index 381c96d2087..00000000000 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/AutomatedIntegrationSuite.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2011 QNX Software Systems 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: - * QNX Software Systems - initial API and implementation - * Markus Schorn (Wind River Systems) - *******************************************************************************/ -package org.eclipse.launchbar.core.tests; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.launchbar.core.internal.LaunchBarManagerTest; - -public class AutomatedIntegrationSuite extends TestSuite { - public AutomatedIntegrationSuite() { - } - - public AutomatedIntegrationSuite(Class theClass, String name) { - super(theClass, name); - } - - public AutomatedIntegrationSuite(Class theClass) { - super(theClass); - } - - public AutomatedIntegrationSuite(String name) { - super(name); - } - - public static Test suite() { - final AutomatedIntegrationSuite suite = new AutomatedIntegrationSuite(); - // tests - suite.addTestSuite(LaunchBarManagerTest.class); - return suite; - } -} From 210058b955b1c24ddda9dc4dbb0ffbb6eb8e2022 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 2 Mar 2015 21:24:57 -0500 Subject: [PATCH 015/198] Hook up the new connection wizard the target selector action area. Also externalize strings for the target selector. Change-Id: Ib082066560a1ab786783d47f165d7638189d338d --- .../launchbar/ui/internal/Messages.java | 1 + .../ui/internal/controls/TargetSelector.java | 29 ++++++++++++++----- .../launchbar/ui/internal/messages.properties | 1 + pom.xml | 4 +-- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 9a432ba18db..c230dfc30a7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -17,6 +17,7 @@ public class Messages extends NLS { public static String LaunchBarControl_Build; public static String LaunchBarControl_Launch; public static String LaunchBarControl_Stop; + public static String TargetSelector_CreateNewTarget; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index 911044c12f0..3e8965dc45a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -13,6 +13,12 @@ package org.eclipse.launchbar.ui.internal.controls; import java.util.Comparator; import java.util.List; +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.NotEnabledException; +import org.eclipse.core.commands.NotHandledException; +import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -20,6 +26,7 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; @@ -36,12 +43,14 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; public class TargetSelector extends CSelector { private final LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); - private static final String[] noTargets = new String[] { "---" }; + private static final String[] noTargets = new String[] { "---" }; //$NON-NLS-1$ public TargetSelector(Composite parent, int style) { super(parent, style); @@ -74,7 +83,7 @@ public class TargetSelector extends CSelector { @Override public Image getImage(Object element) { if (element instanceof IRemoteConnection) { - IRemoteConnection target = (IRemoteConnection) element; + //IRemoteConnection target = (IRemoteConnection) element; // TODO need to get icon form ui service } return super.getImage(element); @@ -141,15 +150,19 @@ public class TargetSelector extends CSelector { final Label createLabel = new Label(createButton, SWT.None); createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - createLabel.setText("Create New Target..."); + createLabel.setText(Messages.TargetSelector_CreateNewTarget); createLabel.setBackground(backgroundColor); MouseListener mouseListener = new MouseAdapter() { - public void mouseUp(org.eclipse.swt.events.MouseEvent e) { - // TODO - // NewLaunchTargetWizard wizard = new NewLaunchTargetWizard(uiManager); - // WizardDialog dialog = new WizardDialog(getShell(), wizard); - // dialog.open(); + public void mouseUp(org.eclipse.swt.events.MouseEvent event) { + try { + ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); + // TODO the command id should be in a remote ui interface + Command newConnectionCmd = commandService.getCommand("org.eclipse.remote.ui.command.newConnection"); //$NON-NLS-1$ + newConnectionCmd.executeWithChecks(new ExecutionEvent()); + } catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e) { + Activator.log(e); + } } }; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 52dfb3cfd9c..cf06ea8f1ad 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -1,3 +1,4 @@ LaunchBarControl_Build=Build LaunchBarControl_Launch=Launch LaunchBarControl_Stop=Stop +TargetSelector_CreateNewTarget=Create New Connection... diff --git a/pom.xml b/pom.xml index d87c22f2e7b..36f59e97155 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.5milestones + http://download.eclipse.org/eclipse/updates/4.5milestones/ p2 @@ -60,7 +60,7 @@ remote - http://download.eclipse.org/tools/ptp/builds/remote/2.0.0 + http://download.eclipse.org/tools/ptp/builds/remote/2.0.0/ p2 From e1fdb68ea30beec9ad7dcdb68c960cdded78e111 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 17 Mar 2015 11:29:36 -0400 Subject: [PATCH 016/198] launchbar: command to open config selector plus more - added command to open config selector (unbound now) - refactored common code to edit config (move into edit config command) - removed unused includes - changed wording on other launch bar command for consistency Change-Id: I9af26cc307cfde4e63d8caa3822a169f42638ef3 --- .../META-INF/MANIFEST.MF | 3 +- bundles/org.eclipse.launchbar.ui/plugin.xml | 13 +++- .../DefaultDescriptorLabelProvider.java | 1 - .../ConfigureActiveLaunchHandler.java | 74 ++++++++++++++----- .../internal/commands/OpenLaunchSelector.java | 43 +++++++++++ .../ui/internal/controls/ConfigSelector.java | 51 ++----------- .../internal/controls/LaunchBarControl.java | 4 + 7 files changed, 120 insertions(+), 69 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/OpenLaunchSelector.java diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index d8805c9e61e..db5c174c759 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.swt, org.eclipse.ui.navigator, org.eclipse.remote.core;bundle-version="2.0.0", - org.eclipse.remote.ui;bundle-version="1.1.0" + org.eclipse.remote.ui;bundle-version="1.1.0", + org.eclipse.e4.core.contexts Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/bundles/org.eclipse.launchbar.ui/plugin.xml index b71b2ecdb12..8a63efff54a 100644 --- a/bundles/org.eclipse.launchbar.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.ui/plugin.xml @@ -21,13 +21,13 @@ categoryId="org.eclipse.launchbar.ui.category.launchBar" defaultHandler="org.eclipse.launchbar.ui.internal.commands.BuildActiveCommandHandler" id="org.eclipse.launchbar.ui.command.buildActive" - name="Build for Active Launch Configuration"> + name="Build Active Launch Configuration"> + name="Launch Active Launch Configuration"> + name="Edit Active Launch Configuration"> + + findElements = service.findElements(application, LaunchBarControl.ID, + null, null); + if (findElements.size() > 0) { + MToolControl mpart = (MToolControl) findElements.get(0); + Object bar = mpart.getObject(); + if (bar instanceof LaunchBarControl) { + ((LaunchBarControl) bar).getConfigSelector().openPopup(); + } + } + return Status.OK_STATUS; + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 65416182f7e..e0d867da78e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -17,14 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchMode; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; -import org.eclipse.debug.ui.ILaunchGroup; -import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -32,13 +25,11 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.Window; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; -import org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog; +import org.eclipse.launchbar.ui.internal.commands.ConfigureActiveLaunchHandler; import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigWizard; -import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -54,8 +45,6 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; @SuppressWarnings("restriction") public class ConfigSelector extends CSelector { @@ -164,39 +153,7 @@ public class ConfigSelector extends CSelector { @Override public void handleEdit(Object element) { - try { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - LaunchBarManager manager = uiManager.getManager(); - ILaunchDescriptor desc = (ILaunchDescriptor) element; - ILaunchMode mode = manager.getActiveLaunchMode(); - IRemoteConnection target = manager.getActiveLaunchTarget(); - if (target == null) { - MessageDialog.openError(shell, "No Active Target", "You must create a target to edit this launch configuration."); - return; - } - ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); - if (configType == null) { - MessageDialog.openError(shell, "No launch configuration type", "Cannot edit this configuration"); - return; - } - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); - if (groupExt != null) { - ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); - if (config == null) { - MessageDialog.openError(shell, "No launch configuration", "Cannot edit this configuration"); - return; - } - if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { - config = ((ILaunchConfigurationWorkingCopy) config).doSave(); - } - final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); - dialog.setInitialStatus(Status.OK_STATUS); - dialog.open(); - } - } catch (CoreException e2) { - Activator.log(e2); - } + ConfigureActiveLaunchHandler.openConfigurationEditor((ILaunchDescriptor) element); } @Override @@ -285,4 +242,8 @@ public class ConfigSelector extends CSelector { super.setSelection(element); } + public void openPopup() { + super.openPopup(); + } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 3993dfc3ba8..d6ca90c3dd0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -145,4 +145,8 @@ public class LaunchBarControl implements Listener { // TODO Auto-generated method stub } + + public ConfigSelector getConfigSelector() { + return configSelector; + } } From b447d528f825fd877652c121fbcaf48f47b689d9 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 18 Mar 2015 12:04:21 -0400 Subject: [PATCH 017/198] launch bar: tests restored and test fixes - restored test module in pom - fixed tests - xml tag was renamed - fixed tests - stub functionality that rely on o.e.remote - fixed NPE when accesssing osname from LaunchTargetTypeInfo - added guards when calling into user defined classes - added more comments in java docs - restored original launch bar tests - current provider won't get notified when lc is removed, need to fix more Change-Id: I15f1a30e9f965ad5c84bdc51238ef129dc314450 Signed-off-by: Alena Laskavaia --- .../core/ILaunchConfigurationProvider.java | 14 +- .../launchbar/core/internal/Activator.java | 2 +- .../core/internal/LaunchBarManager.java | 59 +- .../core/internal/LaunchTargetTypeInfo.java | 34 +- pom.xml | 2 +- .../core/internal/LaunchBarManagerTest.java | 14 +- .../core/internal/LaunchBarManagerTest2.java | 982 ++++++++++++++++++ 7 files changed, 1073 insertions(+), 34 deletions(-) create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index 01472f13e9d..b2be74cb823 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -17,7 +17,10 @@ import org.eclipse.debug.core.ILaunchManager; /** * The provider of launch configurations of a given type for a given descriptor type - * and a given target type. + * and a given target type. + * + * It is recommended to extend {@link LaunchConfigurationProvider} + * instead of implementing this directly. */ public interface ILaunchConfigurationProvider { @@ -27,16 +30,19 @@ public interface ILaunchConfigurationProvider { * And return that object. * * @param configuration - * @return launch object that relates to this config + * @return launch object that relates to this config or null it does not own it. * @throws CoreException */ Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; /** - * A launch configuration has been removed. + * A launch configuration has been removed. + * It it fired after launch configuration has been removed from file system, so accessing its attributes won't work. + * This notification can be used to purge internal cache for example. + * If provider cannot determine if it owns it it should return false. * * @param configuration - * @return was the launch configuration removed by this provider? + * @return true if provider owns this launch configuration * @throws CoreException */ boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index 2e72396d0d4..2e6068c060b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -62,7 +62,7 @@ public class Activator extends Plugin { System.err.println(status.getMessage()); } - public static void log(Exception exception) { + public static void log(Throwable exception) { if (exception instanceof CoreException) { log(((CoreException) exception).getStatus()); } else { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index b4547a7778e..5ff1969740d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -411,7 +411,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private ILaunchConfigurationProvider getConfigProvider(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - if (descriptor == null) { + if (descriptor == null || target==null) { return null; } @@ -457,8 +457,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // to prevent unnecessary plug-in loading for (LaunchDescriptorTypeInfo descriptorInfo : orderedDescriptorTypes) { ILaunchDescriptorType descriptorType = descriptorInfo.getType(); - if (descriptorType.ownsLaunchObject(launchObject)) { - return descriptorType; + try { + if (descriptorType.ownsLaunchObject(launchObject)) { + return descriptorType; + } + } catch (Throwable e) { + Activator.log(e); // one of used defined launch types is misbehaving } } return null; @@ -479,8 +483,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration addDescriptor(launchObject, desc); } } - } catch (CoreException e) { - Activator.log(e.getStatus()); + } catch (Throwable e) { + Activator.log(e); } return desc; @@ -655,7 +659,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return getPreferenceStore().node(toString(getDescriptorId(activeLaunchDesc))); } - private IEclipsePreferences getPreferenceStore() { + // package private so tests can access it + IEclipsePreferences getPreferenceStore() { return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); } @@ -725,7 +730,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - if (targetTypeIds != null) { + return getLaunchTargets(targetTypeIds); + } + + List getLaunchTargets(List targetTypeIds) { + if (targetTypeIds != null && targetTypeIds.size() > 0) { List targetList = new ArrayList<>(); for (IRemoteConnection connection : remoteServicesManager.getAllRemoteConnections()) { for (String targetTypeId : targetTypeIds) { @@ -738,7 +747,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } return targetList; } - // Nope, return the local target, the default default IRemoteConnectionType localServices = remoteServicesManager.getLocalConnectionType(); return localServices.getConnections(); @@ -783,7 +791,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return targets.isEmpty() ? null : targets.get(0); } - private boolean supportsTargetType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + boolean supportsTargetType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { return getConfigProvider(descriptor, target) != null; } @@ -791,6 +799,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration ILaunchConfiguration activeConfig = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); if (activeConfig != null) { // Save the config -> target mapping + // TODO: seems to be weird place for setting this remoteLaunchConfigService.setActiveConnection(activeConfig, activeLaunchTarget); } return activeConfig; @@ -859,8 +868,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return; } } - } catch (CoreException e) { - Activator.log(e.getStatus()); + } catch (Throwable e) { + // catching throwable here because provider is user class and it can do nasty things :) + Activator.log(e); } Activator.trace("launch config not claimed"); @@ -888,8 +898,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return; } } - } catch (CoreException e) { - Activator.log(e.getStatus()); + } catch (Throwable e) { + Activator.log(e); } } @@ -905,13 +915,34 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration while (iter2.hasNext()) { Entry e2 = iter2.next(); if (e2.getValue().equals(configuration)) { - e1.getValue().remove((ILaunchConfigurationProvider) e2.getKey()); + final ILaunchConfigurationProvider provider = e2.getKey(); + try { + provider.launchConfigurationRemoved(e2.getValue()); + Activator.trace("launch config removed by " + provider); + } catch (Throwable e) { + Activator.log(e); + } + e1.getValue().remove((ILaunchConfigurationProvider) provider); return; } } break; } } + } else { + Map configMap = configs.get(desc); + if (configMap != null) { + for (ILaunchConfigurationProvider provider : configMap.keySet()) { + try { + if (provider.launchConfigurationRemoved(configuration)) { + Activator.trace("launch config removed by " + provider); + return; + } + } catch (Throwable e) { + Activator.log(e); + } + } + } } try { removeDescriptor(configuration, desc); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java index 42e27cfaa7d..4b8b1020248 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java @@ -1,10 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2014,2015 QNX Software Systems 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: + * Doug Schaefer + * Elena Laskavaia + *******************************************************************************/ package org.eclipse.launchbar.core.internal; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.remote.core.IRemoteConnection; class LaunchTargetTypeInfo { - public static final String SEP = "|"; + private static final String ANY = ""; private final String id; private final String connectionTypeId; private String osname; @@ -13,20 +24,22 @@ class LaunchTargetTypeInfo { public LaunchTargetTypeInfo(IConfigurationElement ce) { id = ce.getAttribute("id"); connectionTypeId = ce.getAttribute("connectionTypeId"); + if (id == null || connectionTypeId == null) + throw new NullPointerException(); osname = ce.getAttribute("osname"); - if (osname != null && osname.isEmpty()) { - osname = null; + if (osname == null) { + osname = ANY; } osarch = ce.getAttribute("osarch"); - if (osarch != null && osarch.isEmpty()) { - osarch = null; + if (osarch == null) { + osarch = ANY; } } public String getId() { return id; } - + public String getRemoteServicesId() { return connectionTypeId; } @@ -34,7 +47,7 @@ class LaunchTargetTypeInfo { public String getOsName() { return osname; } - + public String getOsArch() { return osarch; } @@ -43,15 +56,12 @@ class LaunchTargetTypeInfo { if (!connectionTypeId.equals(connection.getConnectionType().getId())) { return false; } - - if (osname != null && !osname.equals(connection.getProperty(IRemoteConnection.OS_NAME_PROPERTY))) { + if (!osname.isEmpty() && !osname.equals(connection.getProperty(IRemoteConnection.OS_NAME_PROPERTY))) { return false; } - - if (osarch != null && !osarch.equals(connection.getProperty(IRemoteConnection.OS_ARCH_PROPERTY))) { + if (!osarch.isEmpty() && !osarch.equals(connection.getProperty(IRemoteConnection.OS_ARCH_PROPERTY))) { return false; } - return true; } } diff --git a/pom.xml b/pom.xml index 36f59e97155..c94499a8a00 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ bundles/org.eclipse.launchbar.core bundles/org.eclipse.launchbar.ui features/org.eclipse.launchbar - + tests/org.eclipse.launchbar.core.tests repo diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 605a3487211..b027afd5272 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -3,6 +3,7 @@ package org.eclipse.launchbar.core.internal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; + import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -23,6 +24,7 @@ import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.junit.Test; @@ -52,7 +54,11 @@ public class LaunchBarManagerTest { doReturn(true).when(launchConfigType).supportsMode("debug"); // Inject the launch config - LaunchBarManager manager = new LaunchBarManager(false); + LaunchBarManager manager = new LaunchBarManager(false) { + IRemoteLaunchConfigService getRemoteLaunchConfigService() { + return mock(IRemoteLaunchConfigService.class); + } + }; manager.init(); manager.launchConfigurationAdded(launchConfig); @@ -93,7 +99,7 @@ public class LaunchBarManagerTest { doReturn("targetType").when(element).getName(); String targetTypeId = "org.eclipse.launchbar.core.targetType.local"; doReturn(targetTypeId).when(element).getAttribute("id"); - doReturn("org.eclipse.remote.LocalServices").when(element).getAttribute("remoteServicesId"); + doReturn("org.eclipse.remote.LocalServices").when(element).getAttribute("connectionTypeId"); // fake launch object String launchObject = "fakeObject"; @@ -164,6 +170,10 @@ public class LaunchBarManagerTest { ILaunchManager getLaunchManager() { return launchManager; } + @Override + IRemoteLaunchConfigService getRemoteLaunchConfigService() { + return mock(IRemoteLaunchConfigService.class); + } }; manager.init(); manager.launchObjectAdded(launchObject); diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java new file mode 100644 index 00000000000..64f76dc58e9 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java @@ -0,0 +1,982 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Elena Laskavaia + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import static org.junit.Assert.*; + +import static org.mockito.Matchers.*; +import static org.mockito.Mockito.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; + +import org.eclipse.core.internal.preferences.EclipsePreferences; +import org.eclipse.core.internal.resources.Project; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.ILaunchConfigurationProvider; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.ILaunchDescriptorType; +import org.eclipse.launchbar.core.ProjectLaunchConfigurationProvider; +import org.eclipse.launchbar.core.ProjectLaunchDescriptor; +import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.JVM) +public class LaunchBarManagerTest2 { + private LaunchBarManager manager; + private ILaunchConfigurationProvider provider; + private ILaunchDescriptor descriptor; + private ILaunchDescriptorType descriptorType; + private ILaunchConfigurationType launchConfigType; + private ILaunchConfiguration launchConfig; + private ILaunchManager lman; + private IProject aaa; + private ArrayList globalmodes = new ArrayList<>(); + IExtensionPoint point; + IEclipsePreferences store = new EclipsePreferences(); + private ArrayList elements; + private IExtension extension; + private String targetTypeId; + private String descriptorTypeId; + private IRemoteConnection localtarget; + private String launchObject; + + public class FixedLaunchBarManager extends LaunchBarManager { + public FixedLaunchBarManager() throws CoreException { + super(false); + } + + @Override + public IExtensionPoint getExtensionPoint() { + return point; + } + + @Override + protected ILaunchManager getLaunchManager() { + return lman; + } + + @Override + protected IEclipsePreferences getPreferenceStore() { + return store; + } + + @Override + IRemoteLaunchConfigService getRemoteLaunchConfigService() { + return mock(IRemoteLaunchConfigService.class); + } + }; + + @Before + public void setUp() throws Exception { + basicSetup(); + } + + protected IConfigurationElement mockConfigTypeElement(String targetTypeId, String descriptorTypeId, String launchConfigTypeId) { + IConfigurationElement element = mockElementAndAdd("configType"); + doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); + doReturn(targetTypeId).when(element).getAttribute("targetType"); + doReturn(launchConfigTypeId).when(element).getAttribute("launchConfigurationType"); + return element; + } + + protected ILaunchConfigurationProvider mockProviderTypes(ILaunchConfigurationProvider provider) + throws CoreException { + doReturn(launchConfigType).when(provider).getLaunchConfigurationType(); + doReturn(launchConfig).when(provider).createLaunchConfiguration(lman, descriptor); + return provider; + } + + protected void mockProviderElement(ILaunchConfigurationProvider provider) throws CoreException { + IConfigurationElement element = mockElementAndAdd("configProvider"); + doReturn(launchConfigType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); + doReturn(provider).when(element).createExecutableExtension("class"); + } + + protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId) { + IConfigurationElement element = mockElementAndAdd("descriptorType"); + doReturn(descriptorTypeId).when(element).getAttribute("id"); + return element; + } + + protected void init() throws CoreException { + doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); + // Now inject the launch object + manager.init(); + } + + protected IConfigurationElement mockElementAndAdd(final String configElement) { + IConfigurationElement element = mock(IConfigurationElement.class); + doReturn(configElement).when(element).getName(); + elements.add(element); + return element; + } + + protected String mockLocalTargetElement() { + IConfigurationElement element = mockElementAndAdd("targetType"); + String targetTypeId = "org.eclipse.launchbar.core.targetType.local"; + doReturn(targetTypeId).when(element).getAttribute("id"); + doReturn("org.eclipse.remote.LocalServices").when(element).getAttribute("connectionTypeId"); + return targetTypeId; + } + + protected IConfigurationElement mockTargetElement(String id) { + IConfigurationElement element = mockElementAndAdd("targetType"); + doReturn(id).when(element).getAttribute("id"); + doReturn(id).when(element).getAttribute("connectionTypeId"); + return element; + } + + @Test + public void testDescriptor() throws Exception { + // Create a descriptor type and inject an associated object + // Make sure the descriptor is active with the local target and proper mode + // Make sure the associated launch config is active too + // Mocking + manager.launchObjectAdded(launchObject); + assertEquals(descriptor, manager.getActiveLaunchDescriptor()); + IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); + IRemoteConnectionType localServices = remoteManager.getLocalConnectionType(); + IRemoteConnection localConnection = localServices.getConnections().get(0); + assertNotNull(localConnection); + assertEquals(localConnection, manager.getActiveLaunchTarget()); + assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); + assertNotNull(manager.getActiveLaunchMode()); + assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); + } + + protected void mockLaunchObjectOnDescriptor(Object launchObject) throws CoreException { + doReturn(true).when(descriptorType).ownsLaunchObject(launchObject); + doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); + doReturn(launchObject.toString()).when(descriptor).getName(); + } + + protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId, ILaunchDescriptorType descriptorType) + throws CoreException { + IConfigurationElement element = mockDescriptorTypeElement(descriptorTypeId); + doReturn(descriptorType).when(element).createExecutableExtension("class"); + return element; + } + + private ILaunchConfiguration mockLC(String string, ILaunchConfigurationType lctype2) throws CoreException { + ILaunchConfiguration lc = mock(ILaunchConfiguration.class); + doReturn(string).when(lc).getName(); + doReturn(lctype2).when(lc).getType(); + return lc; + } + + protected ILaunchConfigurationType mockLCType(String id) { + ILaunchConfigurationType lctype = mock(ILaunchConfigurationType.class); + doReturn(id).when(lctype).getIdentifier(); + doReturn(lctype).when(lman).getLaunchConfigurationType(id); + return lctype; + } + + protected ILaunchMode[] mockLaunchModes(ILaunchConfigurationType type, String... modes) { + ILaunchMode res[] = new ILaunchMode[modes.length]; + for (int i = 0; i < modes.length; i++) { + String modeId = modes[i]; + doReturn(true).when(type).supportsMode(modeId); + ILaunchMode mode = mock(ILaunchMode.class); + res[i] = mode; + doReturn(modeId).when(mode).getIdentifier(); + doReturn(mode).when(lman).getLaunchMode(modeId); + globalmodes.add(mode); + } + doReturn(new HashSet<>(Arrays.asList(modes))).when(type).getSupportedModes(); + doReturn(globalmodes.toArray(new ILaunchMode[globalmodes.size()])).when(lman).getLaunchModes(); + return res; + } + + /** + * @param t2 + * @return + */ + private IRemoteConnection mockRemoteConnection(String t2) { + IRemoteConnection target = mock(IRemoteConnection.class); + IRemoteConnectionType type = mock(IRemoteConnectionType.class); + doReturn(t2).when(type).getName(); + doReturn(t2).when(type).getId(); + doReturn(t2 + ".target").when(target).getName(); + doReturn(type).when(target).getConnectionType(); + return target; + } + + class ConfigBasedLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { + private ILaunchConfiguration conf; + private ILaunchDescriptorType type; + + public ConfigBasedLaunchDescriptor(ILaunchDescriptorType type, ILaunchConfiguration conf) { + this.conf = conf; + this.type = type; + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter.isInstance(conf)) + return conf; + return super.getAdapter(adapter); + } + + @Override + public String getName() { + return conf.getName(); + } + + @Override + public ILaunchDescriptorType getType() { + return type; + } + } + + private void basicSetup() throws CoreException { + basicSetupOnly(); + init(); + } + + protected void basicSetupOnly() throws CoreException { + globalmodes.clear(); + point = mock(IExtensionPoint.class); + extension = mock(IExtension.class); + elements = new ArrayList<>(); + doReturn(new IExtension[] { extension }).when(point).getExtensions(); + lman = mock(ILaunchManager.class); + doReturn(globalmodes.toArray(new ILaunchMode[globalmodes.size()])).when(lman).getLaunchModes(); + doReturn(new ILaunchConfiguration[] {}).when(lman).getLaunchConfigurations(); + manager = new FixedLaunchBarManager(); + // mock + // lc + launchConfigType = mockLCType("lctype1"); + launchConfig = mockLC("bla", launchConfigType); + // launch config type + mockLaunchModes(launchConfigType, "run", "debug"); + // target + targetTypeId = mockLocalTargetElement(); + // launch descriptor and type + descriptorType = mock(ILaunchDescriptorType.class); + descriptorTypeId = "descType"; + mockDescriptorTypeElement(descriptorTypeId, descriptorType); + descriptor = mock(ILaunchDescriptor.class); + doReturn(descriptorType).when(descriptor).getType(); + // configProvider + provider = mock(ILaunchConfigurationProvider.class); + mockProviderElement(provider); + mockProviderTypes(provider); + // configType + mockConfigTypeElement(targetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + launchObject = "test"; + mockLaunchObjectOnDescriptor(launchObject); + localtarget = manager.getRemoteServicesManager().getLocalConnectionType().getConnections().get(0); + } + + @Test + public void testLaunchBarManager() { + assertNull(manager.getActiveLaunchDescriptor()); + assertNull(manager.getActiveLaunchTarget()); + assertNull(manager.getActiveLaunchMode()); + } + + @Test + public void testAddConfigProviderBad() throws CoreException { + doThrow(new NullPointerException()).when(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); + manager.launchConfigurationAdded(launchConfig); + verify(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); + } + + @Test + public void testAddDescriptorTypeBad() throws CoreException { + doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); + manager.launchObjectAdded("aaa"); + verify(descriptorType).ownsLaunchObject(any()); + } + + @Test + public void testAddConfigProviderNoTarget_failing() { + // here target type is not defined + try { + basicSetupOnly(); + // configType + mockConfigTypeElement("xxx", descriptorTypeId, launchConfigType.getIdentifier()); + init(); + //fail("Expecting exctpion because target is not registered"); + } catch (Exception e) { + // pass + fail();// fail for now when this is fixed - fix the test + } + } + + // + // @Test + // public void testAddConfigProviderNoDesc() { + // try { + // manager.addTargetType(targetType); + // manager.addConfigProvider(descType.getId(), targetType.getId(), false, provider); + // fail("Expecting exctpion because target is not registered"); + // } catch (Exception e) { + // // pass + // } + // } + // + @Test + public void testAddConfigMappingTwo() throws CoreException { + basicSetupOnly(); + String t2 = "t2"; + mockTargetElement(t2); + IRemoteConnection target = mockRemoteConnection(t2); + mockConfigTypeElement(t2, descriptorTypeId, launchConfigType.getIdentifier()); + init(); + // now create another lc type, which is not registered in config type + ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); + ILaunchConfiguration lc2 = mockLC("bla2", lctype2); + ConfigBasedLaunchDescriptor desc2 = new ConfigBasedLaunchDescriptor(descriptorType, lc2); + // it return original lctype because we did not associate this dynmaically + assertEquals(launchConfigType, manager.getLaunchConfigurationType(desc2, target)); + } + + @Test + public void testAddConfigProviderTwo2() throws CoreException { + basicSetupOnly(); + String t2 = "t2"; + mockTargetElement(t2); + IRemoteConnection target = mockRemoteConnection(t2); + mockConfigTypeElement(t2, descriptorTypeId, launchConfigType.getIdentifier()); + ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); + mockConfigTypeElement(t2, descriptorTypeId, lctype2.getIdentifier()); + init(); + assertEquals(lctype2, manager.getLaunchConfigurationType(descriptor, target)); + } + + @Test + public void testGetLaunchTargets() throws CoreException { + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchDescriptor(descriptor); + List launchTargets = manager.getLaunchTargets(descriptor); + assertEquals(1, launchTargets.size()); + assertEquals(localtarget, launchTargets.get(0)); + } + + @Test + public void testGetLaunchTargetsNoConfigMapping() throws CoreException { + basicSetupOnly(); + elements.clear(); + mockLocalTargetElement(); + mockDescriptorTypeElement(descriptorTypeId, descriptorType); + init(); + manager.launchObjectAdded(launchObject); + ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); + List launchTargets = manager.getLaunchTargets(desc); + assertEquals(1, launchTargets.size()); + } + + @Test + public void testGetLaunchTargetsConfigMapping() throws CoreException { + basicSetupOnly(); + elements.clear(); + mockLocalTargetElement(); + mockDescriptorTypeElement(descriptorTypeId, descriptorType); + mockConfigTypeElement(targetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + init(); + manager.launchObjectAdded(launchObject); + ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); + List launchTargets = manager.getLaunchTargets(desc); + assertEquals(1, launchTargets.size()); + } + + @Test + public void testGetLaunchDescriptorsNull() { + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(0, launchDescriptors.length); + } + + @Test + public void testGetLaunchDescriptorsNull1() throws CoreException { + init(); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(0, launchDescriptors.length); + } + + @Test + public void testGetLaunchDescriptors() throws CoreException { + manager.launchConfigurationAdded(launchConfig); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(1, launchDescriptors.length); + } + + // + // public void testGetLaunchDescriptorsSort() { + // final ILaunchDescriptor res[] = new ILaunchDescriptor[1]; + // manager.addTargetType(targetType); + // ConfigBasedLaunchDescriptorType descType1 = new ConfigBasedLaunchDescriptorType("id1", lctype.getIdentifier()); + // ConfigBasedLaunchDescriptorType descType2 = new ConfigBasedLaunchDescriptorType("id2", lctype.getIdentifier()) { + // @Override + // public ILaunchDescriptor getDescriptor(Object element) { + // return res[0] = super.getDescriptor(element); + // } + // }; + // ConfigBasedLaunchDescriptorType descType3 = new ConfigBasedLaunchDescriptorType("id3", lctype.getIdentifier()); + // manager.addDescriptorType(descType1, 3); + // manager.addDescriptorType(descType2, 5); + // manager.addDescriptorType(descType3, 1); + // manager.addConfigProvider(descType1.getId(), targetType.getId(), true, provider); + // manager.addConfigProvider(descType2.getId(), targetType.getId(), true, provider); + // manager.addConfigProvider(descType3.getId(), targetType.getId(), true, provider); + // targetType.targets.add(mytarget); + // manager.launchObjectAdded(launchObject); + // ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + // assertEquals(1, launchDescriptors.length); + // assertNotNull(launchDescriptors[0]); + // assertSame(res[0], launchDescriptors[0]); + // } + // + @Test + public void testLaunchObjectAdded() throws CoreException { + mockLaunchObjectOnDescriptor(launchConfig); + doReturn(launchConfig.getName()).when(descriptor).getName(); + manager.launchObjectAdded(launchObject); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(1, launchDescriptors.length); + assertNotNull(launchDescriptors[0]); + assertEquals(launchConfig.getName(), launchDescriptors[0].getName()); + } + + @Test + public void testLaunchConfigurationAdded() throws CoreException { + manager.launchConfigurationAdded(launchConfig); + ILaunchConfiguration lc2 = mockLC("lc2", launchConfigType); + manager.launchConfigurationAdded(lc2); + assertEquals(2, manager.getLaunchDescriptors().length); + } + + @Test + public void testLaunchObjectChanged() throws CoreException { + // todo FIX me + manager.launchObjectChanged(launchObject); + } + + public IProject mockProject(String projectName) { + IProject project = mock(Project.class); + when(project.getAdapter(IResource.class)).thenReturn(project); + when(project.getProject()).thenReturn(project); + when(project.getName()).thenReturn(projectName); + IPath path = new Path(projectName); + when(project.getFullPath()).thenReturn(path); + when(project.getType()).thenReturn(IResource.PROJECT); + return project; + } + public static final String ATTR_PROJECT_NAME = "org.eclipse.cdt.launch" + ".PROJECT_ATTR"; + public static final String ATTR_PROGRAM_NAME = "org.eclipse.cdt.launch" + ".PROGRAM_NAME"; + + public ILaunchConfiguration mockLCProject(ILaunchConfiguration lc, String projectName) { + mockLCAttribute(lc, ATTR_PROJECT_NAME, projectName); + return lc; + } + + public ILaunchConfiguration mockLCProject(ILaunchConfiguration lc, IProject project) { + String projectName = project.getName(); + doReturn(projectName).when(lc).getName(); + mockLCProject(lc, projectName); + try { + doReturn(new IResource[] { project }).when(lc).getMappedResources(); + } catch (CoreException e) { + throw new RuntimeException(e); + } + return lc; + } + + public ILaunchConfiguration mockLCBinary(ILaunchConfiguration lc, String binname) { + mockLCAttribute(lc, ATTR_PROGRAM_NAME, binname); + return lc; + } + + public ILaunchConfiguration mockLCAttribute(ILaunchConfiguration lc, String attr, String value) { + try { + when(lc.getAttribute(eq(attr), anyString())).thenReturn(value); + } catch (CoreException e) { + throw new RuntimeException(e); + } + return lc; + } + + protected String getProjectName(ILaunchConfiguration llc) { + try { + return llc.getAttribute(ATTR_PROJECT_NAME, ""); + } catch (CoreException e) { + // + } + return ""; + } + + IProject getProjectByName(String p) { + if (p.equals("aaa")) + return aaa; + return mockProject(p); + } + + protected void userDeletesLC(ILaunchConfiguration lc2) { + String string = lc2.getName(); + reset(lc2); + doReturn(string).when(lc2).getName(); + manager.launchConfigurationRemoved(lc2); + } + + public class ProjectBasedLaunchDescriptorType implements ILaunchDescriptorType { + @Override + public boolean ownsLaunchObject(Object launchObject) throws CoreException { + return launchObject instanceof IProject; + } + + @Override + public ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException { + return new ProjectLaunchDescriptor(this, (IProject) launchObject); + } + + public String getId() { + return "pbtype"; + } + } + + protected void projectMappingSetup() throws CoreException { + descriptorType = new ProjectBasedLaunchDescriptorType(); + descriptorTypeId = ((ProjectBasedLaunchDescriptorType) descriptorType).getId(); + provider = new ProjectLaunchConfigurationProvider() { + @Override + public ILaunchConfigurationType getLaunchConfigurationType() throws CoreException { + return launchConfigType; + } + }; + aaa = mockProject("aaa"); + descriptor = new ProjectLaunchDescriptor(descriptorType, aaa); + // setup some stuff + targetTypeId = mockLocalTargetElement(); + IConfigurationElement element = mockDescriptorTypeElement(descriptorTypeId, descriptorType); + // configType + mockConfigTypeElement(targetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + //lc = provider.createLaunchConfiguration(lman, descType.getDescriptor(aaa)); + mockLCProject(launchConfig, aaa); + String ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; + mockLCAttribute(launchConfig, ORIGINAL_NAME, aaa.getName()); + mockProviderElement(provider); + assertEquals(0, manager.getLaunchDescriptors().length); + init(); + } + + /** + * This scenario when provider will change mapping element->descriptor, depending on other objects involved + */ + @Test + public void testLaunchObjectAddedRemapping() throws CoreException { + projectMappingSetup(); + // user created a project + manager.launchObjectAdded(aaa); + assertEquals(1, manager.getLaunchDescriptors().length); + assertTrue(manager.getLaunchDescriptors()[0].getName().startsWith(aaa.getName())); + // user clicked on descriptor gear to edit lc, new lc is created + manager.launchConfigurationAdded(launchConfig); + assertEquals(1, manager.getLaunchDescriptors().length); + assertEquals(launchConfig.getName(), manager.getLaunchDescriptors()[0].getName()); + // user cloned lc and changed some settings + ILaunchConfiguration lc2 = mockLC("lc2", launchConfigType); + mockLCProject(lc2, aaa); + doReturn("name2").when(lc2).getName(); + manager.launchConfigurationAdded(lc2); + assertEquals(2, manager.getLaunchDescriptors().length); + // user deleted lc + userDeletesLC(lc2); + assertEquals(1, manager.getLaunchDescriptors().length); + // user deleted last lc, now we back to project default + userDeletesLC(launchConfig); + assertEquals(1, manager.getLaunchDescriptors().length); + } + + @Test + public void testLaunchObjectAddedRemapping2() throws CoreException { + projectMappingSetup(); + // test unmapping + manager.launchObjectAdded(aaa); + manager.launchConfigurationAdded(launchConfig); + assertEquals(1, manager.getLaunchDescriptors().length); + manager.launchObjectAdded(aaa); + assertEquals(1, manager.getLaunchDescriptors().length); + assertEquals(launchConfig.getName(), manager.getLaunchDescriptors()[0].getName()); + } + + @Test + public void testLaunchObjectAddedBadDescriptor() throws CoreException { + doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); + // check events + manager.launchObjectAdded(launchObject); + verify(descriptorType).ownsLaunchObject(launchObject); + } + + @Test + public void testLaunchObjectAddedBadDescriptor2() throws CoreException { + doThrow(new NullPointerException()).when(descriptorType).getDescriptor(any()); + // check events + manager.launchObjectAdded(launchObject); + verify(descriptorType).getDescriptor(launchObject); + } + + @Test + public void testLaunchObjectRemoveBadDescriptor() throws CoreException { + doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); + // check events + manager.launchObjectRemoved(launchObject); + } + + @Test + public void testLaunchObjectRemoved() throws CoreException { + manager.launchObjectAdded(launchObject); + assertEquals(1, manager.getLaunchDescriptors().length); + manager.launchObjectRemoved(launchObject); + assertEquals(0, manager.getLaunchDescriptors().length); + } + + @Test + public void testGetActiveLaunchDescriptor() throws CoreException { + Listener lis = mock(Listener.class); + manager.addListener(lis); + manager.launchObjectAdded(launchObject); + // manager.setActiveLaunchDescriptor(desc); + assertEquals(descriptor, manager.getActiveLaunchDescriptor()); + verify(lis).activeLaunchDescriptorChanged(); + } + + @Test + public void testSetActiveLaunchDescriptorUnkn() throws CoreException { + try { + manager.setActiveLaunchDescriptor(descriptor); + fail(); + } catch (Exception e) { + // pass + } + } + + @Test + public void testSetActiveLaunchDescriptorNullBad() throws CoreException { + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchDescriptor(null); + assertEquals(descriptor, manager.getActiveLaunchDescriptor()); + } + + @Test + public void testSetActiveLaunchDescriptorLisBad() throws CoreException { + Listener lis = mock(Listener.class); + manager.addListener(lis); + doThrow(new NullPointerException()).when(lis).activeLaunchDescriptorChanged(); + manager.launchConfigurationAdded(launchConfig); + verify(lis).activeLaunchDescriptorChanged(); + } + + @Test + public void testSetActiveLaunchDescriptorNull() throws CoreException { + manager.launchObjectAdded(launchObject); + manager.launchObjectRemoved(launchObject); + assertEquals(null, manager.getActiveLaunchDescriptor()); + manager.setActiveLaunchDescriptor(null); + } + + @Test + public void testGetLaunchModes() throws CoreException { + ILaunchMode[] launchModes = manager.getLaunchModes(); + assertEquals(0, launchModes.length); + } + + @Test + public void testGetLaunchModesFew() throws CoreException { + globalmodes.clear(); + ILaunchConfigurationType lctype2 = mockLCType("lctype2"); + mockLaunchModes(lctype2, "modex"); + mockLaunchModes(launchConfigType, "run", "debug", "foo"); + manager.launchConfigurationAdded(launchConfig); + ILaunchMode[] launchModes = manager.getLaunchModes(); + assertEquals(3, launchModes.length); + } + + @Test + public void testSetActiveLaunchMode() throws CoreException { + ILaunchMode mode = mock(ILaunchMode.class); + doReturn("bla").when(mode).getIdentifier(); + doReturn("Bla").when(mode).getLabel(); + manager.setActiveLaunchMode(mode); + assertEquals(mode, manager.getActiveLaunchMode()); + } + + @Test + public void testSetActiveLaunchModeNull() throws CoreException { + manager.setActiveLaunchMode(null); + assertEquals(null, manager.getActiveLaunchMode()); + } + + @Test + public void testSetActiveLaunchModeNull2() throws CoreException { + ILaunchMode modes[] = mockLaunchModes(launchConfigType, "run", "debug", "foo"); + manager.setActiveLaunchMode(modes[0]); + manager.setActiveLaunchMode(null); + assertEquals(null, manager.getActiveLaunchMode()); + } + + @Test + public void testSetActiveLaunchModeUnsupported() throws CoreException { + ILaunchConfigurationType lctype2 = mockLCType("lctype2"); + ILaunchMode mode = mockLaunchModes(lctype2, "modex")[0]; + mockLaunchModes(launchConfigType, "run", "debug", "foo"); + manager.launchConfigurationAdded(launchConfig); + try { + manager.setActiveLaunchMode(mode); + fail(); + } catch (Exception e) { + // works + assertNotEquals(mode, manager.getActiveLaunchMode()); + } + } + + @Test + public void testSetActiveLaunchModeLis() throws CoreException { + ILaunchMode mode = mock(ILaunchMode.class); + doReturn("bla").when(mode).getIdentifier(); + Listener lis = mock(Listener.class); + manager.addListener(lis); + manager.setActiveLaunchMode(mode); + manager.setActiveLaunchMode(null); + verify(lis, times(2)).activeLaunchModeChanged(); + } + + @Test + public void testSetActiveLaunchModeLisBad() throws CoreException { + ILaunchMode mode = mock(ILaunchMode.class); + doReturn("bla").when(mode).getIdentifier(); + Listener lis = mock(Listener.class); + manager.addListener(lis); + doThrow(new NullPointerException()).when(lis).activeLaunchModeChanged(); + manager.setActiveLaunchMode(mode); + verify(lis).activeLaunchModeChanged(); + } + + @Test + public void testGetActiveLaunchModeFromDesc() throws CoreException { + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchDescriptor(descriptor); + ILaunchMode resmode = manager.getActiveLaunchMode(); + assertNotNull(resmode); + assertEquals("run", resmode.getIdentifier()); + } + + @Test + public void testGetActiveLaunchModeFromDescDebug() throws CoreException { + globalmodes.clear(); + mockLaunchModes(launchConfigType, "xrun"); + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchDescriptor(descriptor); + ILaunchMode resmode = manager.getActiveLaunchMode(); + assertNotNull(resmode); + assertEquals("xrun", resmode.getIdentifier()); + } + + @Test + public void testGetActiveLaunchModeFromDescActive() throws CoreException { + mockLaunchModes(launchConfigType, "run"); + ILaunchMode mode = mockLaunchModes(launchConfigType, "foo")[0]; + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchMode(mode); + manager.setActiveLaunchDescriptor(descriptor); + ILaunchMode resmode = manager.getActiveLaunchMode(); + assertNotNull(resmode); + assertEquals("foo", resmode.getIdentifier()); + } + + @Test + public void testGetActiveLaunchTarget() throws CoreException { + manager.setActiveLaunchTarget(localtarget); + assertEquals(localtarget, manager.getActiveLaunchTarget()); + } + + @Test + public void testGetLaunchTarget() throws CoreException { + final List list = manager.getLaunchTargets(Collections.singletonList(targetTypeId)); + assertEquals(1, list.size()); + assertEquals(localtarget, list.get(0)); + } + + @Test + public void testGetLaunchTargetNone() throws CoreException { + final List list = manager.getLaunchTargets(Collections.singletonList("xxx")); + assertEquals(0, list.size()); + } + + @Test + public void testGetLaunchConfigurationType() throws CoreException { + assertNotNull(manager.getLaunchConfigurationType(descriptor, localtarget)); + } + + @Test + public void testGetLaunchConfigurationNull() throws CoreException { + assertNull(manager.getLaunchConfiguration(null, localtarget)); + } + + @Test + public void testGetLaunchConfigurationNull2() throws CoreException { + assertNull(manager.getLaunchConfiguration(descriptor, null)); + } + + @Test + public void testGetLaunchConfiguration() throws CoreException { + basicSetup(); + assertTrue(manager.supportsTargetType(descriptor, localtarget)); + assertNotNull(manager.getLaunchConfiguration(descriptor, localtarget)); + } + + @Test + public void testAddListener() throws CoreException { + Listener lis = mock(Listener.class); + manager.addListener(lis); + // check events + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchDescriptor(descriptor); + verify(lis).activeLaunchTargetChanged(); + } + + @Test + public void testAddListenerBad() throws CoreException { + Listener lis = mock(Listener.class); + manager.addListener(lis); + doThrow(new NullPointerException()).when(lis).activeLaunchTargetChanged(); + // check events + manager.launchObjectAdded(launchObject); + manager.setActiveLaunchDescriptor(descriptor); + verify(lis).activeLaunchTargetChanged(); + } + + @Test + public void testRemoveListener() { + Listener lis = mock(Listener.class); + manager.addListener(lis); + manager.removeListener(lis); + verifyZeroInteractions(lis); + } + + @Test + public void testLaunchConfigurationAdded2() throws CoreException { + globalmodes.clear(); + ILaunchMode mode = mockLaunchModes(launchConfigType, "foo")[0]; + // XXX if provider returns object not known by launch bar bad things happen + //doReturn(launchObject).when(provider).launchConfigurationAdded(lc); + manager.launchConfigurationAdded(launchConfig); + verify(provider).launchConfigurationAdded(launchConfig); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(1, launchDescriptors.length); + assertNotNull(launchDescriptors[0]); + assertEquals(launchConfig.getName(), launchDescriptors[0].getName()); + manager.setActiveLaunchDescriptor(launchDescriptors[0]); + assertEquals(localtarget, manager.getActiveLaunchTarget()); + assertEquals(mode, manager.getActiveLaunchMode()); + } + + @Test + public void testLaunchConfigurationAddedDefault() throws CoreException { + // another lc not covered by provider + ILaunchConfigurationType lctype2 = mockLCType("lctype2"); + ILaunchConfiguration lc2 = mockLC("lc2", lctype2); + manager.launchConfigurationAdded(lc2); + verifyZeroInteractions(provider); + //verify(provider).launchConfigurationAdded(lc2); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(1, launchDescriptors.length); + assertNotNull(launchDescriptors[0]); + assertEquals(lc2.getName(), launchDescriptors[0].getName()); + manager.setActiveLaunchDescriptor(launchDescriptors[0]); + assertEquals(localtarget, manager.getActiveLaunchTarget()); + } + + @Test + public void testLaunchConfigurationAddedBad() throws CoreException { + doThrow(new NullPointerException()).when(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); + manager.launchConfigurationAdded(launchConfig); + verify(provider).launchConfigurationAdded(launchConfig); + } + + @Test + public void testLaunchConfigurationRemoved_fails() throws CoreException { + manager.launchConfigurationRemoved(launchConfig); + try { + verify(provider).launchConfigurationRemoved(launchConfig); + fail(); + } catch (Throwable e) { + // temp fail test + } + } + + @Test + public void testLaunchConfigurationRemovedBad_fails() throws CoreException { + doThrow(new NullPointerException()).when(provider).launchConfigurationRemoved(any(ILaunchConfiguration.class)); + manager.launchConfigurationRemoved(launchConfig); + try { + verify(provider).launchConfigurationRemoved(launchConfig); + fail(); + } catch (Throwable e) { + // temp fail test + } + } + + @Test + public void testExtensionConfigDefaultProvider() throws CoreException { + basicSetupOnly(); + elements.clear(); + IConfigurationElement element = mockElementAndAdd("defaultConfigTarget"); + doReturn(launchConfigType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); + targetTypeId = "x2"; + mockTargetElement(targetTypeId); + doReturn(targetTypeId).when(element).getAttribute("targetType"); + init(); + manager.launchConfigurationAdded(launchConfig); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(1, launchDescriptors.length); + assertNotNull(launchDescriptors[0]); + assertEquals(launchConfig.getName(), launchDescriptors[0].getName()); + assertEquals(null, manager.getActiveLaunchTarget()); + } + + @Test + public void testExtensionDescriptorTypeBad() throws CoreException { + basicSetupOnly(); + elements.clear(); + IConfigurationElement element = mockDescriptorTypeElement("d1", descriptorType = mock(ILaunchDescriptorType.class)); + doThrow(new CoreException(new Status(1, "a", "n"))).when(element).createExecutableExtension("class"); + doReturn(new ILaunchConfiguration[] { launchConfig }).when(lman).getLaunchConfigurations(); + mockConfigTypeElement(targetTypeId, "d1", launchConfigType.getIdentifier()); + init(); + ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + assertEquals(1, launchDescriptors.length); // XXX should be 0 + } +} From 28985bd18d4acf19f16e31594a5f8515fde3354b Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 18 Mar 2015 16:28:55 -0400 Subject: [PATCH 018/198] launch bar: renamed test so it picked by gerrit verifier - also mocked another target so it does not always test local one Change-Id: Idf59342aac75bf5c92c5ca63870eade760065f70 Signed-off-by: Alena Laskavaia --- ...rTest2.java => LaunchBarManager2Test.java} | 110 ++++++++++-------- 1 file changed, 62 insertions(+), 48 deletions(-) rename tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/{LaunchBarManagerTest2.java => LaunchBarManager2Test.java} (93%) diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java similarity index 93% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java rename to tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 64f76dc58e9..307b2ad8447 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest2.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -54,7 +54,7 @@ import org.junit.Test; import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.JVM) -public class LaunchBarManagerTest2 { +public class LaunchBarManager2Test { private LaunchBarManager manager; private ILaunchConfigurationProvider provider; private ILaunchDescriptor descriptor; @@ -68,10 +68,14 @@ public class LaunchBarManagerTest2 { IEclipsePreferences store = new EclipsePreferences(); private ArrayList elements; private IExtension extension; - private String targetTypeId; + private String localTargetTypeId; private String descriptorTypeId; - private IRemoteConnection localtarget; + private IRemoteConnection localTarget; private String launchObject; + private IRemoteServicesManager remoteServiceManager; + private IRemoteConnection otherTarget; + private String otherTargetTypeId; + private List targets; public class FixedLaunchBarManager extends LaunchBarManager { public FixedLaunchBarManager() throws CoreException { @@ -97,6 +101,11 @@ public class LaunchBarManagerTest2 { IRemoteLaunchConfigService getRemoteLaunchConfigService() { return mock(IRemoteLaunchConfigService.class); } + + @Override + IRemoteServicesManager getRemoteServicesManager() { + return remoteServiceManager; + } }; @Before @@ -133,7 +142,7 @@ public class LaunchBarManagerTest2 { protected void init() throws CoreException { doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); - // Now inject the launch object + doReturn(targets).when(remoteServiceManager).getAllRemoteConnections(); manager.init(); } @@ -159,24 +168,6 @@ public class LaunchBarManagerTest2 { return element; } - @Test - public void testDescriptor() throws Exception { - // Create a descriptor type and inject an associated object - // Make sure the descriptor is active with the local target and proper mode - // Make sure the associated launch config is active too - // Mocking - manager.launchObjectAdded(launchObject); - assertEquals(descriptor, manager.getActiveLaunchDescriptor()); - IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); - IRemoteConnectionType localServices = remoteManager.getLocalConnectionType(); - IRemoteConnection localConnection = localServices.getConnections().get(0); - assertNotNull(localConnection); - assertEquals(localConnection, manager.getActiveLaunchTarget()); - assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); - assertNotNull(manager.getActiveLaunchMode()); - assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); - } - protected void mockLaunchObjectOnDescriptor(Object launchObject) throws CoreException { doReturn(true).when(descriptorType).ownsLaunchObject(launchObject); doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); @@ -275,6 +266,7 @@ public class LaunchBarManagerTest2 { lman = mock(ILaunchManager.class); doReturn(globalmodes.toArray(new ILaunchMode[globalmodes.size()])).when(lman).getLaunchModes(); doReturn(new ILaunchConfiguration[] {}).when(lman).getLaunchConfigurations(); + remoteServiceManager = spy(Activator.getService(IRemoteServicesManager.class)); manager = new FixedLaunchBarManager(); // mock // lc @@ -283,7 +275,7 @@ public class LaunchBarManagerTest2 { // launch config type mockLaunchModes(launchConfigType, "run", "debug"); // target - targetTypeId = mockLocalTargetElement(); + localTargetTypeId = mockLocalTargetElement(); // launch descriptor and type descriptorType = mock(ILaunchDescriptorType.class); descriptorTypeId = "descType"; @@ -294,11 +286,33 @@ public class LaunchBarManagerTest2 { provider = mock(ILaunchConfigurationProvider.class); mockProviderElement(provider); mockProviderTypes(provider); - // configType - mockConfigTypeElement(targetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + launchObject = "test"; mockLaunchObjectOnDescriptor(launchObject); - localtarget = manager.getRemoteServicesManager().getLocalConnectionType().getConnections().get(0); + localTarget = manager.getRemoteServicesManager().getLocalConnectionType().getConnections().get(0); + otherTargetTypeId = "target2"; + mockTargetElement(otherTargetTypeId); + otherTarget = mock(IRemoteConnection.class); + IRemoteConnectionType rtype = mock(IRemoteConnectionType.class); + doReturn(rtype).when(otherTarget).getConnectionType(); + doReturn(otherTargetTypeId).when(rtype).getId(); + targets = Arrays.asList(new IRemoteConnection[] { otherTarget, localTarget }); + // configType + mockConfigTypeElement(otherTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + } + + @Test + public void testDescriptor() throws Exception { + // Create a descriptor type and inject an associated object + // Make sure the descriptor is active with the local target and proper mode + // Make sure the associated launch config is active too + // Mocking + manager.launchObjectAdded(launchObject); + assertEquals(descriptor, manager.getActiveLaunchDescriptor()); + assertEquals(otherTarget, manager.getActiveLaunchTarget()); + assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); + assertNotNull(manager.getActiveLaunchMode()); + assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); } @Test @@ -384,7 +398,7 @@ public class LaunchBarManagerTest2 { manager.setActiveLaunchDescriptor(descriptor); List launchTargets = manager.getLaunchTargets(descriptor); assertEquals(1, launchTargets.size()); - assertEquals(localtarget, launchTargets.get(0)); + assertEquals(otherTarget, launchTargets.get(0)); } @Test @@ -406,7 +420,7 @@ public class LaunchBarManagerTest2 { elements.clear(); mockLocalTargetElement(); mockDescriptorTypeElement(descriptorTypeId, descriptorType); - mockConfigTypeElement(targetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + mockConfigTypeElement(localTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); @@ -579,10 +593,10 @@ public class LaunchBarManagerTest2 { aaa = mockProject("aaa"); descriptor = new ProjectLaunchDescriptor(descriptorType, aaa); // setup some stuff - targetTypeId = mockLocalTargetElement(); + localTargetTypeId = mockLocalTargetElement(); IConfigurationElement element = mockDescriptorTypeElement(descriptorTypeId, descriptorType); // configType - mockConfigTypeElement(targetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + mockConfigTypeElement(localTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); //lc = provider.createLaunchConfiguration(lman, descType.getDescriptor(aaa)); mockLCProject(launchConfig, aaa); String ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; @@ -593,7 +607,7 @@ public class LaunchBarManagerTest2 { } /** - * This scenario when provider will change mapping element->descriptor, depending on other objects involved + * Test duplicating a config. make sure it's default desc and same targets */ @Test public void testLaunchObjectAddedRemapping() throws CoreException { @@ -806,11 +820,11 @@ public class LaunchBarManagerTest2 { @Test public void testGetActiveLaunchModeFromDescActive() throws CoreException { - mockLaunchModes(launchConfigType, "run"); - ILaunchMode mode = mockLaunchModes(launchConfigType, "foo")[0]; + globalmodes.clear(); + ILaunchMode mode = mockLaunchModes(launchConfigType, "foo","run")[0]; manager.launchObjectAdded(launchObject); - manager.setActiveLaunchMode(mode); manager.setActiveLaunchDescriptor(descriptor); + manager.setActiveLaunchMode(mode); ILaunchMode resmode = manager.getActiveLaunchMode(); assertNotNull(resmode); assertEquals("foo", resmode.getIdentifier()); @@ -818,15 +832,15 @@ public class LaunchBarManagerTest2 { @Test public void testGetActiveLaunchTarget() throws CoreException { - manager.setActiveLaunchTarget(localtarget); - assertEquals(localtarget, manager.getActiveLaunchTarget()); + manager.setActiveLaunchTarget(localTarget); + assertEquals(localTarget, manager.getActiveLaunchTarget()); } @Test public void testGetLaunchTarget() throws CoreException { - final List list = manager.getLaunchTargets(Collections.singletonList(targetTypeId)); + final List list = manager.getLaunchTargets(Collections.singletonList(localTargetTypeId)); assertEquals(1, list.size()); - assertEquals(localtarget, list.get(0)); + assertEquals(localTarget, list.get(0)); } @Test @@ -837,12 +851,12 @@ public class LaunchBarManagerTest2 { @Test public void testGetLaunchConfigurationType() throws CoreException { - assertNotNull(manager.getLaunchConfigurationType(descriptor, localtarget)); + assertNotNull(manager.getLaunchConfigurationType(descriptor, otherTarget)); } @Test public void testGetLaunchConfigurationNull() throws CoreException { - assertNull(manager.getLaunchConfiguration(null, localtarget)); + assertNull(manager.getLaunchConfiguration(null, otherTarget)); } @Test @@ -853,8 +867,8 @@ public class LaunchBarManagerTest2 { @Test public void testGetLaunchConfiguration() throws CoreException { basicSetup(); - assertTrue(manager.supportsTargetType(descriptor, localtarget)); - assertNotNull(manager.getLaunchConfiguration(descriptor, localtarget)); + assertTrue(manager.supportsTargetType(descriptor, otherTarget)); + assertNotNull(manager.getLaunchConfiguration(descriptor, otherTarget)); } @Test @@ -899,7 +913,7 @@ public class LaunchBarManagerTest2 { assertNotNull(launchDescriptors[0]); assertEquals(launchConfig.getName(), launchDescriptors[0].getName()); manager.setActiveLaunchDescriptor(launchDescriptors[0]); - assertEquals(localtarget, manager.getActiveLaunchTarget()); + assertEquals(otherTarget, manager.getActiveLaunchTarget()); assertEquals(mode, manager.getActiveLaunchMode()); } @@ -916,7 +930,7 @@ public class LaunchBarManagerTest2 { assertNotNull(launchDescriptors[0]); assertEquals(lc2.getName(), launchDescriptors[0].getName()); manager.setActiveLaunchDescriptor(launchDescriptors[0]); - assertEquals(localtarget, manager.getActiveLaunchTarget()); + assertEquals(localTarget, manager.getActiveLaunchTarget()); } @Test @@ -955,9 +969,9 @@ public class LaunchBarManagerTest2 { elements.clear(); IConfigurationElement element = mockElementAndAdd("defaultConfigTarget"); doReturn(launchConfigType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); - targetTypeId = "x2"; - mockTargetElement(targetTypeId); - doReturn(targetTypeId).when(element).getAttribute("targetType"); + localTargetTypeId = "x2"; + mockTargetElement(localTargetTypeId); + doReturn(localTargetTypeId).when(element).getAttribute("targetType"); init(); manager.launchConfigurationAdded(launchConfig); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); @@ -974,7 +988,7 @@ public class LaunchBarManagerTest2 { IConfigurationElement element = mockDescriptorTypeElement("d1", descriptorType = mock(ILaunchDescriptorType.class)); doThrow(new CoreException(new Status(1, "a", "n"))).when(element).createExecutableExtension("class"); doReturn(new ILaunchConfiguration[] { launchConfig }).when(lman).getLaunchConfigurations(); - mockConfigTypeElement(targetTypeId, "d1", launchConfigType.getIdentifier()); + mockConfigTypeElement(localTargetTypeId, "d1", launchConfigType.getIdentifier()); init(); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); assertEquals(1, launchDescriptors.length); // XXX should be 0 From 17fff835d1e3208e8d47daa69310e7a21c267176 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 18 Mar 2015 16:58:35 -0400 Subject: [PATCH 019/198] launch-bar: added some guards for mode selection and API for setting mode * added API for setting mode and target without changing active descriptor * used this API in the config selector to set the mode * added guard against mismatched mode Change-Id: I58da4aac12950c21192385820683623f9e939786 Signed-off-by: Alena Laskavaia --- .../core/internal/LaunchBarManager.java | 112 +++++++++++++----- .../ui/internal/controls/ConfigSelector.java | 11 +- .../ui/internal/controls/ModeSelector.java | 3 + .../ui/internal/controls/TargetSelector.java | 10 +- 4 files changed, 98 insertions(+), 38 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 5ff1969740d..b1c4c0041e7 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -558,24 +558,28 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration descriptors.put(id, descriptor); } // store in persistent storage + storeActiveDescriptor(activeLaunchDesc); + + // Send notifications + fireActiveLaunchDescriptorChanged(); + // Set active target + syncActiveTarget(); + // Set active mode + syncActiveMode(); + } + + private void storeActiveDescriptor(ILaunchDescriptor descriptor) { Activator.trace("new active config is stored " + descriptor); - // Store the desc order + // Store the desc order, active one is the last one StringBuffer buff = new StringBuffer(); - for (Pair key : descriptors.keySet()) { + for (Pair key : descriptors.keySet()) {// TODO: this can be very long string if (buff.length() > 0) { buff.append(','); } buff.append(toString(key)); } setPreference(getPreferenceStore(), PREF_CONFIG_DESC_ORDER, buff.toString()); - - // Send notifications - updateLaunchDescriptor(activeLaunchDesc); - // Set active target - syncActiveTarget(); - // Set active mode - syncActiveMode(); } private void syncActiveTarget() throws CoreException { @@ -602,7 +606,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void syncActiveMode() throws CoreException { - if (activeLaunchDesc == null) { + if (activeLaunchDesc == null || activeLaunchTarget == null) { setActiveLaunchMode(null); return; } @@ -652,11 +656,22 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.log(e); } } - + private Preferences getPerDescriptorStore() { - if (activeLaunchDesc == null) + return getPerDescriptorStore(activeLaunchDesc); + } + + private Preferences getPerDescriptorStore(ILaunchDescriptor launchDesc) { + if (launchDesc == null) return getPreferenceStore(); - return getPreferenceStore().node(toString(getDescriptorId(activeLaunchDesc))); + String string; + try { + string = toString(getDescriptorId(launchDesc)); + } catch (Exception e) { + Activator.log(e); + string = launchDesc.getName(); + } + return getPreferenceStore().node(string); } // package private so tests can access it @@ -664,7 +679,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); } - private void updateLaunchDescriptor(ILaunchDescriptor configDesc) { + private void fireActiveLaunchDescriptorChanged() { for (Listener listener : listeners) { try { listener.activeLaunchDescriptorChanged(); @@ -695,6 +710,21 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return activeLaunchMode; } + /** + * Sets the preferred mode for the given descriptor + * + * @param desc + * @param mode + * @throws CoreException + */ + public void setLaunchMode(ILaunchDescriptor desc, ILaunchMode mode) throws CoreException { + if (desc == activeLaunchDesc) { + setActiveLaunchMode(mode); + } else { + storeLaunchMode(desc, mode); + } + } + public void setActiveLaunchMode(ILaunchMode mode) throws CoreException { if (activeLaunchMode == mode) return; @@ -702,7 +732,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration throw new IllegalStateException("Mode is not supported by descriptor"); // change mode activeLaunchMode = mode; - // notify listeners + storeLaunchMode(activeLaunchDesc, mode); + fireActiveLaunchModeChanged(); // notify listeners + } + + private void fireActiveLaunchModeChanged() { for (Listener listener : listeners) { try { listener.activeLaunchModeChanged(); @@ -710,10 +744,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.log(e); } } - if (mode == null) - return; - // store mode - setPreference(getPerDescriptorStore(), PREF_ACTIVE_LAUNCH_MODE, mode.getIdentifier()); // per desc store + } + + + private void storeLaunchMode(ILaunchDescriptor desc, ILaunchMode mode) { + if (mode != null) { + // per desc store, desc can null if will be stored globally + setPreference(getPerDescriptorStore(desc), PREF_ACTIVE_LAUNCH_MODE, mode.getIdentifier()); + } } public List getLaunchTargets(ILaunchDescriptor descriptor) throws CoreException { @@ -755,28 +793,39 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration public IRemoteConnection getActiveLaunchTarget() { return activeLaunchTarget; } + + /** + * Sets preferred target for launch descriptor + * @param desc + * @param target + * @throws CoreException + */ + public void setLaunchTarget(ILaunchDescriptor desc, IRemoteConnection target) throws CoreException { + if (desc == activeLaunchDesc) { + setActiveLaunchTarget(target); + } else { + storeLaunchTarget(desc, target); + } + } public void setActiveLaunchTarget(IRemoteConnection target) throws CoreException { if (activeLaunchTarget == target) { return; } - activeLaunchTarget = target; - launchTargetChanged(activeLaunchTarget); + storeLaunchTarget(activeLaunchDesc, target); + fireActiveLaunchTargetChanged(); // notify listeners + } + + private void storeLaunchTarget(ILaunchDescriptor desc, IRemoteConnection target) { if (target == null) { return; // no point storing null, if stored id is invalid it won't be used anyway } - - if (activeLaunchDesc == null) - return; - - // per desc store - if (supportsTargetType(activeLaunchDesc, target)) - setPreference(getPerDescriptorStore(), - PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); + // per desc store, desc can be null means it store globally + setPreference(getPerDescriptorStore(desc), PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); } - private void launchTargetChanged(IRemoteConnection target) { + private void fireActiveLaunchTargetChanged() { for (Listener listener : listeners) { try { listener.activeLaunchTargetChanged(); @@ -1015,4 +1064,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } + public DefaultLaunchDescriptorType getDefaultDescriptorType(){ + return defaultDescriptorType; + } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index e0d867da78e..d1e2df04f2a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -25,6 +25,7 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.Window; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; @@ -198,9 +199,11 @@ public class ConfigSelector extends CSelector { new Job("Create Launch Configuration") { protected IStatus run(IProgressMonitor monitor) { try { - wizard.getWorkingCopy().doSave(); - ILaunchMode lm = wizard.getLaunchMode(); - uiManager.getManager().setActiveLaunchMode(lm); + ILaunchConfiguration config = wizard.getWorkingCopy().doSave(); + final LaunchBarManager barManager = uiManager.getManager(); + final ILaunchDescriptor desc = barManager.getDefaultDescriptorType().getDescriptor(config); + barManager.setLaunchMode(desc, wizard.getLaunchMode()); + barManager.setActiveLaunchDescriptor(desc); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index da087b23b36..d3a5e3d21b7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -154,6 +154,9 @@ public class ModeSelector extends CSelector { manager.setActiveLaunchMode(mode); } catch (CoreException e) { Activator.log(e.getStatus()); + } catch (Exception e) { + // manager can throw illegal state exception hopefully we never get it + Activator.log(e); } } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index 3e8965dc45a..b5e2835843d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -68,12 +68,12 @@ public class TargetSelector extends CSelector { public Object[] getElements(Object inputElement) { LaunchBarManager manager = uiManager.getManager(); try { - List targets; - targets = manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); + List targets = manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); if (!targets.isEmpty()) { return targets.toArray(); } } catch (CoreException e) { + Activator.log(e); } return noTargets; } @@ -103,7 +103,9 @@ public class TargetSelector extends CSelector { @Override public int compare(Object o1, Object o2) { // Sort by name - return 0; + String s1 = String.valueOf(o1); + String s2 = String.valueOf(o2); + return s1.compareTo(s2); } }); } @@ -193,7 +195,7 @@ public class TargetSelector extends CSelector { try { uiManager.getManager().setActiveLaunchTarget(target); } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } } } From baa294b085fb0ded8b406fdb872de116dfba4484 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 10 Apr 2015 10:00:16 -0400 Subject: [PATCH 020/198] launch-bar: config selector - remove active config chage in last patch I did not actually remove setting active config from configSelector - it should not set it, but it will be set automatically when config is saved. Change-Id: Idcb84d2d71567f1e60cb452fb4df15ed962dded6 --- .../launchbar/ui/internal/controls/ConfigSelector.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index d1e2df04f2a..01bab01a5ea 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -17,7 +17,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -199,11 +198,12 @@ public class ConfigSelector extends CSelector { new Job("Create Launch Configuration") { protected IStatus run(IProgressMonitor monitor) { try { - ILaunchConfiguration config = wizard.getWorkingCopy().doSave(); final LaunchBarManager barManager = uiManager.getManager(); - final ILaunchDescriptor desc = barManager.getDefaultDescriptorType().getDescriptor(config); - barManager.setLaunchMode(desc, wizard.getLaunchMode()); - barManager.setActiveLaunchDescriptor(desc); + final ILaunchDescriptor desc = barManager.getDefaultDescriptorType().getDescriptor(wizard.getWorkingCopy()); + if (desc != null) { + barManager.setLaunchMode(desc, wizard.getLaunchMode()); + } + wizard.getWorkingCopy().doSave();// that would trigger active config change return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); From 013c6fa1febf680c6c618468ed7992ad33ea2c0d Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 10 Apr 2015 11:01:52 -0400 Subject: [PATCH 021/198] launch-bar: prevent event storm on initialization - prevent events dispatch during initialization of launch bar manager - also fix case when connection is renamed - we don't need to remove it Change-Id: I8ba5938afd21c9b2459563cd9e3385fb9a69f673 --- .../core/internal/LaunchBarManager.java | 119 ++++++++++-------- 1 file changed, 68 insertions(+), 51 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index b1c4c0041e7..70cd0a8f4f5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -123,6 +123,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; + + boolean initialized = false; public LaunchBarManager() { this(true); @@ -168,43 +170,47 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // When testing, call this after setting up the mocks. void init() throws CoreException { - // Fetch the desc order before the init messes it up - IEclipsePreferences store = getPreferenceStore(); - String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); - - // Load up the types - loadExtensions(); - - // Add in the default descriptor type - LaunchDescriptorTypeInfo defaultInfo = new LaunchDescriptorTypeInfo(DefaultLaunchDescriptorType.ID, - 0, defaultDescriptorType); - addDescriptorType(defaultInfo); - - // Hook up the existing launch configurations and listen - ILaunchManager launchManager = getLaunchManager(); - for (ILaunchConfiguration configuration : launchManager.getLaunchConfigurations()) { - launchConfigurationAdded(configuration); - } - launchManager.addLaunchConfigurationListener(this); - - // Reorder the descriptors based on the preference - if (!configDescIds.isEmpty()) { - String[] split = configDescIds.split(","); - ILaunchDescriptor last = null; - for (String id : split) { - Pair key = toId(id); - ILaunchDescriptor desc = descriptors.get(key); - if (desc != null) { - descriptors.remove(key); - descriptors.put(key, desc); - last = desc; + try { + // Fetch the desc order before the init messes it up + IEclipsePreferences store = getPreferenceStore(); + String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); + // Load up the types + loadExtensions(); + // Add in the default descriptor type + LaunchDescriptorTypeInfo defaultInfo = new LaunchDescriptorTypeInfo(DefaultLaunchDescriptorType.ID, + 0, defaultDescriptorType); + addDescriptorType(defaultInfo); + // Hook up the existing launch configurations and listen + ILaunchManager launchManager = getLaunchManager(); + for (ILaunchConfiguration configuration : launchManager.getLaunchConfigurations()) { + launchConfigurationAdded(configuration); + } + launchManager.addLaunchConfigurationListener(this); + // Reorder the descriptors based on the preference + if (!configDescIds.isEmpty()) { + String[] split = configDescIds.split(","); + ILaunchDescriptor last = null; + for (String id : split) { + Pair key = toId(id); + ILaunchDescriptor desc = descriptors.get(key); + if (desc != null) { + descriptors.remove(key); + descriptors.put(key, desc); + last = desc; + } + } + // Set the active desc, with MRU, it should be the last one + if (last != null) { + setActiveLaunchDescriptor(last); } } - // Set the active desc, with MRU, it should be the last one - if (last != null) { - setActiveLaunchDescriptor(last); - } + } finally { + initialized = true; } + fireActiveLaunchDescriptorChanged(); + fireActiveLaunchTargetChanged(); + fireActiveLaunchModeChanged(); + fireLaunchTargetsChanged(); } private void loadExtensions() throws CoreException { @@ -680,6 +686,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void fireActiveLaunchDescriptorChanged() { + if (!initialized) return; for (Listener listener : listeners) { try { listener.activeLaunchDescriptorChanged(); @@ -737,6 +744,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void fireActiveLaunchModeChanged() { + if (!initialized) return; for (Listener listener : listeners) { try { listener.activeLaunchModeChanged(); @@ -826,6 +834,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void fireActiveLaunchTargetChanged() { + if (!initialized) return; for (Listener listener : listeners) { try { listener.activeLaunchTargetChanged(); @@ -1027,38 +1036,46 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.log(e); } break; - case RemoteConnectionChangeEvent.CONNECTION_REMOVED: - case RemoteConnectionChangeEvent.CONNECTION_RENAMED: try { launchTargetRemoved(event.getConnection()); } catch (CoreException e) { Activator.log(e); } + break; + case RemoteConnectionChangeEvent.CONNECTION_RENAMED: + fireLaunchTargetsChanged(); + break; + default: + break; + } + } + + private void fireLaunchTargetsChanged() { + if (!initialized) return; + for (Listener listener : listeners) { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); + } } } private void launchTargetAdded(IRemoteConnection target) throws CoreException { - for (Listener listener : listeners) { - try { - listener.launchTargetsChanged(); - } catch (Exception e) { - Activator.log(e); - } - } - if (activeLaunchDesc != null && activeLaunchTarget == null && supportsTargetType(activeLaunchDesc, target)) { + if (!initialized) + return; + fireLaunchTargetsChanged(); + // if we added new target we probably want to use it + if (activeLaunchDesc != null && supportsTargetType(activeLaunchDesc, target)) { setActiveLaunchTarget(target); } } private void launchTargetRemoved(IRemoteConnection target) throws CoreException { - for (Listener listener : listeners) { - try { - listener.launchTargetsChanged(); - } catch (Exception e) { - Activator.log(e); - } - } + if (!initialized) + return; + fireLaunchTargetsChanged(); if (activeLaunchTarget == target) { setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); } From f2b778e3c7a0371346a5bb12e43e1e2a7e171d3c Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 27 Apr 2015 10:35:54 -0400 Subject: [PATCH 022/198] launchbar: active remote connection is not persisted in the remote services - if you select target for given launch config and restart IDE it is not persistent, because it queries remote services and it has not been set. Moving setting of target in the correct place Note: if launch config is not created yet it would not be create and mapping would not be set but it would be persisted by launch bar itself - also added protection against null listener Change-Id: I41f8651ba2251ca9f841450fc1f511643bfde681 --- .../core/internal/LaunchBarManager.java | 34 +++++++++++++------ .../core/internal/LaunchBarManager2Test.java | 5 +-- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 70cd0a8f4f5..9049d48924e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -831,6 +831,15 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } // per desc store, desc can be null means it store globally setPreference(getPerDescriptorStore(desc), PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); + // Also we have to store this in remote connection service + try { + ILaunchConfiguration config = getLaunchConfiguration(desc, target, false); + if (config != null) { + remoteLaunchConfigService.setActiveConnection(config, target); + } + } catch (CoreException e) { + Activator.log(e); + } } private void fireActiveLaunchTargetChanged() { @@ -854,18 +863,16 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { - ILaunchConfiguration activeConfig = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); - if (activeConfig != null) { - // Save the config -> target mapping - // TODO: seems to be weird place for setting this - remoteLaunchConfigService.setActiveConnection(activeConfig, activeLaunchTarget); - } - return activeConfig; + return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); } - // Don't call this to get the active launch config. Use getActiveLaunchConfiguration(). It ensures that config -> target - // mapping is saved. + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + return getLaunchConfiguration(descriptor, target, true); + } + + private ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + boolean create) throws CoreException { if (descriptor == null) { return null; } @@ -884,11 +891,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration configMap = new HashMap<>(); configs.put(descriptor, configMap); } - + if (create == false) + return null; // Not found, create, store and return it ILaunchConfiguration config = configProvider.createLaunchConfiguration(getLaunchManager(), descriptor); if (config != null) { configMap.put(configProvider, config); + // since new LC is created we need to associate it with remote target + storeLaunchTarget(descriptor, target); return config; } } @@ -897,10 +907,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } public void addListener(Listener listener) { + if (listener == null) + return; listeners.add(listener); } public void removeListener(Listener listener) { + if (listener == null) + return; listeners.remove(listener); } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 307b2ad8447..c1597e1b246 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -185,6 +185,7 @@ public class LaunchBarManager2Test { ILaunchConfiguration lc = mock(ILaunchConfiguration.class); doReturn(string).when(lc).getName(); doReturn(lctype2).when(lc).getType(); + doReturn("").when(lc).getAttribute(eq(ORIGINAL_NAME), eq("")); return lc; } @@ -580,7 +581,7 @@ public class LaunchBarManager2Test { return "pbtype"; } } - + String ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; protected void projectMappingSetup() throws CoreException { descriptorType = new ProjectBasedLaunchDescriptorType(); descriptorTypeId = ((ProjectBasedLaunchDescriptorType) descriptorType).getId(); @@ -599,7 +600,7 @@ public class LaunchBarManager2Test { mockConfigTypeElement(localTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); //lc = provider.createLaunchConfiguration(lman, descType.getDescriptor(aaa)); mockLCProject(launchConfig, aaa); - String ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; + mockLCAttribute(launchConfig, ORIGINAL_NAME, aaa.getName()); mockProviderElement(provider); assertEquals(0, manager.getLaunchDescriptors().length); From e8eec12ec4e0c1abba562608642874c27ac79292 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 1 May 2015 12:07:06 -0400 Subject: [PATCH 023/198] Bug 466089 - Stop only launches for the active config. Turns out to be pretty easy, just check the config for each launch and stop the ones that match the active config. Change-Id: Ib74a31405382b2d1996b257f7e8ad1d85a23e6c6 --- .../commands/StopActiveCommandHandler.java | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index f8ed9272654..35f36c6ca97 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -14,6 +14,7 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -22,21 +23,23 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; -import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; public class StopActiveCommandHandler extends AbstractHandler { - private ILaunchBarManager launchBarManager; + private LaunchBarManager launchBarManager; public StopActiveCommandHandler() { - launchBarManager = Activator.getService(ILaunchBarManager.class); + launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); } @Override - public Object execute(ExecutionEvent event) throws ExecutionException { + public Object execute(ExecutionEvent event) throws ExecutionException { stop(); return null; - } + } public void stop() { stopBuild(); @@ -48,16 +51,23 @@ public class StopActiveCommandHandler extends AbstractHandler { if (activeLaunches != null && activeLaunches.length > 0) { new Job("Stopping launches") { protected IStatus run(IProgressMonitor monitor) { - // TODO only stop the launches for the active launch descriptor - // Not sure we have the API to map that out yet. - for (ILaunch launch : activeLaunches) { - try { - launch.terminate(); - } catch (DebugException e) { - return e.getStatus(); + try { + ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration(); + for (ILaunch launch : activeLaunches) { + ILaunchConfiguration launchConfig = launch.getLaunchConfiguration(); + if (launchConfig.equals(activeConfig)) { + launch.terminate(); + } else if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { + // There are evil delegates that use a working copy for scratch storage + if (((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal().equals(activeConfig)) { + launch.terminate(); + } + } } + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); } - return Status.OK_STATUS; }; }.schedule(); } From 3c33b772b80df21ac7e181ec885f89ca300232bf Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 1 May 2015 13:41:52 -0400 Subject: [PATCH 024/198] Bug 466095 - Externalize Strings and minimize warnings. Removed dead code and minimize use of internal interfaces. Change-Id: Ief9c29bff721940bf5a173dfacf60b715691dcf7 --- .../core/LaunchConfigurationProvider.java | 4 +- .../core/ProjectLaunchDescriptor.java | 4 +- .../launchbar/core/internal/Activator.java | 8 +- .../internal/DefaultLaunchDescriptor.java | 4 +- .../internal/DefaultLaunchDescriptorType.java | 2 +- .../core/internal/LaunchBarManager.java | 80 +++++++++---------- .../internal/LaunchConfigProviderInfo.java | 4 +- .../core/internal/LaunchConfigTypeInfo.java | 6 +- .../internal/LaunchDescriptorTypeInfo.java | 6 +- .../core/internal/LaunchTargetTypeInfo.java | 10 +-- .../launchbar/core/internal/Messages.java | 3 + .../core/internal/messages.properties | 3 + .../launchbar/ui/ILaunchBarUIConstants.java | 2 +- .../launchbar/ui/internal/Activator.java | 24 +++--- .../ui/internal/LaunchBarPreferencePage.java | 4 +- .../ui/internal/LaunchBarUIManager.java | 79 ++---------------- .../launchbar/ui/internal/Messages.java | 37 +++++++++ .../commands/StopActiveCommandHandler.java | 6 +- .../ui/internal/controls/CSelector.java | 16 ++-- .../ui/internal/controls/ConfigSelector.java | 10 +-- .../ui/internal/controls/EditButton.java | 7 +- .../ui/internal/controls/FilterControl.java | 6 +- .../internal/controls/LaunchBarControl.java | 2 +- .../controls/LaunchBarListViewer.java | 40 ++-------- .../ui/internal/controls/ModeSelector.java | 19 ++--- .../LaunchConfigurationEditDialog.java | 15 ++-- .../dialogs/NewLaunchConfigEditPage.java | 18 +++-- .../dialogs/NewLaunchConfigModePage.java | 15 ++-- .../dialogs/NewLaunchConfigTypePage.java | 7 +- .../dialogs/NewLaunchConfigWizard.java | 3 +- .../launchbar/ui/internal/messages.properties | 37 +++++++++ .../core/internal/LaunchBarManager2Test.java | 1 + .../core/internal/LaunchBarManagerTest.java | 2 +- 33 files changed, 242 insertions(+), 242 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java index f95a82f7892..2d423398597 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java @@ -23,7 +23,7 @@ import org.eclipse.launchbar.core.internal.Activator; public abstract class LaunchConfigurationProvider implements ILaunchConfigurationProvider { // Used to make sure this is the config we've created - protected static final String ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; + protected static final String ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ @Override public ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException { @@ -71,7 +71,7 @@ public abstract class LaunchConfigurationProvider implements ILaunchConfiguratio return false; // we created it if it has the same name we created it with - return configuration.getAttribute(ORIGINAL_NAME, "").equals(configuration.getName()); + return configuration.getAttribute(ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java index e8474fe19fd..b2ce2c871f1 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java @@ -28,9 +28,9 @@ public class ProjectLaunchDescriptor extends PlatformObject implements ILaunchDe } @Override - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + public T getAdapter(Class adapter) { if (IProject.class.equals(adapter)) { - return project; + return adapter.cast(project); } return super.getAdapter(adapter); } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index 2e6068c060b..e8f1b67aa21 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -21,7 +21,7 @@ import org.osgi.framework.ServiceReference; public class Activator extends Plugin { - public static final String PLUGIN_ID = "org.eclipse.launchbar.core"; + public static final String PLUGIN_ID = "org.eclipse.launchbar.core"; //$NON-NLS-1$ private static Activator plugin; public void start(BundleContext bundleContext) throws Exception { @@ -71,10 +71,10 @@ public class Activator extends Plugin { } private static final String DEBUG_ONE = - PLUGIN_ID + "/debug/launchbar"; + PLUGIN_ID + "/debug/launchbar"; //$NON-NLS-1$ public static void trace(String str) { - if (plugin == null || (plugin.isDebugging() && "true".equalsIgnoreCase(Platform.getDebugOption(DEBUG_ONE)))) - System.out.println("launchbar: " + str); + if (plugin == null || (plugin.isDebugging() && "true".equalsIgnoreCase(Platform.getDebugOption(DEBUG_ONE)))) //$NON-NLS-1$ + System.out.println("launchbar: " + str); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java index b1789b8209e..50cc5cbb689 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java @@ -30,9 +30,9 @@ public class DefaultLaunchDescriptor extends PlatformObject implements ILaunchDe } @Override - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + public T getAdapter(Class adapter) { if (ILaunchConfiguration.class.equals(adapter)) { - return configuration; + return adapter.cast(configuration); } return super.getAdapter(adapter); } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index 6467ae5c6f4..38c9c0024bb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -13,7 +13,7 @@ import org.eclipse.launchbar.core.ILaunchDescriptorType; */ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { - public static final String ID = Activator.PLUGIN_ID + ".descriptorType.default"; + public static final String ID = Activator.PLUGIN_ID + ".descriptorType.default"; //$NON-NLS-1$ private Map descriptors = new HashMap<>(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 9049d48924e..c17331bbe3c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -120,9 +120,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration private IRemoteConnection activeLaunchTarget; // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; - private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; - private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; - private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; + private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; //$NON-NLS-1$ + private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; //$NON-NLS-1$ + private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; //$NON-NLS-1$ boolean initialized = false; @@ -135,7 +135,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration remoteServicesManager.addRemoteConnectionChangeListener(this); if (doInit) { - new Job("Launch Bar Initialization") { + new Job(Messages.LaunchBarManager_0) { @Override protected IStatus run(IProgressMonitor monitor) { try { @@ -160,7 +160,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // To allow override by tests IExtensionPoint getExtensionPoint() throws CoreException { - return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); + return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); //$NON-NLS-1$ } // To allow override by tests @@ -173,7 +173,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration try { // Fetch the desc order before the init messes it up IEclipsePreferences store = getPreferenceStore(); - String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); + String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); //$NON-NLS-1$ // Load up the types loadExtensions(); // Add in the default descriptor type @@ -188,7 +188,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration launchManager.addLaunchConfigurationListener(this); // Reorder the descriptors based on the preference if (!configDescIds.isEmpty()) { - String[] split = configDescIds.split(","); + String[] split = configDescIds.split(","); //$NON-NLS-1$ ILaunchDescriptor last = null; for (String id : split) { Pair key = toId(id); @@ -222,17 +222,17 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (IConfigurationElement element : extension.getConfigurationElements()) { try { String elementName = element.getName(); - if (elementName.equals("descriptorType")) { + if (elementName.equals("descriptorType")) { //$NON-NLS-1$ LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(element); addDescriptorType(typeInfo); - } else if (elementName.equals("targetType")) { + } else if (elementName.equals("targetType")) { //$NON-NLS-1$ LaunchTargetTypeInfo info = new LaunchTargetTypeInfo(element); targetTypes.put(info.getId(), info); - } else if (elementName.equals("configType")) { - String descriptorTypeId = element.getAttribute("descriptorType"); - String targetTypeId = element.getAttribute("targetType"); - String launchConfigTypeId = element.getAttribute("launchConfigurationType"); - String isDefaultStr = element.getAttribute("isDefault"); + } else if (elementName.equals("configType")) { //$NON-NLS-1$ + String descriptorTypeId = element.getAttribute("descriptorType"); //$NON-NLS-1$ + String targetTypeId = element.getAttribute("targetType"); //$NON-NLS-1$ + String launchConfigTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ + String isDefaultStr = element.getAttribute("isDefault"); //$NON-NLS-1$ boolean isDefault = isDefaultStr != null ? Boolean.parseBoolean(isDefaultStr) : false; // add to desc type -> target type mapping @@ -258,13 +258,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // also assume that the target type works for the config type addDefaultConfigTargetType(launchConfigTypeId, targetTypeId, isDefault); - } else if (elementName.equals("configProvider")) { + } else if (elementName.equals("configProvider")) { //$NON-NLS-1$ LaunchConfigProviderInfo info = new LaunchConfigProviderInfo(element); configProviders.put(info.getLaunchConfigTypeId(), info); - } else if (elementName.equals("defaultConfigTarget")) { - String configTypeId = element.getAttribute("launchConfigurationType"); - String targetTypeId = element.getAttribute("targetType"); - String isDefaultStr = element.getAttribute("isDefault"); + } else if (elementName.equals("defaultConfigTarget")) { //$NON-NLS-1$ + String configTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ + String targetTypeId = element.getAttribute("targetType"); //$NON-NLS-1$ + String isDefaultStr = element.getAttribute("isDefault"); //$NON-NLS-1$ boolean isDefault = isDefaultStr != null ? Boolean.parseBoolean(isDefaultStr) : false; addDefaultConfigTargetType(configTypeId, targetTypeId, isDefault); } @@ -279,8 +279,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (IConfigurationElement element : extension.getConfigurationElements()) { try { String elementName = element.getName(); - if (elementName.equals("objectProvider")) { - ILaunchObjectProvider objectProvider = (ILaunchObjectProvider) element.createExecutableExtension("class"); + if (elementName.equals("objectProvider")) { //$NON-NLS-1$ + ILaunchObjectProvider objectProvider = (ILaunchObjectProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ addObjectProvider(objectProvider); } } catch (Exception e) { @@ -309,7 +309,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration orderedDescriptorTypes.add(typeInfo); } - Activator.trace("registered descriptor type " + typeInfo.getId()); + Activator.trace("registered descriptor type " + typeInfo.getId()); //$NON-NLS-1$ } private void addDefaultConfigTargetType(String configTypeId, String targetTypeId, boolean isDefault) { @@ -371,7 +371,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private String toString(Pair key) { - return key.getFirst() + ":" + key.getSecond(); + return key.getFirst() + ":" + key.getSecond(); //$NON-NLS-1$ } private Pair toId(String key) { @@ -476,7 +476,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public ILaunchDescriptor launchObjectAdded(Object launchObject) { - Activator.trace("launch object added " + launchObject); + Activator.trace("launch object added " + launchObject); //$NON-NLS-1$ ILaunchDescriptor desc = objectDescriptorMap.get(launchObject); if (desc != null) return desc; @@ -498,7 +498,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public void launchObjectRemoved(Object launchObject) throws CoreException { - Activator.trace("launch object removed " + launchObject); + Activator.trace("launch object removed " + launchObject); //$NON-NLS-1$ ILaunchDescriptor desc = objectDescriptorMap.get(launchObject); removeDescriptor(launchObject, desc); } @@ -545,16 +545,16 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws CoreException { - Activator.trace("set active descriptor " + descriptor); + Activator.trace("set active descriptor " + descriptor); //$NON-NLS-1$ if (activeLaunchDesc == descriptor) { // Sync since targets could be changed since last time (and modes theoretically too) syncActiveTarget(); syncActiveMode(); - Activator.trace("resync for " + descriptor); + Activator.trace("resync for " + descriptor); //$NON-NLS-1$ return; } if (descriptor != null && !descriptors.containsValue(descriptor)) - throw new IllegalStateException("Active descriptor must be in the map of descriptors"); + throw new IllegalStateException(Messages.LaunchBarManager_1); if (descriptor == null) descriptor = getLastUsedDescriptor(); // do not set to null unless no descriptors activeLaunchDesc = descriptor; @@ -575,7 +575,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void storeActiveDescriptor(ILaunchDescriptor descriptor) { - Activator.trace("new active config is stored " + descriptor); + Activator.trace("new active config is stored " + descriptor); //$NON-NLS-1$ // Store the desc order, active one is the last one StringBuffer buff = new StringBuffer(); @@ -624,8 +624,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration String modeNames[] = new String[] { storedModeId, lastActiveModeId, - "run", - "debug", + "run", //$NON-NLS-1$ + "debug", //$NON-NLS-1$ supportedModes[0].getIdentifier() }; for (int i = 0; i < modeNames.length; i++) { @@ -736,7 +736,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration if (activeLaunchMode == mode) return; if (activeLaunchDesc != null && mode != null && !supportsMode(mode)) - throw new IllegalStateException("Mode is not supported by descriptor"); + throw new IllegalStateException(Messages.LaunchBarManager_2); // change mode activeLaunchMode = mode; storeLaunchMode(activeLaunchDesc, mode); @@ -920,7 +920,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public void launchConfigurationAdded(ILaunchConfiguration configuration) { - Activator.trace("launch config added " + configuration); + Activator.trace("launch config added " + configuration); //$NON-NLS-1$ try { LaunchConfigProviderInfo info = configProviders.get(configuration.getType().getIdentifier()); if (info != null) { @@ -936,7 +936,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } configMap.put(provider, configuration); } - Activator.trace("launch config claimed by " + provider); + Activator.trace("launch config claimed by " + provider); //$NON-NLS-1$ return; } } @@ -945,7 +945,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.log(e); } - Activator.trace("launch config not claimed"); + Activator.trace("launch config not claimed"); //$NON-NLS-1$ try { ILaunchDescriptor desc = defaultDescriptorType.getDescriptor(configuration); addDescriptor(configuration, desc); @@ -956,7 +956,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - Activator.trace("launch config removed " + configuration); + Activator.trace("launch config removed " + configuration); //$NON-NLS-1$ // Is there any way this method is called when a LC still exists??? This may be dead code. // configuration.getType() will fail when !configuration.exists() @@ -966,7 +966,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration if (info != null) { ILaunchConfigurationProvider provider = info.getProvider(); if (provider.launchConfigurationRemoved(configuration)) { - Activator.trace("launch config removed by " + provider); + Activator.trace("launch config removed by " + provider); //$NON-NLS-1$ return; } } @@ -975,7 +975,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - Activator.trace("launch config not claimed"); + Activator.trace("launch config not claimed"); //$NON-NLS-1$ ILaunchDescriptor desc = objectDescriptorMap.get(configuration); if (desc == null) { /* WARNING: This is slow. Call only as a last resort */ @@ -990,7 +990,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration final ILaunchConfigurationProvider provider = e2.getKey(); try { provider.launchConfigurationRemoved(e2.getValue()); - Activator.trace("launch config removed by " + provider); + Activator.trace("launch config removed by " + provider); //$NON-NLS-1$ } catch (Throwable e) { Activator.log(e); } @@ -1007,7 +1007,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (ILaunchConfigurationProvider provider : configMap.keySet()) { try { if (provider.launchConfigurationRemoved(configuration)) { - Activator.trace("launch config removed by " + provider); + Activator.trace("launch config removed by " + provider); //$NON-NLS-1$ return; } } catch (Throwable e) { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 87b0bf244d1..d7b4b51c6e6 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -10,7 +10,7 @@ public class LaunchConfigProviderInfo { private ILaunchConfigurationProvider provider; public LaunchConfigProviderInfo(IConfigurationElement element) { - this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); + this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ this.element = element; } @@ -20,7 +20,7 @@ public class LaunchConfigProviderInfo { public ILaunchConfigurationProvider getProvider() throws CoreException { if (provider == null) { - provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); + provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ element = null; } return provider; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java index c124378ef01..181dda659ca 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java @@ -8,9 +8,9 @@ public class LaunchConfigTypeInfo { private final String launchConfigTypeId; public LaunchConfigTypeInfo(IConfigurationElement element) { - this.descriptorTypeId = element.getAttribute("descriptorType"); - this.targetTypeId = element.getAttribute("targetType"); - this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); + this.descriptorTypeId = element.getAttribute("descriptorType"); //$NON-NLS-1$ + this.targetTypeId = element.getAttribute("targetType"); //$NON-NLS-1$ + this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ } public String getDescriptorTypeId() { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java index 20ed22b6985..787b077d281 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -11,8 +11,8 @@ public class LaunchDescriptorTypeInfo { private ILaunchDescriptorType type; public LaunchDescriptorTypeInfo(IConfigurationElement element) { - this.id = element.getAttribute("id"); - String priorityStr = element.getAttribute("priority"); + this.id = element.getAttribute("id"); //$NON-NLS-1$ + String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$ this.priority = 1; if (priorityStr != null) { try { @@ -42,7 +42,7 @@ public class LaunchDescriptorTypeInfo { public ILaunchDescriptorType getType() throws CoreException { if (type == null) { - type = (ILaunchDescriptorType) element.createExecutableExtension("class"); + type = (ILaunchDescriptorType) element.createExecutableExtension("class"); //$NON-NLS-1$ element = null; } return type; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java index 4b8b1020248..4d53980ba77 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java @@ -15,22 +15,22 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.remote.core.IRemoteConnection; class LaunchTargetTypeInfo { - private static final String ANY = ""; + private static final String ANY = ""; //$NON-NLS-1$ private final String id; private final String connectionTypeId; private String osname; private String osarch; public LaunchTargetTypeInfo(IConfigurationElement ce) { - id = ce.getAttribute("id"); - connectionTypeId = ce.getAttribute("connectionTypeId"); + id = ce.getAttribute("id"); //$NON-NLS-1$ + connectionTypeId = ce.getAttribute("connectionTypeId"); //$NON-NLS-1$ if (id == null || connectionTypeId == null) throw new NullPointerException(); - osname = ce.getAttribute("osname"); + osname = ce.getAttribute("osname"); //$NON-NLS-1$ if (osname == null) { osname = ANY; } - osarch = ce.getAttribute("osarch"); + osarch = ce.getAttribute("osarch"); //$NON-NLS-1$ if (osarch == null) { osarch = ANY; } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java index b1b6d9bb67f..a4d1e8a221b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java @@ -14,6 +14,9 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.launchbar.core.internal.messages"; //$NON-NLS-1$ + public static String LaunchBarManager_0; + public static String LaunchBarManager_1; + public static String LaunchBarManager_2; public static String LocalTarget_name; static { // initialize resource bundle diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties index 2f8d25fcb68..f99096c67c2 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties @@ -1,3 +1,5 @@ +LaunchBarManager_1=Active descriptor must be in the map of descriptors +LaunchBarManager_2=Mode is not supported by descriptor ################################################################################ # Copyright (c) 2014 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials @@ -9,4 +11,5 @@ # Doug Schaefer ################################################################################ +LaunchBarManager_0=Launch Bar Initialization LocalTarget_name=Local Machine diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java index f5bb4321030..d41cd7e49df 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java @@ -15,6 +15,6 @@ public interface ILaunchBarUIConstants { /** * Parameter name for the edit target command. */ - public static final String TARGET_NAME = "targetName"; + public static final String TARGET_NAME = "targetName"; //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index bc27da5b71b..c4c884e8e5a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -41,19 +41,19 @@ public class Activator extends AbstractUIPlugin { public static final String PLUGIN_ID = "org.eclipse.launchbar.ui"; //$NON-NLS-1$ // Images - public static final String IMG_BUTTON_BUILD = "build"; - public static final String IMG_BUTTON_LAUNCH = "launch"; - public static final String IMG_BUTTON_STOP = "stop"; + public static final String IMG_BUTTON_BUILD = "build"; //$NON-NLS-1$ + public static final String IMG_BUTTON_LAUNCH = "launch"; //$NON-NLS-1$ + public static final String IMG_BUTTON_STOP = "stop"; //$NON-NLS-1$ // Command ids - public static final String CMD_BUILD = PLUGIN_ID + ".command.buildActive"; - public static final String CMD_LAUNCH = PLUGIN_ID + ".command.launchActive"; - public static final String CMD_STOP = PLUGIN_ID + ".command.stop"; - public static final String CMD_CONFIG = PLUGIN_ID + ".command.configureActiveLaunch"; + public static final String CMD_BUILD = PLUGIN_ID + ".command.buildActive"; //$NON-NLS-1$ + public static final String CMD_LAUNCH = PLUGIN_ID + ".command.launchActive"; //$NON-NLS-1$ + public static final String CMD_STOP = PLUGIN_ID + ".command.stop"; //$NON-NLS-1$ + public static final String CMD_CONFIG = PLUGIN_ID + ".command.configureActiveLaunch"; //$NON-NLS-1$ // Preference ids - public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; - public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; + public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$ + public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$ // The shared instance private static Activator plugin; @@ -72,9 +72,9 @@ public class Activator extends AbstractUIPlugin { plugin = this; ImageRegistry imageRegistry = getImageRegistry(); - imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); - imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); - imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ } public void stop(BundleContext context) throws Exception { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java index 7a8fbb3951f..9b7ef52bb40 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java @@ -15,12 +15,12 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement @Override public void init(IWorkbench workbench) { setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Preferences for the Launch Bar."); + setDescription(Messages.LaunchBarPreferencePage_0); } @Override protected void createFieldEditors() { - addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, "Enable the Launch Bar.", getFieldEditorParent())); + addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent())); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 68e5a5f7bec..904e16c9499 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal; -import java.net.MalformedURLException; -import java.net.URL; import java.util.HashMap; import java.util.Map; @@ -20,56 +18,28 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.ExecutableExtension; import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.ui.IHoverProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.INewWizard; public class LaunchBarUIManager { - LaunchBarManager manager; - Map> descriptorLabelProviders = new HashMap<>(); - Map targetContributions = new HashMap<>(); - - private final LaunchBarTargetContribution DEFAULT_CONTRIBUTION = new LaunchBarTargetContribution(null, null, null, null, - null, null); + private LaunchBarManager manager; + private Map> descriptorLabelProviders = new HashMap<>(); public LaunchBarUIManager(LaunchBarManager manager) { this.manager = manager; - IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); + IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); //$NON-NLS-1$ IExtension[] extensions = point.getExtensions(); for (IExtension extension : extensions) { for (IConfigurationElement element : extension.getConfigurationElements()) { String elementName = element.getName(); - if (elementName.equals("descriptorUI")) { - String descriptorTypeId = element.getAttribute("descriptorTypeId"); - ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); + if (elementName.equals("descriptorUI")) { //$NON-NLS-1$ + String descriptorTypeId = element.getAttribute("descriptorTypeId"); //$NON-NLS-1$ + ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); //$NON-NLS-1$ descriptorLabelProviders.put(descriptorTypeId, labelProvider); - } else if (elementName.equals("targetUI")) { - String targetTypeId = element.getAttribute("targetTypeId"); - String targetName = element.getAttribute("name"); - String iconStr = element.getAttribute("icon"); - ExecutableExtension labelProvider = new ExecutableExtension(element, "labelProvider"); - - ExecutableExtension hoverProvider = null; - if (element.getAttribute("hoverProvider") != null) { - hoverProvider = new ExecutableExtension(element, "hoverProvider"); - } - - String editCommandId = element.getAttribute("editCommandId"); - - ExecutableExtension newWizard = null; - if (element.getAttribute("newWizard") != null) { - newWizard = new ExecutableExtension(element, "newWizard"); - } - - targetContributions.put(targetTypeId, new LaunchBarTargetContribution(targetName, iconStr, - labelProvider, hoverProvider, editCommandId, newWizard)); } } } @@ -84,41 +54,4 @@ public class LaunchBarUIManager { return provider != null ? provider.get() : null; } - private class LaunchBarTargetContribution { - String name; - String iconStr; - Image icon; - ExecutableExtension labelProvider; - ExecutableExtension hoverProvider; - String editCommandId; - ExecutableExtension newWizard; - - LaunchBarTargetContribution(String name, String iconStr, - ExecutableExtension labelProvider, - ExecutableExtension hoverProvider, - String editCommand, - ExecutableExtension newWizard) { - this.name = name; - this.iconStr = iconStr; - this.icon = null; - this.labelProvider = labelProvider; - this.hoverProvider = hoverProvider; - this.editCommandId = editCommand; - this.newWizard = newWizard; - } - - Image getIcon() { - if (icon == null) { - if (iconStr != null && !iconStr.isEmpty()) { - try { - icon = ImageDescriptor.createFromURL(new URL(iconStr)).createImage(); - } catch (MalformedURLException e) { - Activator.log(e); - } - } - } - return icon; - } - - } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index c230dfc30a7..97d8fbc75ce 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -14,9 +14,46 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.launchbar.ui.internal.messages"; //$NON-NLS-1$ + public static String ConfigSelector_0; + public static String ConfigSelector_1; + public static String ConfigSelector_2; + public static String ConfigSelector_3; + public static String CSelector_0; + public static String CSelector_1; + public static String EditButton_0; + public static String FilterControl_0; + public static String FilterControl_1; + public static String LaunchBarControl_0; public static String LaunchBarControl_Build; public static String LaunchBarControl_Launch; public static String LaunchBarControl_Stop; + public static String LaunchBarListViewer_0; + public static String LaunchBarPreferencePage_0; + public static String LaunchBarPreferencePage_1; + public static String LaunchConfigurationEditDialog_0; + public static String LaunchConfigurationEditDialog_1; + public static String LaunchConfigurationEditDialog_2; + public static String LaunchConfigurationEditDialog_3; + public static String LaunchConfigurationEditDialog_4; + public static String LaunchConfigurationEditDialog_5; + public static String LaunchConfigurationEditDialog_6; + public static String ModeSelector_0; + public static String NewLaunchConfigEditPage_0; + public static String NewLaunchConfigEditPage_1; + public static String NewLaunchConfigEditPage_2; + public static String NewLaunchConfigEditPage_3; + public static String NewLaunchConfigEditPage_4; + public static String NewLaunchConfigEditPage_5; + public static String NewLaunchConfigEditPage_6; + public static String NewLaunchConfigModePage_0; + public static String NewLaunchConfigModePage_1; + public static String NewLaunchConfigModePage_2; + public static String NewLaunchConfigTypePage_0; + public static String NewLaunchConfigTypePage_1; + public static String NewLaunchConfigTypePage_2; + public static String NewLaunchConfigWizard_0; + public static String StopActiveCommandHandler_0; + public static String StopActiveCommandHandler_1; public static String TargetSelector_CreateNewTarget; static { // initialize resource bundle diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index 35f36c6ca97..a176c188a37 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -20,13 +20,13 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; public class StopActiveCommandHandler extends AbstractHandler { private LaunchBarManager launchBarManager; @@ -49,7 +49,7 @@ public class StopActiveCommandHandler extends AbstractHandler { protected void stopActiveLaunches() { final ILaunch[] activeLaunches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); if (activeLaunches != null && activeLaunches.length > 0) { - new Job("Stopping launches") { + new Job(Messages.StopActiveCommandHandler_0) { protected IStatus run(IProgressMonitor monitor) { try { ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration(); @@ -74,7 +74,7 @@ public class StopActiveCommandHandler extends AbstractHandler { } protected void stopBuild() { - Job job = new Job("Stopping build") { + Job job = new Job(Messages.StopActiveCommandHandler_1) { @Override protected IStatus run(IProgressMonitor progress) { // stops all builds diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 6ede13f173c..f8361fad94f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -24,6 +24,7 @@ import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.launchbar.ui.IHoverProvider; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; @@ -98,12 +99,12 @@ public abstract class CSelector extends Composite { final Object eventSource = e.getSource(); if ((eventSource == currentLabel || eventSource == buttonComposite || eventSource == currentIcon)) { if (hoverProvider.displayHover(selection)) { - buttonComposite.setToolTipText(""); + buttonComposite.setToolTipText(""); //$NON-NLS-1$ if (currentLabel != null) { - currentLabel.setToolTipText(""); + currentLabel.setToolTipText(""); //$NON-NLS-1$ } if (currentIcon != null) { - currentIcon.setToolTipText(""); + currentIcon.setToolTipText(""); //$NON-NLS-1$ } toolTipWasModified = true; } @@ -131,12 +132,13 @@ public abstract class CSelector extends Composite { } }; - protected boolean isFocusAncestor(Control control) { + protected boolean myIsFocusAncestor(Control control) { while (control != null && control != this && !(control instanceof Shell)) { control = control.getParent(); } return control == this; } + private Listener focusOutListener = new Listener() { private Job closingJob; @@ -146,7 +148,7 @@ public abstract class CSelector extends Composite { case SWT.FocusIn: if (closingJob != null) closingJob.cancel(); - if (event.widget instanceof Control && isFocusAncestor((Control) event.widget)) { + if (event.widget instanceof Control && myIsFocusAncestor((Control) event.widget)) { break; // not closing } if (!isPopUpInFocus()) { @@ -159,7 +161,7 @@ public abstract class CSelector extends Composite { // to another child, lets schedule a job to wait before we close if (closingJob != null) closingJob.cancel(); - closingJob = new Job("Closing popup") { + closingJob = new Job(Messages.CSelector_0) { @Override protected IStatus run(IProgressMonitor monitor) { if (monitor.isCanceled()) @@ -246,7 +248,7 @@ public abstract class CSelector extends Composite { public void setDelayedSelection(final Object element, long millis) { if (delayJob != null) delayJob.cancel(); - delayJob = new Job("Updating launch bar selection") { + delayJob = new Job(Messages.CSelector_1) { @Override protected IStatus run(final IProgressMonitor monitor) { if (monitor.isCanceled()) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 01bab01a5ea..47a732bebce 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -28,6 +28,7 @@ import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.launchbar.ui.internal.commands.ConfigureActiveLaunchHandler; import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigWizard; import org.eclipse.swt.SWT; @@ -46,17 +47,16 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -@SuppressWarnings("restriction") public class ConfigSelector extends CSelector { private LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); private DefaultDescriptorLabelProvider defaultProvider; - private static final String[] noConfigs = new String[] { "No Launch Configurations" }; + private static final String[] noConfigs = new String[] { Messages.ConfigSelector_0 }; public ConfigSelector(Composite parent, int style) { super(parent, style); - setToolTipText("Launch configuration"); + setToolTipText(Messages.ConfigSelector_1); defaultProvider = new DefaultDescriptorLabelProvider(); setContentProvider(new IStructuredContentProvider() { @@ -187,7 +187,7 @@ public class ConfigSelector extends CSelector { final Label createLabel = new Label(createButton, SWT.None); createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - createLabel.setText("Create New Configuration..."); + createLabel.setText(Messages.ConfigSelector_2); createLabel.setBackground(backgroundColor); MouseListener mouseListener = new MouseAdapter() { @@ -195,7 +195,7 @@ public class ConfigSelector extends CSelector { final NewLaunchConfigWizard wizard = new NewLaunchConfigWizard(); WizardDialog dialog = new WizardDialog(getShell(), wizard); if (dialog.open() == Window.OK) { - new Job("Create Launch Configuration") { + new Job(Messages.ConfigSelector_3) { protected IStatus run(IProgressMonitor monitor) { try { final LaunchBarManager barManager = uiManager.getManager(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java index 1c95f414533..c9e52c9a486 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java @@ -1,13 +1,14 @@ package org.eclipse.launchbar.ui.internal.controls; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.widgets.Composite; public class EditButton extends CButton { public EditButton(Composite parent, int style) { super(parent, style); - setHotImage(Activator.getDefault().getImage("icons/config_config.png")); - setColdImage(Activator.getDefault().getImage("icons/edit_cold.png")); - setToolTipText("Edit"); + setHotImage(Activator.getDefault().getImage("icons/config_config.png")); //$NON-NLS-1$ + setColdImage(Activator.getDefault().getImage("icons/edit_cold.png")); //$NON-NLS-1$ + setToolTipText(Messages.EditButton_0); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java index 9b1cdb45223..5d34e658d95 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java @@ -10,6 +10,7 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.AccessibleAdapter; @@ -33,7 +34,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.internal.WorkbenchMessages; import org.eclipse.ui.progress.WorkbenchJob; /** @@ -101,7 +101,7 @@ public class FilterControl extends Composite { protected void init() { createControl(this, SWT.NONE); createRefreshJob(); - setInitialText(WorkbenchMessages.FilteredTree_FilterMessage); + setInitialText(Messages.FilterControl_0); setFont(parent.getFont()); } @@ -224,7 +224,7 @@ public class FilterControl extends Composite { e.result = initialText; } else { e.result = NLS.bind( - WorkbenchMessages.FilteredTree_AccessibleListenerFiltered, + Messages.FilterControl_1, new String[] { filterTextString, String.valueOf(getFilteredItemsCount()) }); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index d6ca90c3dd0..927a03216e7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -73,7 +73,7 @@ public class LaunchBarControl implements Listener { Label label = new Label(container, SWT.NONE); label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); - label.setText("on" + ":"); + label.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ targetSelector = new TargetSelector(container, SWT.NONE); targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 042ba36b0df..fc7592a21b9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -7,12 +7,10 @@ import java.util.List; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.IFontProvider; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.jface.viewers.Viewer; @@ -20,6 +18,7 @@ import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.DisposeEvent; @@ -44,15 +43,12 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Sash; -import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Widget; public class LaunchBarListViewer extends StructuredViewer { @@ -78,11 +74,13 @@ public class LaunchBarListViewer extends StructuredViewer { } // have to override it because standard ViewerComparator compares by labels only + @SuppressWarnings("unchecked") @Override public int compare(Viewer viewer, Object e1, Object e2) { return getComparator().compare(e1, e2); } } + private TraverseListener listItemTraverseListener = new TraverseListener() { @Override public void keyTraversed(TraverseEvent e) { @@ -152,7 +150,7 @@ public class LaunchBarListViewer extends StructuredViewer { filterControl.setVisible(true); filterControl.setFocus(); filterControl.getParent().layout(true); - filterControl.getFilterText().setText(e.character + ""); + filterControl.getFilterText().setText(e.character + ""); //$NON-NLS-1$ filterControl.getFilterText().setSelection(1); } else if (e.character == SWT.ESC) { setDefaultSelection(new StructuredSelection()); @@ -175,7 +173,7 @@ public class LaunchBarListViewer extends StructuredViewer { @Override public String toString() { - return "[" + index + "] " + labelProvider.getText(element); + return "[" + index + "] " + labelProvider.getText(element); //$NON-NLS-1$ //$NON-NLS-2$ } public ListItem(Composite parent, int style, Object element, int index, ILabelProvider labelProvider, ICellModifier modifier) { @@ -427,7 +425,7 @@ public class LaunchBarListViewer extends StructuredViewer { // ignore } }); - sash.setToolTipText("Increase/Decrease size of recently used elements pane"); + sash.setToolTipText(Messages.LaunchBarListViewer_0); } @Override @@ -504,6 +502,7 @@ public class LaunchBarListViewer extends StructuredViewer { } } + @SuppressWarnings("rawtypes") @Override protected List getSelectionFromWidget() { ArrayList arrayList = new ArrayList<>(); @@ -569,7 +568,7 @@ public class LaunchBarListViewer extends StructuredViewer { } @Override - protected void setSelectionToWidget(List l, boolean reveal) { + protected void setSelectionToWidget(@SuppressWarnings("rawtypes") List l, boolean reveal) { if (l.size() == 0) { return; } @@ -682,29 +681,6 @@ public class LaunchBarListViewer extends StructuredViewer { this.finalSelection = finalSelection; } - public static void main(String[] args) { - Display display = Display.getDefault(); - Shell shell = new Shell(); - RowLayout rowLayout = new RowLayout(); - shell.setLayout(rowLayout); - (new Label(shell, SWT.NULL)).setText("Hello"); - LaunchBarListViewer v = new LaunchBarListViewer(shell); - v.setContentProvider(new ArrayContentProvider()); - v.setLabelProvider(new LabelProvider()); - v.setInput(new String[] { "aaa", "bbb", "ccc" }); - shell.pack(); - shell.open(); - // textUser.forceFocus(); - // Set up the event loop. - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) { - // If no more entries in event queue - display.sleep(); - } - } - display.dispose(); - } - public void setFocus() { if (selIndex >= 0 && listItems != null && listItems.length < selIndex) listItems[selIndex].setFocus(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index d3a5e3d21b7..57b0f3531aa 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -25,6 +25,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Composite; @@ -32,14 +33,14 @@ import org.eclipse.swt.widgets.Composite; @SuppressWarnings("restriction") public class ModeSelector extends CSelector { - private static final String[] noModes = new String[] { "---" }; + private static final String[] noModes = new String[] { "---" }; //$NON-NLS-1$ private final LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); public ModeSelector(Composite parent, int style) { super(parent, style); - setToolTipText("Launch configuration"); + setToolTipText(Messages.ModeSelector_0); setContentProvider(new IStructuredContentProvider() { @Override @@ -98,7 +99,7 @@ public class ModeSelector extends CSelector { try { ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); if (group != null) { - return group.getLabel().replace("&", ""); + return group.getLabel().replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (CoreException e) { Activator.log(e.getStatus()); @@ -115,21 +116,21 @@ public class ModeSelector extends CSelector { String mode1 = ((ILaunchMode)o1).getIdentifier(); String mode2 = ((ILaunchMode)o2).getIdentifier(); // run comes first, then debug, then the rest - if (mode1.equals("run")) { - if (mode2.equals("run")) + if (mode1.equals("run")) { //$NON-NLS-1$ + if (mode2.equals("run")) //$NON-NLS-1$ return 0; else return -1; } - if (mode2.equals("run")) + if (mode2.equals("run")) //$NON-NLS-1$ return 1; - if (mode1.equals("debug")) { - if (mode2.equals("debug")) + if (mode1.equals("debug")) { //$NON-NLS-1$ + if (mode2.equals("debug")) //$NON-NLS-1$ return 0; else return -1; } - if (mode2.equals("debug")) + if (mode2.equals("debug")) //$NON-NLS-1$ return 1; } return 0; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java index 281cc8be798..9aab026cf3a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java @@ -26,6 +26,7 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.layout.GridData; @@ -82,9 +83,9 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties leftButtonComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); leftButtonComp.setFont(parent.getFont()); - createButton(leftButtonComp, DELETE_ID, "Delete", false); - createButton(leftButtonComp, DUPLICATE_ID, "Duplicate", false); - createButton(leftButtonComp, LAUNCH_ID, "Launch", false); + createButton(leftButtonComp, DELETE_ID, Messages.LaunchConfigurationEditDialog_0, false); + createButton(leftButtonComp, DUPLICATE_ID, Messages.LaunchConfigurationEditDialog_1, false); + createButton(leftButtonComp, LAUNCH_ID, Messages.LaunchConfigurationEditDialog_2, false); Composite mainButtonComp = new Composite(composite, SWT.NONE); layout = new GridLayout(); @@ -121,9 +122,9 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties if (c.isWorkingCopy()) c = ((ILaunchConfigurationWorkingCopy)c).getOriginal(); final ILaunchConfiguration config = c; - if (MessageDialog.openConfirm(getShell(), "Confirm Delete", - "Are you sure you want to delete " + config.getName())) { - new Job("Deleting launch configuration") { + if (MessageDialog.openConfirm(getShell(), Messages.LaunchConfigurationEditDialog_3, + Messages.LaunchConfigurationEditDialog_4 + config.getName())) { + new Job(Messages.LaunchConfigurationEditDialog_5) { protected IStatus run(IProgressMonitor monitor) { try { config.delete(); @@ -139,7 +140,7 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties case DUPLICATE_ID: final ILaunchConfiguration original = getLaunchConfiguration(); final String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(original.getName()); - new Job("Duplicating launch configuration") { + new Job(Messages.LaunchConfigurationEditDialog_6) { protected IStatus run(IProgressMonitor monitor) { try { ILaunchConfigurationWorkingCopy newWorkingCopy = original.copy(newName); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 7387e1bb918..02161556a74 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -30,6 +30,7 @@ import org.eclipse.jface.resource.ColorRegistry; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; @@ -42,6 +43,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; +@SuppressWarnings("restriction") public class NewLaunchConfigEditPage extends WizardPage { ILaunchConfigurationWorkingCopy workingCopy; ILaunchConfigurationTabGroup tabGroup; @@ -51,9 +53,9 @@ public class NewLaunchConfigEditPage extends WizardPage { private LaunchConfigurationManager launchConfigurationMgr = DebugUIPlugin.getDefault().getLaunchConfigurationManager(); public NewLaunchConfigEditPage() { - super("NewLaunchConfigEditPage"); - setTitle("Launch Configuration Properties"); - setDescription("Edit the new launch configuration properties"); + super(Messages.NewLaunchConfigEditPage_0); + setTitle(Messages.NewLaunchConfigEditPage_1); + setDescription(Messages.NewLaunchConfigEditPage_2); } @Override @@ -62,7 +64,7 @@ public class NewLaunchConfigEditPage extends WizardPage { comp.setLayout(new GridLayout(2, false)); Label label = new Label(comp, SWT.NONE); label.setLayoutData(new GridData()); - label.setText("Name:"); + label.setText(Messages.NewLaunchConfigEditPage_3 + ":"); //$NON-NLS-1$ nameText = new Text(comp, SWT.BORDER); nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); ColorRegistry reg = JFaceResources.getColorRegistry(); @@ -97,14 +99,14 @@ public class NewLaunchConfigEditPage extends WizardPage { private String checkName(String name) { try { if (name.isEmpty()) { - return "Name can not be empty"; + return Messages.NewLaunchConfigEditPage_4; } ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); if (manager.isExistingLaunchConfigurationName(name)) { ILaunchConfiguration config = ((LaunchManager) manager).findLaunchConfiguration(name); if (config != workingCopy.getOriginal()) { - return ("A configuration with this name already exists"); + return (Messages.NewLaunchConfigEditPage_5); } } } catch (Exception e) { @@ -120,7 +122,7 @@ public class NewLaunchConfigEditPage extends WizardPage { return; try { String initialMode = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); - workingCopy = type.newInstance(null, "New Configuration"); + workingCopy = type.newInstance(null, Messages.NewLaunchConfigEditPage_6); tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, initialMode); for (CTabItem item : tabFolder.getItems()) item.dispose(); @@ -236,7 +238,7 @@ public class NewLaunchConfigEditPage extends WizardPage { @Override public String generateName(String name) { if (name == null) - return ""; + return ""; //$NON-NLS-1$ return DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(name); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java index 20c6e7a2760..f00c6ab85e5 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -17,6 +17,7 @@ import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -32,9 +33,9 @@ public class NewLaunchConfigModePage extends WizardPage { ILaunchGroup selectedGroup; public NewLaunchConfigModePage() { - super("Select Initial Launch Mode"); - setTitle("Initial Launch Mode"); - setDescription("Select initial launch mode."); + super(Messages.NewLaunchConfigModePage_0); + setTitle(Messages.NewLaunchConfigModePage_1); + setDescription(Messages.NewLaunchConfigModePage_2); } @Override @@ -49,14 +50,14 @@ public class NewLaunchConfigModePage extends WizardPage { Set done = new HashSet<>(); for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { - if (group.getMode().equals("run")) { + if (group.getMode().equals("run")) { //$NON-NLS-1$ createModeItem(group); done.add(group); } } for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { - if (group.getMode().equals("debug")) { + if (group.getMode().equals("debug")) { //$NON-NLS-1$ createModeItem(group); done.add(group); } @@ -73,7 +74,7 @@ public class NewLaunchConfigModePage extends WizardPage { int i = 0; boolean hasDebug = false; for (TableItem item : table.getItems()) { - if ("debug".equals(((ILaunchGroup) item.getData()).getMode())) { + if ("debug".equals(((ILaunchGroup) item.getData()).getMode())) { //$NON-NLS-1$ hasDebug = true; table.select(i); break; @@ -103,7 +104,7 @@ public class NewLaunchConfigModePage extends WizardPage { return; TableItem item = new TableItem(table, SWT.NONE); - item.setText(group.getLabel().replace("&", "")); + item.setText(group.getLabel().replace("&", "")); //$NON-NLS-1$ //$NON-NLS-2$ ImageDescriptor imageDesc = group.getImageDescriptor(); if (imageDesc != null) { item.setImage(imageDesc.createImage()); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java index af37da741c7..abb8aab373b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -17,6 +17,7 @@ import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -29,9 +30,9 @@ public class NewLaunchConfigTypePage extends WizardPage { private Table table; public NewLaunchConfigTypePage() { - super("Select Launch Configuration Type"); - setTitle("Launch Configuration Type"); - setDescription("Select the type of launch configuration to create."); + super(Messages.NewLaunchConfigTypePage_0); + setTitle(Messages.NewLaunchConfigTypePage_1); + setDescription(Messages.NewLaunchConfigTypePage_2); } @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java index 29bbe5fdfaf..809ef04befe 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java @@ -21,6 +21,7 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.jface.wizard.Wizard; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; public class NewLaunchConfigWizard extends Wizard implements ILaunchConfigurationListener { @@ -31,7 +32,7 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio private List configsToDelete = new ArrayList<>(); public NewLaunchConfigWizard() { - setWindowTitle("Create Launch Configuration"); + setWindowTitle(Messages.NewLaunchConfigWizard_0); initListeners(); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index cf06ea8f1ad..910ac545fc7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -1,4 +1,41 @@ +ConfigSelector_0=No Launch Configurations +ConfigSelector_1=Launch configuration +ConfigSelector_2=Create New Configuration... +ConfigSelector_3=Create Launch Configuration +CSelector_0=Closing popup +CSelector_1=Updating launch bar selection +EditButton_0=Edit +FilterControl_0=type filter text +FilterControl_1={0} {1} matches. +LaunchBarControl_0=on LaunchBarControl_Build=Build LaunchBarControl_Launch=Launch LaunchBarControl_Stop=Stop +LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane +LaunchBarPreferencePage_0=Preferences for the Launch Bar. +LaunchBarPreferencePage_1=Enable the Launch Bar. +LaunchConfigurationEditDialog_0=Delete +LaunchConfigurationEditDialog_1=Duplicate +LaunchConfigurationEditDialog_2=Launch +LaunchConfigurationEditDialog_3=Confirm Delete +LaunchConfigurationEditDialog_4=Are you sure you want to delete +LaunchConfigurationEditDialog_5=Deleting launch configuration +LaunchConfigurationEditDialog_6=Duplicating launch configuration +ModeSelector_0=Launch configuration +NewLaunchConfigEditPage_0=NewLaunchConfigEditPage +NewLaunchConfigEditPage_1=Launch Configuration Properties +NewLaunchConfigEditPage_2=Edit the new launch configuration properties +NewLaunchConfigEditPage_3=Name +NewLaunchConfigEditPage_4=Name can not be empty +NewLaunchConfigEditPage_5=A configuration with this name already exists +NewLaunchConfigEditPage_6=New Configuration +NewLaunchConfigModePage_0=Select Initial Launch Mode +NewLaunchConfigModePage_1=Initial Launch Mode +NewLaunchConfigModePage_2=Select initial launch mode. +NewLaunchConfigTypePage_0=Select Launch Configuration Type +NewLaunchConfigTypePage_1=Launch Configuration Type +NewLaunchConfigTypePage_2=Select the type of launch configuration to create. +NewLaunchConfigWizard_0=Create Launch Configuration +StopActiveCommandHandler_0=Stopping launches +StopActiveCommandHandler_1=Stopping build TargetSelector_CreateNewTarget=Create New Connection... diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index c1597e1b246..d2d0106e4e2 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -53,6 +53,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; +@SuppressWarnings("restriction") @FixMethodOrder(MethodSorters.JVM) public class LaunchBarManager2Test { private LaunchBarManager manager; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index b027afd5272..babf3026a44 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -27,7 +27,7 @@ import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.junit.Test; - +@SuppressWarnings("nls") public class LaunchBarManagerTest { @Test From 3e548fced4c637d44071e03425346fcb0d022f07 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 4 May 2015 13:44:16 -0400 Subject: [PATCH 025/198] launchbar: hook up connect/disconnect state for target selector Change-Id: I93240fa2385053454fe9f84279eddc1518290d4f --- .../org.eclipse.launchbar.ui/icons/connected.png | Bin 0 -> 266 bytes .../icons/disconnected.png | Bin 0 -> 239 bytes .../ui/internal/controls/TargetSelector.java | 8 ++++++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/icons/connected.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/disconnected.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/connected.png b/bundles/org.eclipse.launchbar.ui/icons/connected.png new file mode 100644 index 0000000000000000000000000000000000000000..4a67a216044b563526f482da6639331fed1b716c GIT binary patch literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvPG!T^vI+f|C;*m|k8!EbCxVS7*b%$-?>6lz`?dnTgjgFKhkZ{^)yV z@L{F{T@I^)m$%(@pVXo;OX{0!#w;dg57jo6J4-e&E%^A5(?ZmTbA7^zSwdQjMtrlC zCNv*>=P^@iR^vK_(yR*mRsPFbBNT^vI+f|C;z#I9VwZf#;>lEeP!uR|G2m)(K}_JBt=9c`K{mm~{Z z17i6M7#A#I2zX<=sp+?aBdZFlj05Zahg=PlL>(GmdT<#v{CTSJj)7|n^T&FPIKC@K c9H+1|-dJi@vM0ah5zr Date: Tue, 5 May 2015 11:19:25 -0400 Subject: [PATCH 026/198] launch bar: "launch" button name in LC edit dialog - use same name as in LaunchConfigurationDialog, i.e. Run, Debug, etc. Change-Id: I497ff5c7913c47e3cfeb736557a3c8e90040d2ef --- .../ui/internal/dialogs/LaunchConfigurationEditDialog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java index 9aab026cf3a..2f474f1bc50 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java @@ -85,7 +85,8 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties createButton(leftButtonComp, DELETE_ID, Messages.LaunchConfigurationEditDialog_0, false); createButton(leftButtonComp, DUPLICATE_ID, Messages.LaunchConfigurationEditDialog_1, false); - createButton(leftButtonComp, LAUNCH_ID, Messages.LaunchConfigurationEditDialog_2, false); + // launch button text same as in eclipse LaunchConfigurationDialog - mode name + createButton(leftButtonComp, LAUNCH_ID, getLaunchButtonText(), false); Composite mainButtonComp = new Composite(composite, SWT.NONE); layout = new GridLayout(); @@ -103,6 +104,10 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties return composite; } + protected String getLaunchButtonText() { + return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode()).getLabel(); + } + @Override protected void createButtonsForButtonBar(Composite parent) { // Do nothing since we now have the buttons created above. From fd58fed7e44a0f6fdb49279418c8610e624861a5 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 5 May 2015 12:02:34 -0400 Subject: [PATCH 027/198] launch bar: corrected edit dialog handling of adding of new LC - launch bar launch config was not handling add of another launch config correctly - it was just resetting itself to handle new LC. This cannot really be done because this dialog is bound to launch group and new lc may not be part of it and may not even support the mode current dialog is in. Also that make missyncronization between LC stored in parent and LC stored in getTabViewer which can cause other nasty problems. So let parent handle adding (which only handles locatio change) and for duplication we just open a new dialog and close current one. Change-Id: I2dde5c3af26d901d1f4b18cad84a83a9857a6ca9 --- .../LaunchConfigurationEditDialog.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java index 2f474f1bc50..067035ca4f1 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java @@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.UIJob; @SuppressWarnings("restriction") public class LaunchConfigurationEditDialog extends LaunchConfigurationPropertiesDialog { @@ -104,21 +105,11 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties return composite; } - protected String getLaunchButtonText() { - return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode()).getLabel(); - } - @Override protected void createButtonsForButtonBar(Composite parent) { // Do nothing since we now have the buttons created above. } - @Override - public void launchConfigurationAdded(ILaunchConfiguration configuration) { - // update the dialog with the new config - getTabViewer().setInput(configuration); - } - @Override protected void buttonPressed(int buttonId) { switch (buttonId) { @@ -145,17 +136,23 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationProperties case DUPLICATE_ID: final ILaunchConfiguration original = getLaunchConfiguration(); final String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(original.getName()); - new Job(Messages.LaunchConfigurationEditDialog_6) { - protected IStatus run(IProgressMonitor monitor) { + final Shell shell = getParentShell(); + final LaunchGroupExtension group = getLaunchGroup(); + + new UIJob(Messages.LaunchConfigurationEditDialog_6) { + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { try { - ILaunchConfigurationWorkingCopy newWorkingCopy = original.copy(newName); - newWorkingCopy.doSave(); - return Status.OK_STATUS; + final ILaunchConfigurationWorkingCopy newWorkingCopy = original.copy(newName); + final ILaunchConfiguration newConfig = newWorkingCopy.doSave(); + new LaunchConfigurationEditDialog(shell, newConfig, group).open(); } catch (CoreException e) { return e.getStatus(); } - }; + return Status.OK_STATUS; + } }.schedule(); + cancelPressed(); break; case LAUNCH_ID: okPressed(); From 4e67214de310a2041d9684a9096d7f66cb1b2c9c Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Tue, 5 May 2015 21:49:03 -0400 Subject: [PATCH 028/198] Bug 466489 - Limit launchbar-visible configs to public launch types; fix unit test - Cleanup of bad catch block Change-Id: If5c9adcc6970ffb480312e2453fcb153674cf79b Signed-off-by: Rob Stryker --- .../internal/DefaultLaunchDescriptorType.java | 22 ++++++++++++++----- .../core/internal/LaunchBarManager2Test.java | 1 + .../core/internal/LaunchBarManagerTest.java | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index 38c9c0024bb..78948c9c646 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -3,7 +3,9 @@ package org.eclipse.launchbar.core.internal; import java.util.HashMap; import java.util.Map; +import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchManager; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; @@ -27,12 +29,20 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { public ILaunchDescriptor getDescriptor(Object element) { if (element instanceof ILaunchConfiguration) { ILaunchConfiguration config = (ILaunchConfiguration) element; - DefaultLaunchDescriptor descriptor = descriptors.get(config); - if (descriptor == null) { - descriptor = new DefaultLaunchDescriptor(this, config); - descriptors.put(config, descriptor); - } - return descriptor; + try { + if( config.getType() != null && config.getType().isPublic() + && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false))) { + + DefaultLaunchDescriptor descriptor = descriptors.get(config); + if (descriptor == null) { + descriptor = new DefaultLaunchDescriptor(this, config); + descriptors.put(config, descriptor); + } + return descriptor; + } + } catch(CoreException ce) { + Activator.log(ce.getStatus()); + } } return null; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index d2d0106e4e2..d02fbfaba19 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -192,6 +192,7 @@ public class LaunchBarManager2Test { protected ILaunchConfigurationType mockLCType(String id) { ILaunchConfigurationType lctype = mock(ILaunchConfigurationType.class); + doReturn(true).when(lctype).isPublic(); doReturn(id).when(lctype).getIdentifier(); doReturn(lctype).when(lman).getLaunchConfigurationType(id); return lctype; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index babf3026a44..69dc99168fe 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -48,6 +48,7 @@ public class LaunchBarManagerTest { // Mocking ILaunchConfigurationType launchConfigType = mock(ILaunchConfigurationType.class); ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); + doReturn(true).when(launchConfigType).isPublic(); doReturn(launchConfigType).when(launchConfig).getType(); doReturn("dummy").when(launchConfigType).getIdentifier(); doReturn(true).when(launchConfigType).supportsMode("run"); From d7a91f70eebe81e2143d03dbba21fbe828c95f78 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 6 May 2015 10:08:19 -0400 Subject: [PATCH 029/198] Bug 466490: [launchbar] Color of the sash Trying to make sash more visible Change-Id: I6baeb1b05451e808c86204d0b0b1a1c13af5c7de --- .../launchbar/ui/internal/controls/LaunchBarListViewer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index fc7592a21b9..e86c77c80bc 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.List; -import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ICellModifier; @@ -45,6 +44,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; @@ -391,11 +391,13 @@ public class LaunchBarListViewer extends StructuredViewer { if (separatorIndex < 0 || !historySupported) return; sash = new Sash(listComp, SWT.BORDER | SWT.HORIZONTAL); - sash.setLayoutData(GridDataFactory.fillDefaults().create()); + sash.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); if (separatorIndex < listItems.length) sash.moveAbove(listItems[separatorIndex]); else sash.moveBelow(null); + + sash.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION)); sash.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event e) { From 899208ac288fb3bd68b63a6ddd19b64978f50363 Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Tue, 5 May 2015 16:04:54 -0400 Subject: [PATCH 030/198] Bug 466488 - Clicking edit on launches that have no launch group, tabs, or have other errors, causes several error dialogs to pop up. Change-Id: Id5b56c2696e4911143a4daeb93cc8a442b3ebe33 Signed-off-by: Rob Stryker --- .../core/internal/LaunchBarManager.java | 4 +- .../launchbar/ui/internal/Messages.java | 16 +++ .../ConfigureActiveLaunchHandler.java | 107 +++++++++++++----- .../launchbar/ui/internal/messages.properties | 13 +++ 4 files changed, 111 insertions(+), 29 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index c17331bbe3c..fa2dc6e6c38 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -948,7 +948,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.trace("launch config not claimed"); //$NON-NLS-1$ try { ILaunchDescriptor desc = defaultDescriptorType.getDescriptor(configuration); - addDescriptor(configuration, desc); + if( desc != null ) { + addDescriptor(configuration, desc); + } } catch (CoreException e) { Activator.log(e.getStatus()); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 97d8fbc75ce..34637d6ea5d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -55,6 +55,22 @@ public class Messages extends NLS { public static String StopActiveCommandHandler_0; public static String StopActiveCommandHandler_1; public static String TargetSelector_CreateNewTarget; + + public static String DescriptorMustNotBeNull; + public static String DescriptorMustNotBeNullDesc; + public static String NoActiveTarget; + public static String NoActiveTargetDesc; + public static String NoLaunchConfigType; + public static String CannotEditLaunchConfiguration; + public static String NoLaunchModeSelected; + public static String NoLaunchGroupSelected; + public static String LaunchConfigurationNotFound; + public static String LaunchConfigurationNotFoundDesc; + public static String NoLaunchTabsDefined; + public static String NoLaunchTabsDefinedDesc; + + + static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index 6d9b02d20e3..f11b404c9a0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -14,18 +14,22 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; +import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.widgets.Shell; @@ -42,43 +46,90 @@ public class ConfigureActiveLaunchHandler extends AbstractHandler { return Status.OK_STATUS; } + + public static IStatus canOpenConfigurationEditor(ILaunchDescriptor desc) { + if (desc == null) + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.DescriptorMustNotBeNull, new Exception(Messages.DescriptorMustNotBeNullDesc)); + LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); + ILaunchMode mode = manager.getActiveLaunchMode(); + IRemoteConnection target = manager.getActiveLaunchTarget(); + if (target == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoActiveTarget, new Exception(Messages.NoActiveTargetDesc)); + } + + ILaunchConfigurationType configType = null; + try { + configType = manager.getLaunchConfigurationType(desc, target); + } catch(CoreException ce) {/* ignore */ }; + if (configType == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchConfigType, new Exception(Messages.CannotEditLaunchConfiguration)); + } + + if( mode == null ) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, new Exception(Messages.NoLaunchModeSelected)); + } + + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); + if( group == null ) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchGroupSelected, new Exception(Messages.NoLaunchGroupSelected)); + } + + String mode2 = group.getMode(); + if( mode2 == null ) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, new Exception(Messages.CannotEditLaunchConfiguration)); + } + + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); + if (groupExt != null) { + ILaunchConfiguration config = null; + try { + config = manager.getLaunchConfiguration(desc, target); + } catch(CoreException ce) { + // Ignore + } + if (config == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LaunchConfigurationNotFound, new Exception(Messages.LaunchConfigurationNotFoundDesc)); + } + try { + LaunchConfigurationPresentationManager mgr = LaunchConfigurationPresentationManager.getDefault(); + ILaunchConfigurationTabGroup tabgroup = mgr.getTabGroup(config, mode.getIdentifier()); + } catch(CoreException ce) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID,Messages.NoLaunchTabsDefined, new Exception(Messages.NoLaunchTabsDefinedDesc)); + } + } else { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CannotEditLaunchConfiguration, new Exception(Messages.CannotEditLaunchConfiguration)); + } + return Status.OK_STATUS; + } + + public static void openConfigurationEditor(ILaunchDescriptor desc) { if (desc == null) return; + + // Display the error message + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + IStatus s = canOpenConfigurationEditor(desc); + if( !s.isOK()) { + MessageDialog.openError(shell, s.getMessage(), s.getException() == null ? s.getMessage() : s.getException().getMessage()); + return; + } + + // At this point, no error handling should be needed. try { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); ILaunchMode mode = manager.getActiveLaunchMode(); IRemoteConnection target = manager.getActiveLaunchTarget(); - if (target == null) { - MessageDialog.openError(shell, "No Active Target", "You must create a target to edit this launch configuration."); - return; - } ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); - if (configType == null) { - MessageDialog.openError(shell, "No launch configuration type", "Cannot edit this configuration"); - return; - } - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager() - .getLaunchGroup(configType, mode.getIdentifier()); - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() - .getLaunchGroup(group.getIdentifier()); - if (groupExt != null) { - ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); - if (config == null) { - MessageDialog.openError(shell, "No launch configuration", "Cannot edit this configuration"); - return; - } - if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { - config = ((ILaunchConfigurationWorkingCopy) config).doSave(); - } - final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); - dialog.setInitialStatus(Status.OK_STATUS); - dialog.open(); - } else { - MessageDialog.openError(shell, "Cannot determine mode", "Cannot edit this configuration"); - return; + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); + ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); + if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { + config = ((ILaunchConfigurationWorkingCopy) config).doSave(); } + final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); + dialog.setInitialStatus(Status.OK_STATUS); + dialog.open(); } catch (CoreException e2) { Activator.log(e2); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 910ac545fc7..be73c78e828 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -39,3 +39,16 @@ NewLaunchConfigWizard_0=Create Launch Configuration StopActiveCommandHandler_0=Stopping launches StopActiveCommandHandler_1=Stopping build TargetSelector_CreateNewTarget=Create New Connection... + +DescriptorMustNotBeNull=Descriptor must not be null +DescriptorMustNotBeNullDesc=The launch descriptor must not be null. +NoActiveTarget=No Active Target +NoActiveTargetDesc=You must create a target to edit this launch configuration. +NoLaunchConfigType=No launch configuration type matches selected launch descriptor. +CannotEditLaunchConfiguration=Cannot edit this configuration. +NoLaunchModeSelected=No launch mode selected. +NoLaunchGroupSelected=No launch group found for the current selection. +LaunchConfigurationNotFound=Launch Configuration Not Found +LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target. +NoLaunchTabsDefined=No launch tabs defined. +NoLaunchTabsDefinedDesc=No launch tabs have been defined for this launch configuration type. From 86c73092fa5a62efc2147c81a4f9e63441e8c748 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Sun, 17 May 2015 23:22:09 -0400 Subject: [PATCH 031/198] Bug 467153 - Step one of making configs per target. WTP needs a new config for every target. That breaks our architecture of one config per target type. But that's actually already broken since we can't really get the proper target to the launch config. Depending on active, we always hoped the target didn't change, but it can. So one config per target is correct anyway. Change-Id: I14ba8413b9494a13f3496eed5535debbc330a56c --- .../META-INF/MANIFEST.MF | 3 +- bundles/org.eclipse.launchbar.core/plugin.xml | 14 +- .../schema/launchBarContributions.exsd | 125 +---- .../core/AbstractLaunchConfigProvider.java | 43 ++ .../core/DefaultLaunchConfigProvider.java | 59 ++ .../core/ILaunchConfigurationProvider.java | 91 ++- .../core/LaunchConfigurationProvider.java | 77 --- .../core/PerTypeLaunchConfigProvider.java | 115 ++++ ...> ProjectPerTypeLaunchConfigProvider.java} | 83 ++- .../internal/DefaultLaunchDescriptorType.java | 3 +- .../core/internal/LaunchBarManager.java | 525 +++++------------- .../internal/LaunchConfigProviderInfo.java | 23 +- .../core/internal/LaunchConfigTypeInfo.java | 27 - .../core/internal/LaunchTargetTypeInfo.java | 67 --- .../IRemoteLaunchConfigurationDelegate.java | 131 +++++ .../RemoteLaunchConfigurationDelegate.java | 59 ++ .../launchbar/ui/internal/Messages.java | 2 + .../commands/BuildActiveCommandHandler.java | 62 ++- .../ui/internal/controls/CSelector.java | 19 - .../ui/internal/controls/ConfigSelector.java | 8 +- .../controls/LaunchBarListViewer.java | 59 +- .../ui/internal/controls/TargetSelector.java | 31 +- .../launchbar/ui/internal/messages.properties | 2 + .../core/internal/LaunchBarManager2Test.java | 314 +++++------ .../core/internal/LaunchBarManagerTest.java | 55 +- 25 files changed, 901 insertions(+), 1096 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java rename bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/{ProjectLaunchConfigurationProvider.java => ProjectPerTypeLaunchConfigProvider.java} (51%) delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index b84817037d6..f28215054bf 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -12,4 +12,5 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, - org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui" + org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui", + org.eclipse.launchbar.core.launch diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index 28ce28378c3..37f566a2016 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -4,14 +4,20 @@ - - + + + + diff --git a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd index 7edd8c1feb8..aa466cf7c57 100644 --- a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd +++ b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd @@ -19,11 +19,8 @@ - - - @@ -86,48 +83,7 @@ - - - - A target is the machine you launch on. Typical examples include the local machine we are running on, or remote embedded or server targets. - - - - - - - - - - - - - - - - - - - - - - - - The osname property for the connection, i.e. the operating system name, e.g. win32, linux. If not specified, matches all. - - - - - - - The osarch property for the connection, i.e. the CPU architecture such as x86, armv7. If not specified, matches all. - - - - - - - + Descriptor types and target types map to a launch configuration type. Configurations of that type knows how to launch for the desciptor on targets of that type. @@ -144,51 +100,11 @@ - + - - - - - - - - - - - - - - - - - - - Is this the default target type for this descriptor type. - - - - - - - - - - The config provider knows how to create launch configurations from descriptors. It tracks which configs it has created so that they don't show up as descriptors on their own. - - - - - - - - - - - @@ -204,43 +120,6 @@ - - - - The default config provider is brought in when no other config providers claim a given launch configuration. This entry associates a target type with the launch configuration so that it can be launched on targets of that type. - - - - - - - - - - - - - - - - - - - - - - - - - - - Is this the default target type for this descriptor type. - - - - - - diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java new file mode 100644 index 00000000000..5166e31301e --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -0,0 +1,43 @@ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.remote.core.IRemoteConnection; + +/** + * Common launch config provider. Manages creating launch configurations and ensuring + * duplicates are managed properly. + */ +public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurationProvider { + + private static final String ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ + + protected ILaunchConfiguration createLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); + String name = launchManager.generateLaunchConfigurationName(descriptor.getName()); + ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfigurationType(descriptor, target).newInstance(null, name); + + populateLaunchConfiguration(descriptor, workingCopy); + + return workingCopy.doSave(); + } + + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchConfigurationWorkingCopy workingCopy) + throws CoreException { + // Leave our breadcrumb + workingCopy.setAttribute(ORIGINAL_NAME, workingCopy.getName()); + } + + @Override + public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + // We created it if it has the same name we created it with. + // This covers the case when the config was duplicated. + // We can own only one, the original one. + return configuration.getAttribute(ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java new file mode 100644 index 00000000000..3d647286428 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -0,0 +1,59 @@ +package org.eclipse.launchbar.core; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.remote.core.IRemoteConnection; + +/** + * The launch config provider for the default descriptor which is the launch config itself. + * + * Override this class and register an extension if you want to support targets other than the local connection. + */ +public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider { + + @Override + public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + // Only supports Local connection + return target.getConnectionType().getId().equals("org.eclipse.remote.LocalServices"); //$NON-NLS-1$ + } + + @Override + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { + return descriptor.getAdapter(ILaunchConfiguration.class).getType(); + } + + @Override + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { + return descriptor.getAdapter(ILaunchConfiguration.class); + } + + @Override + public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + // If I get here, I own it + return true; + } + + @Override + public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + return configuration; + } + + @Override + public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + return true; + } + + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { + // nothing to do + } + + @Override + public void launchTargetRemoved(IRemoteConnection target) throws CoreException { + // nothing to do + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index b2be74cb823..84c883942b8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -1,44 +1,89 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2015 QNX Software Systems 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: - * Doug Schaefer + * QNX Software Systems - initial *******************************************************************************/ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.remote.core.IRemoteConnection; /** * The provider of launch configurations of a given type for a given descriptor type * and a given target type. * - * It is recommended to extend {@link LaunchConfigurationProvider} - * instead of implementing this directly. + * It is recommended to extend {@link AbstractLaunchConfigProvider} or one of it's + * subclasses instead of implementing this directly. */ public interface ILaunchConfigurationProvider { /** - * Does this provider own this launch configuration. If so, make sure the launch descriptor - * is properly constructed by sending in a launch object to the launch manager. - * And return that object. + * Does this config provider provide launch configurations for the combination + * of descriptor and target. + * + * Note: this is called when filtering targets for a descriptor. Processing + * should be minimal. + * + * @param descriptor + * @param target + * @return + */ + boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException; + + /** + * Return the launch configuation type for the descriptor and target. + * + * @param descriptor + * @param target launch configuration type or null if not supported + * @return + * @throws CoreException + */ + ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, + IRemoteConnection target) throws CoreException; + + /** + * Create a launch configuration for the descriptor to launch on the target. + * + * @param descriptor the descriptor to create the config for + * @param target the target to launch the config on + * @return launch configuration + * @throws CoreException + */ + ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException; + + /** + * Does this provider own the launch configuration. + * + * @param configuration launch configuration + * @return true if this provider owns the launch configuration + * @throws CoreException + */ + boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException; + + /** + * A launch configuration has been added. + * Return the launch object associated with this configuration and the launch bar manager + * will ensure the descriptor is created for it. * * @param configuration - * @return launch object that relates to this config or null it does not own it. + * @return whether this provider owns this launch configuration * @throws CoreException */ Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; /** * A launch configuration has been removed. - * It it fired after launch configuration has been removed from file system, so accessing its attributes won't work. * This notification can be used to purge internal cache for example. + * This method is called after launch configuration has been removed from file system, + * so accessing its attributes won't work. * If provider cannot determine if it owns it it should return false. * * @param configuration @@ -48,21 +93,21 @@ public interface ILaunchConfigurationProvider { boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException; /** - * Returns the launch configuration type for configurations created by this provider. - * - * @return launch configuration type - * @throws CoreException - */ - ILaunchConfigurationType getLaunchConfigurationType() throws CoreException; - - /** - * Create a launch configuration for the descriptor to launch on the target. + * A launch descriptor has been removed. Remove any launch configurations that were + * created for it. * * @param descriptor - * @param target - * @return launch configuration - * @throws CoreException + * @throws CoreException */ - ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException; + void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException; + + /** + * A launch target has been removed. Remove any launch configurations that were created + * for it. + * + * @param target + * @throws CoreException + */ + void launchTargetRemoved(IRemoteConnection target) throws CoreException; } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java deleted file mode 100644 index 2d423398597..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/LaunchConfigurationProvider.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.core; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.launchbar.core.internal.Activator; - -/** - * A root class for launch configuration providers. Provides the ability to detect launch - * configurations that it has created. - */ -public abstract class LaunchConfigurationProvider implements ILaunchConfigurationProvider { - - // Used to make sure this is the config we've created - protected static final String ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ - - @Override - public ILaunchConfiguration createLaunchConfiguration(ILaunchManager launchManager, ILaunchDescriptor descriptor) throws CoreException { - String name = launchManager.generateLaunchConfigurationName(getConfigurationName(descriptor)); - ILaunchConfigurationWorkingCopy wc = getLaunchConfigurationType().newInstance(null, name); - wc.setAttribute(ORIGINAL_NAME, name); - populateConfiguration(wc, descriptor); - return wc.doSave(); - } - - /** - * Potential name for new configurations. Names are still put through the launch manager - * to ensure they are unique. - * - * @param descriptor the launch descriptor triggering the configuration creation - * @return candidate configuration name - */ - protected String getConfigurationName(ILaunchDescriptor descriptor) { - // by default, use the descriptor name - return descriptor.getName(); - } - - /** - * Populate the new configuration with attributes and resources. - * - * @param workingCopy working copy for the new configuration - * @param descriptor the launch descriptor that triggered the new configuration - * @throws CoreException - */ - protected void populateConfiguration(ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor) throws CoreException { - // by default, nothing to add - } - - /** - * Determines if we created this launch configuration. Generally used by the launch configuration - * add handler to determine if the incoming launch configuration is ours. - * - * @param configuration - * @return do we own this launch configuration - * @throws CoreException - */ - protected boolean ownsConfiguration(ILaunchConfiguration configuration) throws CoreException { - // must be the same config type - if (!configuration.getType().equals(getLaunchConfigurationType())) - return false; - - // we created it if it has the same name we created it with - return configuration.getAttribute(ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ - } - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java new file mode 100644 index 00000000000..c766166e0fe --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java @@ -0,0 +1,115 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.remote.core.IRemoteConnection; + +/** + * Common launch configuration provider for cases where it provides for a single + * connection type and a single launch configuration type. + */ +public abstract class PerTypeLaunchConfigProvider extends AbstractLaunchConfigProvider { + + // Map from launch object to launch configuration + private Map configMap = new HashMap<>(); + + protected abstract String getRemoteConnectionTypeId(); + + protected abstract String getLaunchConfigurationTypeId(); + + protected abstract Object getLaunchObject(ILaunchDescriptor descriptor); + + protected abstract Object getLaunchObject(ILaunchConfiguration configuration) throws CoreException; + + protected ILaunchConfigurationType getLaunchConfigurationType() { + return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(getLaunchConfigurationTypeId()); + } + + @Override + public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + // If target is null, assume we support it. + return target == null || target.getConnectionType().getId().equals(getRemoteConnectionTypeId()); + } + + @Override + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + if (supports(descriptor, target)) { + return getLaunchConfigurationType(); + } + return null; + } + + @Override + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + if (supports(descriptor, target)) { + Object launchObject = getLaunchObject(descriptor); + ILaunchConfiguration config = configMap.get(launchObject); + if (config == null) { + config = createLaunchConfiguration(descriptor, target); + configMap.put(launchObject, config); + } + return config; + } else { + return null; + } + } + + @Override + public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + if (!super.ownsLaunchConfiguration(configuration)) { + return false; + } + + // Must be of our type + return configuration.getType().equals(getLaunchConfigurationType()); + } + + @Override + public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + if (ownsLaunchConfiguration(configuration)) { + Object launchObject = getLaunchObject(configuration); + configMap.put(launchObject, configuration); + return launchObject; + } + return null; + } + + @Override + public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + if (ownsLaunchConfiguration(configuration)) { + Object launchObject = getLaunchObject(configuration); + configMap.remove(launchObject); + return true; + } + return false; + } + + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { + Object launchObject = getLaunchObject(descriptor); + if (launchObject != null) { + configMap.remove(launchObject); + } + } + + @Override + public void launchTargetRemoved(IRemoteConnection target) throws CoreException { + // nothing to do per target + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTypeLaunchConfigProvider.java similarity index 51% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java rename to bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTypeLaunchConfigProvider.java index 30f0f143127..10ed14dd751 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTypeLaunchConfigProvider.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2015 QNX Software Systems 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: - * Doug Schaefer + * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.launchbar.core; @@ -15,19 +15,44 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.remote.core.IRemoteConnection; -/** - * A root launch configuration provider that can be used with project launch descriptors. - * Takes ownership of configurations we've created that map to the the project. - */ -public abstract class ProjectLaunchConfigurationProvider extends LaunchConfigurationProvider { +public abstract class ProjectPerTypeLaunchConfigProvider extends PerTypeLaunchConfigProvider { + + private static final String PROJECT_CONFIG = Activator.PLUGIN_ID + ".projectConfig"; //$NON-NLS-1$ @Override - protected void populateConfiguration(ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor) throws CoreException { - super.populateConfiguration(workingCopy, descriptor); + protected Object getLaunchObject(ILaunchDescriptor descriptor) { + return descriptor.getAdapter(IProject.class); + } + + @Override + protected Object getLaunchObject(ILaunchConfiguration configuration) throws CoreException { + for (IResource resource : configuration.getMappedResources()) { + if (resource instanceof IProject) { + return (IProject) resource; + } + } + return null; + } + + @Override + public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + if (!super.supports(descriptor, target)) { + return false; + } + + return descriptor.getAdapter(IProject.class) != null; + } + + @Override + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchConfigurationWorkingCopy workingCopy) + throws CoreException { + super.populateLaunchConfiguration(descriptor, workingCopy); // Add our project to the mapped resources - IProject project = (IProject) descriptor.getAdapter(IProject.class); + IProject project = descriptor.getAdapter(IProject.class); IResource[] mappedResources = workingCopy.getMappedResources(); if (mappedResources == null || mappedResources.length == 0) { workingCopy.setMappedResources(new IResource[] { project }); @@ -37,44 +62,16 @@ public abstract class ProjectLaunchConfigurationProvider extends LaunchConfigura newResources[mappedResources.length] = project; workingCopy.setMappedResources(newResources); } - } - - /** - * Extract the project from the launch configuration. Used when checking if we own it. - * - * @param configuration - * @return project for launch configuration. - * @throws CoreException - */ - protected IProject getProject(ILaunchConfiguration configuration) throws CoreException { - // by default return the first project in the mapped resources - for (IResource resource : configuration.getMappedResources()) { - if (resource instanceof IProject) { - return (IProject) resource; - } - } - - return null; + workingCopy.setAttribute(PROJECT_CONFIG, true); } @Override - public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - if (!ownsConfiguration(configuration)) { - return null; + public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + if (!super.ownsLaunchConfiguration(configuration)) { + return false; } - IProject project = getProject(configuration); - if (project == null) { - // The user must have changed project. We don't own it any more in that case. - return null; - } - - return project; - } - - @Override - public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - return ownsConfiguration(configuration); + return configuration.getAttribute(PROJECT_CONFIG, false); } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index 78948c9c646..350d04ae27a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -21,8 +21,7 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { @Override public boolean ownsLaunchObject(Object element) { - // This descriptor type doesn't own any launch objects - return false; + return element instanceof ILaunchConfiguration; } @Override diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index fa2dc6e6c38..d25e5abe818 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -12,13 +12,12 @@ package org.eclipse.launchbar.core.internal; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -38,7 +37,6 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.ILaunchBarManager; -import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ILaunchObjectProvider; @@ -47,7 +45,6 @@ import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.RemoteConnectionChangeEvent; -import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; @@ -73,35 +70,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // The descriptor types private final Map descriptorTypes = new HashMap<>(); + // Descriptor types ordered from highest priority to lowest + private List orderedDescriptorTypes; + // the extended info for loaded descriptor types private final Map descriptorTypeInfo = new HashMap<>(); - // Descriptor types ordered from highest priority to lowest - private final List orderedDescriptorTypes = new LinkedList<>(); - - // The target types by id - private final Map targetTypes = new HashMap<>(); - - // The list of target types for a given descriptor type - private final Map> descriptorTargets = new HashMap<>(); - - // The mapping from descriptor type to target type to launch config type - private final Map> configTypes = new HashMap<>(); - - // Map descriptor type to target type so we can build when no targets have been added - private final Map defaultTargetTypes = new HashMap<>(); - - // Map from launch config type id to target type ids for default descriptors - private final Map> configTargetTypes = new HashMap<>(); - - // Map from launch config type Id to target type id for default descriptor for null target - private final Map defaultConfigTargetTypes = new HashMap<>(); - - // The launch config providers - private final Map configProviders = new HashMap<>(); - - // The default launch descriptor type used to wrap unclaimed launch configs - private DefaultLaunchDescriptorType defaultDescriptorType = new DefaultLaunchDescriptorType(); + private final Map> configProviders = new HashMap<>(); // Descriptors in MRU order, key is desc type id and desc name. private final Map, ILaunchDescriptor> descriptors = new LinkedHashMap<>(); @@ -109,11 +84,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // Map of launch objects to launch descriptors private final Map objectDescriptorMap = new HashMap<>(); - // The created launch configurations - private final Map> configs = new HashMap<>(); - private final IRemoteServicesManager remoteServicesManager = getRemoteServicesManager(); - private final IRemoteLaunchConfigService remoteLaunchConfigService = getRemoteLaunchConfigService(); private ILaunchDescriptor activeLaunchDesc; private ILaunchMode activeLaunchMode; @@ -123,7 +94,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; //$NON-NLS-1$ private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; //$NON-NLS-1$ private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; //$NON-NLS-1$ - + boolean initialized = false; public LaunchBarManager() { @@ -154,10 +125,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return Activator.getService(IRemoteServicesManager.class); } - IRemoteLaunchConfigService getRemoteLaunchConfigService() { - return Activator.getService(IRemoteLaunchConfigService.class); - } - // To allow override by tests IExtensionPoint getExtensionPoint() throws CoreException { return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); //$NON-NLS-1$ @@ -174,18 +141,17 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // Fetch the desc order before the init messes it up IEclipsePreferences store = getPreferenceStore(); String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); //$NON-NLS-1$ + // Load up the types loadExtensions(); - // Add in the default descriptor type - LaunchDescriptorTypeInfo defaultInfo = new LaunchDescriptorTypeInfo(DefaultLaunchDescriptorType.ID, - 0, defaultDescriptorType); - addDescriptorType(defaultInfo); + // Hook up the existing launch configurations and listen ILaunchManager launchManager = getLaunchManager(); for (ILaunchConfiguration configuration : launchManager.getLaunchConfigurations()) { launchConfigurationAdded(configuration); } launchManager.addLaunchConfigurationListener(this); + // Reorder the descriptors based on the preference if (!configDescIds.isEmpty()) { String[] split = configDescIds.split(","); //$NON-NLS-1$ @@ -199,6 +165,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration last = desc; } } + // Set the active desc, with MRU, it should be the last one if (last != null) { setActiveLaunchDescriptor(last); @@ -224,49 +191,24 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration String elementName = element.getName(); if (elementName.equals("descriptorType")) { //$NON-NLS-1$ LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(element); - addDescriptorType(typeInfo); - } else if (elementName.equals("targetType")) { //$NON-NLS-1$ - LaunchTargetTypeInfo info = new LaunchTargetTypeInfo(element); - targetTypes.put(info.getId(), info); - } else if (elementName.equals("configType")) { //$NON-NLS-1$ - String descriptorTypeId = element.getAttribute("descriptorType"); //$NON-NLS-1$ - String targetTypeId = element.getAttribute("targetType"); //$NON-NLS-1$ - String launchConfigTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ - String isDefaultStr = element.getAttribute("isDefault"); //$NON-NLS-1$ - boolean isDefault = isDefaultStr != null ? Boolean.parseBoolean(isDefaultStr) : false; - // add to desc type -> target type mapping - List targetTypes = descriptorTargets.get(descriptorTypeId); - if (targetTypes == null) { - targetTypes = new ArrayList<>(); - descriptorTargets.put(descriptorTypeId, targetTypes); + descriptorTypes.put(typeInfo.getId(), typeInfo); + // TODO figure out a better place to set the id so we don't load the type object + // until needed + descriptorTypeInfo.put(typeInfo.getType(), typeInfo); + + if (configProviders.get(typeInfo.getId()) == null) { + // Make sure we initialize the list + configProviders.put(typeInfo.getId(), new ArrayList()); } - targetTypes.add(targetTypeId); - - // Add to desc type -> target type -> config type mapping - Map targetConfigMap = configTypes.get(descriptorTypeId); - if (targetConfigMap == null) { - targetConfigMap = new HashMap<>(); - configTypes.put(descriptorTypeId, targetConfigMap); - } - targetConfigMap.put(targetTypeId, launchConfigTypeId); - - // If default, add to defaults list - if (isDefault) { - defaultTargetTypes.put(descriptorTypeId, targetTypeId); - } - - // also assume that the target type works for the config type - addDefaultConfigTargetType(launchConfigTypeId, targetTypeId, isDefault); } else if (elementName.equals("configProvider")) { //$NON-NLS-1$ LaunchConfigProviderInfo info = new LaunchConfigProviderInfo(element); - configProviders.put(info.getLaunchConfigTypeId(), info); - } else if (elementName.equals("defaultConfigTarget")) { //$NON-NLS-1$ - String configTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ - String targetTypeId = element.getAttribute("targetType"); //$NON-NLS-1$ - String isDefaultStr = element.getAttribute("isDefault"); //$NON-NLS-1$ - boolean isDefault = isDefaultStr != null ? Boolean.parseBoolean(isDefaultStr) : false; - addDefaultConfigTargetType(configTypeId, targetTypeId, isDefault); + List providers = configProviders.get(info.getDescriptorTypeId()); + if (providers == null) { + providers = new ArrayList<>(); + configProviders.put(info.getDescriptorTypeId(), providers); + } + providers.add(info); } } catch (CoreException e) { Activator.log(e.getStatus()); @@ -274,6 +216,41 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } + // Sort things + orderedDescriptorTypes = new ArrayList<>(descriptorTypes.values()); + Collections.sort(orderedDescriptorTypes, new Comparator() { + @Override + public int compare(LaunchDescriptorTypeInfo o1, LaunchDescriptorTypeInfo o2) { + int p1 = o1.getPriority(); + int p2 = o2.getPriority(); + if (p1 < p2) { + return 1; + } else if (p1 > p2) { + return -1; + } else { + return 0; + } + } + }); + + for (List providers : configProviders.values()) { + Collections.sort(providers, new Comparator() { + @Override + public int compare(LaunchConfigProviderInfo o1, LaunchConfigProviderInfo o2) { + int p1 = o1.getPriority(); + int p2 = o2.getPriority(); + if (p1 < p2) { + return 1; + } else if (p1 > p2) { + return -1; + } else { + return 0; + } + } + }); + + } + // Now that all the types are loaded, the object providers which now populate the descriptors for (IExtension extension : extensions) { for (IConfigurationElement element : extension.getConfigurationElements()) { @@ -281,7 +258,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration String elementName = element.getName(); if (elementName.equals("objectProvider")) { //$NON-NLS-1$ ILaunchObjectProvider objectProvider = (ILaunchObjectProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ - addObjectProvider(objectProvider); + objectProviders.add(objectProvider); + objectProvider.init(this); } } catch (Exception e) { Activator.log(e); // exceptions during extension loading, log and move on @@ -290,86 +268,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - private void addDescriptorType(LaunchDescriptorTypeInfo typeInfo) throws CoreException { - descriptorTypes.put(typeInfo.getId(), typeInfo); - // TODO figure out a better place to set the id so we don't load the type object until needed - descriptorTypeInfo.put(typeInfo.getType(), typeInfo); - - Iterator iterator = orderedDescriptorTypes.iterator(); - boolean inserted = false; - for (int i = 0; i < orderedDescriptorTypes.size(); ++i) { - if (iterator.next().getPriority() < typeInfo.getPriority()) { - orderedDescriptorTypes.add(i, typeInfo); - inserted = true; - break; - } - } - - if (!inserted) { - orderedDescriptorTypes.add(typeInfo); - } - - Activator.trace("registered descriptor type " + typeInfo.getId()); //$NON-NLS-1$ - } - - private void addDefaultConfigTargetType(String configTypeId, String targetTypeId, boolean isDefault) { - List targetTypes = configTargetTypes.get(configTypeId); - if (targetTypes == null) { - targetTypes = new ArrayList<>(); - configTargetTypes.put(configTypeId, targetTypes); - } - targetTypes.add(targetTypeId); - - if (isDefault) { - defaultConfigTargetTypes.put(configTypeId, targetTypeId); - } - } - - private void addObjectProvider(ILaunchObjectProvider objectProvider) { - objectProviders.add(objectProvider); - try { - objectProvider.init(this); - } catch (Exception e) { - Activator.log(e); - } - } - - private void addDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { - descriptors.put(getDescriptorId(descriptor), descriptor); - objectDescriptorMap.put(launchObject, descriptor); - setActiveLaunchDescriptor(descriptor); - } - - private void removeDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { - objectDescriptorMap.remove(launchObject); // remove launch object unconditionally - if (descriptor != null) { - descriptors.remove(getDescriptorId(descriptor)); - if (descriptor.equals(activeLaunchDesc)) { - setActiveLaunchDescriptor(getLastUsedDescriptor()); - } - // Also delete any configs created for this descriptor - Map configMap = configs.get(descriptor); - if (configMap != null) { - configs.remove(descriptor); - for (ILaunchConfiguration config : configMap.values()) { - config.delete(); - } - } - } - } - - public String getDescriptorTypeId(ILaunchDescriptorType type) { - return descriptorTypeInfo.get(type).getId(); - } - - private Pair getDescriptorId(ILaunchDescriptor descriptor) { - return new Pair(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); - } - - private Pair getTargetId(IRemoteConnection target) { - return new Pair(target.getConnectionType().getId(), target.getName()); - } - private String toString(Pair key) { return key.getFirst() + ":" + key.getSecond(); //$NON-NLS-1$ } @@ -383,78 +281,49 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return new Pair(key.substring(0, i), key.substring(i + 1)); } - private LaunchTargetTypeInfo getTargetTypeInfo(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - // Figure out what our target type is. - // Any target types registered with this descriptor type? - List targetTypeIds = descriptorTargets.get(getDescriptorTypeId(descriptor.getType())); - if (targetTypeIds == null) { - // Nope, how about with the config type - ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); - if (config != null) { - targetTypeIds = configTargetTypes.get(config.getType().getIdentifier()); - } - } - - LaunchTargetTypeInfo targetTypeInfo = null; - if (targetTypeIds != null) { - for (String targetTypeId : targetTypeIds) { - LaunchTargetTypeInfo info = targetTypes.get(targetTypeId); - if (info != null && info.matches(target)) { - if (targetTypeInfo == null) { - targetTypeInfo = info; - } else { - // Is it a better match? i.e. doesn't rely on wild cards - if ((targetTypeInfo.getOsName().isEmpty() && !info.getOsName().isEmpty()) - || (targetTypeInfo.getOsArch().isEmpty() && !info.getOsArch().isEmpty())) { - targetTypeInfo = info; - } - } - } - } - } - - return targetTypeInfo; + public String getDescriptorTypeId(ILaunchDescriptorType type) { + return descriptorTypeInfo.get(type).getId(); } - private ILaunchConfigurationProvider getConfigProvider(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - if (descriptor == null || target==null) { - return null; - } + private Pair getDescriptorId(ILaunchDescriptor descriptor) { + return new Pair(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); + } - LaunchTargetTypeInfo targetTypeInfo = getTargetTypeInfo(descriptor, target); - if (targetTypeInfo == null) { - return null; - } + private Pair getTargetId(IRemoteConnection target) { + return new Pair(target.getConnectionType().getId(), target.getName()); + } - Map targetMap = configTypes.get(getDescriptorTypeId(descriptor.getType())); - if (targetMap != null) { - String configProviderId = targetMap.get(targetTypeInfo.getId()); - LaunchConfigProviderInfo providerInfo = configProviders.get(configProviderId); - if (providerInfo != null) { - return providerInfo.getProvider(); + private void addDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { + descriptors.put(getDescriptorId(descriptor), descriptor); + objectDescriptorMap.put(launchObject, descriptor); + setActiveLaunchDescriptor(descriptor); + } + + private void removeDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { + objectDescriptorMap.remove(launchObject); // remove launch object unconditionally + if (descriptor != null) { + descriptors.remove(getDescriptorId(descriptor)); + if (descriptor.equals(activeLaunchDesc)) { + setActiveLaunchDescriptor(getLastUsedDescriptor()); + } + + for (LaunchConfigProviderInfo provider : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { + provider.getProvider().launchDescriptorRemoved(descriptor); } } - - return null; } public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { if (descriptor == null) return null; - LaunchTargetTypeInfo targetTypeInfo = getTargetTypeInfo(descriptor, target); - if (targetTypeInfo != null) { - Map targetMap = configTypes.get(getDescriptorTypeId(descriptor.getType())); - if (targetMap != null) { - String configTypeId = targetMap.get(targetTypeInfo.getId()); - return getLaunchManager().getLaunchConfigurationType(configTypeId); + for (LaunchConfigProviderInfo provider : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { + ILaunchConfigurationType type = provider.getProvider().getLaunchConfigurationType(descriptor, target); + if (type != null) { + return type; } } - ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); - if (config != null) - return config.getType(); - return null; } @@ -526,7 +395,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - protected ILaunchDescriptor getLastUsedDescriptor() { + private ILaunchDescriptor getLastUsedDescriptor() { if (descriptors.size() == 0) return null; ILaunchDescriptor[] descs = descriptors.values().toArray(new ILaunchDescriptor[descriptors.size()]); @@ -601,7 +470,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration IRemoteConnectionType remoteServices = remoteServicesManager.getConnectionType(id.getFirst()); if (remoteServices != null) { IRemoteConnection storedTarget = remoteServices.getConnection(id.getSecond()); - if (storedTarget != null && supportsTargetType(activeLaunchDesc, storedTarget)) { + if (storedTarget != null && supportsTarget(activeLaunchDesc, storedTarget)) { setActiveLaunchTarget(storedTarget); return; } @@ -662,7 +531,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.log(e); } } - + private Preferences getPerDescriptorStore() { return getPerDescriptorStore(activeLaunchDesc); } @@ -753,7 +622,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } } - + private void storeLaunchMode(ILaunchDescriptor desc, ILaunchMode mode) { if (mode != null) { @@ -766,42 +635,30 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration if (descriptor == null) return Collections.emptyList(); - // Any target types registered with this descriptor type? - List targetTypeIds = descriptorTargets.get(getDescriptorTypeId(descriptor.getType())); - if (targetTypeIds == null) { - // Nope, how about with the config type - ILaunchConfiguration config = (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); - if (config != null) { - targetTypeIds = configTargetTypes.get(config.getType().getIdentifier()); - } + List targets = new ArrayList<>(); + for (IRemoteConnection target : remoteServicesManager.getAllRemoteConnections()) { + if (supportsTarget(descriptor, target)) { + targets.add(target); + } } - return getLaunchTargets(targetTypeIds); + return targets; } - List getLaunchTargets(List targetTypeIds) { - if (targetTypeIds != null && targetTypeIds.size() > 0) { - List targetList = new ArrayList<>(); - for (IRemoteConnection connection : remoteServicesManager.getAllRemoteConnections()) { - for (String targetTypeId : targetTypeIds) { - LaunchTargetTypeInfo info = targetTypes.get(targetTypeId); - if (info != null && info.matches(connection)) { - targetList.add(connection); - break; - } - } + boolean supportsTarget(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); + for (LaunchConfigProviderInfo provider : configProviders.get(descriptorTypeId)) { + if (provider.getProvider().supports(descriptor, target)) { + return true; } - return targetList; } - // Nope, return the local target, the default default - IRemoteConnectionType localServices = remoteServicesManager.getLocalConnectionType(); - return localServices.getConnections(); + return false; } public IRemoteConnection getActiveLaunchTarget() { return activeLaunchTarget; } - + /** * Sets preferred target for launch descriptor * @param desc @@ -831,15 +688,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } // per desc store, desc can be null means it store globally setPreference(getPerDescriptorStore(desc), PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); - // Also we have to store this in remote connection service - try { - ILaunchConfiguration config = getLaunchConfiguration(desc, target, false); - if (config != null) { - remoteLaunchConfigService.setActiveConnection(config, target); - } - } catch (CoreException e) { - Activator.log(e); - } } private void fireActiveLaunchTargetChanged() { @@ -858,52 +706,26 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return targets.isEmpty() ? null : targets.get(0); } - boolean supportsTargetType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - return getConfigProvider(descriptor, target) != null; - } - public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); } - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - return getLaunchConfiguration(descriptor, target, true); - } - - private ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, - boolean create) throws CoreException { + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { if (descriptor == null) { return null; } - ILaunchConfigurationProvider configProvider = getConfigProvider(descriptor, target); - if (configProvider != null) { - // First see if it exists yet - Map configMap = configs.get(descriptor); - if (configMap != null) { - ILaunchConfiguration config = configMap.get(configProvider); - if (config != null) { - return config; - } - } else { - // we'll need this in a minute - configMap = new HashMap<>(); - configs.put(descriptor, configMap); - } - if (create == false) - return null; - // Not found, create, store and return it - ILaunchConfiguration config = configProvider.createLaunchConfiguration(getLaunchManager(), descriptor); + String descTypeId = getDescriptorTypeId(descriptor.getType()); + for (LaunchConfigProviderInfo provider : configProviders.get(descTypeId)) { + ILaunchConfiguration config = provider.getProvider().getLaunchConfiguration(descriptor, target); if (config != null) { - configMap.put(configProvider, config); - // since new LC is created we need to associate it with remote target - storeLaunchTarget(descriptor, target); return config; } } - return (ILaunchConfiguration) descriptor.getAdapter(ILaunchConfiguration.class); + return null; } public void addListener(Listener listener) { @@ -920,108 +742,45 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public void launchConfigurationAdded(ILaunchConfiguration configuration) { - Activator.trace("launch config added " + configuration); //$NON-NLS-1$ - try { - LaunchConfigProviderInfo info = configProviders.get(configuration.getType().getIdentifier()); - if (info != null) { - ILaunchConfigurationProvider provider = info.getProvider(); - Object launchObject = provider.launchConfigurationAdded(configuration); - if (launchObject != null) { - ILaunchDescriptor descriptor = objectDescriptorMap.get(launchObject); - if (descriptor != null) { - Map configMap = configs.get(descriptor); - if (configMap == null) { - configMap = new HashMap<>(); - configs.put(descriptor, configMap); + for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { + try { + Object launchObject = providerInfo.getProvider().launchConfigurationAdded(configuration); + if (launchObject != null) { + ILaunchDescriptor descriptor = objectDescriptorMap.get(launchObject); + if (descriptor != null) { + setActiveLaunchDescriptor(descriptor); + } else { + launchObjectAdded(configuration); } - configMap.put(provider, configuration); + return; } - Activator.trace("launch config claimed by " + provider); //$NON-NLS-1$ - return; + } catch (Throwable e) { + Activator.log(e); } } - } catch (Throwable e) { - // catching throwable here because provider is user class and it can do nasty things :) - Activator.log(e); - } - - Activator.trace("launch config not claimed"); //$NON-NLS-1$ - try { - ILaunchDescriptor desc = defaultDescriptorType.getDescriptor(configuration); - if( desc != null ) { - addDescriptor(configuration, desc); - } - } catch (CoreException e) { - Activator.log(e.getStatus()); } } @Override public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - Activator.trace("launch config removed " + configuration); //$NON-NLS-1$ + try { + launchObjectRemoved(configuration); + } catch (Throwable e) { + Activator.log(e); + } - // Is there any way this method is called when a LC still exists??? This may be dead code. - // configuration.getType() will fail when !configuration.exists() - if (configuration.exists()) { - try { - LaunchConfigProviderInfo info = configProviders.get(configuration.getType().getIdentifier()); - if (info != null) { - ILaunchConfigurationProvider provider = info.getProvider(); - if (provider.launchConfigurationRemoved(configuration)) { - Activator.trace("launch config removed by " + provider); //$NON-NLS-1$ + // TODO do I need to do this if configs are launch objects? + for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { + try { + if (providerInfo.getProvider().launchConfigurationRemoved(configuration)) { return; } - } - } catch (Throwable e) { - Activator.log(e); - } - } - - Activator.trace("launch config not claimed"); //$NON-NLS-1$ - ILaunchDescriptor desc = objectDescriptorMap.get(configuration); - if (desc == null) { - /* WARNING: This is slow. Call only as a last resort */ - Iterator>> iter = configs.entrySet().iterator(); - while (iter.hasNext()) { - Entry> e1 = iter.next(); - if (e1.getValue().containsValue(configuration)) { - Iterator> iter2 = e1.getValue().entrySet().iterator(); - while (iter2.hasNext()) { - Entry e2 = iter2.next(); - if (e2.getValue().equals(configuration)) { - final ILaunchConfigurationProvider provider = e2.getKey(); - try { - provider.launchConfigurationRemoved(e2.getValue()); - Activator.trace("launch config removed by " + provider); //$NON-NLS-1$ - } catch (Throwable e) { - Activator.log(e); - } - e1.getValue().remove((ILaunchConfigurationProvider) provider); - return; - } - } - break; + } catch (Throwable e) { + Activator.log(e); } } - } else { - Map configMap = configs.get(desc); - if (configMap != null) { - for (ILaunchConfigurationProvider provider : configMap.keySet()) { - try { - if (provider.launchConfigurationRemoved(configuration)) { - Activator.trace("launch config removed by " + provider); //$NON-NLS-1$ - return; - } - } catch (Throwable e) { - Activator.log(e); - } - } - } - } - try { - removeDescriptor(configuration, desc); - } catch (CoreException e) { - Activator.log(e.getStatus()); } } @@ -1066,9 +825,10 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration break; } } - + private void fireLaunchTargetsChanged() { - if (!initialized) return; + if (!initialized) + return; for (Listener listener : listeners) { try { listener.launchTargetsChanged(); @@ -1083,7 +843,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return; fireLaunchTargetsChanged(); // if we added new target we probably want to use it - if (activeLaunchDesc != null && supportsTargetType(activeLaunchDesc, target)) { + if (activeLaunchDesc != null && supportsTarget(activeLaunchDesc, target)) { setActiveLaunchTarget(target); } } @@ -1097,7 +857,4 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - public DefaultLaunchDescriptorType getDefaultDescriptorType(){ - return defaultDescriptorType; - } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index d7b4b51c6e6..75219c64e57 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -5,17 +5,32 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; public class LaunchConfigProviderInfo { - private final String launchConfigTypeId; + private final String descriptorTypeId; + private final int priority; private IConfigurationElement element; private ILaunchConfigurationProvider provider; public LaunchConfigProviderInfo(IConfigurationElement element) { - this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ + this.descriptorTypeId = element.getAttribute("descriptorType"); //$NON-NLS-1$ + + String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$ + int priorityNum; + try { + priorityNum = Integer.parseInt(priorityStr); + } catch (NumberFormatException e) { + priorityNum = 0; + } + priority = priorityNum; + this.element = element; } - public String getLaunchConfigTypeId() { - return launchConfigTypeId; + public String getDescriptorTypeId() { + return descriptorTypeId; + } + + public int getPriority() { + return priority; } public ILaunchConfigurationProvider getProvider() throws CoreException { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java deleted file mode 100644 index 181dda659ca..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigTypeInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.launchbar.core.internal; - -import org.eclipse.core.runtime.IConfigurationElement; - -public class LaunchConfigTypeInfo { - private final String descriptorTypeId; - private final String targetTypeId; - private final String launchConfigTypeId; - - public LaunchConfigTypeInfo(IConfigurationElement element) { - this.descriptorTypeId = element.getAttribute("descriptorType"); //$NON-NLS-1$ - this.targetTypeId = element.getAttribute("targetType"); //$NON-NLS-1$ - this.launchConfigTypeId = element.getAttribute("launchConfigurationType"); //$NON-NLS-1$ - } - - public String getDescriptorTypeId() { - return descriptorTypeId; - } - - public String getTargetTypeId() { - return targetTypeId; - } - - public String getLaunchConfigTypeId() { - return launchConfigTypeId; - } -} \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java deleted file mode 100644 index 4d53980ba77..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchTargetTypeInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014,2015 QNX Software Systems 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: - * Doug Schaefer - * Elena Laskavaia - *******************************************************************************/ -package org.eclipse.launchbar.core.internal; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.remote.core.IRemoteConnection; - -class LaunchTargetTypeInfo { - private static final String ANY = ""; //$NON-NLS-1$ - private final String id; - private final String connectionTypeId; - private String osname; - private String osarch; - - public LaunchTargetTypeInfo(IConfigurationElement ce) { - id = ce.getAttribute("id"); //$NON-NLS-1$ - connectionTypeId = ce.getAttribute("connectionTypeId"); //$NON-NLS-1$ - if (id == null || connectionTypeId == null) - throw new NullPointerException(); - osname = ce.getAttribute("osname"); //$NON-NLS-1$ - if (osname == null) { - osname = ANY; - } - osarch = ce.getAttribute("osarch"); //$NON-NLS-1$ - if (osarch == null) { - osarch = ANY; - } - } - - public String getId() { - return id; - } - - public String getRemoteServicesId() { - return connectionTypeId; - } - - public String getOsName() { - return osname; - } - - public String getOsArch() { - return osarch; - } - - public boolean matches(IRemoteConnection connection) { - if (!connectionTypeId.equals(connection.getConnectionType().getId())) { - return false; - } - if (!osname.isEmpty() && !osname.equals(connection.getProperty(IRemoteConnection.OS_NAME_PROPERTY))) { - return false; - } - if (!osarch.isEmpty() && !osarch.equals(connection.getProperty(IRemoteConnection.OS_ARCH_PROPERTY))) { - return false; - } - return true; - } -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java new file mode 100644 index 00000000000..39fdf01c4d6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java @@ -0,0 +1,131 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * QNX Software Systems - initial + * IBM and others who contributed to ILaunchConfigurationDelegate2 + * and ILaunchConfigurationDelegate + *******************************************************************************/ +package org.eclipse.launchbar.core.launch; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; +import org.eclipse.remote.core.IRemoteConnection; + +/** + * A launch configuration delegate that accepts a IRemoteConnection as an additional + * parameter to the launch functions. Delegates who want to receive this parameter from + * the LaunchBar launch actions need to implement this interface. + */ +public interface IRemoteLaunchConfigurationDelegate extends ILaunchConfigurationDelegate2 { + + /** + * Returns a launch object to use when launching the given launch + * configuration in the given mode, or null if a new default + * launch object should be created by the debug platform. If a launch object + * is returned, its launch mode must match that of the mode specified in + * this method call. + * + * @param configuration the configuration being launched + * @param mode the mode the configuration is being launched in + * @param target the remote connection to launch on + * @return a launch object or null + * @throws CoreException if unable to launch + */ + public ILaunch getLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target) throws CoreException; + + /** + * Optionally performs any required building before launching the given + * configuration in the specified mode, and returns whether the debug platform + * should perform an incremental workspace build before the launch continues. + * If false is returned the launch will proceed without further + * building, and if true is returned an incremental build will + * be performed on the workspace before launching. + *

+ * This method is only called if the launch is invoked with flag indicating + * building should take place before the launch. This is done via the + * method + * ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build). + *

+ * @param configuration the configuration being launched + * @param mode the mode the configuration is being launched in + * @param target the remote connection the configuration is being launched on + * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job + * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided + * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor + * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag + * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. + * @return whether the debug platform should perform an incremental workspace + * build before the launch + * @throws CoreException if an exception occurs while building + */ + public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, IProgressMonitor monitor) throws CoreException; + + /** + * Returns whether a launch should proceed. This method is called after + * preLaunchCheck() and buildForLaunch() providing + * a final chance for this launch delegate to abort a launch if required. + * For example, a delegate could cancel a launch if it discovered compilation + * errors that would prevent the launch from succeeding. + * + * @param configuration the configuration being launched + * @param mode launch mode + * @param target the remote connection the configuration is being launched on + * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job + * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided + * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor + * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag + * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. + * @return whether the launch should proceed + * @throws CoreException if an exception occurs during final checks + */ + public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, IProgressMonitor monitor) throws CoreException; + + /** + * Returns whether a launch should proceed. This method is called first + * in the launch sequence providing an opportunity for this launch delegate + * to abort the launch. + * + * @param configuration configuration being launched + * @param mode launch mode + * @param target the remote connection the configuration is being launched on + * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job + * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided + * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor + * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag + * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. + * @return whether the launch should proceed + * @throws CoreException if an exception occurs while performing pre-launch checks + */ + public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, IProgressMonitor monitor) throws CoreException; + + /** + * Launches the given configuration in the specified mode, contributing + * debug targets and/or processes to the given launch object. The + * launch object has already been registered with the launch manager. + * + * @param configuration the configuration to launch + * @param mode the mode in which to launch, one of the mode constants + * defined by ILaunchManager - + * RUN_MODE or DEBUG_MODE. + * @param target the remote connection the configuration to launched on + * @param monitor progress monitor, or null progress monitor, or null. A cancelable progress + * monitor is provided by the Job framework. It should be noted that the setCanceled(boolean) method should + * never be called on the provided monitor or the monitor passed to any delegates from this method; due to a + * limitation in the progress monitor framework using the setCanceled method can cause entire workspace batch + * jobs to be canceled, as the canceled flag is propagated up the top-level parent monitor. + * The provided monitor is not guaranteed to have been started. + * @param launch the launch object to contribute processes and debug + * targets to + * @exception CoreException if launching fails + */ + public void launch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, ILaunch launch, IProgressMonitor monitor) throws CoreException; + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java new file mode 100644 index 00000000000..c7c0f938515 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * QNX Software Systems - initial + *******************************************************************************/ +package org.eclipse.launchbar.core.launch; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.model.LaunchConfigurationDelegate; +import org.eclipse.remote.core.IRemoteConnection; + +public abstract class RemoteLaunchConfigurationDelegate extends LaunchConfigurationDelegate + implements IRemoteLaunchConfigurationDelegate { + + @Override + public ILaunch getLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target) + throws CoreException { + return getLaunch(configuration, mode); + } + + @Override + public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, + IProgressMonitor monitor) throws CoreException { + return buildForLaunch(configuration, mode, monitor); + } + + @Override + public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, + IProgressMonitor monitor) throws CoreException { + return finalLaunchCheck(configuration, mode, monitor); + } + + @Override + public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, + IProgressMonitor monitor) throws CoreException { + return preLaunchCheck(configuration, mode, monitor); + } + + @Override + public void launch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, ILaunch launch, + IProgressMonitor monitor) throws CoreException { + launch(configuration, mode, launch, monitor); + } + + @Override + public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) + throws CoreException { + // do nothing by default assuming the subclass has implemented a proper remote launch() method. + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 34637d6ea5d..b6421bd3531 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -14,6 +14,8 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.launchbar.ui.internal.messages"; //$NON-NLS-1$ + public static String BuildActiveCommandHandler_0; + public static String BuildActiveCommandHandler_1; public static String ConfigSelector_0; public static String ConfigSelector_1; public static String ConfigSelector_2; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index 171ac471118..29197d2586f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -35,7 +35,10 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.launch.IRemoteLaunchConfigurationDelegate; import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; @@ -52,23 +55,25 @@ public class BuildActiveCommandHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { - new UIJob(Display.getDefault(), "Building Active Configuration") { - @Override - public boolean belongsTo(Object family) { - return ResourcesPlugin.FAMILY_MANUAL_BUILD.equals(family); - } + try { + LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + final ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); + final ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + final IRemoteConnection target = launchBarManager.getActiveLaunchTarget(); - public IStatus runInUIThread(IProgressMonitor monitor) { - try { - final LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - final ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); + new UIJob(Display.getDefault(), Messages.BuildActiveCommandHandler_0) { + @Override + public boolean belongsTo(Object family) { + return ResourcesPlugin.FAMILY_MANUAL_BUILD.equals(family); + } + public IStatus runInUIThread(IProgressMonitor monitor) { final Collection projects = getProjects(config); if (BuildAction.isSaveAllSet()) { saveEditors(projects); } - new Job("Building Active Configuration") { + new Job(Messages.BuildActiveCommandHandler_1) { @Override protected IStatus run(IProgressMonitor monitor) { try { @@ -77,25 +82,36 @@ public class BuildActiveCommandHandler extends AbstractHandler { ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); return Status.OK_STATUS; } - - ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); - String mode = launchMode.getIdentifier(); + + String mode = launchMode != null ? launchMode.getIdentifier() : "run"; //$NON-NLS-1$ Set modes = new HashSet<>(); modes.add(mode); ILaunchDelegate delegate = config.getType().getPreferredDelegate(modes); if (delegate == null) delegate = config.getType().getDelegates(modes)[0]; ILaunchConfigurationDelegate configDel = delegate.getDelegate(); - if (configDel instanceof ILaunchConfigurationDelegate2) { + if (configDel instanceof IRemoteLaunchConfigurationDelegate) { + IRemoteLaunchConfigurationDelegate configDel2 = (IRemoteLaunchConfigurationDelegate)configDel; + boolean ret; + ret = configDel2.preLaunchCheck(config, mode, target, monitor); + if (!ret) { + return Status.CANCEL_STATUS; + } + if (!configDel2.buildForLaunch(config, mode, target, monitor)) { + return Status.OK_STATUS; + } + } else if (configDel instanceof ILaunchConfigurationDelegate2) { ILaunchConfigurationDelegate2 configDel2 = (ILaunchConfigurationDelegate2)configDel; boolean ret; ret = configDel2.preLaunchCheck(config, mode, monitor); - if (!ret) + if (!ret) { return Status.CANCEL_STATUS; - if (!configDel2.buildForLaunch(config, mode, monitor)) + } + if (!configDel2.buildForLaunch(config, mode, monitor)) { return Status.OK_STATUS; + } } - + // Fall through, do a normal build if (projects.isEmpty()) { ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); @@ -111,14 +127,14 @@ public class BuildActiveCommandHandler extends AbstractHandler { } } }.schedule(); - } catch (CoreException e) { - return e.getStatus(); - } - return Status.OK_STATUS; - }; - }.schedule(); + return Status.OK_STATUS; + }; + }.schedule(); + } catch (CoreException e) { + return e.getStatus(); + } return Status.OK_STATUS; } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index f8361fad94f..9f650bdedfb 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -17,7 +17,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.layout.GridLayoutFactory; -import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; @@ -188,23 +187,6 @@ public abstract class CSelector extends Composite { } }; - private ICellModifier modifier = new ICellModifier() { - @Override - public void modify(Object element, String property, Object value) { - handleEdit(element); - } - - @Override - public Object getValue(Object element, String property) { - return null; - } - - @Override - public boolean canModify(Object element, String property) { - return isEditable(element); - } - }; - public CSelector(Composite parent, int style) { super(parent, style); @@ -439,7 +421,6 @@ public abstract class CSelector extends Composite { protected void initializeListViewer(LaunchBarListViewer listViewer) { listViewer.setContentProvider(contentProvider); listViewer.setLabelProvider(labelProvider); - listViewer.setCellModifier(modifier); listViewer.setComparator(sorter); listViewer.setHistoryComparator(sorterTop); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 47a732bebce..5e648b536df 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -24,7 +24,6 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.Window; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; @@ -198,12 +197,7 @@ public class ConfigSelector extends CSelector { new Job(Messages.ConfigSelector_3) { protected IStatus run(IProgressMonitor monitor) { try { - final LaunchBarManager barManager = uiManager.getManager(); - final ILaunchDescriptor desc = barManager.getDefaultDescriptorType().getDescriptor(wizard.getWorkingCopy()); - if (desc != null) { - barManager.setLaunchMode(desc, wizard.getLaunchMode()); - } - wizard.getWorkingCopy().doSave();// that would trigger active config change + wizard.getWorkingCopy().doSave(); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index e86c77c80bc..7688a76053e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -6,7 +6,6 @@ import java.util.List; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.IFontProvider; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; @@ -31,8 +30,6 @@ import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; @@ -61,7 +58,6 @@ public class LaunchBarListViewer extends StructuredViewer { private final int maxScrollBucket = 6; private int separatorIndex = -1; private boolean historySupported = true; - private ICellModifier modifier; private ViewerComparator historyComparator; private boolean finalSelection = false; private FilterControl filterControl; @@ -169,19 +165,16 @@ public class LaunchBarListViewer extends StructuredViewer { private Color outlineColor = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); private Color highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); private ILabelProvider labelProvider; - private ICellModifier modifer; @Override public String toString() { return "[" + index + "] " + labelProvider.getText(element); //$NON-NLS-1$ //$NON-NLS-2$ } - public ListItem(Composite parent, int style, Object element, int index, ILabelProvider labelProvider, - ICellModifier modifier) { + public ListItem(Composite parent, int style, Object element, int index, ILabelProvider labelProvider) { super(parent, style); this.element = element; this.index = index; this.labelProvider = labelProvider; - this.modifer = modifier; setData(element); addPaintListener(new PaintListener() { @Override @@ -199,12 +192,9 @@ public class LaunchBarListViewer extends StructuredViewer { protected void lazyInit() { Image image = labelProvider.getImage(element); - boolean editable = isEditable(element); int columns = 1; if (image != null) columns++; - if (editable) - columns++; GridLayout layout = new GridLayout(columns, false); layout.marginWidth = layout.marginHeight = 7; setLayout(layout); @@ -235,31 +225,9 @@ public class LaunchBarListViewer extends StructuredViewer { label = createLabel(this, element); label.addMouseListener(listItemMouseListener); label.addMouseTrackListener(listItemMouseTrackListener); - if (editable) { - editButton = new EditButton(this, SWT.NONE); - editButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - // Need to run this after the current event storm - // Or we get a disposed error. - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (editButton.isSelected()) - handleEdit(element); - } - }); - } - }); - editButton.setBackground(backgroundColor); - editButton.addMouseTrackListener(listItemMouseTrackListener); - editButton.addTraverseListener(listItemTraverseListener); - editButton.addKeyListener(lisItemKeyListener); - } else { - // add traverse listnener to control which will have keyboard focus - addTraverseListener(listItemTraverseListener); - addKeyListener(lisItemKeyListener); - } + // add traverse listnener to control which will have keyboard focus + addTraverseListener(listItemTraverseListener); + addKeyListener(lisItemKeyListener); setBackground(backgroundColor); layout(true); @@ -286,19 +254,6 @@ public class LaunchBarListViewer extends StructuredViewer { } } - protected boolean isEditable(Object element) { - if (modifer != null) { - return modifer.canModify(element, null); - } - return false; - } - - protected void handleEdit(Object element) { - if (modifer != null) { - modifer.modify(element, null, null); - } - } - @Override public void setBackground(Color color) { super.setBackground(color); @@ -470,7 +425,7 @@ public class LaunchBarListViewer extends StructuredViewer { } private ListItem createListItem(Object[] elements, int i) { - ListItem item = new ListItem(listComposite, SWT.NONE, elements[i], i, (ILabelProvider) getLabelProvider(), modifier); + ListItem item = new ListItem(listComposite, SWT.NONE, elements[i], i, (ILabelProvider) getLabelProvider()); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); item.setLayoutData(gd); if (i <= maxScrollBucket) { // this is how many visible by default @@ -601,10 +556,6 @@ public class LaunchBarListViewer extends StructuredViewer { return historyPref; } - public void setCellModifier(ICellModifier modifier) { - this.modifier = modifier; - } - public int getItemCount() { return listItems.length; } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index bba5ba68c8f..46145371e8f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -21,13 +21,14 @@ import org.eclipse.core.commands.NotHandledException; import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.ui.IRemoteUIConnectionService; +import org.eclipse.remote.ui.RemoteConnectionsLabelProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -37,7 +38,6 @@ import org.eclipse.swt.events.MouseTrackListener; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -79,29 +79,7 @@ public class TargetSelector extends CSelector { } }); - setLabelProvider(new LabelProvider() { - @Override - public Image getImage(Object element) { - if (element instanceof IRemoteConnection) { - IRemoteConnection target = (IRemoteConnection) element; - if (target.isOpen()) { - return Activator.getDefault().getImage("icons/connected.png"); - } else { - return Activator.getDefault().getImage("icons/disconnected.png"); - } - } - return super.getImage(element); - } - - @Override - public String getText(Object element) { - if (element instanceof IRemoteConnection) { - IRemoteConnection target = (IRemoteConnection) element; - return target.getName(); - } - return super.getText(element); - } - }); + setLabelProvider(new RemoteConnectionsLabelProvider()); setSorter(new Comparator() { @Override @@ -163,8 +141,7 @@ public class TargetSelector extends CSelector { public void mouseUp(org.eclipse.swt.events.MouseEvent event) { try { ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); - // TODO the command id should be in a remote ui interface - Command newConnectionCmd = commandService.getCommand("org.eclipse.remote.ui.command.newConnection"); //$NON-NLS-1$ + Command newConnectionCmd = commandService.getCommand(IRemoteUIConnectionService.NEW_CONNECTION_COMMAND); newConnectionCmd.executeWithChecks(new ExecutionEvent()); } catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e) { Activator.log(e); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index be73c78e828..496ccf7940b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -1,3 +1,5 @@ +BuildActiveCommandHandler_0=Building Active Configuration +BuildActiveCommandHandler_1=Building Active Configuration ConfigSelector_0=No Launch Configurations ConfigSelector_1=Launch configuration ConfigSelector_2=Create New Configuration... diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index d02fbfaba19..1a3ebb2df08 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -10,14 +10,27 @@ *******************************************************************************/ package org.eclipse.launchbar.core.internal; -import static org.junit.Assert.*; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -38,22 +51,22 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.DefaultLaunchConfigProvider; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; -import org.eclipse.launchbar.core.ProjectLaunchConfigurationProvider; import org.eclipse.launchbar.core.ProjectLaunchDescriptor; +import org.eclipse.launchbar.core.ProjectPerTypeLaunchConfigProvider; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; -import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -@SuppressWarnings("restriction") +@SuppressWarnings({"restriction", "nls"}) @FixMethodOrder(MethodSorters.JVM) public class LaunchBarManager2Test { private LaunchBarManager manager; @@ -69,13 +82,12 @@ public class LaunchBarManager2Test { IEclipsePreferences store = new EclipsePreferences(); private ArrayList elements; private IExtension extension; - private String localTargetTypeId; + private static final String localTargetTypeId = "org.eclipse.remote.LocalServices"; private String descriptorTypeId; private IRemoteConnection localTarget; private String launchObject; private IRemoteServicesManager remoteServiceManager; private IRemoteConnection otherTarget; - private String otherTargetTypeId; private List targets; public class FixedLaunchBarManager extends LaunchBarManager { @@ -98,11 +110,6 @@ public class LaunchBarManager2Test { return store; } - @Override - IRemoteLaunchConfigService getRemoteLaunchConfigService() { - return mock(IRemoteLaunchConfigService.class); - } - @Override IRemoteServicesManager getRemoteServicesManager() { return remoteServiceManager; @@ -114,30 +121,31 @@ public class LaunchBarManager2Test { basicSetup(); } - protected IConfigurationElement mockConfigTypeElement(String targetTypeId, String descriptorTypeId, String launchConfigTypeId) { - IConfigurationElement element = mockElementAndAdd("configType"); - doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); - doReturn(targetTypeId).when(element).getAttribute("targetType"); - doReturn(launchConfigTypeId).when(element).getAttribute("launchConfigurationType"); - return element; - } - - protected ILaunchConfigurationProvider mockProviderTypes(ILaunchConfigurationProvider provider) - throws CoreException { - doReturn(launchConfigType).when(provider).getLaunchConfigurationType(); - doReturn(launchConfig).when(provider).createLaunchConfiguration(lman, descriptor); - return provider; - } - - protected void mockProviderElement(ILaunchConfigurationProvider provider) throws CoreException { + protected void mockProviderElement(String descriptorTypeId, int priority, ILaunchConfigurationProvider provider) throws CoreException { IConfigurationElement element = mockElementAndAdd("configProvider"); - doReturn(launchConfigType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); + doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); + doReturn(Integer.toString(priority)).when(element).getAttribute("priority"); doReturn(provider).when(element).createExecutableExtension("class"); } - protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId) { + protected ILaunchConfigurationProvider mockProviderElement(String descriptorTypeId, int priority, ILaunchDescriptor descriptor, IRemoteConnection target, + ILaunchConfiguration config, Object launchObj) throws CoreException { + ILaunchConfigurationProvider provider = mock(ILaunchConfigurationProvider.class); + mockProviderElement(descriptorTypeId, priority, provider); + doReturn(config.getType()).when(provider).getLaunchConfigurationType(descriptor, target); + doReturn(config).when(provider).getLaunchConfiguration(descriptor, target); + doReturn(true).when(provider).supports(descriptor, target); + doReturn(true).when(provider).ownsLaunchConfiguration(config); + doReturn(launchObj).when(provider).launchConfigurationAdded(config); + return provider; + } + + protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId, int priority, ILaunchDescriptorType descriptorType) + throws CoreException { IConfigurationElement element = mockElementAndAdd("descriptorType"); doReturn(descriptorTypeId).when(element).getAttribute("id"); + doReturn(Integer.toString(priority)).when(element).getAttribute("priority"); + doReturn(descriptorType).when(element).createExecutableExtension("class"); return element; } @@ -154,34 +162,12 @@ public class LaunchBarManager2Test { return element; } - protected String mockLocalTargetElement() { - IConfigurationElement element = mockElementAndAdd("targetType"); - String targetTypeId = "org.eclipse.launchbar.core.targetType.local"; - doReturn(targetTypeId).when(element).getAttribute("id"); - doReturn("org.eclipse.remote.LocalServices").when(element).getAttribute("connectionTypeId"); - return targetTypeId; - } - - protected IConfigurationElement mockTargetElement(String id) { - IConfigurationElement element = mockElementAndAdd("targetType"); - doReturn(id).when(element).getAttribute("id"); - doReturn(id).when(element).getAttribute("connectionTypeId"); - return element; - } - protected void mockLaunchObjectOnDescriptor(Object launchObject) throws CoreException { doReturn(true).when(descriptorType).ownsLaunchObject(launchObject); doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); doReturn(launchObject.toString()).when(descriptor).getName(); } - protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId, ILaunchDescriptorType descriptorType) - throws CoreException { - IConfigurationElement element = mockDescriptorTypeElement(descriptorTypeId); - doReturn(descriptorType).when(element).createExecutableExtension("class"); - return element; - } - private ILaunchConfiguration mockLC(String string, ILaunchConfigurationType lctype2) throws CoreException { ILaunchConfiguration lc = mock(ILaunchConfiguration.class); doReturn(string).when(lc).getName(); @@ -238,9 +224,9 @@ public class LaunchBarManager2Test { } @Override - public Object getAdapter(Class adapter) { + public T getAdapter(Class adapter) { if (adapter.isInstance(conf)) - return conf; + return adapter.cast(conf); return super.getAdapter(adapter); } @@ -271,37 +257,38 @@ public class LaunchBarManager2Test { doReturn(new ILaunchConfiguration[] {}).when(lman).getLaunchConfigurations(); remoteServiceManager = spy(Activator.getService(IRemoteServicesManager.class)); manager = new FixedLaunchBarManager(); - // mock - // lc - launchConfigType = mockLCType("lctype1"); - launchConfig = mockLC("bla", launchConfigType); - // launch config type - mockLaunchModes(launchConfigType, "run", "debug"); - // target - localTargetTypeId = mockLocalTargetElement(); - // launch descriptor and type - descriptorType = mock(ILaunchDescriptorType.class); - descriptorTypeId = "descType"; - mockDescriptorTypeElement(descriptorTypeId, descriptorType); - descriptor = mock(ILaunchDescriptor.class); - doReturn(descriptorType).when(descriptor).getType(); - // configProvider - provider = mock(ILaunchConfigurationProvider.class); - mockProviderElement(provider); - mockProviderTypes(provider); - - launchObject = "test"; - mockLaunchObjectOnDescriptor(launchObject); localTarget = manager.getRemoteServicesManager().getLocalConnectionType().getConnections().get(0); - otherTargetTypeId = "target2"; - mockTargetElement(otherTargetTypeId); + // mock + launchObject = "test"; + // remote connections otherTarget = mock(IRemoteConnection.class); IRemoteConnectionType rtype = mock(IRemoteConnectionType.class); doReturn(rtype).when(otherTarget).getConnectionType(); - doReturn(otherTargetTypeId).when(rtype).getId(); + doReturn("otherTargetType").when(rtype).getId(); targets = Arrays.asList(new IRemoteConnection[] { otherTarget, localTarget }); - // configType - mockConfigTypeElement(otherTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + // lc + String launchConfigTypeId = "lctype1"; + launchConfigType = mockLCType(launchConfigTypeId); + launchConfig = mockLC(launchObject, launchConfigType); + // launch config type + mockLaunchModes(launchConfigType, "run", "debug"); + // launch descriptor and type + descriptorType = mock(ILaunchDescriptorType.class); + descriptorTypeId = "descType"; + mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); + descriptor = mock(ILaunchDescriptor.class); + doReturn(descriptorType).when(descriptor).getType(); + doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); + // configProvider + provider = mockProviderElement(descriptorTypeId, 10, descriptor, otherTarget, launchConfig, launchObject); + + mockLaunchObjectOnDescriptor(launchObject); + + // default descriptor + String defaultDescTypeId = "defaultDescType"; + mockDescriptorTypeElement(defaultDescTypeId, 0, new DefaultLaunchDescriptorType()); + ILaunchConfigurationProvider defaultProvider = new DefaultLaunchConfigProvider(); + mockProviderElement(defaultDescTypeId, 0, defaultProvider); } @Test @@ -339,58 +326,29 @@ public class LaunchBarManager2Test { verify(descriptorType).ownsLaunchObject(any()); } - @Test - public void testAddConfigProviderNoTarget_failing() { - // here target type is not defined - try { - basicSetupOnly(); - // configType - mockConfigTypeElement("xxx", descriptorTypeId, launchConfigType.getIdentifier()); - init(); - //fail("Expecting exctpion because target is not registered"); - } catch (Exception e) { - // pass - fail();// fail for now when this is fixed - fix the test - } - } - - // - // @Test - // public void testAddConfigProviderNoDesc() { - // try { - // manager.addTargetType(targetType); - // manager.addConfigProvider(descType.getId(), targetType.getId(), false, provider); - // fail("Expecting exctpion because target is not registered"); - // } catch (Exception e) { - // // pass - // } - // } - // @Test public void testAddConfigMappingTwo() throws CoreException { basicSetupOnly(); - String t2 = "t2"; - mockTargetElement(t2); - IRemoteConnection target = mockRemoteConnection(t2); - mockConfigTypeElement(t2, descriptorTypeId, launchConfigType.getIdentifier()); - init(); + IRemoteConnection target = mockRemoteConnection("t2"); + mockProviderElement(descriptorTypeId, 10, descriptor, target, launchConfig, launchObject); // now create another lc type, which is not registered in config type ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); ILaunchConfiguration lc2 = mockLC("bla2", lctype2); ConfigBasedLaunchDescriptor desc2 = new ConfigBasedLaunchDescriptor(descriptorType, lc2); + mockProviderElement(descriptorTypeId, 10, desc2, target, lc2, lc2); + init(); // it return original lctype because we did not associate this dynmaically - assertEquals(launchConfigType, manager.getLaunchConfigurationType(desc2, target)); + assertEquals(launchConfigType, manager.getLaunchConfigurationType(descriptor, target)); } @Test public void testAddConfigProviderTwo2() throws CoreException { basicSetupOnly(); - String t2 = "t2"; - mockTargetElement(t2); - IRemoteConnection target = mockRemoteConnection(t2); - mockConfigTypeElement(t2, descriptorTypeId, launchConfigType.getIdentifier()); + IRemoteConnection target = mockRemoteConnection("t2"); + mockProviderElement(descriptorTypeId, 15, descriptor, target, launchConfig, launchObject); ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); - mockConfigTypeElement(t2, descriptorTypeId, lctype2.getIdentifier()); + ILaunchConfiguration lc2 = mockLC("lc2", lctype2); + mockProviderElement(descriptorTypeId, 20, descriptor, target, lc2, launchObject); init(); assertEquals(lctype2, manager.getLaunchConfigurationType(descriptor, target)); } @@ -408,8 +366,8 @@ public class LaunchBarManager2Test { public void testGetLaunchTargetsNoConfigMapping() throws CoreException { basicSetupOnly(); elements.clear(); - mockLocalTargetElement(); - mockDescriptorTypeElement(descriptorTypeId, descriptorType); + mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); + mockProviderElement(descriptorTypeId, 10, new DefaultLaunchConfigProvider()); init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); @@ -421,9 +379,8 @@ public class LaunchBarManager2Test { public void testGetLaunchTargetsConfigMapping() throws CoreException { basicSetupOnly(); elements.clear(); - mockLocalTargetElement(); - mockDescriptorTypeElement(descriptorTypeId, descriptorType); - mockConfigTypeElement(localTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); + mockProviderElement(descriptorTypeId, 10, descriptor, localTarget, launchConfig, launchObject); init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); @@ -539,7 +496,16 @@ public class LaunchBarManager2Test { public ILaunchConfiguration mockLCAttribute(ILaunchConfiguration lc, String attr, String value) { try { - when(lc.getAttribute(eq(attr), anyString())).thenReturn(value); + doReturn(value).when(lc).getAttribute(eq(attr), anyString()); + } catch (CoreException e) { + throw new RuntimeException(e); + } + return lc; + } + + public ILaunchConfiguration mockLCAttribute(ILaunchConfiguration lc, String attr, boolean value) { + try { + doReturn(value).when(lc).getAttribute(attr, false); } catch (CoreException e) { throw new RuntimeException(e); } @@ -583,29 +549,53 @@ public class LaunchBarManager2Test { return "pbtype"; } } + String ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; + String PROJECT_CONFIG = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".projectConfig"; protected void projectMappingSetup() throws CoreException { descriptorType = new ProjectBasedLaunchDescriptorType(); descriptorTypeId = ((ProjectBasedLaunchDescriptorType) descriptorType).getId(); - provider = new ProjectLaunchConfigurationProvider() { - @Override - public ILaunchConfigurationType getLaunchConfigurationType() throws CoreException { - return launchConfigType; - } - }; aaa = mockProject("aaa"); descriptor = new ProjectLaunchDescriptor(descriptorType, aaa); // setup some stuff - localTargetTypeId = mockLocalTargetElement(); - IConfigurationElement element = mockDescriptorTypeElement(descriptorTypeId, descriptorType); - // configType - mockConfigTypeElement(localTargetTypeId, descriptorTypeId, launchConfigType.getIdentifier()); + mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); //lc = provider.createLaunchConfiguration(lman, descType.getDescriptor(aaa)); mockLCProject(launchConfig, aaa); - mockLCAttribute(launchConfig, ORIGINAL_NAME, aaa.getName()); - mockProviderElement(provider); + mockLCAttribute(launchConfig, PROJECT_CONFIG, true); assertEquals(0, manager.getLaunchDescriptors().length); + provider = new ProjectPerTypeLaunchConfigProvider() { + @Override + protected String getRemoteConnectionTypeId() { + return localTargetTypeId; + } + + @Override + protected String getLaunchConfigurationTypeId() { + return launchConfigType.getIdentifier(); + } + + @Override + public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + return configuration == launchConfig; + } + + @Override + protected Object getLaunchObject(ILaunchConfiguration configuration) throws CoreException { + if (configuration == launchConfig) + return aaa; + return null; + } + + @Override + protected Object getLaunchObject(ILaunchDescriptor d) { + if (descriptor == d) { + return aaa; + } + return null; + } + }; + mockProviderElement(descriptorTypeId, 10, provider); init(); } @@ -621,6 +611,7 @@ public class LaunchBarManager2Test { assertTrue(manager.getLaunchDescriptors()[0].getName().startsWith(aaa.getName())); // user clicked on descriptor gear to edit lc, new lc is created manager.launchConfigurationAdded(launchConfig); + // the project launch config should have caught this assertEquals(1, manager.getLaunchDescriptors().length); assertEquals(launchConfig.getName(), manager.getLaunchDescriptors()[0].getName()); // user cloned lc and changed some settings @@ -841,17 +832,12 @@ public class LaunchBarManager2Test { @Test public void testGetLaunchTarget() throws CoreException { - final List list = manager.getLaunchTargets(Collections.singletonList(localTargetTypeId)); + IRemoteConnectionType targetType = remoteServiceManager.getConnectionType(localTargetTypeId); + final List list = targetType.getConnections(); assertEquals(1, list.size()); assertEquals(localTarget, list.get(0)); } - @Test - public void testGetLaunchTargetNone() throws CoreException { - final List list = manager.getLaunchTargets(Collections.singletonList("xxx")); - assertEquals(0, list.size()); - } - @Test public void testGetLaunchConfigurationType() throws CoreException { assertNotNull(manager.getLaunchConfigurationType(descriptor, otherTarget)); @@ -870,7 +856,7 @@ public class LaunchBarManager2Test { @Test public void testGetLaunchConfiguration() throws CoreException { basicSetup(); - assertTrue(manager.supportsTargetType(descriptor, otherTarget)); + assertTrue(manager.supportsTarget(descriptor, otherTarget)); assertNotNull(manager.getLaunchConfiguration(descriptor, otherTarget)); } @@ -907,8 +893,7 @@ public class LaunchBarManager2Test { public void testLaunchConfigurationAdded2() throws CoreException { globalmodes.clear(); ILaunchMode mode = mockLaunchModes(launchConfigType, "foo")[0]; - // XXX if provider returns object not known by launch bar bad things happen - //doReturn(launchObject).when(provider).launchConfigurationAdded(lc); + manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); verify(provider).launchConfigurationAdded(launchConfig); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); @@ -926,7 +911,6 @@ public class LaunchBarManager2Test { ILaunchConfigurationType lctype2 = mockLCType("lctype2"); ILaunchConfiguration lc2 = mockLC("lc2", lctype2); manager.launchConfigurationAdded(lc2); - verifyZeroInteractions(provider); //verify(provider).launchConfigurationAdded(lc2); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); assertEquals(1, launchDescriptors.length); @@ -966,34 +950,4 @@ public class LaunchBarManager2Test { } } - @Test - public void testExtensionConfigDefaultProvider() throws CoreException { - basicSetupOnly(); - elements.clear(); - IConfigurationElement element = mockElementAndAdd("defaultConfigTarget"); - doReturn(launchConfigType.getIdentifier()).when(element).getAttribute("launchConfigurationType"); - localTargetTypeId = "x2"; - mockTargetElement(localTargetTypeId); - doReturn(localTargetTypeId).when(element).getAttribute("targetType"); - init(); - manager.launchConfigurationAdded(launchConfig); - ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); - assertEquals(1, launchDescriptors.length); - assertNotNull(launchDescriptors[0]); - assertEquals(launchConfig.getName(), launchDescriptors[0].getName()); - assertEquals(null, manager.getActiveLaunchTarget()); - } - - @Test - public void testExtensionDescriptorTypeBad() throws CoreException { - basicSetupOnly(); - elements.clear(); - IConfigurationElement element = mockDescriptorTypeElement("d1", descriptorType = mock(ILaunchDescriptorType.class)); - doThrow(new CoreException(new Status(1, "a", "n"))).when(element).createExecutableExtension("class"); - doReturn(new ILaunchConfiguration[] { launchConfig }).when(lman).getLaunchConfigurations(); - mockConfigTypeElement(localTargetTypeId, "d1", launchConfigType.getIdentifier()); - init(); - ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); - assertEquals(1, launchDescriptors.length); // XXX should be 0 - } } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 69dc99168fe..d5a43b01274 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -3,7 +3,10 @@ package org.eclipse.launchbar.core.internal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; - +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -24,8 +27,9 @@ import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; -import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; @SuppressWarnings("nls") public class LaunchBarManagerTest { @@ -48,17 +52,17 @@ public class LaunchBarManagerTest { // Mocking ILaunchConfigurationType launchConfigType = mock(ILaunchConfigurationType.class); ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); + String launchConfigName = "launchConfig"; + doReturn(launchConfigName).when(launchConfig).getName(); + doReturn(launchConfigName).when(launchConfig).getAttribute(eq("org.eclipse.launchbar.core.originalName"), anyString()); doReturn(true).when(launchConfigType).isPublic(); doReturn(launchConfigType).when(launchConfig).getType(); - doReturn("dummy").when(launchConfigType).getIdentifier(); + doReturn("launchConfigType").when(launchConfigType).getIdentifier(); doReturn(true).when(launchConfigType).supportsMode("run"); doReturn(true).when(launchConfigType).supportsMode("debug"); // Inject the launch config LaunchBarManager manager = new LaunchBarManager(false) { - IRemoteLaunchConfigService getRemoteLaunchConfigService() { - return mock(IRemoteLaunchConfigService.class); - } }; manager.init(); manager.launchConfigurationAdded(launchConfig); @@ -94,14 +98,6 @@ public class LaunchBarManagerTest { List elements = new ArrayList<>(); IConfigurationElement element; - // local target type - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("targetType").when(element).getName(); - String targetTypeId = "org.eclipse.launchbar.core.targetType.local"; - doReturn(targetTypeId).when(element).getAttribute("id"); - doReturn("org.eclipse.remote.LocalServices").when(element).getAttribute("connectionTypeId"); - // fake launch object String launchObject = "fakeObject"; @@ -143,22 +139,23 @@ public class LaunchBarManagerTest { element = mock(IConfigurationElement.class); elements.add(element); doReturn("configProvider").when(element).getName(); - doReturn(launchConfigTypeId).when(element).getAttribute("launchConfigurationType"); + doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); + doReturn("10").when(element).getAttribute("priority"); + ILaunchConfigurationProvider configProvider = mock(ILaunchConfigurationProvider.class); doReturn(configProvider).when(element).createExecutableExtension("class"); - doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(); - ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); - doReturn(launchConfigType).when(launchConfig).getType(); - doReturn(launchConfig).when(configProvider).createLaunchConfiguration(launchManager, descriptor); - // configType - element = mock(IConfigurationElement.class); - elements.add(element); - doReturn("configType").when(element).getName(); - doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); - doReturn(targetTypeId).when(element).getAttribute("targetType"); - doReturn(launchConfigTypeId).when(element).getAttribute("launchConfigurationType"); - + ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); + doReturn(launchConfig).when(configProvider).getLaunchConfiguration(eq(descriptor), any(IRemoteConnection.class)); + doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(any(ILaunchDescriptor.class), any(IRemoteConnection.class)); + doAnswer(new Answer() { + @Override + public Boolean answer(InvocationOnMock invocation) throws Throwable { + IRemoteConnection target = (IRemoteConnection) invocation.getArguments()[1]; + return target.getConnectionType().getId().equals("org.eclipse.remote.LocalServices"); + } + }).when(configProvider).supports(eq(descriptor), any(IRemoteConnection.class)); + doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); // Now inject the launch object @@ -171,10 +168,6 @@ public class LaunchBarManagerTest { ILaunchManager getLaunchManager() { return launchManager; } - @Override - IRemoteLaunchConfigService getRemoteLaunchConfigService() { - return mock(IRemoteLaunchConfigService.class); - } }; manager.init(); manager.launchObjectAdded(launchObject); From f6e8b921c3f10d3a119a11f04f1f00879f92759a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 18 May 2015 23:19:40 -0400 Subject: [PATCH 032/198] Bug 467153 - Remove last remnants of per type config providers. Also adds a tighter check for ownsConfiguration based on class name of the provider that created the config. Change-Id: If197246af0906cb5af92819171ee97dc7cd30bee --- .../core/AbstractLaunchConfigProvider.java | 18 +-- .../core/DefaultLaunchConfigProvider.java | 10 +- .../core/ILaunchConfigurationProvider.java | 11 -- .../core/PerTargetLaunchConfigProvider.java | 78 ++++++++++++ .../core/PerTypeLaunchConfigProvider.java | 115 ------------------ ...ProjectPerTargetLaunchConfigProvider.java} | 41 +------ .../core/internal/LaunchBarManager.java | 11 +- .../core/internal/LaunchBarManager2Test.java | 48 ++------ 8 files changed, 112 insertions(+), 220 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java rename bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/{ProjectPerTypeLaunchConfigProvider.java => ProjectPerTargetLaunchConfigProvider.java} (57%) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index 5166e31301e..dbddba5fc16 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -14,30 +14,34 @@ import org.eclipse.remote.core.IRemoteConnection; */ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurationProvider { - private static final String ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ + private static final String ATTR_ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ + private static final String ATTR_PROVIDER_CLASS = Activator.PLUGIN_ID + ".providerClass"; //$NON-NLS-1$ protected ILaunchConfiguration createLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); String name = launchManager.generateLaunchConfigurationName(descriptor.getName()); ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfigurationType(descriptor, target).newInstance(null, name); - populateLaunchConfiguration(descriptor, workingCopy); + populateLaunchConfiguration(descriptor, target, workingCopy); return workingCopy.doSave(); } - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchConfigurationWorkingCopy workingCopy) - throws CoreException { + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { // Leave our breadcrumb - workingCopy.setAttribute(ORIGINAL_NAME, workingCopy.getName()); + workingCopy.setAttribute(ATTR_ORIGINAL_NAME, workingCopy.getName()); + workingCopy.setAttribute(ATTR_PROVIDER_CLASS, getClass().getName()); } @Override public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { - // We created it if it has the same name we created it with. + // Check for our class name but also that the config name + // matches what we originally set it to. // This covers the case when the config was duplicated. // We can own only one, the original one. - return configuration.getAttribute(ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ + return configuration.getAttribute(ATTR_PROVIDER_CLASS, "").equals(getClass().getName()) //$NON-NLS-1$ + && configuration.getAttribute(ATTR_ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index 3d647286428..c8537607dfc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -32,17 +32,13 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider @Override public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { - // If I get here, I own it - return true; - } - - @Override - public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - return configuration; + // return false so that the config is added as a launch object + return false; } @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + // catch any left over configs return true; } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index 84c883942b8..f0b833981fb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -67,17 +67,6 @@ public interface ILaunchConfigurationProvider { * @throws CoreException */ boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException; - - /** - * A launch configuration has been added. - * Return the launch object associated with this configuration and the launch bar manager - * will ensure the descriptor is created for it. - * - * @param configuration - * @return whether this provider owns this launch configuration - * @throws CoreException - */ - Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; /** * A launch configuration has been removed. diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java new file mode 100644 index 00000000000..1a05bbb2438 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -0,0 +1,78 @@ +package org.eclipse.launchbar.core; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.remote.core.IRemoteConnection; + +public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfigProvider { + + public static final String ATTR_CONNECTION_TYPE = "connectionType"; //$NON-NLS-1$ + public static final String ATTR_CONNECTION_NAME = "connectionName"; //$NON-NLS-1$ + + private final Map> configMap = new HashMap<>(); + + @Override + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { + Map targetMap = configMap.get(descriptor); + if (targetMap != null) { + ILaunchConfiguration config = targetMap.get(target); + if (config != null) { + return config; + } + } + + ILaunchConfiguration config = createLaunchConfiguration(descriptor, target); + if (targetMap == null) { + targetMap = new HashMap<>(); + configMap.put(descriptor, targetMap); + } + targetMap.put(target, config); + return config; + } + + @Override + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { + super.populateLaunchConfiguration(descriptor, target, workingCopy); + workingCopy.setAttribute(ATTR_CONNECTION_TYPE, target.getConnectionType().getId()); + workingCopy.setAttribute(ATTR_CONNECTION_NAME, target.getName()); + } + + @Override + public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + for (Entry> descEntry : configMap.entrySet()) { + for (Entry targetEntry : descEntry.getValue().entrySet()) { + if (targetEntry.getValue().equals(configuration)) { + descEntry.getValue().remove(targetEntry.getKey()); + if (descEntry.getValue().isEmpty()) { + configMap.remove(descEntry.getKey()); + } + return true; + } + } + } + return false; + } + + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { + configMap.remove(descriptor); + } + + @Override + public void launchTargetRemoved(IRemoteConnection target) throws CoreException { + for (Entry> descEntry : configMap.entrySet()) { + descEntry.getValue().remove(target); + if (descEntry.getValue().isEmpty()) { + configMap.remove(descEntry.getKey()); + } + } + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java deleted file mode 100644 index c766166e0fe..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTypeLaunchConfigProvider.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 QNX Software Systems 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: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.launchbar.core; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.remote.core.IRemoteConnection; - -/** - * Common launch configuration provider for cases where it provides for a single - * connection type and a single launch configuration type. - */ -public abstract class PerTypeLaunchConfigProvider extends AbstractLaunchConfigProvider { - - // Map from launch object to launch configuration - private Map configMap = new HashMap<>(); - - protected abstract String getRemoteConnectionTypeId(); - - protected abstract String getLaunchConfigurationTypeId(); - - protected abstract Object getLaunchObject(ILaunchDescriptor descriptor); - - protected abstract Object getLaunchObject(ILaunchConfiguration configuration) throws CoreException; - - protected ILaunchConfigurationType getLaunchConfigurationType() { - return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(getLaunchConfigurationTypeId()); - } - - @Override - public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - // If target is null, assume we support it. - return target == null || target.getConnectionType().getId().equals(getRemoteConnectionTypeId()); - } - - @Override - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - if (supports(descriptor, target)) { - return getLaunchConfigurationType(); - } - return null; - } - - @Override - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - if (supports(descriptor, target)) { - Object launchObject = getLaunchObject(descriptor); - ILaunchConfiguration config = configMap.get(launchObject); - if (config == null) { - config = createLaunchConfiguration(descriptor, target); - configMap.put(launchObject, config); - } - return config; - } else { - return null; - } - } - - @Override - public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { - if (!super.ownsLaunchConfiguration(configuration)) { - return false; - } - - // Must be of our type - return configuration.getType().equals(getLaunchConfigurationType()); - } - - @Override - public Object launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - if (ownsLaunchConfiguration(configuration)) { - Object launchObject = getLaunchObject(configuration); - configMap.put(launchObject, configuration); - return launchObject; - } - return null; - } - - @Override - public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - if (ownsLaunchConfiguration(configuration)) { - Object launchObject = getLaunchObject(configuration); - configMap.remove(launchObject); - return true; - } - return false; - } - - @Override - public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { - Object launchObject = getLaunchObject(descriptor); - if (launchObject != null) { - configMap.remove(launchObject); - } - } - - @Override - public void launchTargetRemoved(IRemoteConnection target) throws CoreException { - // nothing to do per target - } - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTypeLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java similarity index 57% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTypeLaunchConfigProvider.java rename to bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java index 10ed14dd751..0e0a5eeaffc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTypeLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java @@ -13,43 +13,20 @@ package org.eclipse.launchbar.core; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.remote.core.IRemoteConnection; -public abstract class ProjectPerTypeLaunchConfigProvider extends PerTypeLaunchConfigProvider { - - private static final String PROJECT_CONFIG = Activator.PLUGIN_ID + ".projectConfig"; //$NON-NLS-1$ - - @Override - protected Object getLaunchObject(ILaunchDescriptor descriptor) { - return descriptor.getAdapter(IProject.class); - } - - @Override - protected Object getLaunchObject(ILaunchConfiguration configuration) throws CoreException { - for (IResource resource : configuration.getMappedResources()) { - if (resource instanceof IProject) { - return (IProject) resource; - } - } - return null; - } +public abstract class ProjectPerTargetLaunchConfigProvider extends PerTargetLaunchConfigProvider { @Override public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - if (!super.supports(descriptor, target)) { - return false; - } - return descriptor.getAdapter(IProject.class) != null; } @Override - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchConfigurationWorkingCopy workingCopy) - throws CoreException { - super.populateLaunchConfiguration(descriptor, workingCopy); + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { + super.populateLaunchConfiguration(descriptor, target, workingCopy); // Add our project to the mapped resources IProject project = descriptor.getAdapter(IProject.class); @@ -62,16 +39,6 @@ public abstract class ProjectPerTypeLaunchConfigProvider extends PerTypeLaunchCo newResources[mappedResources.length] = project; workingCopy.setMappedResources(newResources); } - workingCopy.setAttribute(PROJECT_CONFIG, true); - } - - @Override - public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { - if (!super.ownsLaunchConfiguration(configuration)) { - return false; - } - - return configuration.getAttribute(PROJECT_CONFIG, false); } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index d25e5abe818..6db5f6b157d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -745,14 +745,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { - Object launchObject = providerInfo.getProvider().launchConfigurationAdded(configuration); - if (launchObject != null) { - ILaunchDescriptor descriptor = objectDescriptorMap.get(launchObject); - if (descriptor != null) { - setActiveLaunchDescriptor(descriptor); - } else { - launchObjectAdded(configuration); - } + if (providerInfo.getProvider().ownsLaunchConfiguration(configuration)) { return; } } catch (Throwable e) { @@ -760,6 +753,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } } + // No one clamed it, add it as a launch object + launchObjectAdded(configuration); } @Override diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 1a3ebb2df08..8761480f379 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -56,7 +56,7 @@ import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ProjectLaunchDescriptor; -import org.eclipse.launchbar.core.ProjectPerTypeLaunchConfigProvider; +import org.eclipse.launchbar.core.ProjectPerTargetLaunchConfigProvider; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; @@ -136,7 +136,6 @@ public class LaunchBarManager2Test { doReturn(config).when(provider).getLaunchConfiguration(descriptor, target); doReturn(true).when(provider).supports(descriptor, target); doReturn(true).when(provider).ownsLaunchConfiguration(config); - doReturn(launchObj).when(provider).launchConfigurationAdded(config); return provider; } @@ -312,13 +311,6 @@ public class LaunchBarManager2Test { assertNull(manager.getActiveLaunchMode()); } - @Test - public void testAddConfigProviderBad() throws CoreException { - doThrow(new NullPointerException()).when(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); - manager.launchConfigurationAdded(launchConfig); - verify(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); - } - @Test public void testAddDescriptorTypeBad() throws CoreException { doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); @@ -403,6 +395,7 @@ public class LaunchBarManager2Test { @Test public void testGetLaunchDescriptors() throws CoreException { + manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); assertEquals(1, launchDescriptors.length); @@ -447,6 +440,7 @@ public class LaunchBarManager2Test { @Test public void testLaunchConfigurationAdded() throws CoreException { + manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); ILaunchConfiguration lc2 = mockLC("lc2", launchConfigType); manager.launchConfigurationAdded(lc2); @@ -564,36 +558,17 @@ public class LaunchBarManager2Test { mockLCAttribute(launchConfig, ORIGINAL_NAME, aaa.getName()); mockLCAttribute(launchConfig, PROJECT_CONFIG, true); assertEquals(0, manager.getLaunchDescriptors().length); - provider = new ProjectPerTypeLaunchConfigProvider() { + provider = new ProjectPerTargetLaunchConfigProvider() { @Override - protected String getRemoteConnectionTypeId() { - return localTargetTypeId; + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, + IRemoteConnection target) throws CoreException { + return launchConfigType; } - @Override - protected String getLaunchConfigurationTypeId() { - return launchConfigType.getIdentifier(); - } - @Override public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { return configuration == launchConfig; } - - @Override - protected Object getLaunchObject(ILaunchConfiguration configuration) throws CoreException { - if (configuration == launchConfig) - return aaa; - return null; - } - - @Override - protected Object getLaunchObject(ILaunchDescriptor d) { - if (descriptor == d) { - return aaa; - } - return null; - } }; mockProviderElement(descriptorTypeId, 10, provider); init(); @@ -703,6 +678,7 @@ public class LaunchBarManager2Test { Listener lis = mock(Listener.class); manager.addListener(lis); doThrow(new NullPointerException()).when(lis).activeLaunchDescriptorChanged(); + manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); verify(lis).activeLaunchDescriptorChanged(); } @@ -727,6 +703,7 @@ public class LaunchBarManager2Test { ILaunchConfigurationType lctype2 = mockLCType("lctype2"); mockLaunchModes(lctype2, "modex"); mockLaunchModes(launchConfigType, "run", "debug", "foo"); + manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); ILaunchMode[] launchModes = manager.getLaunchModes(); assertEquals(3, launchModes.length); @@ -760,6 +737,7 @@ public class LaunchBarManager2Test { ILaunchConfigurationType lctype2 = mockLCType("lctype2"); ILaunchMode mode = mockLaunchModes(lctype2, "modex")[0]; mockLaunchModes(launchConfigType, "run", "debug", "foo"); + manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); try { manager.setActiveLaunchMode(mode); @@ -895,7 +873,7 @@ public class LaunchBarManager2Test { ILaunchMode mode = mockLaunchModes(launchConfigType, "foo")[0]; manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); - verify(provider).launchConfigurationAdded(launchConfig); + verify(provider).ownsLaunchConfiguration(launchConfig); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); assertEquals(1, launchDescriptors.length); assertNotNull(launchDescriptors[0]); @@ -922,9 +900,9 @@ public class LaunchBarManager2Test { @Test public void testLaunchConfigurationAddedBad() throws CoreException { - doThrow(new NullPointerException()).when(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); + doThrow(new NullPointerException()).when(provider).ownsLaunchConfiguration(any(ILaunchConfiguration.class)); manager.launchConfigurationAdded(launchConfig); - verify(provider).launchConfigurationAdded(launchConfig); + verify(provider).ownsLaunchConfiguration(launchConfig); } @Test From 456b2f42b52762a9a15a92dcd366d9408154502a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 19 May 2015 10:41:04 -0400 Subject: [PATCH 033/198] Remove the special launch config delegate for remote. It's too hard to replicate the entire debug platform launch sequence in order to insert the target this way. We'll need to come up with something better if we want to share launch configs between targets. But that will have to wait until Neon at the earliest. Change-Id: I208eed527961e172316f0b12b869be5665a6aca5 --- .../META-INF/MANIFEST.MF | 3 +- .../core/PerTargetLaunchConfigProvider.java | 23 +++ .../IRemoteLaunchConfigurationDelegate.java | 131 ------------------ .../RemoteLaunchConfigurationDelegate.java | 59 -------- .../commands/BuildActiveCommandHandler.java | 15 +- 5 files changed, 25 insertions(+), 206 deletions(-) delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java delete mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index f28215054bf..b84817037d6 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -12,5 +12,4 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, - org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui", - org.eclipse.launchbar.core.launch + org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui" diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index 1a05bbb2438..7867d4942c3 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -7,7 +7,10 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteServicesManager; public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfigProvider { @@ -44,6 +47,26 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig workingCopy.setAttribute(ATTR_CONNECTION_NAME, target.getName()); } + public static IRemoteConnection getTarget(ILaunchConfiguration configuration) throws CoreException { + IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); + String connectionTypeId = configuration.getAttribute(ATTR_CONNECTION_TYPE, ""); //$NON-NLS-1$ + if (connectionTypeId.isEmpty()) { + return null; + } + + IRemoteConnectionType connectionType = remoteManager.getConnectionType(connectionTypeId); + if (connectionType == null) { + return null; + } + + String connectionName = configuration.getAttribute(ATTR_CONNECTION_NAME, ""); //$NON-NLS-1$ + if (connectionName.isEmpty()) { + return null; + } + + return connectionType.getConnection(connectionName); + } + @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { for (Entry> descEntry : configMap.entrySet()) { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java deleted file mode 100644 index 39fdf01c4d6..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/IRemoteLaunchConfigurationDelegate.java +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 QNX Software Systems 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: - * QNX Software Systems - initial - * IBM and others who contributed to ILaunchConfigurationDelegate2 - * and ILaunchConfigurationDelegate - *******************************************************************************/ -package org.eclipse.launchbar.core.launch; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; -import org.eclipse.remote.core.IRemoteConnection; - -/** - * A launch configuration delegate that accepts a IRemoteConnection as an additional - * parameter to the launch functions. Delegates who want to receive this parameter from - * the LaunchBar launch actions need to implement this interface. - */ -public interface IRemoteLaunchConfigurationDelegate extends ILaunchConfigurationDelegate2 { - - /** - * Returns a launch object to use when launching the given launch - * configuration in the given mode, or null if a new default - * launch object should be created by the debug platform. If a launch object - * is returned, its launch mode must match that of the mode specified in - * this method call. - * - * @param configuration the configuration being launched - * @param mode the mode the configuration is being launched in - * @param target the remote connection to launch on - * @return a launch object or null - * @throws CoreException if unable to launch - */ - public ILaunch getLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target) throws CoreException; - - /** - * Optionally performs any required building before launching the given - * configuration in the specified mode, and returns whether the debug platform - * should perform an incremental workspace build before the launch continues. - * If false is returned the launch will proceed without further - * building, and if true is returned an incremental build will - * be performed on the workspace before launching. - *

- * This method is only called if the launch is invoked with flag indicating - * building should take place before the launch. This is done via the - * method - * ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build). - *

- * @param configuration the configuration being launched - * @param mode the mode the configuration is being launched in - * @param target the remote connection the configuration is being launched on - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return whether the debug platform should perform an incremental workspace - * build before the launch - * @throws CoreException if an exception occurs while building - */ - public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, IProgressMonitor monitor) throws CoreException; - - /** - * Returns whether a launch should proceed. This method is called after - * preLaunchCheck() and buildForLaunch() providing - * a final chance for this launch delegate to abort a launch if required. - * For example, a delegate could cancel a launch if it discovered compilation - * errors that would prevent the launch from succeeding. - * - * @param configuration the configuration being launched - * @param mode launch mode - * @param target the remote connection the configuration is being launched on - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return whether the launch should proceed - * @throws CoreException if an exception occurs during final checks - */ - public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, IProgressMonitor monitor) throws CoreException; - - /** - * Returns whether a launch should proceed. This method is called first - * in the launch sequence providing an opportunity for this launch delegate - * to abort the launch. - * - * @param configuration configuration being launched - * @param mode launch mode - * @param target the remote connection the configuration is being launched on - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return whether the launch should proceed - * @throws CoreException if an exception occurs while performing pre-launch checks - */ - public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, IProgressMonitor monitor) throws CoreException; - - /** - * Launches the given configuration in the specified mode, contributing - * debug targets and/or processes to the given launch object. The - * launch object has already been registered with the launch manager. - * - * @param configuration the configuration to launch - * @param mode the mode in which to launch, one of the mode constants - * defined by ILaunchManager - - * RUN_MODE or DEBUG_MODE. - * @param target the remote connection the configuration to launched on - * @param monitor progress monitor, or null progress monitor, or null. A cancelable progress - * monitor is provided by the Job framework. It should be noted that the setCanceled(boolean) method should - * never be called on the provided monitor or the monitor passed to any delegates from this method; due to a - * limitation in the progress monitor framework using the setCanceled method can cause entire workspace batch - * jobs to be canceled, as the canceled flag is propagated up the top-level parent monitor. - * The provided monitor is not guaranteed to have been started. - * @param launch the launch object to contribute processes and debug - * targets to - * @exception CoreException if launching fails - */ - public void launch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, ILaunch launch, IProgressMonitor monitor) throws CoreException; - -} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java deleted file mode 100644 index c7c0f938515..00000000000 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/launch/RemoteLaunchConfigurationDelegate.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 QNX Software Systems 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: - * QNX Software Systems - initial - *******************************************************************************/ -package org.eclipse.launchbar.core.launch; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.LaunchConfigurationDelegate; -import org.eclipse.remote.core.IRemoteConnection; - -public abstract class RemoteLaunchConfigurationDelegate extends LaunchConfigurationDelegate - implements IRemoteLaunchConfigurationDelegate { - - @Override - public ILaunch getLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target) - throws CoreException { - return getLaunch(configuration, mode); - } - - @Override - public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, - IProgressMonitor monitor) throws CoreException { - return buildForLaunch(configuration, mode, monitor); - } - - @Override - public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, - IProgressMonitor monitor) throws CoreException { - return finalLaunchCheck(configuration, mode, monitor); - } - - @Override - public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IRemoteConnection target, - IProgressMonitor monitor) throws CoreException { - return preLaunchCheck(configuration, mode, monitor); - } - - @Override - public void launch(ILaunchConfiguration configuration, String mode, IRemoteConnection target, ILaunch launch, - IProgressMonitor monitor) throws CoreException { - launch(configuration, mode, launch, monitor); - } - - @Override - public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) - throws CoreException { - // do nothing by default assuming the subclass has implemented a proper remote launch() method. - } - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index 29197d2586f..2c26c8be95a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -35,10 +35,8 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.core.launch.IRemoteLaunchConfigurationDelegate; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; @@ -59,7 +57,6 @@ public class BuildActiveCommandHandler extends AbstractHandler { LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); final ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); final ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); - final IRemoteConnection target = launchBarManager.getActiveLaunchTarget(); new UIJob(Display.getDefault(), Messages.BuildActiveCommandHandler_0) { @Override @@ -90,17 +87,7 @@ public class BuildActiveCommandHandler extends AbstractHandler { if (delegate == null) delegate = config.getType().getDelegates(modes)[0]; ILaunchConfigurationDelegate configDel = delegate.getDelegate(); - if (configDel instanceof IRemoteLaunchConfigurationDelegate) { - IRemoteLaunchConfigurationDelegate configDel2 = (IRemoteLaunchConfigurationDelegate)configDel; - boolean ret; - ret = configDel2.preLaunchCheck(config, mode, target, monitor); - if (!ret) { - return Status.CANCEL_STATUS; - } - if (!configDel2.buildForLaunch(config, mode, target, monitor)) { - return Status.OK_STATUS; - } - } else if (configDel instanceof ILaunchConfigurationDelegate2) { + if (configDel instanceof ILaunchConfigurationDelegate2) { ILaunchConfigurationDelegate2 configDel2 = (ILaunchConfigurationDelegate2)configDel; boolean ret; ret = configDel2.preLaunchCheck(config, mode, monitor); From 92a0b1cb0e9dc96f79b9816db706296a1fc99a4a Mon Sep 17 00:00:00 2001 From: Date: Wed, 20 May 2015 15:59:27 -0400 Subject: [PATCH 034/198] launcbar: shash does not drag on mac Change-Id: I89c37ad8ae0a3ea6cc3e2d5b2450fd8ed1bafa33 Signed-off-by: --- .../ui/internal/controls/LaunchBarListViewer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 7688a76053e..c02e69ec206 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.List; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.IFontProvider; @@ -26,6 +27,7 @@ import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseMoveListener; import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; import org.eclipse.swt.events.PaintEvent; @@ -374,13 +376,17 @@ public class LaunchBarListViewer extends StructuredViewer { @Override public void mouseDown(MouseEvent e) { - sash.moveAbove(null); // keep on top so user see it when moving + if (!Platform.getOS().equals(Platform.OS_MACOSX)) { // does not work on mac + sash.moveAbove(null); // keep on top so user see it when moving + } } @Override public void mouseDoubleClick(MouseEvent e) { // ignore } + + }); sash.setToolTipText(Messages.LaunchBarListViewer_0); } From 32a1b3134c490296fffc7851365790b90f6eb82f Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 21 May 2015 10:21:39 -0400 Subject: [PATCH 035/198] Fix missing about files. --- bundles/org.eclipse.launchbar.core/build.properties | 3 ++- bundles/org.eclipse.launchbar.ui/build.properties | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/build.properties b/bundles/org.eclipse.launchbar.core/build.properties index e9863e281ea..786b1df9364 100644 --- a/bundles/org.eclipse.launchbar.core/build.properties +++ b/bundles/org.eclipse.launchbar.core/build.properties @@ -2,4 +2,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - plugin.xml + plugin.xml,\ + about.html diff --git a/bundles/org.eclipse.launchbar.ui/build.properties b/bundles/org.eclipse.launchbar.ui/build.properties index 6b4afb7a5a7..088f01d1b5a 100644 --- a/bundles/org.eclipse.launchbar.ui/build.properties +++ b/bundles/org.eclipse.launchbar.ui/build.properties @@ -4,4 +4,5 @@ bin.includes = META-INF/,\ .,\ plugin.xml,\ icons/,\ - plugin.properties + plugin.properties,\ + about.html From 93a926385fa93b75c81dc77c3ba6b84f809d7b53 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 26 May 2015 13:05:56 -0400 Subject: [PATCH 036/198] launch bar: API for config added/changed we missing API to notify provider that configs are added/changed. it required to keep internal provider map in sync, i.e. restore the state of config/descriptor map on startup for example. Change-Id: I3af24a21d5d41084f85731f6da2f7aca2df81f1c --- .../core/DefaultLaunchConfigProvider.java | 11 +++++++++++ .../core/ILaunchConfigurationProvider.java | 16 ++++++++++++++++ .../core/PerTargetLaunchConfigProvider.java | 11 +++++++++++ .../launchbar/core/ProjectLaunchDescriptor.java | 4 ++++ .../core/internal/LaunchBarManager.java | 11 ++++++++++- 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index c8537607dfc..5022250ea84 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -52,4 +52,15 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider // nothing to do } + @Override + public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + // catch any left over configs + return true; + } + + @Override + public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { + // catch any left over configs + return true; + } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index f0b833981fb..8094d185ada 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -81,6 +81,21 @@ public interface ILaunchConfigurationProvider { */ boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException; + /** + * A launch configuration has been added. Provider can inspect it and associate with internal map. + * Provider should make sure it owns this launch configuration or it can modify it to take over. + * + * @return true of provider owns this launch configuration + */ + boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; + + /** + * A launch configuration has been changed. Provider can inspect it to re-evaluate its internal map. + * Provider should make sure it owns this launch configuration or it can modify it to take over. + * + * @return true of provider owns this launch configuration + */ + boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException; /** * A launch descriptor has been removed. Remove any launch configurations that were * created for it. @@ -99,4 +114,5 @@ public interface ILaunchConfigurationProvider { */ void launchTargetRemoved(IRemoteConnection target) throws CoreException; + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index 7867d4942c3..b8d7a6fc363 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -83,6 +83,17 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig return false; } + @Override + public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + // TODO re-create map + return false; + } + + @Override + public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { + return false; + } + @Override public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { configMap.remove(descriptor); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java index b2ce2c871f1..4796f9d0b61 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java @@ -45,4 +45,8 @@ public class ProjectLaunchDescriptor extends PlatformObject implements ILaunchDe return type; } + @Override + public String toString() { + return getName(); // for debugging purposes + } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 6db5f6b157d..5887f548f44 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -745,6 +745,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { + providerInfo.getProvider().launchConfigurationAdded(configuration); if (providerInfo.getProvider().ownsLaunchConfiguration(configuration)) { return; } @@ -781,7 +782,15 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration @Override public void launchConfigurationChanged(ILaunchConfiguration configuration) { - // Nothing to do on changes + for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { + try { + providerInfo.getProvider().launchConfigurationChanged(configuration); + } catch (Throwable e) { + Activator.log(e); + } + } + } } public void dispose() { From 652500b20026b8a6c54eacd812455169e995393b Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Tue, 26 May 2015 15:55:34 -0400 Subject: [PATCH 037/198] Bug 468399 - mode selector filled with tostrings Change-Id: I109b728b2b7e1356c026c11b3b3663089940c5fe Signed-off-by: Rob Stryker --- .../ui/internal/controls/ModeSelector.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 57b0f3531aa..305735601ee 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -16,8 +16,10 @@ import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredContentProvider; @@ -77,6 +79,9 @@ public class ModeSelector extends CSelector { ILaunchMode mode = (ILaunchMode) element; try { ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); + if( group == null ) { + group = getDefaultLaunchGroup(mode.getIdentifier()); + } if (group != null) { ImageDescriptor imageDesc = group.getImageDescriptor(); Image image = images.get(imageDesc); @@ -98,6 +103,9 @@ public class ModeSelector extends CSelector { ILaunchMode mode = (ILaunchMode) element; try { ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); + if( group == null ) { + group = getDefaultLaunchGroup(mode.getIdentifier()); + } if (group != null) { return group.getLabel().replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -138,7 +146,20 @@ public class ModeSelector extends CSelector { }); } - + protected ILaunchGroup getDefaultLaunchGroup(String mode) throws CoreException { + String groupId = null; + if (mode.equals(ILaunchManager.DEBUG_MODE)) { + groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP; + } else if( mode.equals(ILaunchManager.PROFILE_MODE)) { + groupId = IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP; + } else { + groupId = IDebugUIConstants.ID_RUN_LAUNCH_GROUP; + } + if( groupId != null ) + return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupId); + return null; + } + protected ILaunchGroup getLaunchGroup(String mode) throws CoreException { ILaunchConfigurationType type = manager.getLaunchConfigurationType(manager.getActiveLaunchDescriptor(), manager.getActiveLaunchTarget()); if (type == null) From b46cc02560c8a52eba2e7bf0d03ab3d78d88558e Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 27 May 2015 15:13:00 -0400 Subject: [PATCH 038/198] launch bar: per target provider and test fixes - fixed tests and added tests for previous API changes - fixed unsafe call of provider methods without catching exceptions - added description of priority attribute in the extension point API - fixed default return values in DefaultLaunchConfigProvider, in case it is extended - removed unused import - fixed per target provider to support persistance - added test for per target provider Change-Id: If08b18b939e86757108a800d1092a62621a8c7d0 --- .../schema/launchBarContributions.exsd | 18 +- .../core/DefaultLaunchConfigProvider.java | 25 +- .../core/ILaunchConfigurationProvider.java | 3 +- .../core/PerTargetLaunchConfigProvider.java | 163 ++++++++--- .../ProjectPerTargetLaunchConfigProvider.java | 32 ++- .../core/internal/LaunchBarManager.java | 26 +- .../controls/LaunchBarListViewer.java | 1 - .../META-INF/MANIFEST.MF | 2 +- .../build.properties | 3 +- .../fragment.xml | 14 + .../PerTargetLaunchConfigProviderTest.java | 259 ++++++++++++++++++ .../core/internal/LaunchBarManager2Test.java | 56 ++-- .../core/internal/LaunchBarManagerTest.java | 3 +- 13 files changed, 515 insertions(+), 90 deletions(-) create mode 100644 tests/org.eclipse.launchbar.core.tests/fragment.xml create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java diff --git a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd index aa466cf7c57..328698bd179 100644 --- a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd +++ b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd @@ -59,21 +59,24 @@ - + Global descriptor type id. I.e. com.example.mytype - + Priority of the descriptor, values from 1 to 100. +Lower values represent lower priority. +I.e. descriptor with priority 10 will override +descriptor with priority 5. Priority 0 is reserved for default descriptor. - + Class that implements ILaunchDescriptorType @@ -93,7 +96,7 @@ - + Id of the descriptor type defined in descriptorType element (can be from another extension) @@ -103,14 +106,17 @@ - + Priority of the provider, values from 1 to 100. +Lower values represent lower priority. +I.e. provider with priority 10 will be checked before +provider with priority 5. Priority 0 is reserved for default provider. - + Class that implements ILaunchConfigurationProvider diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index 5022250ea84..36ae2dbd50c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -12,10 +12,17 @@ import org.eclipse.remote.core.IRemoteConnection; */ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider { + /** + * Only support local connection. Override to support different types of connection. + */ @Override public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { // Only supports Local connection - return target.getConnectionType().getId().equals("org.eclipse.remote.LocalServices"); //$NON-NLS-1$ + if (target != null && target.getConnectionType().getId().equals("org.eclipse.remote.LocalServices")) { //$NON-NLS-1$ + return true; + } else { + return false; + } } @Override @@ -30,6 +37,10 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider return descriptor.getAdapter(ILaunchConfiguration.class); } + /** + * If you do override this method and return true you would have to make sure you add launch object which matches + * this configuration, otherwise it will not be visible + */ @Override public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { // return false so that the config is added as a launch object @@ -38,8 +49,8 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - // catch any left over configs - return true; + // by contract we return true if we own or use to own configuration + return ownsLaunchConfiguration(configuration); } @Override @@ -54,13 +65,13 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider @Override public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - // catch any left over configs - return true; + // by contract we return true if we own configuration + return ownsLaunchConfiguration(configuration); } @Override public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { - // catch any left over configs - return true; + // by contract we return true if we own configuration + return ownsLaunchConfiguration(configuration); } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index 8094d185ada..91520233b45 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -23,7 +23,6 @@ import org.eclipse.remote.core.IRemoteConnection; * subclasses instead of implementing this directly. */ public interface ILaunchConfigurationProvider { - /** * Does this config provider provide launch configurations for the combination * of descriptor and target. @@ -33,7 +32,7 @@ public interface ILaunchConfigurationProvider { * * @param descriptor * @param target - * @return + * @return true if target is supported, false otherwise. */ boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index b8d7a6fc363..8652d880a66 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -1,6 +1,9 @@ package org.eclipse.launchbar.core; +import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; @@ -13,30 +16,90 @@ import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfigProvider { - - public static final String ATTR_CONNECTION_TYPE = "connectionType"; //$NON-NLS-1$ - public static final String ATTR_CONNECTION_NAME = "connectionName"; //$NON-NLS-1$ + public final String ATTR_CONNECTION_TYPE = getConnectionTypeAttribute(); + public final String ATTR_CONNECTION_NAME = getConnectionNameAttribute(); private final Map> configMap = new HashMap<>(); + private final Collection ownedConfigs = new LinkedHashSet<>(); + + protected String getConnectionNameAttribute() { + return "org.eclipse.launchbar.core.connectionName";//$NON-NLS-1$ + } + + protected String getConnectionTypeAttribute() { + return "org.eclipse.launchbar.core.connectionType";//$NON-NLS-1$ + } @Override public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - Map targetMap = configMap.get(descriptor); - if (targetMap != null) { - ILaunchConfiguration config = targetMap.get(target); - if (config != null) { - return config; - } + Map targetMap = getTargetMap(descriptor); + ILaunchConfiguration config = targetMap.get(target); + if (config != null) { + return config; } + // first search for owned configurations, to see if any match to descriptor + config = findLaunchConfiguration(descriptor, target); + if (config == null) { + config = createLaunchConfiguration(descriptor, target); + launchConfigurationAdded(config); + } + targetMap.put(target, config); + return config; + } - ILaunchConfiguration config = createLaunchConfiguration(descriptor, target); + protected Map getTargetMap(ILaunchDescriptor descriptor) { + Map targetMap = configMap.get(descriptor); if (targetMap == null) { targetMap = new HashMap<>(); configMap.put(descriptor, targetMap); } - targetMap.put(target, config); - return config; + return targetMap; + } + + protected ILaunchConfiguration findLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { + for (ILaunchConfiguration configuration : ownedConfigs) { + if (descriptorAndTargetMatchesConfiguration(descriptor, target, configuration)) { + return configuration; + } + } + return null; + } + + protected boolean descriptorAndTargetMatchesConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + ILaunchConfiguration configuration) { + if (targetMatchesConfiguration(target, configuration) == false) + return false; + if (descriptorMatchesConfiguration(descriptor, configuration) == false) + return false; + return true; + } + + /** + * This method should be overridden to check that configuration does actually represent the descriptor. + * You don't need to check ownership since this method will be only called on owned configurations + */ + protected boolean descriptorMatchesConfiguration(ILaunchDescriptor descriptor, ILaunchConfiguration configuration) { + // we using startsWith instead of equals because new configuration using "generateLaunchConfigurationName" method which + // means only prefix guaranteed to be matching, and the prefix is the descriptor name + return configuration.getName().startsWith(descriptor.getName()); + } + + protected boolean targetMatchesConfiguration(IRemoteConnection target, ILaunchConfiguration configuration) { + String targetName; + try { + targetName = configuration.getAttribute(ATTR_CONNECTION_NAME, ""); + } catch (CoreException e) { + return false; + } + if (target != null && target.getName().equals(targetName)) { + return true; + } else if (target == null && (targetName == null || targetName.isEmpty())) { + return true; + } else { + return false; + } } @Override @@ -47,66 +110,104 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig workingCopy.setAttribute(ATTR_CONNECTION_NAME, target.getName()); } - public static IRemoteConnection getTarget(ILaunchConfiguration configuration) throws CoreException { + public IRemoteConnection getTarget(ILaunchConfiguration configuration) throws CoreException { IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); String connectionTypeId = configuration.getAttribute(ATTR_CONNECTION_TYPE, ""); //$NON-NLS-1$ if (connectionTypeId.isEmpty()) { return null; } - IRemoteConnectionType connectionType = remoteManager.getConnectionType(connectionTypeId); if (connectionType == null) { return null; } - String connectionName = configuration.getAttribute(ATTR_CONNECTION_NAME, ""); //$NON-NLS-1$ if (connectionName.isEmpty()) { return null; } - return connectionType.getConnection(connectionName); } + @Override + public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + return ownedConfigs.contains(configuration); + } + + public boolean ownsLaunchConfigurationByAttributes(ILaunchConfiguration configuration) { + try { + return super.ownsLaunchConfiguration(configuration); + } catch (CoreException e) { + // will happened if called after LC is deleted + return false; + } + } + @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - for (Entry> descEntry : configMap.entrySet()) { - for (Entry targetEntry : descEntry.getValue().entrySet()) { - if (targetEntry.getValue().equals(configuration)) { - descEntry.getValue().remove(targetEntry.getKey()); - if (descEntry.getValue().isEmpty()) { - configMap.remove(descEntry.getKey()); + boolean owned = ownsLaunchConfiguration(configuration); + if (owned) { + ownedConfigs.remove(configuration); + for (Entry> descEntry : configMap.entrySet()) { + for (Entry targetEntry : descEntry.getValue().entrySet()) { + if (targetEntry.getValue().equals(configuration)) { + descEntry.getValue().remove(targetEntry.getKey()); + if (descEntry.getValue().isEmpty()) { + configMap.remove(descEntry.getKey()); + } + return true; } - return true; } } } - return false; + return owned; } @Override public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - // TODO re-create map + if (ownsLaunchConfigurationByAttributes(configuration)) { + ownedConfigs.add(configuration); + return true; + } return false; } @Override public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { + if (ownsLaunchConfigurationByAttributes(configuration)) { + // clear cache, target could have changed + launchConfigurationRemoved(configuration); + ownedConfigs.add(configuration); + return true; + } else if (ownedConfigs.contains(configuration)) { + // user did something that will cause us to loose ownership of this configuration + launchConfigurationRemoved(configuration); + } return false; } @Override public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { - configMap.remove(descriptor); + Map map = configMap.remove(descriptor); + if (map == null) + return; + for (ILaunchConfiguration config : map.values()) { + ownedConfigs.remove(config); + config.delete(); // remove all auto-configs associated with descriptor + } } @Override public void launchTargetRemoved(IRemoteConnection target) throws CoreException { - for (Entry> descEntry : configMap.entrySet()) { - descEntry.getValue().remove(target); - if (descEntry.getValue().isEmpty()) { - configMap.remove(descEntry.getKey()); + for (Iterator>> iterator = configMap.entrySet() + .iterator(); iterator.hasNext();) { + Entry> descEntry = iterator.next(); + Map map = descEntry.getValue(); + ILaunchConfiguration config = map.remove(target); + if (config != null) { + config.delete(); // remove all auto-configs associated with target + } + if (map.isEmpty()) { + iterator.remove(); } } } - } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java index 0e0a5eeaffc..fbde803bf02 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java @@ -13,21 +13,44 @@ package org.eclipse.launchbar.core; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.remote.core.IRemoteConnection; public abstract class ProjectPerTargetLaunchConfigProvider extends PerTargetLaunchConfigProvider { - @Override public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - return descriptor.getAdapter(IProject.class) != null; + return (descriptor.getAdapter(IProject.class) != null); } @Override - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + protected boolean descriptorMatchesConfiguration(ILaunchDescriptor descriptor, ILaunchConfiguration configuration) { + IProject project = descriptor.getAdapter(IProject.class); + if (project == null || configuration == null) + return false; + return (project.equals(getProject(configuration))); + } + + protected IProject getProject(ILaunchConfiguration configuration) { + IResource[] mappedResources = null; + try { + mappedResources = configuration.getMappedResources(); + } catch (CoreException e) { + return null; + } + if (mappedResources == null) + return null; + for (IResource resource : mappedResources) { + if (resource instanceof IProject) + return (IProject) resource; + } + return null; + } + + @Override + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { super.populateLaunchConfiguration(descriptor, target, workingCopy); - // Add our project to the mapped resources IProject project = descriptor.getAdapter(IProject.class); IResource[] mappedResources = workingCopy.getMappedResources(); @@ -40,5 +63,4 @@ public abstract class ProjectPerTargetLaunchConfigProvider extends PerTargetLaun workingCopy.setMappedResources(newResources); } } - } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 5887f548f44..c1bd9c35178 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -37,6 +37,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ILaunchObjectProvider; @@ -648,8 +649,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration boolean supportsTarget(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo provider : configProviders.get(descriptorTypeId)) { - if (provider.getProvider().supports(descriptor, target)) { - return true; + try { + if (provider.getProvider().supports(descriptor, target)) { + return true; + } + } catch (Throwable e) { + Activator.log(e); } } return false; @@ -718,10 +723,19 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } String descTypeId = getDescriptorTypeId(descriptor.getType()); - for (LaunchConfigProviderInfo provider : configProviders.get(descTypeId)) { - ILaunchConfiguration config = provider.getProvider().getLaunchConfiguration(descriptor, target); - if (config != null) { - return config; + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeId)) { + try { + ILaunchConfigurationProvider provider = providerInfo.getProvider(); + // between multiple provider who support this descriptor we need to find one + // that supports this target + if (provider.supports(descriptor, target)) { + ILaunchConfiguration config = provider.getLaunchConfiguration(descriptor, target); + if (config != null) { + return config; + } + } + } catch (Throwable e) { + Activator.log(e); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index c02e69ec206..46fbd2d1c33 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -27,7 +27,6 @@ import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; import org.eclipse.swt.events.PaintEvent; diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF index c3a97cb2e66..7cedb534a9e 100644 --- a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Launch Bar Core Tests -Bundle-SymbolicName: org.eclipse.launchbar.core.tests +Bundle-SymbolicName: org.eclipse.launchbar.core.tests;singleton:=true Bundle-Version: 1.0.0.qualifier Fragment-Host: org.eclipse.launchbar.core;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.eclipse.launchbar.core.tests/build.properties b/tests/org.eclipse.launchbar.core.tests/build.properties index 34d2e4d2dad..e3023e14e99 100644 --- a/tests/org.eclipse.launchbar.core.tests/build.properties +++ b/tests/org.eclipse.launchbar.core.tests/build.properties @@ -1,4 +1,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + fragment.xml diff --git a/tests/org.eclipse.launchbar.core.tests/fragment.xml b/tests/org.eclipse.launchbar.core.tests/fragment.xml new file mode 100644 index 00000000000..25d5965ecbc --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/fragment.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java new file mode 100644 index 00000000000..a2fe64af600 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -0,0 +1,259 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * Elena Laskavaia + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.internal.LaunchBarManager2Test; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteServicesManager; +import org.junit.After; +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.JVM) +public class PerTargetLaunchConfigProviderTest { + private IRemoteServicesManager remoteServiceManager; + private IRemoteConnection localTarget; + private String launchName; + private IRemoteConnection otherTarget; + private ILaunchConfigurationType launchConfigType; + private ILaunchDescriptorType descriptorType; + private ILaunchDescriptor descriptor; + private PerTargetLaunchConfigProvider1 provider; + + @Before + public void basicSetupOnly() throws CoreException { + remoteServiceManager = spy(Activator.getService(IRemoteServicesManager.class)); + localTarget = remoteServiceManager.getLocalConnectionType().getConnections().get(0); + // other mocked remote connections + otherTarget = mock(IRemoteConnection.class); + IRemoteConnectionType rtype = mock(IRemoteConnectionType.class); + doReturn(rtype).when(otherTarget).getConnectionType(); + doReturn("otherTargetType").when(rtype).getId(); + doReturn("otherTarget").when(otherTarget).getName(); + // launch stuff + launchName = "test"; + // launch config type + launchConfigType = getLaunchManager().getLaunchConfigurationType("org.eclipse.launchbar.core.tests.lctype1"); + // launch descriptor and type + descriptorType = mock(ILaunchDescriptorType.class); + descriptor = mock(ILaunchDescriptor.class); + doReturn(descriptorType).when(descriptor).getType(); + doReturn(launchName).when(descriptor).getName(); + // configProvider + provider = new PerTargetLaunchConfigProvider1(); + } + + private ILaunchManager getLaunchManager() { + return DebugPlugin.getDefault().getLaunchManager(); + } + + @After + public void after() throws CoreException { + ILaunchConfiguration[] launchConfigurations = getLaunchManager().getLaunchConfigurations(); + for (ILaunchConfiguration lc : launchConfigurations) { + lc.delete(); + } + } + + public class PerTargetLaunchConfigProvider1 extends PerTargetLaunchConfigProvider { + @Override + public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + return true; + } + + @Override + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { + return launchConfigType; + } + }; + + @Test + public void testPopulateLaunchConfiguration() throws CoreException { + ILaunchConfiguration launchConfig = launchConfigType.newInstance(null, launchName).doSave(); + ILaunchConfigurationWorkingCopy launchConfigWC = launchConfig.getWorkingCopy(); + provider.populateLaunchConfiguration(descriptor, localTarget, launchConfigWC); + //assertEquals(launchConfig.getName(), launchConfigWC.getAttribute(LaunchBarManager2Test.ATTR_ORIGINAL_NAME, "")); + //assertEquals(provider.getClass().getName(), launchConfigWC.getAttribute(LaunchBarManager2Test.ATTR_PROVIDER_CLASS, "")); + assertTrue(provider.ownsLaunchConfigurationByAttributes(launchConfigWC)); + } + + @Test + public void testOwnsLaunchConfiguration() throws CoreException { + ILaunchConfiguration launchConfig = launchConfigType.newInstance(null, launchName).doSave(); + assertFalse(provider.ownsLaunchConfiguration(launchConfig)); + ILaunchConfiguration launchConfiguration = provider.getLaunchConfiguration(descriptor, localTarget); + assertTrue(provider.ownsLaunchConfiguration(launchConfiguration)); + } + + @Test + public void testGetLaunchConfiguration() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, otherTarget); + assertNotNull(launchConfiguration1); + assertNotNull(launchConfiguration2); + assertNotEquals(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testGetLaunchConfigurationReuse() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + assertSame(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testGetLaunchConfigurationPersistance() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + // reset provider + provider = new PerTargetLaunchConfigProvider1(); + provider.launchConfigurationAdded(launchConfiguration1); // simulate provider initialization on startup + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + assertEquals(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testGetTarget() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + assertSame(localTarget, provider.getTarget(launchConfiguration1)); + } + + @Test + public void testLaunchConfigurationRemoved() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + provider.launchConfigurationRemoved(launchConfiguration1); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + assertNotEquals(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testLaunchConfigurationChanged_NotReallyChanged() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + provider.launchConfigurationChanged(launchConfiguration1); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + assertSame(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testLaunchConfigurationChanged_Target() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + ILaunchConfigurationWorkingCopy wc = launchConfiguration1.getWorkingCopy(); + wc.setAttribute(provider.getConnectionNameAttribute(), otherTarget.getName()); + wc.doSave(); + provider.launchConfigurationChanged(launchConfiguration1); + //provider.launchConfigurationChanged(lc3); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + assertNotEquals(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testLaunchConfigurationChanged_OrgName() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + ILaunchConfigurationWorkingCopy wc = launchConfiguration1.getWorkingCopy(); + wc.setAttribute(LaunchBarManager2Test.ATTR_ORIGINAL_NAME, "bla"); + wc.doSave(); + provider.launchConfigurationChanged(launchConfiguration1); + // we should have lost ownership + assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + assertNotEquals(launchConfiguration1, launchConfiguration2); + } + + @Test + public void testLaunchDescriptorRemoved() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration1); + provider.launchDescriptorRemoved(descriptor); + assertEquals(0, provider.getTargetMap(descriptor).size()); + assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); + assertFalse(launchConfiguration1.exists()); + } + + @Test + public void testLaunchDescriptorRemoved2() throws CoreException { + provider.launchDescriptorRemoved(descriptor); + assertEquals(0, provider.getTargetMap(descriptor).size()); + } + + @Test + public void testLaunchTargetRemoved() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, otherTarget); + assertNotNull(launchConfiguration1); + provider.launchTargetRemoved(otherTarget); + assertEquals(0, provider.getTargetMap(descriptor).size()); + assertFalse(launchConfiguration1.exists()); + } + + @Test + public void testLaunchTargetRemoved2() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, otherTarget); + assertNotNull(launchConfiguration1); + ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); + assertNotNull(launchConfiguration2); + provider.launchTargetRemoved(otherTarget); + assertEquals(1, provider.getTargetMap(descriptor).size()); + assertFalse(launchConfiguration1.exists()); + assertTrue(launchConfiguration2.exists()); + } + + @Test + public void testLaunchTargetRemoved3() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, otherTarget); + assertNotNull(launchConfiguration1); + provider.launchTargetRemoved(localTarget); + assertEquals(1, provider.getTargetMap(descriptor).size()); + } + + @Test + public void testLCRemoved() throws CoreException { + ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, otherTarget); + assertNotNull(launchConfiguration1); + assertTrue(provider.ownsLaunchConfiguration(launchConfiguration1)); + launchConfiguration1.delete(); + assertTrue(provider.ownsLaunchConfiguration(launchConfiguration1)); + provider.launchConfigurationRemoved(launchConfiguration1); + assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); + } +} diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 8761480f379..478d08f5c46 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -16,6 +16,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; @@ -45,7 +46,6 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; @@ -66,7 +66,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -@SuppressWarnings({"restriction", "nls"}) +@SuppressWarnings({ "restriction", "nls" }) @FixMethodOrder(MethodSorters.JVM) public class LaunchBarManager2Test { private LaunchBarManager manager; @@ -121,14 +121,16 @@ public class LaunchBarManager2Test { basicSetup(); } - protected void mockProviderElement(String descriptorTypeId, int priority, ILaunchConfigurationProvider provider) throws CoreException { + protected void mockProviderElement(String descriptorTypeId, int priority, ILaunchConfigurationProvider provider) + throws CoreException { IConfigurationElement element = mockElementAndAdd("configProvider"); doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); doReturn(Integer.toString(priority)).when(element).getAttribute("priority"); doReturn(provider).when(element).createExecutableExtension("class"); } - protected ILaunchConfigurationProvider mockProviderElement(String descriptorTypeId, int priority, ILaunchDescriptor descriptor, IRemoteConnection target, + protected ILaunchConfigurationProvider mockProviderElement(String descriptorTypeId, int priority, ILaunchDescriptor descriptor, + IRemoteConnection target, ILaunchConfiguration config, Object launchObj) throws CoreException { ILaunchConfigurationProvider provider = mock(ILaunchConfigurationProvider.class); mockProviderElement(descriptorTypeId, priority, provider); @@ -139,7 +141,8 @@ public class LaunchBarManager2Test { return provider; } - protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId, int priority, ILaunchDescriptorType descriptorType) + protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId, int priority, + ILaunchDescriptorType descriptorType) throws CoreException { IConfigurationElement element = mockElementAndAdd("descriptorType"); doReturn(descriptorTypeId).when(element).getAttribute("id"); @@ -171,7 +174,8 @@ public class LaunchBarManager2Test { ILaunchConfiguration lc = mock(ILaunchConfiguration.class); doReturn(string).when(lc).getName(); doReturn(lctype2).when(lc).getType(); - doReturn("").when(lc).getAttribute(eq(ORIGINAL_NAME), eq("")); + doReturn("").when(lc).getAttribute(eq(ATTR_ORIGINAL_NAME), eq("")); + doReturn("").when(lc).getAttribute(eq(ATTR_PROVIDER_CLASS), eq("")); return lc; } @@ -280,9 +284,7 @@ public class LaunchBarManager2Test { doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); // configProvider provider = mockProviderElement(descriptorTypeId, 10, descriptor, otherTarget, launchConfig, launchObject); - mockLaunchObjectOnDescriptor(launchObject); - // default descriptor String defaultDescTypeId = "defaultDescType"; mockDescriptorTypeElement(defaultDescTypeId, 0, new DefaultLaunchDescriptorType()); @@ -543,9 +545,9 @@ public class LaunchBarManager2Test { return "pbtype"; } } + public static final String ATTR_ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ + public static final String ATTR_PROVIDER_CLASS = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".providerClass"; //$NON-NLS-1$ - String ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; - String PROJECT_CONFIG = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".projectConfig"; protected void projectMappingSetup() throws CoreException { descriptorType = new ProjectBasedLaunchDescriptorType(); descriptorTypeId = ((ProjectBasedLaunchDescriptorType) descriptorType).getId(); @@ -555,8 +557,7 @@ public class LaunchBarManager2Test { mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); //lc = provider.createLaunchConfiguration(lman, descType.getDescriptor(aaa)); mockLCProject(launchConfig, aaa); - mockLCAttribute(launchConfig, ORIGINAL_NAME, aaa.getName()); - mockLCAttribute(launchConfig, PROJECT_CONFIG, true); + mockLCAttribute(launchConfig, ATTR_ORIGINAL_NAME, aaa.getName()); assertEquals(0, manager.getLaunchDescriptors().length); provider = new ProjectPerTargetLaunchConfigProvider() { @Override @@ -571,6 +572,7 @@ public class LaunchBarManager2Test { } }; mockProviderElement(descriptorTypeId, 10, provider); + mockLCAttribute(launchConfig, ATTR_PROVIDER_CLASS, provider.getClass().getName()); init(); } @@ -793,7 +795,7 @@ public class LaunchBarManager2Test { @Test public void testGetActiveLaunchModeFromDescActive() throws CoreException { globalmodes.clear(); - ILaunchMode mode = mockLaunchModes(launchConfigType, "foo","run")[0]; + ILaunchMode mode = mockLaunchModes(launchConfigType, "foo", "run")[0]; manager.launchObjectAdded(launchObject); manager.setActiveLaunchDescriptor(descriptor); manager.setActiveLaunchMode(mode); @@ -902,30 +904,26 @@ public class LaunchBarManager2Test { public void testLaunchConfigurationAddedBad() throws CoreException { doThrow(new NullPointerException()).when(provider).ownsLaunchConfiguration(any(ILaunchConfiguration.class)); manager.launchConfigurationAdded(launchConfig); + verify(provider).launchConfigurationAdded(launchConfig); verify(provider).ownsLaunchConfiguration(launchConfig); } @Test - public void testLaunchConfigurationRemoved_fails() throws CoreException { - manager.launchConfigurationRemoved(launchConfig); - try { - verify(provider).launchConfigurationRemoved(launchConfig); - fail(); - } catch (Throwable e) { - // temp fail test - } + public void testLaunchConfigurationChanged() throws CoreException { + manager.launchConfigurationChanged(launchConfig); + verify(provider).launchConfigurationChanged(launchConfig); } @Test - public void testLaunchConfigurationRemovedBad_fails() throws CoreException { - doThrow(new NullPointerException()).when(provider).launchConfigurationRemoved(any(ILaunchConfiguration.class)); + public void testLaunchConfigurationRemoved() throws CoreException { manager.launchConfigurationRemoved(launchConfig); - try { - verify(provider).launchConfigurationRemoved(launchConfig); - fail(); - } catch (Throwable e) { - // temp fail test - } + verify(provider).launchConfigurationRemoved(launchConfig); } + @Test + public void testLaunchConfigurationRemovedBad() throws CoreException { + doThrow(new NullPointerException()).when(provider).launchConfigurationRemoved(any(ILaunchConfiguration.class)); + manager.launchConfigurationRemoved(launchConfig); + verify(provider).launchConfigurationRemoved(launchConfig); + } } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index d5a43b01274..81bce296aa4 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -3,6 +3,7 @@ package org.eclipse.launchbar.core.internal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; + import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; @@ -33,7 +34,6 @@ import org.mockito.stubbing.Answer; @SuppressWarnings("nls") public class LaunchBarManagerTest { - @Test public void startupTest() throws Exception { // Make sure the manager starts up and defaults everything to null @@ -55,6 +55,7 @@ public class LaunchBarManagerTest { String launchConfigName = "launchConfig"; doReturn(launchConfigName).when(launchConfig).getName(); doReturn(launchConfigName).when(launchConfig).getAttribute(eq("org.eclipse.launchbar.core.originalName"), anyString()); + doReturn("").when(launchConfig).getAttribute(eq("org.eclipse.launchbar.core.providerClass"), anyString()); doReturn(true).when(launchConfigType).isPublic(); doReturn(launchConfigType).when(launchConfig).getType(); doReturn("launchConfigType").when(launchConfigType).getIdentifier(); From f4944e5e27031ea893bbcbf45fe0c47eb77ec227 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 29 May 2015 13:16:15 -0400 Subject: [PATCH 039/198] launchbar: enablement expressions for desc. type added ability to define enablement for descriptor type, to allow lazy loading of plugins Change-Id: I9a9f494d0720f752c0cfebf20316f9f8274ee23f --- .../META-INF/MANIFEST.MF | 3 +- bundles/org.eclipse.launchbar.core/plugin.xml | 3 +- .../schema/launchBarContributions.exsd | 5 +++ .../launchbar/core/ILaunchDescriptorType.java | 6 ++- .../core/internal/LaunchBarManager.java | 20 +++++----- .../internal/LaunchDescriptorTypeInfo.java | 32 +++++++++++++++ .../core/internal/LaunchBarManager2Test.java | 40 ++++++++++++++++++- 7 files changed, 93 insertions(+), 16 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index b84817037d6..cc050c64a05 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -8,7 +8,8 @@ Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, org.eclipse.core.filesystem, - org.eclipse.remote.core;bundle-version="2.0.0" + org.eclipse.remote.core;bundle-version="2.0.0", + org.eclipse.core.expressions Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index 37f566a2016..47331771ed4 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -10,8 +10,9 @@ + + + @@ -56,6 +58,9 @@ + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java index 0b3fad90502..49edd67687d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java @@ -18,11 +18,13 @@ import org.eclipse.core.runtime.CoreException; * It is strongly recommended to extend AbstarctLaunchDescriptorType instead of implementing this directly */ public interface ILaunchDescriptorType { - /** * Does this type own this launch object? * - * @deprecated this needs to be replaced by enablement to avoid plug-in loading. + * The main checking should be done in enablement expression of extension declaring the type, + * if enablement expression if defined this method can return true. + * This also can used for fine-tuning of ownership + * which is hard to declared in xml. * * @param element * @return owns element diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index c1bd9c35178..79c876f5f92 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -76,7 +76,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // the extended info for loaded descriptor types private final Map descriptorTypeInfo = new HashMap<>(); - private final Map> configProviders = new HashMap<>(); // Descriptors in MRU order, key is desc type id and desc name. @@ -194,9 +193,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(element); descriptorTypes.put(typeInfo.getId(), typeInfo); - // TODO figure out a better place to set the id so we don't load the type object - // until needed - descriptorTypeInfo.put(typeInfo.getType(), typeInfo); + if (configProviders.get(typeInfo.getId()) == null) { // Make sure we initialize the list @@ -211,8 +208,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } providers.add(info); } - } catch (CoreException e) { - Activator.log(e.getStatus()); + } catch (Exception e) { + Activator.log(e); } } } @@ -329,13 +326,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private ILaunchDescriptorType ownsLaunchObject(Object launchObject) throws CoreException { - // TODO use enablement to find out what descriptor types to ask - // to prevent unnecessary plug-in loading for (LaunchDescriptorTypeInfo descriptorInfo : orderedDescriptorTypes) { - ILaunchDescriptorType descriptorType = descriptorInfo.getType(); try { - if (descriptorType.ownsLaunchObject(launchObject)) { - return descriptorType; + if (descriptorInfo.ownsLaunchObject(launchObject)) { + ILaunchDescriptorType type = descriptorInfo.getType(); + descriptorTypeInfo.put(type, descriptorInfo); + if (type.ownsLaunchObject(launchObject)) { + return type; + } } } catch (Throwable e) { Activator.log(e); // one of used defined launch types is misbehaving diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java index 787b077d281..61ee75a5dbb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -1,7 +1,12 @@ package org.eclipse.launchbar.core.internal; +import org.eclipse.core.expressions.EvaluationContext; +import org.eclipse.core.expressions.EvaluationResult; +import org.eclipse.core.expressions.Expression; +import org.eclipse.core.expressions.ExpressionConverter; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Status; import org.eclipse.launchbar.core.ILaunchDescriptorType; public class LaunchDescriptorTypeInfo { @@ -9,6 +14,7 @@ public class LaunchDescriptorTypeInfo { private int priority; private IConfigurationElement element; private ILaunchDescriptorType type; + private Expression expression; public LaunchDescriptorTypeInfo(IConfigurationElement element) { this.id = element.getAttribute("id"); //$NON-NLS-1$ @@ -23,6 +29,25 @@ public class LaunchDescriptorTypeInfo { } } this.element = element; + IConfigurationElement[] enabledExpressions = element.getChildren("enablement");//$NON-NLS-1$ + if (enabledExpressions == null || enabledExpressions.length == 0) { + Activator.log(new Status(Status.WARNING, Activator.PLUGIN_ID, + "Enablement expression is missing for descriptor type " + id));//$NON-NLS-1$ + } else if (enabledExpressions.length > 1) { + Activator.log(new Status(Status.WARNING, Activator.PLUGIN_ID, + "Multiple enablement expressions are detected for descriptor type "//$NON-NLS-1$ + + id)); + } else { + try { + expression = ExpressionConverter.getDefault().perform(enabledExpressions[0]); + } catch (CoreException e) { + Activator.log(e); + } + if (expression == null) { + Activator.log(new Status(Status.ERROR, Activator.PLUGIN_ID, + "Cannot parse enablement expression defined in descriptor type " + id)); //$NON-NLS-1$ + } + } } // Used for testing @@ -47,4 +72,11 @@ public class LaunchDescriptorTypeInfo { } return type; } + + public boolean ownsLaunchObject(Object object) throws CoreException { + if (expression == null) + return true; + EvaluationResult result = expression.evaluate(new EvaluationContext(null, object)); + return (result == EvaluationResult.TRUE); + } } \ No newline at end of file diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 478d08f5c46..c9fa7fd5dbc 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -80,7 +80,7 @@ public class LaunchBarManager2Test { private ArrayList globalmodes = new ArrayList<>(); IExtensionPoint point; IEclipsePreferences store = new EclipsePreferences(); - private ArrayList elements; + private ArrayList elements; private IExtension extension; private static final String localTargetTypeId = "org.eclipse.remote.LocalServices"; private String descriptorTypeId; @@ -148,9 +148,23 @@ public class LaunchBarManager2Test { doReturn(descriptorTypeId).when(element).getAttribute("id"); doReturn(Integer.toString(priority)).when(element).getAttribute("priority"); doReturn(descriptorType).when(element).createExecutableExtension("class"); + mockEnablementElement(element); return element; } + private void mockSubElement(IConfigurationElement parent, IConfigurationElement... elements) { + doReturn(elements).when(parent).getChildren(); + String name = elements[0].getName(); + doReturn(elements).when(parent).getChildren(name); + } + + private IConfigurationElement mockEnablementElement(IConfigurationElement parent) { + IConfigurationElement enablement = mock(IConfigurationElement.class); + doReturn("enablement").when(enablement).getName(); + mockSubElement(parent, new IConfigurationElement[] { enablement }); + return enablement; + } + protected void init() throws CoreException { doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); doReturn(targets).when(remoteServiceManager).getAllRemoteConnections(); @@ -331,6 +345,7 @@ public class LaunchBarManager2Test { ConfigBasedLaunchDescriptor desc2 = new ConfigBasedLaunchDescriptor(descriptorType, lc2); mockProviderElement(descriptorTypeId, 10, desc2, target, lc2, lc2); init(); + manager.launchObjectAdded(launchObject); // it return original lctype because we did not associate this dynmaically assertEquals(launchConfigType, manager.getLaunchConfigurationType(descriptor, target)); } @@ -344,6 +359,7 @@ public class LaunchBarManager2Test { ILaunchConfiguration lc2 = mockLC("lc2", lctype2); mockProviderElement(descriptorTypeId, 20, descriptor, target, lc2, launchObject); init(); + manager.launchObjectAdded(launchObject); assertEquals(lctype2, manager.getLaunchConfigurationType(descriptor, target)); } @@ -820,6 +836,7 @@ public class LaunchBarManager2Test { @Test public void testGetLaunchConfigurationType() throws CoreException { + manager.launchObjectAdded(launchObject); assertNotNull(manager.getLaunchConfigurationType(descriptor, otherTarget)); } @@ -830,12 +847,14 @@ public class LaunchBarManager2Test { @Test public void testGetLaunchConfigurationNull2() throws CoreException { + manager.launchObjectAdded(launchObject); assertNull(manager.getLaunchConfiguration(descriptor, null)); } @Test public void testGetLaunchConfiguration() throws CoreException { basicSetup(); + manager.launchObjectAdded(launchObject); assertTrue(manager.supportsTarget(descriptor, otherTarget)); assertNotNull(manager.getLaunchConfiguration(descriptor, otherTarget)); } @@ -926,4 +945,23 @@ public class LaunchBarManager2Test { manager.launchConfigurationRemoved(launchConfig); verify(provider).launchConfigurationRemoved(launchConfig); } + + @Test + public void testDescriptorEnablement() throws CoreException { + basicSetupOnly(); + elements.clear(); + + IConfigurationElement element = mockDescriptorTypeElement("type2", 10, descriptorType); + IConfigurationElement enablement = mockEnablementElement(element); + IConfigurationElement instance = mock(IConfigurationElement.class); + doReturn("instanceof").when(instance).getName(); + mockSubElement(enablement, new IConfigurationElement[] { instance }); + doReturn("java.lang.Integer").when(instance).getAttribute("value"); + init(); + assertNull(manager.launchObjectAdded(launchObject)); // this will be refused by enablement expression + assertNull(manager.launchObjectAdded(1)); // we programmatically refuse this + mockLaunchObjectOnDescriptor(1); + assertNotNull(manager.launchObjectAdded(1)); // now we both good programmatically and in expression in extension + } + } From e1ac2000de46fad83b39edc6a0d16103df4f8889 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Sat, 30 May 2015 22:55:41 -0400 Subject: [PATCH 040/198] Final LaunchBar 1.0 API. Lots of clean up and simplification. launchConfigAdded becomes pretty important. Requires providers to be able to find descriptor and target from the incoming configuration if they own it. Also added handing for a default when the target is null. removed ownsConfiguration in providers since the launchConfigAdd does that by returning false. Added enablement for config providers, but that will need work and some default property testers for it to be useful. For the correct way to add in a config provider, check out the Arduino change for this API at: https://git.eclipse.org/r/#/c/49029/ Change-Id: I46b194a933c846d7d3e4eea8a0213c4ec324816f --- bundles/org.eclipse.launchbar.core/plugin.xml | 5 +- .../schema/launchBarContributions.exsd | 5 +- .../core/AbstractLaunchConfigProvider.java | 23 +- .../core/DefaultLaunchConfigProvider.java | 36 +-- .../launchbar/core/ILaunchBarManager.java | 22 +- .../core/ILaunchConfigurationProvider.java | 72 +++-- .../launchbar/core/ILaunchDescriptor.java | 10 +- .../launchbar/core/ILaunchDescriptorType.java | 27 +- .../core/PerTargetLaunchConfigProvider.java | 235 +++++++---------- .../core/ProjectLaunchDescriptor.java | 36 ++- .../ProjectPerTargetLaunchConfigProvider.java | 48 ++-- .../internal/DefaultLaunchDescriptorType.java | 21 +- .../core/internal/LaunchBarManager.java | 245 ++++++++++-------- .../internal/LaunchConfigProviderInfo.java | 35 +++ .../internal/LaunchDescriptorTypeInfo.java | 10 +- .../internal/ProjectLaunchObjectProvider.java | 11 +- .../PerTargetLaunchConfigProviderTest.java | 78 ++++-- .../core/internal/LaunchBarManager2Test.java | 143 +++++----- .../core/internal/LaunchBarManagerTest.java | 40 +-- 19 files changed, 596 insertions(+), 506 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index 47331771ed4..a34277ac63a 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -12,7 +12,10 @@ class="org.eclipse.launchbar.core.internal.DefaultLaunchDescriptorType" id="org.eclipse.launchbar.core.descriptorType.default" priority="0"> - + + + - + @@ -98,6 +98,9 @@ descriptor with priority 5. Priority 0 is reserved for default descriptor. + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index dbddba5fc16..9ddd7c46de4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -3,30 +3,33 @@ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.remote.core.IRemoteConnection; /** - * Common launch config provider. Manages creating launch configurations and ensuring - * duplicates are managed properly. + * Common launch config provider. Manages creating launch configurations and + * ensuring duplicates are managed properly. */ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurationProvider { private static final String ATTR_ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ private static final String ATTR_PROVIDER_CLASS = Activator.PLUGIN_ID + ".providerClass"; //$NON-NLS-1$ - protected ILaunchConfiguration createLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + protected ILaunchConfiguration createLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); String name = launchManager.generateLaunchConfigurationName(descriptor.getName()); - ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfigurationType(descriptor, target).newInstance(null, name); + ILaunchConfigurationType type = getLaunchConfigurationType(descriptor, target); + ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, name); populateLaunchConfiguration(descriptor, target, workingCopy); return workingCopy.doSave(); } - + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { // Leave our breadcrumb @@ -34,14 +37,18 @@ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurati workingCopy.setAttribute(ATTR_PROVIDER_CLASS, getClass().getName()); } - @Override - public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + protected boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + if (!configuration.exists()) { + // can't own it if it doesn't exist + return false; + } + // Check for our class name but also that the config name // matches what we originally set it to. // This covers the case when the config was duplicated. // We can own only one, the original one. return configuration.getAttribute(ATTR_PROVIDER_CLASS, "").equals(getClass().getName()) //$NON-NLS-1$ - && configuration.getAttribute(ATTR_ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ + && configuration.getAttribute(ATTR_ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index 36ae2dbd50c..87a70b31c87 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -6,15 +6,14 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.remote.core.IRemoteConnection; /** - * The launch config provider for the default descriptor which is the launch config itself. + * The launch config provider for the default descriptor which is the launch + * config itself. * - * Override this class and register an extension if you want to support targets other than the local connection. + * Override this class and register an extension if you want to support targets + * other than the local connection. */ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider { - /** - * Only support local connection. Override to support different types of connection. - */ @Override public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { // Only supports Local connection @@ -37,20 +36,20 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider return descriptor.getAdapter(ILaunchConfiguration.class); } - /** - * If you do override this method and return true you would have to make sure you add launch object which matches - * this configuration, otherwise it will not be visible - */ @Override - public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { - // return false so that the config is added as a launch object + public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + // return false so that the configuration can become a launch object + return false; + } + + @Override + public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { return false; } @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - // by contract we return true if we own or use to own configuration - return ownsLaunchConfiguration(configuration); + return false; } @Override @@ -63,15 +62,4 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider // nothing to do } - @Override - public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - // by contract we return true if we own configuration - return ownsLaunchConfiguration(configuration); - } - - @Override - public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { - // by contract we return true if we own configuration - return ownsLaunchConfiguration(configuration); - } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index e81a0a5ea43..9f6f4387d35 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -11,22 +11,32 @@ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfigurationListener; -public interface ILaunchBarManager { +/** + * Interface to the Launch Bar Manager. + * + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface ILaunchBarManager extends ILaunchConfigurationListener { /** - * A launch object has been added. Create a matching launch descriptor if available. + * A launch object has been added. Create a matching launch descriptor if + * available. * - * @param element launch object + * @param element + * launch object * @return the launch descriptor that got created, null of none was * @throws CoreException */ ILaunchDescriptor launchObjectAdded(Object launchObject) throws CoreException; /** - * A launch object has been removed. Remove the associated launch descriptor if there is one. + * A launch object has been removed. Remove the associated launch descriptor + * if there is one. * - * @param element launch object + * @param element + * launch object * @throws CoreException */ void launchObjectRemoved(Object launchObject) throws CoreException; @@ -39,6 +49,4 @@ public interface ILaunchBarManager { */ void launchObjectChanged(Object launchObject) throws CoreException; - // TODO API for adding and removing types. - } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index 91520233b45..b416f87ea40 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -16,23 +16,23 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.remote.core.IRemoteConnection; /** - * The provider of launch configurations of a given type for a given descriptor type - * and a given target type. + * The provider of launch configurations of a given type for a given descriptor + * type and a given target type. * - * It is recommended to extend {@link AbstractLaunchConfigProvider} or one of it's - * subclasses instead of implementing this directly. + * It is recommended to extend {@link AbstractLaunchConfigProvider} or one of + * it's subclasses instead of implementing this directly. */ public interface ILaunchConfigurationProvider { /** - * Does this config provider provide launch configurations for the combination - * of descriptor and target. + * Does this config provider provide launch configurations for the + * combination of descriptor and target. * * Note: this is called when filtering targets for a descriptor. Processing * should be minimal. * * @param descriptor * @param target - * @return true if target is supported, false otherwise. + * @return true if target is supported, false otherwise. */ boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException; @@ -40,39 +40,42 @@ public interface ILaunchConfigurationProvider { * Return the launch configuation type for the descriptor and target. * * @param descriptor - * @param target launch configuration type or null if not supported + * @param target + * launch configuration type or null if not supported * @return * @throws CoreException */ - ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, - IRemoteConnection target) throws CoreException; + ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException; /** * Create a launch configuration for the descriptor to launch on the target. * - * @param descriptor the descriptor to create the config for - * @param target the target to launch the config on + * @param descriptor + * the descriptor to create the config for + * @param target + * the target to launch the config on * @return launch configuration - * @throws CoreException + * @throws CoreException */ ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException; /** - * Does this provider own the launch configuration. + * A launch configuration has been added. Provider can inspect it and + * associate with internal map. Provider should make sure it owns this + * launch configuration or it can modify it to take over. * - * @param configuration launch configuration - * @return true if this provider owns the launch configuration - * @throws CoreException + * @return true of provider owns this launch configuration */ - boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException; + boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; /** - * A launch configuration has been removed. - * This notification can be used to purge internal cache for example. - * This method is called after launch configuration has been removed from file system, - * so accessing its attributes won't work. - * If provider cannot determine if it owns it it should return false. + * A launch configuration has been removed. This notification can be used to + * purge internal cache for example. This method is called after launch + * configuration has been removed from file system, so accessing its + * attributes won't work. If provider cannot determine if it owns it it + * should return false. * * @param configuration * @return true if provider owns this launch configuration @@ -81,23 +84,17 @@ public interface ILaunchConfigurationProvider { boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException; /** - * A launch configuration has been added. Provider can inspect it and associate with internal map. - * Provider should make sure it owns this launch configuration or it can modify it to take over. - * - * @return true of provider owns this launch configuration - */ - boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; - - /** - * A launch configuration has been changed. Provider can inspect it to re-evaluate its internal map. - * Provider should make sure it owns this launch configuration or it can modify it to take over. + * A launch configuration has been changed. Provider can inspect it to + * re-evaluate its internal map. Provider should make sure it owns this + * launch configuration or it can modify it to take over. * * @return true of provider owns this launch configuration */ boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException; + /** - * A launch descriptor has been removed. Remove any launch configurations that were - * created for it. + * A launch descriptor has been removed. Remove any launch configurations + * that were created for it. * * @param descriptor * @throws CoreException @@ -105,13 +102,12 @@ public interface ILaunchConfigurationProvider { void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException; /** - * A launch target has been removed. Remove any launch configurations that were created - * for it. + * A launch target has been removed. Remove any launch configurations that + * were created for it. * * @param target * @throws CoreException */ void launchTargetRemoved(IRemoteConnection target) throws CoreException; - } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java index de457386e68..f0806988d50 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java @@ -12,17 +12,15 @@ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.IAdaptable; - /** - * Represents a thing that can be launched. - * It is good practice that the descriptor is adaptable to the launch object - * it is representing. + * Represents a thing that can be launched. It is good practice that the + * descriptor is adaptable to the launch object it is representing. */ public interface ILaunchDescriptor extends IAdaptable { /** - * Name to show in the launch descriptor selector. - * Names must be unique for all descriptors of a given type. + * Name to show in the launch descriptor selector. Names must be unique for + * all descriptors of a given type. * * @return name of the launch descriptor */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java index 49edd67687d..6452c7d2efe 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java @@ -14,33 +14,22 @@ import org.eclipse.core.runtime.CoreException; /** * Provides mapping between launch objects and launch descriptors. - * - * It is strongly recommended to extend AbstarctLaunchDescriptorType instead of implementing this directly */ public interface ILaunchDescriptorType { - /** - * Does this type own this launch object? - * - * The main checking should be done in enablement expression of extension declaring the type, - * if enablement expression if defined this method can return true. - * This also can used for fine-tuning of ownership - * which is hard to declared in xml. - * - * @param element - * @return owns element - * @throws CoreException - */ - boolean ownsLaunchObject(Object launchObject) throws CoreException; /** * Return a descriptor for the given launch object. * - * May return null to essentially eat the element so no other types - * create a descriptor for it. + * May return null to essentially eat the element so no other types create a + * descriptor for it. * - * @param descriptor launch object for descriptor + * The enablement expression for a given launch object must pass for this + * clause to be executed. + * + * @param descriptor + * launch object for descriptor * @return the best descriptor - * @throws CoreException + * @throws CoreException */ ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index 8652d880a66..fbefcb6fb9d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -9,201 +9,146 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionType; -import org.eclipse.remote.core.IRemoteServicesManager; public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfigProvider { - public final String ATTR_CONNECTION_TYPE = getConnectionTypeAttribute(); - public final String ATTR_CONNECTION_NAME = getConnectionNameAttribute(); - private final Map> configMap = new HashMap<>(); + private final Map defaultConfigs = new HashMap<>(); private final Collection ownedConfigs = new LinkedHashSet<>(); - protected String getConnectionNameAttribute() { - return "org.eclipse.launchbar.core.connectionName";//$NON-NLS-1$ - } - - protected String getConnectionTypeAttribute() { - return "org.eclipse.launchbar.core.connectionType";//$NON-NLS-1$ + protected ILaunchBarManager getManager() { + return Activator.getService(ILaunchBarManager.class); } @Override public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { - Map targetMap = getTargetMap(descriptor); - ILaunchConfiguration config = targetMap.get(target); - if (config != null) { - return config; - } - // first search for owned configurations, to see if any match to descriptor - config = findLaunchConfiguration(descriptor, target); - if (config == null) { - config = createLaunchConfiguration(descriptor, target); - launchConfigurationAdded(config); - } - targetMap.put(target, config); - return config; - } - - protected Map getTargetMap(ILaunchDescriptor descriptor) { - Map targetMap = configMap.get(descriptor); - if (targetMap == null) { - targetMap = new HashMap<>(); - configMap.put(descriptor, targetMap); - } - return targetMap; - } - - protected ILaunchConfiguration findLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) - throws CoreException { - for (ILaunchConfiguration configuration : ownedConfigs) { - if (descriptorAndTargetMatchesConfiguration(descriptor, target, configuration)) { - return configuration; + if (target != null) { + Map targetMap = configMap.get(descriptor); + if (targetMap != null) { + ILaunchConfiguration config = targetMap.get(target); + if (config != null) { + return config; + } + } + } else { + ILaunchConfiguration config = defaultConfigs.get(descriptor); + if (config != null) { + return config; } } - return null; + + // The config will get added to the cache when launchConfigurationAdded + // is called when the new config is saved. + return createLaunchConfiguration(descriptor, target); } - protected boolean descriptorAndTargetMatchesConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, - ILaunchConfiguration configuration) { - if (targetMatchesConfiguration(target, configuration) == false) - return false; - if (descriptorMatchesConfiguration(descriptor, configuration) == false) + protected abstract ILaunchDescriptor getLaunchDescriptor(ILaunchConfiguration configuration) throws CoreException; + + protected abstract IRemoteConnection getLaunchTarget(ILaunchConfiguration configuration) throws CoreException; + + protected boolean providesForNullTarget() { + return false; + } + + private boolean addLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { + ILaunchDescriptor desc = getLaunchDescriptor(configuration); + if (desc == null) { return false; + } + + IRemoteConnection target = getLaunchTarget(configuration); + if (target == null) { + if (providesForNullTarget()) { + defaultConfigs.put(desc, configuration); + } else { + return false; + } + } else { + Map targetMap = configMap.get(desc); + if (targetMap == null) { + targetMap = new HashMap<>(); + configMap.put(desc, targetMap); + } + targetMap.put(target, configuration); + } + + ownedConfigs.add(configuration); return true; } - /** - * This method should be overridden to check that configuration does actually represent the descriptor. - * You don't need to check ownership since this method will be only called on owned configurations - */ - protected boolean descriptorMatchesConfiguration(ILaunchDescriptor descriptor, ILaunchConfiguration configuration) { - // we using startsWith instead of equals because new configuration using "generateLaunchConfigurationName" method which - // means only prefix guaranteed to be matching, and the prefix is the descriptor name - return configuration.getName().startsWith(descriptor.getName()); + @Override + public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + if (ownsLaunchConfiguration(configuration)) { + return addLaunchConfiguration(configuration); + } + return false; } - protected boolean targetMatchesConfiguration(IRemoteConnection target, ILaunchConfiguration configuration) { - String targetName; - try { - targetName = configuration.getAttribute(ATTR_CONNECTION_NAME, ""); - } catch (CoreException e) { - return false; - } - if (target != null && target.getName().equals(targetName)) { - return true; - } else if (target == null && (targetName == null || targetName.isEmpty())) { + @Override + public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { + if (ownsLaunchConfiguration(configuration)) { + // clear cache, target could have changed + launchConfigurationRemoved(configuration); + return addLaunchConfiguration(configuration); + } else if (ownedConfigs.contains(configuration)) { + // something changed that will cause us to loose ownership of this + // configuration. Remove and add it back in. + ILaunchBarManager manager = getManager(); + manager.launchConfigurationRemoved(configuration); + manager.launchConfigurationAdded(configuration); return true; } else { return false; } } - @Override - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, - ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { - super.populateLaunchConfiguration(descriptor, target, workingCopy); - workingCopy.setAttribute(ATTR_CONNECTION_TYPE, target.getConnectionType().getId()); - workingCopy.setAttribute(ATTR_CONNECTION_NAME, target.getName()); - } - - public IRemoteConnection getTarget(ILaunchConfiguration configuration) throws CoreException { - IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); - String connectionTypeId = configuration.getAttribute(ATTR_CONNECTION_TYPE, ""); //$NON-NLS-1$ - if (connectionTypeId.isEmpty()) { - return null; - } - IRemoteConnectionType connectionType = remoteManager.getConnectionType(connectionTypeId); - if (connectionType == null) { - return null; - } - String connectionName = configuration.getAttribute(ATTR_CONNECTION_NAME, ""); //$NON-NLS-1$ - if (connectionName.isEmpty()) { - return null; - } - return connectionType.getConnection(connectionName); - } - - @Override - public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { - return ownedConfigs.contains(configuration); - } - - public boolean ownsLaunchConfigurationByAttributes(ILaunchConfiguration configuration) { - try { - return super.ownsLaunchConfiguration(configuration); - } catch (CoreException e) { - // will happened if called after LC is deleted - return false; - } - } - @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { - boolean owned = ownsLaunchConfiguration(configuration); - if (owned) { - ownedConfigs.remove(configuration); - for (Entry> descEntry : configMap.entrySet()) { - for (Entry targetEntry : descEntry.getValue().entrySet()) { - if (targetEntry.getValue().equals(configuration)) { - descEntry.getValue().remove(targetEntry.getKey()); - if (descEntry.getValue().isEmpty()) { - configMap.remove(descEntry.getKey()); - } - return true; + ownedConfigs.remove(configuration); + for (Entry> descEntry : configMap.entrySet()) { + for (Entry targetEntry : descEntry.getValue().entrySet()) { + if (targetEntry.getValue().equals(configuration)) { + descEntry.getValue().remove(targetEntry.getKey()); + if (descEntry.getValue().isEmpty()) { + configMap.remove(descEntry.getKey()); } + return true; } } } - return owned; - } - - @Override - public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { - if (ownsLaunchConfigurationByAttributes(configuration)) { - ownedConfigs.add(configuration); - return true; - } - return false; - } - - @Override - public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { - if (ownsLaunchConfigurationByAttributes(configuration)) { - // clear cache, target could have changed - launchConfigurationRemoved(configuration); - ownedConfigs.add(configuration); - return true; - } else if (ownedConfigs.contains(configuration)) { - // user did something that will cause us to loose ownership of this configuration - launchConfigurationRemoved(configuration); - } return false; } @Override public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { Map map = configMap.remove(descriptor); - if (map == null) - return; - for (ILaunchConfiguration config : map.values()) { + if (map != null) { + for (ILaunchConfiguration config : map.values()) { + ownedConfigs.remove(config); + // remove all auto-configs associated with descriptor + config.delete(); + } + } + + ILaunchConfiguration config = defaultConfigs.remove(descriptor); + if (config != null) { ownedConfigs.remove(config); - config.delete(); // remove all auto-configs associated with descriptor + config.delete(); } } @Override public void launchTargetRemoved(IRemoteConnection target) throws CoreException { - for (Iterator>> iterator = configMap.entrySet() - .iterator(); iterator.hasNext();) { + for (Iterator>> iterator = configMap + .entrySet().iterator(); iterator.hasNext();) { Entry> descEntry = iterator.next(); Map map = descEntry.getValue(); ILaunchConfiguration config = map.remove(target); if (config != null) { - config.delete(); // remove all auto-configs associated with target + // remove all auto-configs associated with target + config.delete(); } if (map.isEmpty()) { iterator.remove(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java index 4796f9d0b61..bf4a2c63908 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java @@ -14,8 +14,8 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.PlatformObject; /** - * A reusable descriptor for wrapping projects that can be used by descriptor types - * that map to projects. + * A reusable descriptor for wrapping projects that can be used by descriptor + * types that map to projects. */ public class ProjectLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { @@ -49,4 +49,36 @@ public class ProjectLaunchDescriptor extends PlatformObject implements ILaunchDe public String toString() { return getName(); // for debugging purposes } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((project == null) ? 0 : project.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ProjectLaunchDescriptor other = (ProjectLaunchDescriptor) obj; + if (project == null) { + if (other.project != null) + return false; + } else if (!project.equals(other.project)) + return false; + if (type == null) { + if (other.type != null) + return false; + } else if (!type.equals(other.type)) + return false; + return true; + } + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java index fbde803bf02..7eb5116a960 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java @@ -15,42 +15,21 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.remote.core.IRemoteConnection; public abstract class ProjectPerTargetLaunchConfigProvider extends PerTargetLaunchConfigProvider { + @Override public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { return (descriptor.getAdapter(IProject.class) != null); } - @Override - protected boolean descriptorMatchesConfiguration(ILaunchDescriptor descriptor, ILaunchConfiguration configuration) { - IProject project = descriptor.getAdapter(IProject.class); - if (project == null || configuration == null) - return false; - return (project.equals(getProject(configuration))); - } - - protected IProject getProject(ILaunchConfiguration configuration) { - IResource[] mappedResources = null; - try { - mappedResources = configuration.getMappedResources(); - } catch (CoreException e) { - return null; - } - if (mappedResources == null) - return null; - for (IResource resource : mappedResources) { - if (resource instanceof IProject) - return (IProject) resource; - } - return null; - } - @Override protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { super.populateLaunchConfiguration(descriptor, target, workingCopy); + // Add our project to the mapped resources IProject project = descriptor.getAdapter(IProject.class); IResource[] mappedResources = workingCopy.getMappedResources(); @@ -63,4 +42,25 @@ public abstract class ProjectPerTargetLaunchConfigProvider extends PerTargetLaun workingCopy.setMappedResources(newResources); } } + + @Override + protected ILaunchDescriptor getLaunchDescriptor(ILaunchConfiguration configuration) throws CoreException { + IResource[] mappedResources = configuration.getMappedResources(); + if (mappedResources == null) { + return null; + } + + IProject project = null; + for (IResource resource : mappedResources) { + if (resource instanceof IProject) + project = (IProject) resource; + } + if (project == null) { + return null; + } + + ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); + return manager.launchObjectAdded(project); + } + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index 350d04ae27a..ecacc4b51a4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -10,8 +10,8 @@ import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; /** - * A special descriptor type that managed configurations that aren't owned - * by other descriptor types. + * A special descriptor type that managed configurations that aren't owned by + * other descriptor types. */ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { @@ -20,16 +20,11 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { private Map descriptors = new HashMap<>(); @Override - public boolean ownsLaunchObject(Object element) { - return element instanceof ILaunchConfiguration; - } - - @Override - public ILaunchDescriptor getDescriptor(Object element) { - if (element instanceof ILaunchConfiguration) { - ILaunchConfiguration config = (ILaunchConfiguration) element; + public ILaunchDescriptor getDescriptor(Object launchObject) { + if (launchObject instanceof ILaunchConfiguration) { + ILaunchConfiguration config = (ILaunchConfiguration) launchObject; try { - if( config.getType() != null && config.getType().isPublic() + if (config.getType() != null && config.getType().isPublic() && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false))) { DefaultLaunchDescriptor descriptor = descriptors.get(config); @@ -39,9 +34,9 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { } return descriptor; } - } catch(CoreException ce) { + } catch (CoreException ce) { Activator.log(ce.getStatus()); - } + } } return null; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 79c876f5f92..998a8722d32 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -32,7 +32,6 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationListener; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; @@ -52,14 +51,19 @@ import org.osgi.service.prefs.Preferences; /** * The brains of the launch bar. */ -public class LaunchBarManager implements ILaunchBarManager, ILaunchConfigurationListener, IRemoteConnectionChangeListener { +public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionChangeListener { - // TODO make these more fine grained or break them into more focused listeners + // TODO make these more fine grained or break them into more focused + // listeners public interface Listener { void activeLaunchDescriptorChanged(); + void activeLaunchModeChanged(); + void activeLaunchTargetChanged(); + void launchDescriptorRemoved(ILaunchDescriptor descriptor); + void launchTargetsChanged(); } @@ -90,7 +94,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration private ILaunchMode activeLaunchMode; private IRemoteConnection activeLaunchTarget; - // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; + // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; //$NON-NLS-1$ private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; //$NON-NLS-1$ private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; //$NON-NLS-1$ @@ -194,7 +198,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration descriptorTypes.put(typeInfo.getId(), typeInfo); - if (configProviders.get(typeInfo.getId()) == null) { // Make sure we initialize the list configProviders.put(typeInfo.getId(), new ArrayList()); @@ -249,18 +252,21 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } - // Now that all the types are loaded, the object providers which now populate the descriptors + // Now that all the types are loaded, the object providers which now + // populate the descriptors for (IExtension extension : extensions) { for (IConfigurationElement element : extension.getConfigurationElements()) { try { String elementName = element.getName(); if (elementName.equals("objectProvider")) { //$NON-NLS-1$ - ILaunchObjectProvider objectProvider = (ILaunchObjectProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ + ILaunchObjectProvider objectProvider = (ILaunchObjectProvider) element + .createExecutableExtension("class"); //$NON-NLS-1$ objectProviders.add(objectProvider); objectProvider.init(this); } } catch (Exception e) { - Activator.log(e); // exceptions during extension loading, log and move on + // exceptions during extension loading, log and move on + Activator.log(e); } } } @@ -297,48 +303,21 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration setActiveLaunchDescriptor(descriptor); } - private void removeDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { - objectDescriptorMap.remove(launchObject); // remove launch object unconditionally - if (descriptor != null) { - descriptors.remove(getDescriptorId(descriptor)); - if (descriptor.equals(activeLaunchDesc)) { - setActiveLaunchDescriptor(getLastUsedDescriptor()); - } - - for (LaunchConfigProviderInfo provider : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { - provider.getProvider().launchDescriptorRemoved(descriptor); - } - } - } - - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { if (descriptor == null) return null; - for (LaunchConfigProviderInfo provider : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { - ILaunchConfigurationType type = provider.getProvider().getLaunchConfigurationType(descriptor, target); - if (type != null) { - return type; - } - } - - return null; - } - - private ILaunchDescriptorType ownsLaunchObject(Object launchObject) throws CoreException { - for (LaunchDescriptorTypeInfo descriptorInfo : orderedDescriptorTypes) { - try { - if (descriptorInfo.ownsLaunchObject(launchObject)) { - ILaunchDescriptorType type = descriptorInfo.getType(); - descriptorTypeInfo.put(type, descriptorInfo); - if (type.ownsLaunchObject(launchObject)) { - return type; - } + for (LaunchConfigProviderInfo providerInfo : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { + if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) { + ILaunchConfigurationType type = providerInfo.getProvider().getLaunchConfigurationType(descriptor, + target); + if (type != null) { + return type; } - } catch (Throwable e) { - Activator.log(e); // one of used defined launch types is misbehaving } } + return null; } @@ -346,51 +325,77 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration public ILaunchDescriptor launchObjectAdded(Object launchObject) { Activator.trace("launch object added " + launchObject); //$NON-NLS-1$ ILaunchDescriptor desc = objectDescriptorMap.get(launchObject); - if (desc != null) + if (desc != null) { return desc; - - try { - ILaunchDescriptorType type = ownsLaunchObject(launchObject); - if (type != null) { - desc = type.getDescriptor(launchObject); - if (desc != null) { - addDescriptor(launchObject, desc); - } - } - } catch (Throwable e) { - Activator.log(e); } - return desc; + for (LaunchDescriptorTypeInfo descriptorInfo : orderedDescriptorTypes) { + try { + if (descriptorInfo.enabled(launchObject)) { + ILaunchDescriptorType type = descriptorInfo.getType(); + // For newly loaded types, this is the first time we see + // them + // Add it to the info map. + descriptorTypeInfo.put(type, descriptorInfo); + desc = type.getDescriptor(launchObject); + if (desc != null) { + addDescriptor(launchObject, desc); + return desc; + } + + } + } catch (Throwable e) { + Activator.log(e); + } + } + + return null; } @Override public void launchObjectRemoved(Object launchObject) throws CoreException { Activator.trace("launch object removed " + launchObject); //$NON-NLS-1$ - ILaunchDescriptor desc = objectDescriptorMap.get(launchObject); - removeDescriptor(launchObject, desc); + ILaunchDescriptor descriptor = objectDescriptorMap.remove(launchObject); + if (descriptor != null) { + descriptors.remove(getDescriptorId(descriptor)); + if (descriptor.equals(activeLaunchDesc)) { + setActiveLaunchDescriptor(getLastUsedDescriptor()); + } + + for (LaunchConfigProviderInfo providerInfo : configProviders + .get(getDescriptorTypeId(descriptor.getType()))) { + if (providerInfo.enabled(descriptor)) { + providerInfo.getProvider().launchDescriptorRemoved(descriptor); + } + } + } } @Override public void launchObjectChanged(Object launchObject) throws CoreException { // TODO deal with object renames here, somehow - // check if a new descriptor wants to take over ILaunchDescriptor origDesc = objectDescriptorMap.get(launchObject); - ILaunchDescriptorType newDescType = ownsLaunchObject(launchObject); + if (origDesc == null) { + // See if anyone wants it now + launchObjectAdded(launchObject); + return; + } - if (newDescType != null) { - if (origDesc == null || !origDesc.getType().equals(newDescType)) { - // we have a take over - if (origDesc != null) { - removeDescriptor(launchObject, origDesc); - } - - ILaunchDescriptor newDesc = newDescType.getDescriptor(launchObject); - if (newDesc != null) { - addDescriptor(launchObject, newDesc); - } + // check if descriptor still wants it + ILaunchDescriptorType origDescType = origDesc.getType(); + try { + ILaunchDescriptor newDesc = origDescType.getDescriptor(launchObject); + if (newDesc == null) { + // nope, give it back to the pool + objectDescriptorMap.remove(launchObject); + launchObjectAdded(launchObject); + } else if (!newDesc.equals(origDesc)) { + // record the new descriptor + objectDescriptorMap.put(launchObject, newDesc); } + } catch (Throwable e) { + Activator.log(e); } } @@ -402,7 +407,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } public ILaunchDescriptor[] getLaunchDescriptors() { - // return descriptor in usage order (most used first). UI can sort them later as it wishes + // return descriptor in usage order (most used first). UI can sort them + // later as it wishes ArrayList values = new ArrayList<>(descriptors.values()); Collections.reverse(values); return values.toArray(new ILaunchDescriptor[values.size()]); @@ -415,18 +421,23 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws CoreException { Activator.trace("set active descriptor " + descriptor); //$NON-NLS-1$ if (activeLaunchDesc == descriptor) { - // Sync since targets could be changed since last time (and modes theoretically too) + // Sync since targets could be changed since last time (and modes + // theoretically too) syncActiveTarget(); syncActiveMode(); Activator.trace("resync for " + descriptor); //$NON-NLS-1$ return; } - if (descriptor != null && !descriptors.containsValue(descriptor)) + if (descriptor != null && !descriptors.containsValue(descriptor)) { throw new IllegalStateException(Messages.LaunchBarManager_1); - if (descriptor == null) - descriptor = getLastUsedDescriptor(); // do not set to null unless no descriptors + } + if (descriptor == null) { + // do not set to null unless no descriptors + descriptor = getLastUsedDescriptor(); + } activeLaunchDesc = descriptor; - if (descriptor != null) { // keeps most used descriptor last + if (descriptor != null) { + // keeps most used descriptor last Pair id = getDescriptorId(descriptor); descriptors.remove(id); descriptors.put(id, descriptor); @@ -447,7 +458,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration // Store the desc order, active one is the last one StringBuffer buff = new StringBuffer(); - for (Pair key : descriptors.keySet()) {// TODO: this can be very long string + // TODO: this can be very long string + for (Pair key : descriptors.keySet()) { if (buff.length() > 0) { buff.append(','); } @@ -485,17 +497,15 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return; } ILaunchMode foundMode = null; - String storedModeId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_MODE, null); // last desc mode id + // last desc mode id + String storedModeId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_MODE, null); String lastActiveModeId = activeLaunchMode == null ? null : activeLaunchMode.getIdentifier(); - ILaunchMode[] supportedModes = getLaunchModes(); // this is based on active desc and target which are already set + // this is based on active desc and target which are already set + ILaunchMode[] supportedModes = getLaunchModes(); if (supportedModes.length > 0) { // mna, what if no modes are supported? - String modeNames[] = new String[] { - storedModeId, - lastActiveModeId, - "run", //$NON-NLS-1$ + String modeNames[] = new String[] { storedModeId, lastActiveModeId, "run", //$NON-NLS-1$ "debug", //$NON-NLS-1$ - supportedModes[0].getIdentifier() - }; + supportedModes[0].getIdentifier() }; for (int i = 0; i < modeNames.length; i++) { foundMode = getLaunchManager().getLaunchMode(modeNames[i]); if (supportsMode(foundMode)) @@ -554,7 +564,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void fireActiveLaunchDescriptorChanged() { - if (!initialized) return; + if (!initialized) + return; for (Listener listener : listeners) { try { listener.activeLaunchDescriptorChanged(); @@ -612,7 +623,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } private void fireActiveLaunchModeChanged() { - if (!initialized) return; + if (!initialized) + return; for (Listener listener : listeners) { try { listener.activeLaunchModeChanged(); @@ -622,7 +634,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } } - private void storeLaunchMode(ILaunchDescriptor desc, ILaunchMode mode) { if (mode != null) { // per desc store, desc can null if will be stored globally @@ -646,10 +657,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration boolean supportsTarget(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); - for (LaunchConfigProviderInfo provider : configProviders.get(descriptorTypeId)) { + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descriptorTypeId)) { try { - if (provider.getProvider().supports(descriptor, target)) { - return true; + if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) { + if (providerInfo.getProvider().supports(descriptor, target)) { + return true; + } } } catch (Throwable e) { Activator.log(e); @@ -664,6 +677,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration /** * Sets preferred target for launch descriptor + * * @param desc * @param target * @throws CoreException @@ -682,19 +696,23 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration } activeLaunchTarget = target; storeLaunchTarget(activeLaunchDesc, target); + syncActiveMode(); fireActiveLaunchTargetChanged(); // notify listeners } private void storeLaunchTarget(ILaunchDescriptor desc, IRemoteConnection target) { if (target == null) { - return; // no point storing null, if stored id is invalid it won't be used anyway + // no point storing null, if stored id is invalid it won't be used + // anyway + return; } // per desc store, desc can be null means it store globally setPreference(getPerDescriptorStore(desc), PREF_ACTIVE_LAUNCH_TARGET, toString(getTargetId(target))); } private void fireActiveLaunchTargetChanged() { - if (!initialized) return; + if (!initialized) + return; for (Listener listener : listeners) { try { listener.activeLaunchTargetChanged(); @@ -713,7 +731,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); } - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { if (descriptor == null) { @@ -723,13 +740,15 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration String descTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeId)) { try { - ILaunchConfigurationProvider provider = providerInfo.getProvider(); - // between multiple provider who support this descriptor we need to find one - // that supports this target - if (provider.supports(descriptor, target)) { - ILaunchConfiguration config = provider.getLaunchConfiguration(descriptor, target); - if (config != null) { - return config; + if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) { + ILaunchConfigurationProvider provider = providerInfo.getProvider(); + // between multiple provider who support this descriptor we + // need to find one that supports this target + if (provider.supports(descriptor, target)) { + ILaunchConfiguration config = provider.getLaunchConfiguration(descriptor, target); + if (config != null) { + return config; + } } } } catch (Throwable e) { @@ -757,9 +776,10 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { - providerInfo.getProvider().launchConfigurationAdded(configuration); - if (providerInfo.getProvider().ownsLaunchConfiguration(configuration)) { - return; + if (providerInfo.enabled(configuration)) { + if (providerInfo.getProvider().launchConfigurationAdded(configuration)) { + return; + } } } catch (Throwable e) { Activator.log(e); @@ -778,12 +798,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration Activator.log(e); } - // TODO do I need to do this if configs are launch objects? for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { - if (providerInfo.getProvider().launchConfigurationRemoved(configuration)) { - return; + if (providerInfo.enabled(configuration)) { + if (providerInfo.getProvider().launchConfigurationRemoved(configuration)) { + return; + } } } catch (Throwable e) { Activator.log(e); @@ -797,7 +818,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchConfiguration for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { - providerInfo.getProvider().launchConfigurationChanged(configuration); + if (providerInfo.enabled(configuration)) { + if (providerInfo.getProvider().launchConfigurationChanged(configuration)) { + return; + } + } } catch (Throwable e) { Activator.log(e); } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 75219c64e57..8e178db020f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -1,7 +1,12 @@ package org.eclipse.launchbar.core.internal; +import org.eclipse.core.expressions.EvaluationContext; +import org.eclipse.core.expressions.EvaluationResult; +import org.eclipse.core.expressions.Expression; +import org.eclipse.core.expressions.ExpressionConverter; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Status; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; public class LaunchConfigProviderInfo { @@ -9,6 +14,7 @@ public class LaunchConfigProviderInfo { private final int priority; private IConfigurationElement element; private ILaunchConfigurationProvider provider; + private Expression expression; public LaunchConfigProviderInfo(IConfigurationElement element) { this.descriptorTypeId = element.getAttribute("descriptorType"); //$NON-NLS-1$ @@ -23,6 +29,27 @@ public class LaunchConfigProviderInfo { priority = priorityNum; this.element = element; + + IConfigurationElement[] enabledExpressions = element.getChildren("enablement");//$NON-NLS-1$ + if (enabledExpressions == null || enabledExpressions.length == 0) { + Activator.log(new Status(Status.WARNING, Activator.PLUGIN_ID, + "Enablement expression is missing for config provider for " + descriptorTypeId)); //$NON-NLS-1$ + } else if (enabledExpressions.length > 1) { + Activator.log(new Status(Status.WARNING, Activator.PLUGIN_ID, + "Multiple enablement expressions are detected for config provider for "//$NON-NLS-1$ + + descriptorTypeId)); + } else { + try { + expression = ExpressionConverter.getDefault().perform(enabledExpressions[0]); + } catch (CoreException e) { + Activator.log(e); + } + if (expression == null) { + Activator.log(new Status(Status.ERROR, Activator.PLUGIN_ID, + "Cannot parse enablement expression defined in config provider for " + descriptorTypeId)); //$NON-NLS-1$ + } + } + } public String getDescriptorTypeId() { @@ -40,4 +67,12 @@ public class LaunchConfigProviderInfo { } return provider; } + + public boolean enabled(Object element) throws CoreException { + if (expression == null) + return true; + EvaluationResult result = expression.evaluate(new EvaluationContext(null, element)); + return (result == EvaluationResult.TRUE); + } + } \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java index 61ee75a5dbb..2fcea474e2a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -28,7 +28,9 @@ public class LaunchDescriptorTypeInfo { Activator.log(e); } } + this.element = element; + IConfigurationElement[] enabledExpressions = element.getChildren("enablement");//$NON-NLS-1$ if (enabledExpressions == null || enabledExpressions.length == 0) { Activator.log(new Status(Status.WARNING, Activator.PLUGIN_ID, @@ -36,7 +38,7 @@ public class LaunchDescriptorTypeInfo { } else if (enabledExpressions.length > 1) { Activator.log(new Status(Status.WARNING, Activator.PLUGIN_ID, "Multiple enablement expressions are detected for descriptor type "//$NON-NLS-1$ - + id)); + + id)); } else { try { expression = ExpressionConverter.getDefault().perform(enabledExpressions[0]); @@ -51,7 +53,7 @@ public class LaunchDescriptorTypeInfo { } // Used for testing - public LaunchDescriptorTypeInfo(String id, int priority, ILaunchDescriptorType type) { + LaunchDescriptorTypeInfo(String id, int priority, ILaunchDescriptorType type) { this.id = id; this.priority = priority; this.type = type; @@ -73,10 +75,10 @@ public class LaunchDescriptorTypeInfo { return type; } - public boolean ownsLaunchObject(Object object) throws CoreException { + public boolean enabled(Object launchObject) throws CoreException { if (expression == null) return true; - EvaluationResult result = expression.evaluate(new EvaluationContext(null, object)); + EvaluationResult result = expression.evaluate(new EvaluationContext(null, launchObject)); return (result == EvaluationResult.TRUE); } } \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java index c706cf46a25..8d494062154 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java @@ -25,8 +25,8 @@ import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchObjectProvider; /** - * Injects IProject objects from platform resources into the launch bar model for potential - * project descriptors. + * Injects IProject objects from platform resources into the launch bar model + * for potential project descriptors. */ public class ProjectLaunchObjectProvider implements ILaunchObjectProvider, IResourceChangeListener { private ILaunchBarManager manager; @@ -60,8 +60,11 @@ public class ProjectLaunchObjectProvider implements ILaunchObjectProvider, IReso } else if ((kind & IResourceDelta.REMOVED) != 0) { manager.launchObjectRemoved(project); } else if ((kind & IResourceDelta.CHANGED) != 0) { - // TODO may need to be more concise as to what changes we're looking for - manager.launchObjectChanged(project); + int flags = delta.getFlags(); + // Right now, only care about nature changes + if ((flags & IResourceDelta.DESCRIPTION) != 0) { + manager.launchObjectChanged(project); + } } return false; } else if (res instanceof IFile || res instanceof IFolder) { diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index a2fe64af600..9f59c4d140a 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -16,10 +16,10 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; - import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; @@ -38,6 +38,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; +@SuppressWarnings("nls") @FixMethodOrder(MethodSorters.JVM) public class PerTargetLaunchConfigProviderTest { private IRemoteServicesManager remoteServiceManager; @@ -85,16 +86,62 @@ public class PerTargetLaunchConfigProviderTest { } public class PerTargetLaunchConfigProvider1 extends PerTargetLaunchConfigProvider { + public static final String CONNECTION_NAME_ATTR = "connectionName"; + private ILaunchBarManager manager; + @Override public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { return true; } @Override - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) - throws CoreException { + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, + IRemoteConnection target) throws CoreException { return launchConfigType; } + + @Override + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { + super.populateLaunchConfiguration(descriptor, target, workingCopy); + workingCopy.setAttribute(CONNECTION_NAME_ATTR, target.getName()); + } + + @Override + protected ILaunchDescriptor getLaunchDescriptor(ILaunchConfiguration configuration) throws CoreException { + return descriptor; + } + + @Override + protected IRemoteConnection getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { + String name = configuration.getAttribute(CONNECTION_NAME_ATTR, ""); + if (localTarget.getName().equals(name)) { + return localTarget; + } else if (otherTarget.getName().equals(name)) { + return otherTarget; + } else { + return null; + } + } + + @Override + protected ILaunchBarManager getManager() { + if (manager == null) { + manager = mock(ILaunchBarManager.class); + } + return manager; + } + + @Override + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + throws CoreException { + ILaunchConfiguration config = super.getLaunchConfiguration(descriptor, target); + // Since this provider isn't hooked in properly, need to manually + // add in the config + launchConfigurationAdded(config); + return config; + } + }; @Test @@ -102,9 +149,7 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfig = launchConfigType.newInstance(null, launchName).doSave(); ILaunchConfigurationWorkingCopy launchConfigWC = launchConfig.getWorkingCopy(); provider.populateLaunchConfiguration(descriptor, localTarget, launchConfigWC); - //assertEquals(launchConfig.getName(), launchConfigWC.getAttribute(LaunchBarManager2Test.ATTR_ORIGINAL_NAME, "")); - //assertEquals(provider.getClass().getName(), launchConfigWC.getAttribute(LaunchBarManager2Test.ATTR_PROVIDER_CLASS, "")); - assertTrue(provider.ownsLaunchConfigurationByAttributes(launchConfigWC)); + assertTrue(provider.ownsLaunchConfiguration(launchConfigWC)); } @Test @@ -139,7 +184,8 @@ public class PerTargetLaunchConfigProviderTest { assertNotNull(launchConfiguration1); // reset provider provider = new PerTargetLaunchConfigProvider1(); - provider.launchConfigurationAdded(launchConfiguration1); // simulate provider initialization on startup + // simulate provider initialization on startup + provider.launchConfigurationAdded(launchConfiguration1); ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration2); assertEquals(launchConfiguration1, launchConfiguration2); @@ -149,7 +195,7 @@ public class PerTargetLaunchConfigProviderTest { public void testGetTarget() throws CoreException { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration1); - assertSame(localTarget, provider.getTarget(launchConfiguration1)); + assertSame(localTarget, provider.getLaunchTarget(launchConfiguration1)); } @Test @@ -177,10 +223,10 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration1); ILaunchConfigurationWorkingCopy wc = launchConfiguration1.getWorkingCopy(); - wc.setAttribute(provider.getConnectionNameAttribute(), otherTarget.getName()); + wc.setAttribute(PerTargetLaunchConfigProvider1.CONNECTION_NAME_ATTR, otherTarget.getName()); wc.doSave(); provider.launchConfigurationChanged(launchConfiguration1); - //provider.launchConfigurationChanged(lc3); + // provider.launchConfigurationChanged(lc3); ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration2); assertNotEquals(launchConfiguration1, launchConfiguration2); @@ -192,10 +238,14 @@ public class PerTargetLaunchConfigProviderTest { assertNotNull(launchConfiguration1); ILaunchConfigurationWorkingCopy wc = launchConfiguration1.getWorkingCopy(); wc.setAttribute(LaunchBarManager2Test.ATTR_ORIGINAL_NAME, "bla"); - wc.doSave(); + launchConfiguration1 = wc.doSave(); provider.launchConfigurationChanged(launchConfiguration1); // we should have lost ownership assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); + verify(provider.manager).launchConfigurationRemoved(launchConfiguration1); + verify(provider.manager).launchConfigurationAdded(launchConfiguration1); + // have to fake out the remove + provider.launchConfigurationRemoved(launchConfiguration1); ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration2); assertNotEquals(launchConfiguration1, launchConfiguration2); @@ -206,7 +256,6 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration1); provider.launchDescriptorRemoved(descriptor); - assertEquals(0, provider.getTargetMap(descriptor).size()); assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); assertFalse(launchConfiguration1.exists()); } @@ -214,7 +263,6 @@ public class PerTargetLaunchConfigProviderTest { @Test public void testLaunchDescriptorRemoved2() throws CoreException { provider.launchDescriptorRemoved(descriptor); - assertEquals(0, provider.getTargetMap(descriptor).size()); } @Test @@ -222,7 +270,6 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, otherTarget); assertNotNull(launchConfiguration1); provider.launchTargetRemoved(otherTarget); - assertEquals(0, provider.getTargetMap(descriptor).size()); assertFalse(launchConfiguration1.exists()); } @@ -233,7 +280,6 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration2); provider.launchTargetRemoved(otherTarget); - assertEquals(1, provider.getTargetMap(descriptor).size()); assertFalse(launchConfiguration1.exists()); assertTrue(launchConfiguration2.exists()); } @@ -243,7 +289,6 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, otherTarget); assertNotNull(launchConfiguration1); provider.launchTargetRemoved(localTarget); - assertEquals(1, provider.getTargetMap(descriptor).size()); } @Test @@ -252,7 +297,6 @@ public class PerTargetLaunchConfigProviderTest { assertNotNull(launchConfiguration1); assertTrue(provider.ownsLaunchConfiguration(launchConfiguration1)); launchConfiguration1.delete(); - assertTrue(provider.ownsLaunchConfiguration(launchConfiguration1)); provider.launchConfigurationRemoved(launchConfiguration1); assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index c9fa7fd5dbc..08842f3311d 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -16,7 +16,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; - import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; @@ -129,26 +128,26 @@ public class LaunchBarManager2Test { doReturn(provider).when(element).createExecutableExtension("class"); } - protected ILaunchConfigurationProvider mockProviderElement(String descriptorTypeId, int priority, ILaunchDescriptor descriptor, - IRemoteConnection target, - ILaunchConfiguration config, Object launchObj) throws CoreException { + protected ILaunchConfigurationProvider mockConfigProviderElement(String descriptorTypeId, int priority, + ILaunchDescriptor descriptor, IRemoteConnection target, ILaunchConfiguration config, Object launchObj) + throws CoreException { ILaunchConfigurationProvider provider = mock(ILaunchConfigurationProvider.class); mockProviderElement(descriptorTypeId, priority, provider); doReturn(config.getType()).when(provider).getLaunchConfigurationType(descriptor, target); doReturn(config).when(provider).getLaunchConfiguration(descriptor, target); doReturn(true).when(provider).supports(descriptor, target); - doReturn(true).when(provider).ownsLaunchConfiguration(config); + doReturn(true).when(provider).launchConfigurationAdded(config); return provider; } protected IConfigurationElement mockDescriptorTypeElement(String descriptorTypeId, int priority, - ILaunchDescriptorType descriptorType) - throws CoreException { + ILaunchDescriptorType descriptorType) throws CoreException { IConfigurationElement element = mockElementAndAdd("descriptorType"); doReturn(descriptorTypeId).when(element).getAttribute("id"); doReturn(Integer.toString(priority)).when(element).getAttribute("priority"); doReturn(descriptorType).when(element).createExecutableExtension("class"); - mockEnablementElement(element); + // TODO need a real enablement here, not an empty one + // mockEnablementElement(element); return element; } @@ -179,7 +178,6 @@ public class LaunchBarManager2Test { } protected void mockLaunchObjectOnDescriptor(Object launchObject) throws CoreException { - doReturn(true).when(descriptorType).ownsLaunchObject(launchObject); doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); doReturn(launchObject.toString()).when(descriptor).getName(); } @@ -297,7 +295,7 @@ public class LaunchBarManager2Test { doReturn(descriptorType).when(descriptor).getType(); doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); // configProvider - provider = mockProviderElement(descriptorTypeId, 10, descriptor, otherTarget, launchConfig, launchObject); + provider = mockConfigProviderElement(descriptorTypeId, 10, descriptor, otherTarget, launchConfig, launchObject); mockLaunchObjectOnDescriptor(launchObject); // default descriptor String defaultDescTypeId = "defaultDescType"; @@ -309,7 +307,8 @@ public class LaunchBarManager2Test { @Test public void testDescriptor() throws Exception { // Create a descriptor type and inject an associated object - // Make sure the descriptor is active with the local target and proper mode + // Make sure the descriptor is active with the local target and proper + // mode // Make sure the associated launch config is active too // Mocking manager.launchObjectAdded(launchObject); @@ -327,26 +326,20 @@ public class LaunchBarManager2Test { assertNull(manager.getActiveLaunchMode()); } - @Test - public void testAddDescriptorTypeBad() throws CoreException { - doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); - manager.launchObjectAdded("aaa"); - verify(descriptorType).ownsLaunchObject(any()); - } - @Test public void testAddConfigMappingTwo() throws CoreException { basicSetupOnly(); IRemoteConnection target = mockRemoteConnection("t2"); - mockProviderElement(descriptorTypeId, 10, descriptor, target, launchConfig, launchObject); + mockConfigProviderElement(descriptorTypeId, 10, descriptor, target, launchConfig, launchObject); // now create another lc type, which is not registered in config type ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); ILaunchConfiguration lc2 = mockLC("bla2", lctype2); ConfigBasedLaunchDescriptor desc2 = new ConfigBasedLaunchDescriptor(descriptorType, lc2); - mockProviderElement(descriptorTypeId, 10, desc2, target, lc2, lc2); + mockConfigProviderElement(descriptorTypeId, 10, desc2, target, lc2, lc2); init(); manager.launchObjectAdded(launchObject); - // it return original lctype because we did not associate this dynmaically + // it return original lctype because we did not associate this + // dynmaically assertEquals(launchConfigType, manager.getLaunchConfigurationType(descriptor, target)); } @@ -354,10 +347,10 @@ public class LaunchBarManager2Test { public void testAddConfigProviderTwo2() throws CoreException { basicSetupOnly(); IRemoteConnection target = mockRemoteConnection("t2"); - mockProviderElement(descriptorTypeId, 15, descriptor, target, launchConfig, launchObject); + mockConfigProviderElement(descriptorTypeId, 15, descriptor, target, launchConfig, launchObject); ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); ILaunchConfiguration lc2 = mockLC("lc2", lctype2); - mockProviderElement(descriptorTypeId, 20, descriptor, target, lc2, launchObject); + mockConfigProviderElement(descriptorTypeId, 20, descriptor, target, lc2, launchObject); init(); manager.launchObjectAdded(launchObject); assertEquals(lctype2, manager.getLaunchConfigurationType(descriptor, target)); @@ -390,7 +383,7 @@ public class LaunchBarManager2Test { basicSetupOnly(); elements.clear(); mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); - mockProviderElement(descriptorTypeId, 10, descriptor, localTarget, launchConfig, launchObject); + mockConfigProviderElement(descriptorTypeId, 10, descriptor, localTarget, launchConfig, launchObject); init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); @@ -420,30 +413,36 @@ public class LaunchBarManager2Test { } // - // public void testGetLaunchDescriptorsSort() { - // final ILaunchDescriptor res[] = new ILaunchDescriptor[1]; - // manager.addTargetType(targetType); - // ConfigBasedLaunchDescriptorType descType1 = new ConfigBasedLaunchDescriptorType("id1", lctype.getIdentifier()); - // ConfigBasedLaunchDescriptorType descType2 = new ConfigBasedLaunchDescriptorType("id2", lctype.getIdentifier()) { - // @Override - // public ILaunchDescriptor getDescriptor(Object element) { - // return res[0] = super.getDescriptor(element); - // } - // }; - // ConfigBasedLaunchDescriptorType descType3 = new ConfigBasedLaunchDescriptorType("id3", lctype.getIdentifier()); - // manager.addDescriptorType(descType1, 3); - // manager.addDescriptorType(descType2, 5); - // manager.addDescriptorType(descType3, 1); - // manager.addConfigProvider(descType1.getId(), targetType.getId(), true, provider); - // manager.addConfigProvider(descType2.getId(), targetType.getId(), true, provider); - // manager.addConfigProvider(descType3.getId(), targetType.getId(), true, provider); - // targetType.targets.add(mytarget); - // manager.launchObjectAdded(launchObject); - // ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); - // assertEquals(1, launchDescriptors.length); - // assertNotNull(launchDescriptors[0]); - // assertSame(res[0], launchDescriptors[0]); - // } + // public void testGetLaunchDescriptorsSort() { + // final ILaunchDescriptor res[] = new ILaunchDescriptor[1]; + // manager.addTargetType(targetType); + // ConfigBasedLaunchDescriptorType descType1 = new + // ConfigBasedLaunchDescriptorType("id1", lctype.getIdentifier()); + // ConfigBasedLaunchDescriptorType descType2 = new + // ConfigBasedLaunchDescriptorType("id2", lctype.getIdentifier()) { + // @Override + // public ILaunchDescriptor getDescriptor(Object element) { + // return res[0] = super.getDescriptor(element); + // } + // }; + // ConfigBasedLaunchDescriptorType descType3 = new + // ConfigBasedLaunchDescriptorType("id3", lctype.getIdentifier()); + // manager.addDescriptorType(descType1, 3); + // manager.addDescriptorType(descType2, 5); + // manager.addDescriptorType(descType3, 1); + // manager.addConfigProvider(descType1.getId(), targetType.getId(), true, + // provider); + // manager.addConfigProvider(descType2.getId(), targetType.getId(), true, + // provider); + // manager.addConfigProvider(descType3.getId(), targetType.getId(), true, + // provider); + // targetType.targets.add(mytarget); + // manager.launchObjectAdded(launchObject); + // ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); + // assertEquals(1, launchDescriptors.length); + // assertNotNull(launchDescriptors[0]); + // assertSame(res[0], launchDescriptors[0]); + // } // @Test public void testLaunchObjectAdded() throws CoreException { @@ -481,6 +480,7 @@ public class LaunchBarManager2Test { when(project.getType()).thenReturn(IResource.PROJECT); return project; } + public static final String ATTR_PROJECT_NAME = "org.eclipse.cdt.launch" + ".PROJECT_ATTR"; public static final String ATTR_PROGRAM_NAME = "org.eclipse.cdt.launch" + ".PROGRAM_NAME"; @@ -547,11 +547,6 @@ public class LaunchBarManager2Test { } public class ProjectBasedLaunchDescriptorType implements ILaunchDescriptorType { - @Override - public boolean ownsLaunchObject(Object launchObject) throws CoreException { - return launchObject instanceof IProject; - } - @Override public ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException { return new ProjectLaunchDescriptor(this, (IProject) launchObject); @@ -561,8 +556,11 @@ public class LaunchBarManager2Test { return "pbtype"; } } - public static final String ATTR_ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ - public static final String ATTR_PROVIDER_CLASS = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + ".providerClass"; //$NON-NLS-1$ + + public static final String ATTR_ORIGINAL_NAME = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + + ".originalName"; //$NON-NLS-1$ + public static final String ATTR_PROVIDER_CLASS = org.eclipse.launchbar.core.internal.Activator.PLUGIN_ID + + ".providerClass"; //$NON-NLS-1$ protected void projectMappingSetup() throws CoreException { descriptorType = new ProjectBasedLaunchDescriptorType(); @@ -571,7 +569,8 @@ public class LaunchBarManager2Test { descriptor = new ProjectLaunchDescriptor(descriptorType, aaa); // setup some stuff mockDescriptorTypeElement(descriptorTypeId, 10, descriptorType); - //lc = provider.createLaunchConfiguration(lman, descType.getDescriptor(aaa)); + // lc = provider.createLaunchConfiguration(lman, + // descType.getDescriptor(aaa)); mockLCProject(launchConfig, aaa); mockLCAttribute(launchConfig, ATTR_ORIGINAL_NAME, aaa.getName()); assertEquals(0, manager.getLaunchDescriptors().length); @@ -586,6 +585,16 @@ public class LaunchBarManager2Test { public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { return configuration == launchConfig; } + + @Override + protected ILaunchDescriptor getLaunchDescriptor(ILaunchConfiguration configuration) throws CoreException { + return descriptor; + } + + @Override + protected IRemoteConnection getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { + return localTarget; + } }; mockProviderElement(descriptorTypeId, 10, provider); mockLCAttribute(launchConfig, ATTR_PROVIDER_CLASS, provider.getClass().getName()); @@ -635,10 +644,10 @@ public class LaunchBarManager2Test { @Test public void testLaunchObjectAddedBadDescriptor() throws CoreException { - doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); + doThrow(new NullPointerException()).when(descriptorType).getDescriptor(any()); // check events manager.launchObjectAdded(launchObject); - verify(descriptorType).ownsLaunchObject(launchObject); + verify(descriptorType).getDescriptor(launchObject); } @Test @@ -651,7 +660,7 @@ public class LaunchBarManager2Test { @Test public void testLaunchObjectRemoveBadDescriptor() throws CoreException { - doThrow(new NullPointerException()).when(descriptorType).ownsLaunchObject(any()); + doThrow(new NullPointerException()).when(descriptorType).getDescriptor(any()); // check events manager.launchObjectRemoved(launchObject); } @@ -894,7 +903,7 @@ public class LaunchBarManager2Test { ILaunchMode mode = mockLaunchModes(launchConfigType, "foo")[0]; manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); - verify(provider).ownsLaunchConfiguration(launchConfig); + verify(provider).launchConfigurationAdded(launchConfig); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); assertEquals(1, launchDescriptors.length); assertNotNull(launchDescriptors[0]); @@ -910,7 +919,7 @@ public class LaunchBarManager2Test { ILaunchConfigurationType lctype2 = mockLCType("lctype2"); ILaunchConfiguration lc2 = mockLC("lc2", lctype2); manager.launchConfigurationAdded(lc2); - //verify(provider).launchConfigurationAdded(lc2); + // verify(provider).launchConfigurationAdded(lc2); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); assertEquals(1, launchDescriptors.length); assertNotNull(launchDescriptors[0]); @@ -921,10 +930,9 @@ public class LaunchBarManager2Test { @Test public void testLaunchConfigurationAddedBad() throws CoreException { - doThrow(new NullPointerException()).when(provider).ownsLaunchConfiguration(any(ILaunchConfiguration.class)); + doThrow(new NullPointerException()).when(provider).launchConfigurationAdded(any(ILaunchConfiguration.class)); manager.launchConfigurationAdded(launchConfig); verify(provider).launchConfigurationAdded(launchConfig); - verify(provider).ownsLaunchConfiguration(launchConfig); } @Test @@ -958,10 +966,13 @@ public class LaunchBarManager2Test { mockSubElement(enablement, new IConfigurationElement[] { instance }); doReturn("java.lang.Integer").when(instance).getAttribute("value"); init(); - assertNull(manager.launchObjectAdded(launchObject)); // this will be refused by enablement expression - assertNull(manager.launchObjectAdded(1)); // we programmatically refuse this + // this will be refused by enablement expression + assertNull(manager.launchObjectAdded(launchObject)); + // we programmatically refuse this + assertNull(manager.launchObjectAdded(1)); mockLaunchObjectOnDescriptor(1); - assertNotNull(manager.launchObjectAdded(1)); // now we both good programmatically and in expression in extension + // now we both good programmatically and in expression in extension + assertNotNull(manager.launchObjectAdded(1)); } } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 81bce296aa4..f821d43e1fb 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -3,7 +3,6 @@ package org.eclipse.launchbar.core.internal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; - import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; @@ -46,15 +45,17 @@ public class LaunchBarManagerTest { @Test public void defaultTest() throws Exception { - // Create a launch config, make sure default mode and local target are active + // Create a launch config, make sure default mode and local target are + // active // And that that config is the active config. - + // Mocking ILaunchConfigurationType launchConfigType = mock(ILaunchConfigurationType.class); ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); String launchConfigName = "launchConfig"; doReturn(launchConfigName).when(launchConfig).getName(); - doReturn(launchConfigName).when(launchConfig).getAttribute(eq("org.eclipse.launchbar.core.originalName"), anyString()); + doReturn(launchConfigName).when(launchConfig).getAttribute(eq("org.eclipse.launchbar.core.originalName"), + anyString()); doReturn("").when(launchConfig).getAttribute(eq("org.eclipse.launchbar.core.providerClass"), anyString()); doReturn(true).when(launchConfigType).isPublic(); doReturn(launchConfigType).when(launchConfig).getType(); @@ -80,25 +81,25 @@ public class LaunchBarManagerTest { assertNotNull(manager.getActiveLaunchMode()); assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); - + assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); } @Test - @SuppressWarnings("deprecation") public void descriptorTest() throws Exception { // Create a descriptor type and inject an associated object - // Make sure the descriptor is active with the local target and proper mode + // Make sure the descriptor is active with the local target and proper + // mode // Make sure the associated launch config is active too // Mocking final IExtensionPoint extensionPoint = mock(IExtensionPoint.class); IExtension extension = mock(IExtension.class); doReturn(new IExtension[] { extension }).when(extensionPoint).getExtensions(); - + List elements = new ArrayList<>(); IConfigurationElement element; - + // fake launch object String launchObject = "fakeObject"; @@ -110,7 +111,6 @@ public class LaunchBarManagerTest { doReturn(descriptorTypeId).when(element).getAttribute("id"); ILaunchDescriptorType descriptorType = mock(ILaunchDescriptorType.class); doReturn(descriptorType).when(element).createExecutableExtension("class"); - doReturn(true).when(descriptorType).ownsLaunchObject(launchObject); ILaunchDescriptor descriptor = mock(ILaunchDescriptor.class); doReturn(descriptor).when(descriptorType).getDescriptor(launchObject); doReturn(descriptorType).when(descriptor).getType(); @@ -142,13 +142,15 @@ public class LaunchBarManagerTest { doReturn("configProvider").when(element).getName(); doReturn(descriptorTypeId).when(element).getAttribute("descriptorType"); doReturn("10").when(element).getAttribute("priority"); - + ILaunchConfigurationProvider configProvider = mock(ILaunchConfigurationProvider.class); doReturn(configProvider).when(element).createExecutableExtension("class"); ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); - doReturn(launchConfig).when(configProvider).getLaunchConfiguration(eq(descriptor), any(IRemoteConnection.class)); - doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(any(ILaunchDescriptor.class), any(IRemoteConnection.class)); + doReturn(launchConfig).when(configProvider).getLaunchConfiguration(eq(descriptor), + any(IRemoteConnection.class)); + doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(any(ILaunchDescriptor.class), + any(IRemoteConnection.class)); doAnswer(new Answer() { @Override public Boolean answer(InvocationOnMock invocation) throws Throwable { @@ -158,13 +160,14 @@ public class LaunchBarManagerTest { }).when(configProvider).supports(eq(descriptor), any(IRemoteConnection.class)); doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); - + // Now inject the launch object LaunchBarManager manager = new LaunchBarManager(false) { @Override IExtensionPoint getExtensionPoint() throws CoreException { return extensionPoint; } + @Override ILaunchManager getLaunchManager() { return launchManager; @@ -183,10 +186,13 @@ public class LaunchBarManagerTest { assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); } - // TODO - test that changing active target type produces a different launch config type + // TODO - test that changing active target type produces a different launch + // config type // TODO - test that settings are maintained after a restart - // TODO - test that two target types that map to the same desc type and config type share configs - // TODO - test duplicating a config. make sure it's default desc and same targets + // TODO - test that two target types that map to the same desc type and + // config type share configs + // TODO - test duplicating a config. make sure it's default desc and same + // targets // TODO - test project descriptors and stuff // TODO - test descriptor takeovers (new descriptors on launchObjectChange From 01bfa62a4d3c7d36b7af1662ab0c421e1be3db04 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 3 Jun 2015 10:53:32 -0400 Subject: [PATCH 041/198] launchbar: target config provider lc working copies bugs per target config provider adds working copy into cache on change notifications which creates problems a) they never cleaned up b) now when its searching its picking a wrong config (wc) causing it to return invalid config fix push up higher in launch bar itself, no point propagating launch change notifications from working copies Change-Id: I3b7bc94f3ef6ab385fc43cc5482ab4c9b943e8fa --- .../eclipse/launchbar/core/internal/LaunchBarManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 998a8722d32..9bad6cdba57 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -815,6 +815,11 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha @Override public void launchConfigurationChanged(ILaunchConfiguration configuration) { + // we have to ignore notifications from working copies, otherwise + // we will get thousand of events and we don't track working copies + // (add/remove events are not sent for WCs) + if (configuration.isWorkingCopy()) + return; for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { From 9953b7f05ded100400cb06461ccbedc7ebbc407d Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 15 Jun 2015 09:10:24 -0400 Subject: [PATCH 042/198] launchbar: get rid of startup warning about missing enablement expr Change-Id: Id9cefa69f1cf532d54eb5fd18724d8ae1d50aa52 --- bundles/org.eclipse.launchbar.core/plugin.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index a34277ac63a..dd5ec17e2a7 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -21,6 +21,8 @@ class="org.eclipse.launchbar.core.DefaultLaunchConfigProvider" descriptorType="org.eclipse.launchbar.core.descriptorType.default" priority="0"> + + From d6a022692a74c7d7e7e8b873ceaff11d8debeeea Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 19 Jun 2015 09:42:10 -0400 Subject: [PATCH 043/198] Remove 32-bit Mac. It's gone now. Change-Id: Id2b00af1eda3a5c990a4f7ec774b68628c565d71 --- pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pom.xml b/pom.xml index c94499a8a00..ee3c80c5ffe 100644 --- a/pom.xml +++ b/pom.xml @@ -228,11 +228,6 @@ win32 x86_64 - - macosx - cocoa - x86 - macosx cocoa From 329f20b8c97268d1e429cc005e17998074365de9 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 18 Jun 2015 11:19:15 -0400 Subject: [PATCH 044/198] launchbar: NPE in ModeSelector is group does not have an image this prevents mode selector from working at all Change-Id: Iefc80b8a71cc4550e35fedb2dadcc450f256cb63 --- .../eclipse/launchbar/ui/internal/controls/ModeSelector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 305735601ee..6543f7fa7f7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -84,6 +84,8 @@ public class ModeSelector extends CSelector { } if (group != null) { ImageDescriptor imageDesc = group.getImageDescriptor(); + if (imageDesc == null) + return null; Image image = images.get(imageDesc); if (image == null) { image = imageDesc.createImage(); From a637a8a4ef97ddf8c3156e3348b69efc6465c5df Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 22 Jun 2015 10:05:09 -0400 Subject: [PATCH 045/198] Bug 469522 - [Launch bar] An internal error occurred during: "Stopping launches" (NPE) Change-Id: I3d3af8182680a39cccc734015927235bb4bcc227 Signed-off-by: Alena Laskavaia --- .../ui/internal/commands/StopActiveCommandHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index a176c188a37..5e3f24c884f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -55,7 +55,7 @@ public class StopActiveCommandHandler extends AbstractHandler { ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration(); for (ILaunch launch : activeLaunches) { ILaunchConfiguration launchConfig = launch.getLaunchConfiguration(); - if (launchConfig.equals(activeConfig)) { + if (launchConfig != null && launchConfig.equals(activeConfig)) { launch.terminate(); } else if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { // There are evil delegates that use a working copy for scratch storage From 3a6a685bdb5f8b69b3cb31863c1b5ec676339875 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 22 Jun 2015 10:20:15 -0400 Subject: [PATCH 046/198] Bug 470717 - [Launch Bar] NPE in some launch configuration when creating through launch bar wizard Change-Id: Ib4627341b3074613dd8e42e71e85161267a37c65 --- .../dialogs/NewLaunchConfigEditPage.java | 61 ++++++++++++++++--- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 02161556a74..e07ae5ef3fc 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -20,11 +20,14 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.internal.core.LaunchManager; import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; import org.eclipse.debug.ui.ILaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; +import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.resource.ColorRegistry; import org.eclipse.jface.resource.JFaceResources; @@ -49,7 +52,7 @@ public class NewLaunchConfigEditPage extends WizardPage { ILaunchConfigurationTabGroup tabGroup; private Text nameText; private CTabFolder tabFolder; - private LaunchConfigurationDialog launchConfigurationDialog = new LaunchConfigurationDialog(); + private LaunchConfigurationDialog launchConfigurationDialog = new LaunchConfigurationDialogFake(); private LaunchConfigurationManager launchConfigurationMgr = DebugUIPlugin.getDefault().getLaunchConfigurationManager(); public NewLaunchConfigEditPage() { @@ -126,6 +129,7 @@ public class NewLaunchConfigEditPage extends WizardPage { tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, initialMode); for (CTabItem item : tabFolder.getItems()) item.dispose(); + LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); tabGroup.createTabs(launchConfigurationDialog, initialMode); boolean firstTab = true; for (ILaunchConfigurationTab tab : tabGroup.getTabs()) { @@ -165,12 +169,13 @@ public class NewLaunchConfigEditPage extends WizardPage { return false; for (ILaunchConfigurationTab tab : tabGroup.getTabs()) tab.performApply(workingCopy); + LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(null); return true; } public void validateFields() { // page is not complete unless we finish validation successfully - setPageComplete(false); + setPageComplete(false); if (workingCopy == null) return; String message = null; @@ -213,12 +218,31 @@ public class NewLaunchConfigEditPage extends WizardPage { } } - private class LaunchConfigurationDialog implements ILaunchConfigurationDialog { + private class LaunchConfigurationDialogFake extends LaunchConfigurationDialog { + public LaunchConfigurationDialogFake() { + super(NewLaunchConfigEditPage.this.getShell(), null, null); + } + + @Override + protected ILaunchConfiguration getLaunchConfiguration() { + return workingCopy; + } + + @Override + public LaunchGroupExtension getLaunchGroup() { + return NewLaunchConfigEditPage.this.getLaunchGroup(); + } + + @Override + public String getMode() { + return NewLaunchConfigEditPage.this.getMode(); + } + @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { - // TODO Auto-generated method stub + // ignore } @Override @@ -232,7 +256,7 @@ public class NewLaunchConfigEditPage extends WizardPage { @Override public void setName(String name) { - // TODO Auto-generated method stub + // ignore } @Override @@ -253,10 +277,6 @@ public class NewLaunchConfigEditPage extends WizardPage { return tabGroup.getTabs()[i]; } - @Override - public String getMode() { - return ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); - } @Override public void setActiveTab(ILaunchConfigurationTab tab) { @@ -276,4 +296,25 @@ public class NewLaunchConfigEditPage extends WizardPage { tabFolder.setSelection(index); } } + + public String getMode() { + return ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); + } + + public LaunchGroupExtension getLaunchGroup() { + try { + if (workingCopy == null) + return null; + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager() + .getLaunchGroup(workingCopy.getType(), getMode()); + if (group == null) { + return null; + } + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() + .getLaunchGroup(group.getIdentifier()); + return groupExt; + } catch (CoreException e) { + return null; + } + } } From 9986e4d6f6bb6d698507ddb887ab18c58c987a33 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 23 Jul 2015 10:44:01 -0400 Subject: [PATCH 047/198] launchbar: using native toolbar items for buttons - tested on linux ubuntu 14.04 gtk 3.10, mac os x 10.10.3 and windows 7 - looks good. On linux it has extra spacing but this is consistent with other toolbar items. Change-Id: Iafeb1510ce83163f77a09f61c28a4f67d14ab0a1 --- .../internal/controls/LaunchBarControl.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 927a03216e7..8c3959e5396 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -14,6 +14,7 @@ import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.eclipse.debug.core.ILaunchMode; + import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; @@ -29,6 +30,8 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.swt.widgets.ToolItem; public class LaunchBarControl implements Listener { public static final String ID = "org.eclipse.launchbar"; //$NON-NLS-1$ @@ -48,9 +51,9 @@ public class LaunchBarControl implements Listener { Composite container = new Composite(parent, SWT.NONE); container.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); - GridLayout layout = new GridLayout(7, false); - layout.marginHeight = 8; - layout.marginWidth = 8; + GridLayout layout = new GridLayout(5, false); + layout.marginHeight = 2; + layout.marginWidth = 2; container.setLayout(layout); container.addDisposeListener(new DisposeListener() { @Override @@ -59,9 +62,10 @@ public class LaunchBarControl implements Listener { } }); - createButton(container, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); - createButton(container, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); - createButton(container, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); + ToolBar toolBar = new ToolBar(container, SWT.FLAT); + createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); + createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); modeSelector = new ModeSelector(container, SWT.NONE); modeSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); @@ -97,11 +101,11 @@ public class LaunchBarControl implements Listener { } private void createButton(Composite parent, String imageName, String toolTipText, final String command) { - CButton button = new CButton(parent, SWT.NONE); - button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); + ToolItem button = new ToolItem((ToolBar) parent, SWT.FLAT); + //button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); Image srcImage = Activator.getDefault().getImage(imageName); - Image image = new Image(parent.getDisplay(), srcImage, SWT.IMAGE_COPY); - button.setHotImage(image); + //Image image = new Image(parent.getDisplay(), srcImage, SWT.IMAGE_COPY); + button.setImage(srcImage); button.setToolTipText(toolTipText); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { From 9401e510014a377daafd20751b1b3d6b8834c22f Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 23 Jul 2015 13:10:17 -0400 Subject: [PATCH 048/198] launchbar: fixing some labels - mode selector tooltip Launch configuration -> Launch Mode - launch selector Launch configuration -> Launch Configuration - new text Create New Configuration... -> New Launch Configuration... (consistent with tooltip for same button in lc dialog) Change-Id: I339ce4263783a08d10f11f3474abf9f4b468e775 --- .../org/eclipse/launchbar/ui/internal/messages.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 496ccf7940b..0484937e241 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -1,8 +1,8 @@ BuildActiveCommandHandler_0=Building Active Configuration BuildActiveCommandHandler_1=Building Active Configuration ConfigSelector_0=No Launch Configurations -ConfigSelector_1=Launch configuration -ConfigSelector_2=Create New Configuration... +ConfigSelector_1=Launch Configuration +ConfigSelector_2=New Launch Configuration... ConfigSelector_3=Create Launch Configuration CSelector_0=Closing popup CSelector_1=Updating launch bar selection @@ -23,7 +23,7 @@ LaunchConfigurationEditDialog_3=Confirm Delete LaunchConfigurationEditDialog_4=Are you sure you want to delete LaunchConfigurationEditDialog_5=Deleting launch configuration LaunchConfigurationEditDialog_6=Duplicating launch configuration -ModeSelector_0=Launch configuration +ModeSelector_0=Launch Mode NewLaunchConfigEditPage_0=NewLaunchConfigEditPage NewLaunchConfigEditPage_1=Launch Configuration Properties NewLaunchConfigEditPage_2=Edit the new launch configuration properties From 0fc265dc4efe9fd97719cb510f08c7d70306a7b0 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 23 Jul 2015 13:31:22 -0400 Subject: [PATCH 049/198] launchbar: fixes in config edit wizard page - removed code that did nothing - added dispose code to restore lc dialog otherwise if you cancel cannot bring any sort of lc dialog again - added code to have unique lc name as suggestion Change-Id: Ia33abed6019edb097cc775f00cbfea1629e9720b --- .../dialogs/NewLaunchConfigEditPage.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index e07ae5ef3fc..5106f560110 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -104,7 +104,7 @@ public class NewLaunchConfigEditPage extends WizardPage { if (name.isEmpty()) { return Messages.NewLaunchConfigEditPage_4; } - + ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); if (manager.isExistingLaunchConfigurationName(name)) { ILaunchConfiguration config = ((LaunchManager) manager).findLaunchConfiguration(name); @@ -125,20 +125,19 @@ public class NewLaunchConfigEditPage extends WizardPage { return; try { String initialMode = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); - workingCopy = type.newInstance(null, Messages.NewLaunchConfigEditPage_6); + ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); + String name = manager.generateLaunchConfigurationName("launchConfiguration"); //$NON-NLS-1$ + workingCopy = type.newInstance(null, name); tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, initialMode); for (CTabItem item : tabFolder.getItems()) item.dispose(); LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); tabGroup.createTabs(launchConfigurationDialog, initialMode); - boolean firstTab = true; + for (ILaunchConfigurationTab tab : tabGroup.getTabs()) { tab.setLaunchConfigurationDialog(launchConfigurationDialog); tab.createControl(tabFolder); tab.setDefaults(workingCopy); - if (firstTab) { - firstTab = false; - } } // Do this after all the tabs have their controls created @@ -164,6 +163,7 @@ public class NewLaunchConfigEditPage extends WizardPage { } } + boolean performFinish() { if (workingCopy == null) return false; @@ -173,6 +173,11 @@ public class NewLaunchConfigEditPage extends WizardPage { return true; } + @Override + public void dispose() { + LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(null); + } + public void validateFields() { // page is not complete unless we finish validation successfully setPageComplete(false); @@ -228,6 +233,13 @@ public class NewLaunchConfigEditPage extends WizardPage { return workingCopy; } + @Override + public void launchConfigurationAdded(ILaunchConfiguration configuration) { + if (getLaunchConfiguration() == null) + return; + super.launchConfigurationAdded(configuration); + } + @Override public LaunchGroupExtension getLaunchGroup() { return NewLaunchConfigEditPage.this.getLaunchGroup(); From 6c7b1ba259975bd7bc7892b1a12850fd755c96be Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 23 Jul 2015 15:09:11 -0400 Subject: [PATCH 050/198] launchbar: make launchbar selectors resizeable Change-Id: Iba264b3b1a666257663ba36bca9262d0c6339f89 --- .../ui/internal/controls/CSelector.java | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 9f650bdedfb..53bfc7eca7c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -17,12 +17,14 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.launchbar.ui.IHoverProvider; +import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; @@ -368,7 +370,7 @@ public abstract class CSelector extends Composite { if (popup != null && !popup.isDisposed()) { popup.dispose(); } - popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP); + popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP | SWT.RESIZE); popup.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); @@ -395,11 +397,8 @@ public abstract class CSelector extends Composite { Point popupLocation = popup.getDisplay().map(this, null, 0, buttonBounds.height); popup.setLocation(popupLocation.x, popupLocation.y + 5); - Point size = popup.computeSize(SWT.DEFAULT, SWT.DEFAULT); - Point buttonSize = getSize(); - size.x = Math.max(size.x, buttonSize.x); - size.y = Math.min(size.y, 300); - popup.setSize(size); + + restoreShellSize(); popup.setVisible(true); popup.setFocus(); getDisplay().addFilter(SWT.FocusIn, focusOutListener); @@ -411,13 +410,45 @@ public abstract class CSelector extends Composite { getDisplay().removeFilter(SWT.FocusIn, focusOutListener); getDisplay().removeFilter(SWT.FocusOut, focusOutListener); getDisplay().removeFilter(SWT.MouseUp, focusOutListener); + saveShellSize(); } + }); if (hoverProvider != null) { hoverProvider.dismissHover(selection != null ? selection : null, true); } } + protected String getDialogPreferencePrefix() { + return getClass().getSimpleName(); + } + + protected void restoreShellSize() { + Point size = popup.computeSize(SWT.DEFAULT, SWT.DEFAULT); + Point buttonSize = getSize(); + size.x = Math.max(size.x, buttonSize.x); + size.y = Math.min(size.y, 300); + try { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + String prefName = getDialogPreferencePrefix(); + int w = store.getInt(prefName + ".shell.w"); + int h = store.getInt(prefName + ".shell.h"); + size.x = Math.max(size.x, w); + size.y = Math.max(size.y, h); + } catch (Exception e) { + Activator.log(e); + } + popup.setSize(size); + } + + protected void saveShellSize() { + Point size = popup.getSize(); + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + String prefName = getDialogPreferencePrefix(); + store.setValue(prefName + ".shell.w", size.x); + store.setValue(prefName + ".shell.h", size.y); + } + protected void initializeListViewer(LaunchBarListViewer listViewer) { listViewer.setContentProvider(contentProvider); listViewer.setLabelProvider(labelProvider); @@ -501,7 +532,7 @@ public abstract class CSelector extends Composite { /** * Set sorter for the bottom part of the selector - * + * * @param sorter */ public void setSorter(Comparator sorter) { @@ -510,7 +541,7 @@ public abstract class CSelector extends Composite { /** * Set sorter for the "history" part of the selector - * + * * @param sorter */ public void setHistorySortComparator(Comparator sorter) { From 38577c4ec9de7bd2bafd6fcb95f276fa6ffecd46 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 25 Aug 2015 09:30:27 -0400 Subject: [PATCH 051/198] NPE in StopActiveCommandHandler when origin is null Change-Id: Ic6749311328d9521d64c5d339006c0065e200117 --- .../internal/commands/StopActiveCommandHandler.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index 5e3f24c884f..f6a6c3fb1f3 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -50,17 +50,24 @@ public class StopActiveCommandHandler extends AbstractHandler { final ILaunch[] activeLaunches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); if (activeLaunches != null && activeLaunches.length > 0) { new Job(Messages.StopActiveCommandHandler_0) { + @Override protected IStatus run(IProgressMonitor monitor) { try { ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration(); + if (activeConfig == null) { + return Status.OK_STATUS; + } for (ILaunch launch : activeLaunches) { ILaunchConfiguration launchConfig = launch.getLaunchConfiguration(); - if (launchConfig != null && launchConfig.equals(activeConfig)) { + if (activeConfig.equals(launchConfig)) { launch.terminate(); - } else if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { + continue; + } + if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { // There are evil delegates that use a working copy for scratch storage - if (((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal().equals(activeConfig)) { + if (activeConfig.equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) { launch.terminate(); + continue; } } } From 4b6a04fac1ca5a4a9fbb98b44f7c45cfb79f1135 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 26 Aug 2015 13:49:06 -0400 Subject: [PATCH 052/198] launchbar: resurrect gear on target selector it will open Properties dialog on connection. Contributors can adapt connection to their class to show various property pages and allow to edit "targets" Change-Id: I0fe486b069450bbf8379930ffdeaabd9c8dbbd6e --- .../ui/internal/controls/TargetSelector.java | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index 46145371e8f..f8a72c3684c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -20,8 +20,13 @@ import org.eclipse.core.commands.NotEnabledException; import org.eclipse.core.commands.NotHandledException; import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.window.SameShellProvider; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; @@ -45,6 +50,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.dialogs.PropertyDialogAction; public class TargetSelector extends CSelector { @@ -94,13 +100,37 @@ public class TargetSelector extends CSelector { @Override public boolean isEditable(Object element) { - // TODO - return false; + + return true; } + private ISelectionProvider getSelectionProvider(){ + return new ISelectionProvider() { + @Override + public void setSelection(ISelection selection) { + // ignore + } + + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + // ignore + } + + @Override + public ISelection getSelection() { + return new StructuredSelection(TargetSelector.this.getSelection()); + } + + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + // ignore + } + }; + } @Override public void handleEdit(Object element) { - // TODO + // opens property dialog on a selected target + new PropertyDialogAction(new SameShellProvider(getShell()), getSelectionProvider()).run(); } @Override @@ -138,6 +168,7 @@ public class TargetSelector extends CSelector { createLabel.setBackground(backgroundColor); MouseListener mouseListener = new MouseAdapter() { + @Override public void mouseUp(org.eclipse.swt.events.MouseEvent event) { try { ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); From 806ae521c6c00885fdbeaee6207b4de7c4ef4d4d Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 8 Sep 2015 10:48:31 -0400 Subject: [PATCH 053/198] launchbar: when there is no descriptors show all connections - when you bring IDE in new workspace all drops downs are empty, so you create new connection from target drop down, but its still remain empty after connection is created which is quite confusing. So its better to show all connection when descriptor is null (i.e. no descriptor at all) Change-Id: Idef1b676baef4978f8327135691e485ca287d7fe --- .../launchbar/core/internal/LaunchBarManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 9bad6cdba57..ca8787cb1f3 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -598,7 +598,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha /** * Sets the preferred mode for the given descriptor - * + * * @param desc * @param mode * @throws CoreException @@ -643,7 +643,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha public List getLaunchTargets(ILaunchDescriptor descriptor) throws CoreException { if (descriptor == null) - return Collections.emptyList(); + return remoteServicesManager.getAllRemoteConnections(); List targets = new ArrayList<>(); for (IRemoteConnection target : remoteServicesManager.getAllRemoteConnections()) { @@ -677,7 +677,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha /** * Sets preferred target for launch descriptor - * + * * @param desc * @param target * @throws CoreException @@ -816,7 +816,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha @Override public void launchConfigurationChanged(ILaunchConfiguration configuration) { // we have to ignore notifications from working copies, otherwise - // we will get thousand of events and we don't track working copies + // we will get thousand of events and we don't track working copies // (add/remove events are not sent for WCs) if (configuration.isWorkingCopy()) return; @@ -889,7 +889,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha return; fireLaunchTargetsChanged(); // if we added new target we probably want to use it - if (activeLaunchDesc != null && supportsTarget(activeLaunchDesc, target)) { + if (activeLaunchDesc == null || supportsTarget(activeLaunchDesc, target)) { setActiveLaunchTarget(target); } } From 3c10977fd97a9bac6c532110e12f2cc79ad9ca90 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 8 Sep 2015 11:26:16 -0400 Subject: [PATCH 054/198] Upversion launchbar for Mars.1 (launchbar 1.0.1). Change-Id: I6f24e2c7c67e09ad67a9c7a5096236e293a91557 --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.core/pom.xml | 2 +- bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/pom.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index cc050c64a05..ab864804f79 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml index 8603ddf64b9..4f1fe4e0d79 100644 --- a/bundles/org.eclipse.launchbar.core/pom.xml +++ b/bundles/org.eclipse.launchbar.core/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.core - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index db5c174c759..07287ff698f 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.ui, diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml index 1d44fd01db7..62c18d01f02 100644 --- a/bundles/org.eclipse.launchbar.ui/pom.xml +++ b/bundles/org.eclipse.launchbar.ui/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.ui - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT eclipse-plugin diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 2e413fd1721..5e8f84c18df 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index 73646980c7b..6591751cf0d 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT eclipse-feature From ce54f54a33ed1b0feeed810604de29f51f2ea1d1 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 9 Sep 2015 10:20:40 -0400 Subject: [PATCH 055/198] launchbar: fixed refresh of connection status on toolbar - when we show icon with connection status it does not refresh automatically because launchbar does not propogate connection change events. Fixed that. Change-Id: I00c580d303460f6ead3a2aa3a91e8f151fd9f38a --- .../launchbar/core/internal/LaunchBarManager.java | 1 + .../launchbar/ui/internal/controls/CSelector.java | 11 ++++++++++- .../ui/internal/controls/LaunchBarControl.java | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index ca8787cb1f3..a982bfe30ef 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -868,6 +868,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha fireLaunchTargetsChanged(); break; default: + fireLaunchTargetsChanged(); break; } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 53bfc7eca7c..3b790248664 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; public abstract class CSelector extends Composite { private IStructuredContentProvider contentProvider; @@ -557,7 +558,15 @@ public abstract class CSelector extends Composite { } public void refresh() { - // TODO add any new ones to the popup if it's open + PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + update(selection); // update current selection - name or icon may have changed + if (popup != null && !popup.isDisposed()) { + listViewer.refresh(true); // update all labels in the popup + } + } + }); } public void update(Object element) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 8c3959e5396..768601e22c0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -108,6 +108,7 @@ public class LaunchBarControl implements Listener { button.setImage(srcImage); button.setToolTipText(toolTipText); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { Activator.runCommand(command); }; @@ -146,8 +147,7 @@ public class LaunchBarControl implements Listener { @Override public void launchTargetsChanged() { - // TODO Auto-generated method stub - + targetSelector.refresh(); } public ConfigSelector getConfigSelector() { From 117074d323ae74f637d3dfaed02d37c9d33fedc9 Mon Sep 17 00:00:00 2001 From: Teodor Madan Date: Fri, 2 Oct 2015 11:19:35 +0300 Subject: [PATCH 056/198] Fix missing copyright headers Change-Id: I0ce153ec219cf63a90e2d832080b4aacb2860fde Signed-off-by: Teodor Madan --- .../core/AbstractLaunchConfigProvider.java | 10 ++++++++++ .../core/DefaultLaunchConfigProvider.java | 10 ++++++++++ .../launchbar/core/ILaunchObjectProvider.java | 10 ++++++++++ .../core/PerTargetLaunchConfigProvider.java | 10 ++++++++++ .../internal/DefaultLaunchDescriptorType.java | 10 ++++++++++ .../core/internal/LaunchConfigProviderInfo.java | 10 ++++++++++ .../core/internal/LaunchDescriptorTypeInfo.java | 10 ++++++++++ .../schema/launchBarUIContributions.exsd | 17 +++++++++++++++++ .../DefaultDescriptorLabelProvider.java | 10 ++++++++++ .../LaunchBarPreferenceInitializer.java | 10 ++++++++++ .../ui/internal/LaunchBarPreferencePage.java | 10 ++++++++++ .../ui/internal/controls/EditButton.java | 10 ++++++++++ .../ui/internal/controls/FilterControl.java | 10 ++++++++++ .../internal/controls/LaunchBarListViewer.java | 10 ++++++++++ .../core/internal/LaunchBarManagerTest.java | 10 ++++++++++ 15 files changed, 157 insertions(+) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index 9ddd7c46de4..3758fabbfb2 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index 87a70b31c87..a1dca878dec 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java index 4d77c944a07..59525dd87ac 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index fbefcb6fb9d..f00e7c2264b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core; import java.util.Collection; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index ecacc4b51a4..ed7cc5bc1d3 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core.internal; import java.util.HashMap; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 8e178db020f..46721079320 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core.internal; import org.eclipse.core.expressions.EvaluationContext; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java index 2fcea474e2a..5978e49243a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core.internal; import org.eclipse.core.expressions.EvaluationContext; diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd index 4e96a6c92e8..e13cca0bb24 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd @@ -108,5 +108,22 @@ + + + + + + /******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ + + diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java index dc7b7bf493d..848b96195d6 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.ui.internal; import java.util.HashMap; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java index c74b8511e13..6aff0a56f42 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.ui.internal; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java index 9b7ef52bb40..3016001605b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.ui.internal; import org.eclipse.jface.preference.BooleanFieldEditor; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java index c9e52c9a486..f66a173c3b2 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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: + * Alena Laskavaia + *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; import org.eclipse.launchbar.ui.internal.Activator; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java index 5d34e658d95..718da8e3e4f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Alena Laskavaia + *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; import org.eclipse.core.runtime.IProgressMonitor; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 46fbd2d1c33..8c510834789 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014 QNX Software Systems 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: + * Alena Laskavaia + *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; import java.util.ArrayList; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index f821d43e1fb..33105f6351a 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + *******************************************************************************/ package org.eclipse.launchbar.core.internal; import static org.junit.Assert.assertEquals; From 50e08bc7d5861cd50b0e93d0ab5d9622f118c593 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 6 Oct 2015 11:44:32 -0400 Subject: [PATCH 057/198] LaunchBar: use o.e.debug control to manage lc tabs - current wizard page tries to replicate functionality of lc editor in regards to tabs but it does not work the same which creates issues for contributed tabs - for example it never calls "activate" on the tab - we also have rendering problem - pages are not resized correctly and show up empty until resized - I switched to use standard control called LaunchConfigurationTabGroupViewer to show tabs. Hack with fake LaunchConfigurationDialog has to remain to interact with this control. - If we move it to o.e.debug we have to fix these classes to remove some of the hacks and expose proper APIs to re-use this control Change-Id: Ia39706fb5972883167f5f39751985d97e1815c86 --- .../dialogs/NewLaunchConfigEditPage.java | 232 +++++------------- .../dialogs/NewLaunchConfigModePage.java | 18 +- .../dialogs/NewLaunchConfigTypePage.java | 21 +- .../dialogs/NewLaunchConfigWizard.java | 20 +- 4 files changed, 92 insertions(+), 199 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 5106f560110..5dd8ff1f801 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -17,43 +17,28 @@ import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.internal.core.LaunchManager; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.resource.ColorRegistry; -import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; @SuppressWarnings("restriction") public class NewLaunchConfigEditPage extends WizardPage { - ILaunchConfigurationWorkingCopy workingCopy; - ILaunchConfigurationTabGroup tabGroup; - private Text nameText; - private CTabFolder tabFolder; - private LaunchConfigurationDialog launchConfigurationDialog = new LaunchConfigurationDialogFake(); - private LaunchConfigurationManager launchConfigurationMgr = DebugUIPlugin.getDefault().getLaunchConfigurationManager(); + private ILaunchConfigurationWorkingCopy workingCopy; + private LaunchConfigurationDialogExt launchConfigurationDialog = new LaunchConfigurationDialogExt(); + private LaunchConfigurationTabGroupViewerExt tabViewer; + private ILaunchConfigurationType type; public NewLaunchConfigEditPage() { super(Messages.NewLaunchConfigEditPage_0); @@ -64,111 +49,50 @@ public class NewLaunchConfigEditPage extends WizardPage { @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); - comp.setLayout(new GridLayout(2, false)); - Label label = new Label(comp, SWT.NONE); - label.setLayoutData(new GridData()); - label.setText(Messages.NewLaunchConfigEditPage_3 + ":"); //$NON-NLS-1$ - nameText = new Text(comp, SWT.BORDER); - nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - ColorRegistry reg = JFaceResources.getColorRegistry(); - Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$ - c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$ - tabFolder = new CTabFolder(comp, SWT.BORDER | SWT.NO_REDRAW_RESIZE | SWT.FLAT); - GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); - gridData.horizontalSpan = 2; - tabFolder.setLayoutData(gridData); - tabFolder.setSimple(false); - tabFolder.setSelectionBackground(new Color[] { c1, c2 }, new int[] { 100 }, true); - tabFolder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$ - + comp.setLayout(new GridLayout(1, false)); setControl(comp); - nameText.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - String name = nameText.getText().trim(); - workingCopy.rename(name); - - String errMessage = checkName(name); - if (errMessage == null) { - validateFields(); - } else { - setErrorMessage(errMessage); - } - } - }); + // create tab viewer + LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); + tabViewer = new LaunchConfigurationTabGroupViewerExt(comp, launchConfigurationDialog); + launchConfigurationDialog.setTabViewer(tabViewer); + changeLaunchConfigType(type); + GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false); + data.heightHint = 500; + tabViewer.getControl().setLayoutData(data); + parent.layout(true, true); validateFields(); } - private String checkName(String name) { - try { - if (name.isEmpty()) { - return Messages.NewLaunchConfigEditPage_4; - } - - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - if (manager.isExistingLaunchConfigurationName(name)) { - ILaunchConfiguration config = ((LaunchManager) manager).findLaunchConfiguration(name); - if (config != workingCopy.getOriginal()) { - return (Messages.NewLaunchConfigEditPage_5); - } - } - } catch (Exception e) { - Activator.log(e); - return (e.getLocalizedMessage()); - } - return null; + /** + * @return the workingCopy + */ + public ILaunchConfigurationWorkingCopy getWorkingCopy() { + return workingCopy; } - void changeLaunchConfigType(ILaunchConfigurationType type) { if (type == null) return; try { - String initialMode = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - String name = manager.generateLaunchConfigurationName("launchConfiguration"); //$NON-NLS-1$ - workingCopy = type.newInstance(null, name); - tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, initialMode); - for (CTabItem item : tabFolder.getItems()) - item.dispose(); + this.type = type; LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); - tabGroup.createTabs(launchConfigurationDialog, initialMode); - - for (ILaunchConfigurationTab tab : tabGroup.getTabs()) { - tab.setLaunchConfigurationDialog(launchConfigurationDialog); - tab.createControl(tabFolder); - tab.setDefaults(workingCopy); + if (tabViewer != null) { + String name = launchConfigurationDialog.generateName("launchConfiguration"); //$NON-NLS-1$ + workingCopy = type.newInstance(null, name); + launchConfigurationDialog.doSetDefaults(workingCopy); + tabViewer.setInput(workingCopy); } - - // Do this after all the tabs have their controls created - for (ILaunchConfigurationTab tab : tabGroup.getTabs()) { - tab.initializeFrom(workingCopy); - - CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); - tabItem.setText(tab.getName()); - tabItem.setImage(!tab.isValid(workingCopy) && tab.getErrorMessage() != null ? - launchConfigurationMgr.getErrorTabImage(tab) : tab.getImage()); - tabItem.setControl(tab.getControl()); - } - - // Clean up any created configs before we set the name and trigger - // any validation - ((NewLaunchConfigWizard) getWizard()).cleanUpConfigs(); - - tabFolder.setSelection(0); - nameText.setText(workingCopy.getName()); } catch (CoreException e) { Activator.log(e); return; } } - boolean performFinish() { if (workingCopy == null) return false; - for (ILaunchConfigurationTab tab : tabGroup.getTabs()) - tab.performApply(workingCopy); + workingCopy.rename(tabViewer.getWorkingCopy().getName()); + tabViewer.getTabGroup().performApply(workingCopy); LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(null); return true; } @@ -183,38 +107,7 @@ public class NewLaunchConfigEditPage extends WizardPage { setPageComplete(false); if (workingCopy == null) return; - String message = null; - String old_msg = getErrorMessage(); - setErrorMessage(null); - message = checkName(workingCopy.getName()); - if (message == null) { - ILaunchConfigurationTab[] tabs = tabGroup.getTabs(); - int tLen = tabs.length; - int tfLen = tabFolder.getItems().length; - for (int i = 0; i < tLen; i++) { - ILaunchConfigurationTab tab = tabs[i]; - try { - tab.isValid(workingCopy); - message = tab.getErrorMessage(); - } catch (Exception e) { - // if createControl hasn't been called yet can throw exception.. - // like the NPE issue in CTestingTab - message = e.getMessage(); - } - // this is similar to what LaunchConfigurationTabGroupViewer.refresh() does, which is not available in this case - if (tLen == tfLen && - (old_msg == null && message != null || old_msg != null && message == null)) { - CTabItem item = tabFolder.getItem(i); - if (item != null) { - item.setImage(message != null ? launchConfigurationMgr.getErrorTabImage(tab) - : tab.getImage()); - } - } - if (message != null) { - break; - } - } - } + String message = tabViewer.getErrorMesssage(); setErrorMessage(message); if (getErrorMessage() != null) { setPageComplete(false); @@ -223,8 +116,8 @@ public class NewLaunchConfigEditPage extends WizardPage { } } - private class LaunchConfigurationDialogFake extends LaunchConfigurationDialog { - public LaunchConfigurationDialogFake() { + private class LaunchConfigurationDialogExt extends LaunchConfigurationDialog { + public LaunchConfigurationDialogExt() { super(NewLaunchConfigEditPage.this.getShell(), null, null); } @@ -250,24 +143,22 @@ public class NewLaunchConfigEditPage extends WizardPage { return NewLaunchConfigEditPage.this.getMode(); } - @Override - public void run(boolean fork, boolean cancelable, - IRunnableWithProgress runnable) - throws InvocationTargetException, InterruptedException { - // ignore - } - - @Override - public void updateButtons() { - } - @Override public void updateMessage() { validateFields(); } @Override - public void setName(String name) { + public void updateButtons() { + // Launch button + getTabViewer().refresh(); + // getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithModes() & !getTabViewer().hasDuplicateDelegates()); + } + + @Override + public void run(boolean fork, boolean cancelable, + IRunnableWithProgress runnable) + throws InvocationTargetException, InterruptedException { // ignore } @@ -279,36 +170,27 @@ public class NewLaunchConfigEditPage extends WizardPage { } @Override - public ILaunchConfigurationTab[] getTabs() { - return tabGroup.getTabs(); + public void doSetDefaults(ILaunchConfigurationWorkingCopy wc) { + super.doSetDefaults(wc); } @Override - public ILaunchConfigurationTab getActiveTab() { - int i = tabFolder.getSelectionIndex(); - return tabGroup.getTabs()[i]; - } - - - @Override - public void setActiveTab(ILaunchConfigurationTab tab) { - ILaunchConfigurationTab[] tabs = tabGroup.getTabs(); - int tLen = tabs.length; - for (int i = 0; i < tLen; i++) { - ILaunchConfigurationTab tabi = tabs[i]; - if (tabi.equals(tab)) { - setActiveTab(i); - break; - } - } - } - - @Override - public void setActiveTab(int index) { - tabFolder.setSelection(index); + public void setTabViewer(LaunchConfigurationTabGroupViewer viewer) { + super.setTabViewer(viewer); } } + private class LaunchConfigurationTabGroupViewerExt extends LaunchConfigurationTabGroupViewer { + public LaunchConfigurationTabGroupViewerExt(Composite parent, ILaunchConfigurationDialog dialog) { + super(parent, dialog); + } + + @Override + public ILaunchConfigurationWorkingCopy getWorkingCopy() { + return super.getWorkingCopy(); + } + }; + public String getMode() { return ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java index f00c6ab85e5..6ae6734e692 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -31,38 +31,38 @@ public class NewLaunchConfigModePage extends WizardPage { private Table table; ILaunchGroup selectedGroup; - + public NewLaunchConfigModePage() { super(Messages.NewLaunchConfigModePage_0); setTitle(Messages.NewLaunchConfigModePage_1); setDescription(Messages.NewLaunchConfigModePage_2); } - + @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout(1, false)); - + table = new Table(comp, SWT.SINGLE | SWT.BORDER); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); table.setLayoutData(data); - + Set done = new HashSet<>(); - + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { if (group.getMode().equals("run")) { //$NON-NLS-1$ createModeItem(group); done.add(group); } } - + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { if (group.getMode().equals("debug")) { //$NON-NLS-1$ createModeItem(group); done.add(group); } } - + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { if (!done.contains(group)) { createModeItem(group); @@ -87,7 +87,7 @@ public class NewLaunchConfigModePage extends WizardPage { } selectedGroup = (ILaunchGroup) table.getSelection()[0].getData(); } - + table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -102,7 +102,7 @@ public class NewLaunchConfigModePage extends WizardPage { private void createModeItem(ILaunchGroup group) { if (group.getCategory() != null || !group.isPublic()) return; - + TableItem item = new TableItem(table, SWT.NONE); item.setText(group.getLabel().replace("&", "")); //$NON-NLS-1$ //$NON-NLS-2$ ImageDescriptor imageDesc = group.getImageDescriptor(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java index abb8aab373b..2a610ed2f13 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -26,27 +26,26 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; public class NewLaunchConfigTypePage extends WizardPage { - private Table table; - + public NewLaunchConfigTypePage() { super(Messages.NewLaunchConfigTypePage_0); setTitle(Messages.NewLaunchConfigTypePage_1); setDescription(Messages.NewLaunchConfigTypePage_2); } - + @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout(1, false)); - + table = new Table(comp, SWT.SINGLE | SWT.BORDER); GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); data.heightHint = 500; table.setLayoutData(data); populateItems(); - + setControl(comp); } @@ -70,7 +69,7 @@ public class NewLaunchConfigTypePage extends WizardPage { item.setImage(imageDesc.createImage()); item.setData(type); } - + if (haveItems) { table.select(0); } @@ -84,10 +83,14 @@ public class NewLaunchConfigTypePage extends WizardPage { @Override public IWizardPage getNextPage() { - ILaunchConfigurationType type = (ILaunchConfigurationType)table.getSelection()[0].getData(); - NewLaunchConfigEditPage editPage = ((NewLaunchConfigWizard)getWizard()).editPage; + ILaunchConfigurationType type = (ILaunchConfigurationType) table.getSelection()[0].getData(); + NewLaunchConfigWizard wiz = (NewLaunchConfigWizard) getWizard(); + NewLaunchConfigEditPage editPage = wiz.editPage; + // lazy page creation + if (wiz.getPage(editPage.getName()) == null) { + wiz.addPage(editPage); + } editPage.changeLaunchConfigType(type); return editPage; } - } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java index 809ef04befe..ea52f0bdfc0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java @@ -28,28 +28,36 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio NewLaunchConfigModePage modePage = new NewLaunchConfigModePage(); NewLaunchConfigTypePage typePage = new NewLaunchConfigTypePage(); NewLaunchConfigEditPage editPage = new NewLaunchConfigEditPage(); - + private List configsToDelete = new ArrayList<>(); public NewLaunchConfigWizard() { setWindowTitle(Messages.NewLaunchConfigWizard_0); initListeners(); } - + @Override public void addPages() { addPage(modePage); addPage(typePage); - addPage(editPage); + //addPage(editPage); // add dynamically on the types page } - + + @Override + public boolean canFinish() { + if (getPage(editPage.getName()) == null) { + return false; + } + return super.canFinish(); + } + public ILaunchConfigurationWorkingCopy getWorkingCopy() { - return editPage.workingCopy; + return editPage.getWorkingCopy(); } public ILaunchMode getLaunchMode() { String initMode = modePage.selectedGroup.getMode(); - return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(initMode); + return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(initMode); } @Override From edd5f69a87c8ff6eac0da5519b34a34a2e3058f1 Mon Sep 17 00:00:00 2001 From: "Torkild U. Resheim" Date: Wed, 21 Oct 2015 14:32:08 +0200 Subject: [PATCH 058/198] 480248: [LaunchBar] Add preference to disable launch bar "target selector" Change-Id: I26d74addc779786403077978f9a44bc88a33b999 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=480248 Signed-off-by: Torkild U. Resheim --- .../launchbar/ui/internal/Activator.java | 4 ++- .../ui/internal/LaunchBarInjector.java | 11 +++++++- .../LaunchBarPreferenceInitializer.java | 2 ++ .../ui/internal/LaunchBarPreferencePage.java | 2 ++ .../launchbar/ui/internal/Messages.java | 4 ++- .../internal/controls/LaunchBarControl.java | 27 ++++++++++++------- .../launchbar/ui/internal/messages.properties | 1 + 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index c4c884e8e5a..f5164f7cd7a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2015 QNX Software Systems 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 @@ -7,6 +7,7 @@ * * Contributors: * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -53,6 +54,7 @@ public class Activator extends AbstractUIPlugin { // Preference ids public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$ + public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$ public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$ // The shared instance diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java index ad697e01050..ce87ead0b42 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2014 QNX Software Systems 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 @@ -7,6 +7,7 @@ * * Contributors: * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -71,6 +72,14 @@ public class LaunchBarInjector { boolean enabled = Boolean.parseBoolean(event.getNewValue().toString()); injectIntoAll(enabled); } + if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)) { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); + if (enabled){ + injectIntoAll(false); + injectIntoAll(true); + } + } } }); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java index 6aff0a56f42..3cde32d1a02 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java @@ -7,6 +7,7 @@ * * Contributors: * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -19,6 +20,7 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true); + store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true); store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java index 3016001605b..814222893aa 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java @@ -7,6 +7,7 @@ * * Contributors: * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -31,6 +32,7 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement @Override protected void createFieldEditors() { addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent())); + addField(new BooleanFieldEditor(Activator.PREF_ENABLE_TARGETSELECTOR, Messages.LaunchBarPreferencePage_EnableTargetSelector, getFieldEditorParent())); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index b6421bd3531..1621a8ce5f8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2015 QNX Software Systems 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 @@ -7,6 +7,7 @@ * * Contributors: * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -32,6 +33,7 @@ public class Messages extends NLS { public static String LaunchBarListViewer_0; public static String LaunchBarPreferencePage_0; public static String LaunchBarPreferencePage_1; + public static String LaunchBarPreferencePage_EnableTargetSelector; public static String LaunchConfigurationEditDialog_0; public static String LaunchConfigurationEditDialog_1; public static String LaunchConfigurationEditDialog_2; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 768601e22c0..b527c1329bc 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2015 QNX Software Systems 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 @@ -7,6 +7,7 @@ * * Contributors: * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; @@ -14,7 +15,7 @@ import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.eclipse.debug.core.ILaunchMode; - +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; @@ -75,13 +76,17 @@ public class LaunchBarControl implements Listener { configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); configSelector.setInput(manager); - Label label = new Label(container, SWT.NONE); - label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); - label.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ - - targetSelector = new TargetSelector(container, SWT.NONE); - targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); - targetSelector.setInput(manager); + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR); + if (enabled) { + Label label = new Label(container, SWT.NONE); + label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + label.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ + + targetSelector = new TargetSelector(container, SWT.NONE); + targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + targetSelector.setInput(manager); + } syncSelectors(); } @@ -147,7 +152,9 @@ public class LaunchBarControl implements Listener { @Override public void launchTargetsChanged() { - targetSelector.refresh(); + if (targetSelector!=null){ + targetSelector.refresh(); + } } public ConfigSelector getConfigSelector() { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 0484937e241..d1d335eb26f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -16,6 +16,7 @@ LaunchBarControl_Stop=Stop LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane LaunchBarPreferencePage_0=Preferences for the Launch Bar. LaunchBarPreferencePage_1=Enable the Launch Bar. +LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector. LaunchConfigurationEditDialog_0=Delete LaunchConfigurationEditDialog_1=Duplicate LaunchConfigurationEditDialog_2=Launch From 3c6d66259a13c7859cc116c291dc6e7460250568 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 3 Nov 2015 16:00:17 -0500 Subject: [PATCH 059/198] Bug 481352 - reintroduce ILaunchTarget as target selector. Replace IRemoteConnection with ILaunchTarget. Launch target providers that want to use IRemoteConnection can adapt to it. Also removes IHoverProvider since tools tips on the target selector use the status message for the target. Change-Id: I117745e61789ef780c742da9b73bded2b598915c --- bundles/org.eclipse.launchbar.core/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../META-INF/MANIFEST.MF | 10 +- .../build.properties | 3 +- bundles/org.eclipse.launchbar.core/plugin.xml | 8 + bundles/org.eclipse.launchbar.core/pom.xml | 2 +- .../schema/launchTargetTypes.exsd | 109 +++++++++ .../core/AbstractLaunchConfigProvider.java | 6 +- .../core/DefaultLaunchConfigProvider.java | 17 +- .../core/ILaunchConfigurationProvider.java | 10 +- .../core/PerTargetLaunchConfigProvider.java | 28 +-- .../ProjectPerTargetLaunchConfigProvider.java | 6 +- .../launchbar/core/internal/Activator.java | 9 +- .../core/internal/LaunchBarManager.java | 130 +++++------ .../internal/LaunchConfigProviderInfo.java | 21 +- .../launchbar/core/internal/Messages.java | 2 + .../core/internal/messages.properties | 3 +- .../core/internal/target/LaunchTarget.java | 64 ++++++ .../internal/target/LaunchTargetManager.java | 211 +++++++++++++++++ .../target/LocalLaunchTargetProvider.java | 31 +++ .../launchbar/core/target/ILaunchTarget.java | 35 +++ .../core/target/ILaunchTargetListener.java | 43 ++++ .../core/target/ILaunchTargetManager.java | 101 ++++++++ .../core/target/ILaunchTargetProvider.java | 29 +++ .../launchbar/core/target/TargetStatus.java | 32 +++ .../ILaunchConfigurationTargetedDelegate.java | 130 +++++++++++ .../core/target/launch/ITargetedLaunch.java | 25 ++ bundles/org.eclipse.launchbar.ui/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../META-INF/MANIFEST.MF | 9 +- .../org.eclipse.launchbar.ui/build.properties | 3 +- .../icons/localTarget.png | Bin 0 -> 452 bytes bundles/org.eclipse.launchbar.ui/plugin.xml | 1 + bundles/org.eclipse.launchbar.ui/pom.xml | 2 +- .../schema/launchTargetTypeUI.exsd | 112 +++++++++ .../eclipse/launchbar/ui/IHoverProvider.java | 36 --- .../launchbar/ui/internal/Activator.java | 8 +- .../launchbar/ui/internal/Messages.java | 7 +- .../ConfigureActiveLaunchHandler.java | 84 ++++--- .../ui/internal/controls/CSelector.java | 112 +++------ .../internal/controls/LaunchBarControl.java | 16 +- .../ui/internal/controls/ModeSelector.java | 27 ++- .../ui/internal/controls/TargetSelector.java | 216 +++++++++--------- .../launchbar/ui/internal/messages.properties | 1 + .../target/LaunchTargetUIManager.java | 85 +++++++ .../ui/target/ILaunchTargetUIManager.java | 27 +++ .../PerTargetLaunchConfigProviderTest.java | 45 ++-- .../core/internal/LaunchBarManager2Test.java | 69 +++--- .../core/internal/LaunchBarManagerTest.java | 51 +++-- 49 files changed, 1490 insertions(+), 502 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java create mode 100644 bundles/org.eclipse.launchbar.ui/icons/localTarget.png create mode 100644 bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java diff --git a/bundles/org.eclipse.launchbar.core/.classpath b/bundles/org.eclipse.launchbar.core/.classpath index 098194ca4b7..eca7bdba8f0 100644 --- a/bundles/org.eclipse.launchbar.core/.classpath +++ b/bundles/org.eclipse.launchbar.core/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs index f42de363afa..0c68a61dca8 100644 --- a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index ab864804f79..dad42f94192 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,15 +2,15 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 1.0.1.qualifier +Bundle-Version: 2.0.0.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, - org.eclipse.core.filesystem, - org.eclipse.remote.core;bundle-version="2.0.0", org.eclipse.core.expressions -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, - org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui" + org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui", + org.eclipse.launchbar.core.target, + org.eclipse.launchbar.core.target.launch diff --git a/bundles/org.eclipse.launchbar.core/build.properties b/bundles/org.eclipse.launchbar.core/build.properties index 786b1df9364..e34cf111400 100644 --- a/bundles/org.eclipse.launchbar.core/build.properties +++ b/bundles/org.eclipse.launchbar.core/build.properties @@ -3,4 +3,5 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ - about.html + about.html,\ + schema/ diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index dd5ec17e2a7..a85371f601e 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -2,6 +2,7 @@ + + + + + diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml index 4f1fe4e0d79..3cf8b86a839 100644 --- a/bundles/org.eclipse.launchbar.core/pom.xml +++ b/bundles/org.eclipse.launchbar.core/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.core - 1.0.1-SNAPSHOT + 2.0.0-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd b/bundles/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd new file mode 100644 index 00000000000..290bf844499 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index 3758fabbfb2..6203abb43bc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -17,7 +17,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.launchbar.core.internal.Activator; -import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.launchbar.core.target.ILaunchTarget; /** * Common launch config provider. Manages creating launch configurations and @@ -28,7 +28,7 @@ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurati private static final String ATTR_ORIGINAL_NAME = Activator.PLUGIN_ID + ".originalName"; //$NON-NLS-1$ private static final String ATTR_PROVIDER_CLASS = Activator.PLUGIN_ID + ".providerClass"; //$NON-NLS-1$ - protected ILaunchConfiguration createLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + protected ILaunchConfiguration createLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); String name = launchManager.generateLaunchConfigurationName(descriptor.getName()); @@ -40,7 +40,7 @@ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurati return workingCopy.doSave(); } - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { // Leave our breadcrumb workingCopy.setAttribute(ATTR_ORIGINAL_NAME, workingCopy.getName()); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index a1dca878dec..ab26e5e83c7 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -13,7 +13,8 @@ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; /** * The launch config provider for the default descriptor which is the launch @@ -25,23 +26,19 @@ import org.eclipse.remote.core.IRemoteConnection; public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider { @Override - public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { // Only supports Local connection - if (target != null && target.getConnectionType().getId().equals("org.eclipse.remote.LocalServices")) { //$NON-NLS-1$ - return true; - } else { - return false; - } + return target != null && target.getTypeId().equals(ILaunchTargetManager.localLaunchTargetTypeId); } @Override - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { return descriptor.getAdapter(ILaunchConfiguration.class).getType(); } @Override - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { return descriptor.getAdapter(ILaunchConfiguration.class); } @@ -68,7 +65,7 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider } @Override - public void launchTargetRemoved(IRemoteConnection target) throws CoreException { + public void launchTargetRemoved(ILaunchTarget target) throws CoreException { // nothing to do } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index b416f87ea40..ef7c9f473f2 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -13,7 +13,7 @@ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.launchbar.core.target.ILaunchTarget; /** * The provider of launch configurations of a given type for a given descriptor @@ -34,7 +34,7 @@ public interface ILaunchConfigurationProvider { * @param target * @return true if target is supported, false otherwise. */ - boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException; + boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException; /** * Return the launch configuation type for the descriptor and target. @@ -45,7 +45,7 @@ public interface ILaunchConfigurationProvider { * @return * @throws CoreException */ - ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException; /** @@ -58,7 +58,7 @@ public interface ILaunchConfigurationProvider { * @return launch configuration * @throws CoreException */ - ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException; /** @@ -108,6 +108,6 @@ public interface ILaunchConfigurationProvider { * @param target * @throws CoreException */ - void launchTargetRemoved(IRemoteConnection target) throws CoreException; + void launchTargetRemoved(ILaunchTarget target) throws CoreException; } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index f00e7c2264b..314a17591ee 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -20,10 +20,10 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.launchbar.core.internal.Activator; -import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.launchbar.core.target.ILaunchTarget; public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfigProvider { - private final Map> configMap = new HashMap<>(); + private final Map> configMap = new HashMap<>(); private final Map defaultConfigs = new HashMap<>(); private final Collection ownedConfigs = new LinkedHashSet<>(); @@ -32,10 +32,10 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig } @Override - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { if (target != null) { - Map targetMap = configMap.get(descriptor); + Map targetMap = configMap.get(descriptor); if (targetMap != null) { ILaunchConfiguration config = targetMap.get(target); if (config != null) { @@ -56,7 +56,7 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig protected abstract ILaunchDescriptor getLaunchDescriptor(ILaunchConfiguration configuration) throws CoreException; - protected abstract IRemoteConnection getLaunchTarget(ILaunchConfiguration configuration) throws CoreException; + protected abstract ILaunchTarget getLaunchTarget(ILaunchConfiguration configuration) throws CoreException; protected boolean providesForNullTarget() { return false; @@ -68,7 +68,7 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig return false; } - IRemoteConnection target = getLaunchTarget(configuration); + ILaunchTarget target = getLaunchTarget(configuration); if (target == null) { if (providesForNullTarget()) { defaultConfigs.put(desc, configuration); @@ -76,7 +76,7 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig return false; } } else { - Map targetMap = configMap.get(desc); + Map targetMap = configMap.get(desc); if (targetMap == null) { targetMap = new HashMap<>(); configMap.put(desc, targetMap); @@ -117,8 +117,8 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig @Override public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { ownedConfigs.remove(configuration); - for (Entry> descEntry : configMap.entrySet()) { - for (Entry targetEntry : descEntry.getValue().entrySet()) { + for (Entry> descEntry : configMap.entrySet()) { + for (Entry targetEntry : descEntry.getValue().entrySet()) { if (targetEntry.getValue().equals(configuration)) { descEntry.getValue().remove(targetEntry.getKey()); if (descEntry.getValue().isEmpty()) { @@ -133,7 +133,7 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig @Override public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { - Map map = configMap.remove(descriptor); + Map map = configMap.remove(descriptor); if (map != null) { for (ILaunchConfiguration config : map.values()) { ownedConfigs.remove(config); @@ -150,11 +150,11 @@ public abstract class PerTargetLaunchConfigProvider extends AbstractLaunchConfig } @Override - public void launchTargetRemoved(IRemoteConnection target) throws CoreException { - for (Iterator>> iterator = configMap + public void launchTargetRemoved(ILaunchTarget target) throws CoreException { + for (Iterator>> iterator = configMap .entrySet().iterator(); iterator.hasNext();) { - Entry> descEntry = iterator.next(); - Map map = descEntry.getValue(); + Entry> descEntry = iterator.next(); + Map map = descEntry.getValue(); ILaunchConfiguration config = map.remove(target); if (config != null) { // remove all auto-configs associated with target diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java index 7eb5116a960..d85961f426a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java @@ -16,17 +16,17 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.launchbar.core.internal.Activator; -import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.launchbar.core.target.ILaunchTarget; public abstract class ProjectPerTargetLaunchConfigProvider extends PerTargetLaunchConfigProvider { @Override - public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { return (descriptor.getAdapter(IProject.class) != null); } @Override - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { super.populateLaunchConfiguration(descriptor, target, workingCopy); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index e8f1b67aa21..80b6cccacc9 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -16,6 +16,8 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.internal.target.LaunchTargetManager; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -27,6 +29,7 @@ public class Activator extends Plugin { public void start(BundleContext bundleContext) throws Exception { super.start(bundleContext); plugin = this; + bundleContext.registerService(ILaunchTargetManager.class, new LaunchTargetManager(), null); bundleContext.registerService(ILaunchBarManager.class, new LaunchBarManager(), null); } @@ -42,7 +45,8 @@ public class Activator extends Plugin { /** * Return the OSGi service with the given service interface. * - * @param service service interface + * @param service + * service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { @@ -70,8 +74,7 @@ public class Activator extends Plugin { } } - private static final String DEBUG_ONE = - PLUGIN_ID + "/debug/launchbar"; //$NON-NLS-1$ + private static final String DEBUG_ONE = PLUGIN_ID + "/debug/launchbar"; //$NON-NLS-1$ public static void trace(String str) { if (plugin == null || (plugin.isDebugging() && "true".equalsIgnoreCase(Platform.getDebugOption(DEBUG_ONE)))) //$NON-NLS-1$ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index a982bfe30ef..4fef96cea76 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -11,6 +11,7 @@ package org.eclipse.launchbar.core.internal; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -40,31 +41,32 @@ import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ILaunchObjectProvider; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionChangeListener; -import org.eclipse.remote.core.IRemoteConnectionType; -import org.eclipse.remote.core.IRemoteServicesManager; -import org.eclipse.remote.core.RemoteConnectionChangeEvent; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetListener; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; /** * The brains of the launch bar. */ -public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionChangeListener { +public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListener { - // TODO make these more fine grained or break them into more focused - // listeners public interface Listener { - void activeLaunchDescriptorChanged(); + default void activeLaunchDescriptorChanged() { + } - void activeLaunchModeChanged(); + default void activeLaunchModeChanged() { + } - void activeLaunchTargetChanged(); + default void activeLaunchTargetChanged() { + } - void launchDescriptorRemoved(ILaunchDescriptor descriptor); + default void launchDescriptorRemoved(ILaunchDescriptor descriptor) { + } - void launchTargetsChanged(); + default void launchTargetsChanged() { + } } private final List listeners = new LinkedList<>(); @@ -88,11 +90,11 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha // Map of launch objects to launch descriptors private final Map objectDescriptorMap = new HashMap<>(); - private final IRemoteServicesManager remoteServicesManager = getRemoteServicesManager(); + private ILaunchTargetManager launchTargetManager; private ILaunchDescriptor activeLaunchDesc; private ILaunchMode activeLaunchMode; - private IRemoteConnection activeLaunchTarget; + private ILaunchTarget activeLaunchTarget; // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; //$NON-NLS-1$ @@ -107,8 +109,8 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha // called from unit tests to ensure everything is inited LaunchBarManager(boolean doInit) { - remoteServicesManager.addRemoteConnectionChangeListener(this); - + launchTargetManager = getLaunchTargetManager(); + launchTargetManager.addListener(this); if (doInit) { new Job(Messages.LaunchBarManager_0) { @Override @@ -124,11 +126,6 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha } } - // To allow override by tests - IRemoteServicesManager getRemoteServicesManager() { - return Activator.getService(IRemoteServicesManager.class); - } - // To allow override by tests IExtensionPoint getExtensionPoint() throws CoreException { return Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarContributions"); //$NON-NLS-1$ @@ -139,6 +136,10 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha return DebugPlugin.getDefault().getLaunchManager(); } + ILaunchTargetManager getLaunchTargetManager() { + return Activator.getService(ILaunchTargetManager.class); + } + // When testing, call this after setting up the mocks. void init() throws CoreException { try { @@ -293,8 +294,8 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha return new Pair(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); } - private Pair getTargetId(IRemoteConnection target) { - return new Pair(target.getConnectionType().getId(), target.getName()); + private Pair getTargetId(ILaunchTarget target) { + return new Pair(target.getTypeId(), target.getName()); } private void addDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { @@ -303,7 +304,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha setActiveLaunchDescriptor(descriptor); } - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, IRemoteConnection target) + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { if (descriptor == null) return null; @@ -478,13 +479,10 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha String activeTargetId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_TARGET, null); if (activeTargetId != null) { Pair id = toId(activeTargetId); - IRemoteConnectionType remoteServices = remoteServicesManager.getConnectionType(id.getFirst()); - if (remoteServices != null) { - IRemoteConnection storedTarget = remoteServices.getConnection(id.getSecond()); - if (storedTarget != null && supportsTarget(activeLaunchDesc, storedTarget)) { - setActiveLaunchTarget(storedTarget); - return; - } + ILaunchTarget storedTarget = launchTargetManager.getLaunchTarget(id.getFirst(), id.getSecond()); + if (storedTarget != null && supportsTarget(activeLaunchDesc, storedTarget)) { + setActiveLaunchTarget(storedTarget); + return; } } // default target for descriptor @@ -641,12 +639,12 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha } } - public List getLaunchTargets(ILaunchDescriptor descriptor) throws CoreException { + public List getLaunchTargets(ILaunchDescriptor descriptor) { if (descriptor == null) - return remoteServicesManager.getAllRemoteConnections(); + return Arrays.asList(launchTargetManager.getLaunchTargets()); - List targets = new ArrayList<>(); - for (IRemoteConnection target : remoteServicesManager.getAllRemoteConnections()) { + List targets = new ArrayList<>(); + for (ILaunchTarget target : launchTargetManager.getLaunchTargets()) { if (supportsTarget(descriptor, target)) { targets.add(target); } @@ -655,7 +653,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha return targets; } - boolean supportsTarget(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + boolean supportsTarget(ILaunchDescriptor descriptor, ILaunchTarget target) { String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo providerInfo : configProviders.get(descriptorTypeId)) { try { @@ -671,7 +669,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha return false; } - public IRemoteConnection getActiveLaunchTarget() { + public ILaunchTarget getActiveLaunchTarget() { return activeLaunchTarget; } @@ -682,7 +680,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha * @param target * @throws CoreException */ - public void setLaunchTarget(ILaunchDescriptor desc, IRemoteConnection target) throws CoreException { + public void setLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target) throws CoreException { if (desc == activeLaunchDesc) { setActiveLaunchTarget(target); } else { @@ -690,7 +688,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha } } - public void setActiveLaunchTarget(IRemoteConnection target) throws CoreException { + public void setActiveLaunchTarget(ILaunchTarget target) throws CoreException { if (activeLaunchTarget == target) { return; } @@ -700,7 +698,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha fireActiveLaunchTargetChanged(); // notify listeners } - private void storeLaunchTarget(ILaunchDescriptor desc, IRemoteConnection target) { + private void storeLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target) { if (target == null) { // no point storing null, if stored id is invalid it won't be used // anyway @@ -722,8 +720,8 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha } } - private IRemoteConnection getDefaultLaunchTarget(ILaunchDescriptor descriptor) throws CoreException { - List targets = getLaunchTargets(descriptor); + private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { + List targets = getLaunchTargets(descriptor); return targets.isEmpty() ? null : targets.get(0); } @@ -731,7 +729,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); } - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { if (descriptor == null) { return null; @@ -847,32 +845,6 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha } } - @Override - public void connectionChanged(RemoteConnectionChangeEvent event) { - switch (event.getType()) { - case RemoteConnectionChangeEvent.CONNECTION_ADDED: - try { - launchTargetAdded(event.getConnection()); - } catch (CoreException e) { - Activator.log(e); - } - break; - case RemoteConnectionChangeEvent.CONNECTION_REMOVED: - try { - launchTargetRemoved(event.getConnection()); - } catch (CoreException e) { - Activator.log(e); - } - break; - case RemoteConnectionChangeEvent.CONNECTION_RENAMED: - fireLaunchTargetsChanged(); - break; - default: - fireLaunchTargetsChanged(); - break; - } - } - private void fireLaunchTargetsChanged() { if (!initialized) return; @@ -885,22 +857,32 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha } } - private void launchTargetAdded(IRemoteConnection target) throws CoreException { + @Override + public void launchTargetAdded(ILaunchTarget target) { if (!initialized) return; fireLaunchTargetsChanged(); // if we added new target we probably want to use it if (activeLaunchDesc == null || supportsTarget(activeLaunchDesc, target)) { - setActiveLaunchTarget(target); + try { + setActiveLaunchTarget(target); + } catch (CoreException e) { + Activator.log(e); + } } } - private void launchTargetRemoved(IRemoteConnection target) throws CoreException { + @Override + public void launchTargetRemoved(ILaunchTarget target) { if (!initialized) return; fireLaunchTargetsChanged(); if (activeLaunchTarget == target) { - setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); + try { + setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); + } catch (CoreException e) { + Activator.log(e); + } } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 46721079320..625b15eff8f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -70,19 +70,28 @@ public class LaunchConfigProviderInfo { return priority; } - public ILaunchConfigurationProvider getProvider() throws CoreException { + public ILaunchConfigurationProvider getProvider() { if (provider == null) { - provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ - element = null; + try { + provider = (ILaunchConfigurationProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ + element = null; + } catch (CoreException e) { + Activator.log(e); + } } return provider; } - public boolean enabled(Object element) throws CoreException { + public boolean enabled(Object element) { if (expression == null) return true; - EvaluationResult result = expression.evaluate(new EvaluationContext(null, element)); - return (result == EvaluationResult.TRUE); + try { + EvaluationResult result = expression.evaluate(new EvaluationContext(null, element)); + return (result == EvaluationResult.TRUE); + } catch (CoreException e) { + Activator.log(e); + return false; + } } } \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java index a4d1e8a221b..aac564aa411 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java @@ -18,6 +18,8 @@ public class Messages extends NLS { public static String LaunchBarManager_1; public static String LaunchBarManager_2; public static String LocalTarget_name; + public static String OK; + static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties index f99096c67c2..9d627bf8d9c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties @@ -12,4 +12,5 @@ LaunchBarManager_2=Mode is not supported by descriptor ################################################################################ LaunchBarManager_0=Launch Bar Initialization -LocalTarget_name=Local Machine +LocalTarget_name=Local +OK=OK diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java new file mode 100644 index 00000000000..49c6e4ef0b3 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.internal.target; + +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +public class LaunchTarget extends PlatformObject implements ILaunchTarget { + + private final String typeId; + private final String name; + + public LaunchTarget(String typeId, String name) { + this.typeId = typeId; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getTypeId() { + return typeId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((typeId == null) ? 0 : typeId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + LaunchTarget other = (LaunchTarget) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (typeId == null) { + if (other.typeId != null) + return false; + } else if (!typeId.equals(other.typeId)) + return false; + return true; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java new file mode 100644 index 00000000000..d08ce033232 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -0,0 +1,211 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.internal.target; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetListener; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.ILaunchTargetProvider; +import org.eclipse.launchbar.core.target.TargetStatus; +import org.osgi.service.prefs.BackingStoreException; +import org.osgi.service.prefs.Preferences; + +public class LaunchTargetManager implements ILaunchTargetManager { + + private Map> targets; + private Map typeElements; + private Map typeProviders = new HashMap<>(); + private List listeners = new LinkedList<>(); + + private static final String DELIMETER = ","; //$NON-NLS-1$ + + private Preferences getTargetsPref() { + return InstanceScope.INSTANCE.getNode(Activator.getDefault().getBundle().getSymbolicName()) + .node(getClass().getSimpleName()); + } + + private synchronized void initTargets() { + if (targets == null) { + // load target type elements from registry + typeElements = new HashMap<>(); + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint point = registry + .getExtensionPoint(Activator.getDefault().getBundle().getSymbolicName() + ".launchTargetTypes"); //$NON-NLS-1$ + for (IExtension extension : point.getExtensions()) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String id = element.getAttribute("id"); //$NON-NLS-1$ + if (id != null) { + typeElements.put(id, element); + } + } + } + + // load targets from preference store + targets = new HashMap<>(); + Preferences prefs = getTargetsPref(); + try { + for (String typeId : prefs.keys()) { + Map type = targets.get(typeId); + if (type == null) { + type = new HashMap<>(); + targets.put(typeId, type); + } + + for (String name : prefs.get(typeId, "").split(DELIMETER)) { //$NON-NLS-1$ + type.put(name, new LaunchTarget(typeId, name)); + } + } + } catch (BackingStoreException e) { + Activator.log(e); + } + + // Call the provider's init + // TODO check enablement so we don't call them if we don't need to + for (String typeId : typeElements.keySet()) { + ILaunchTargetProvider provider = getProvider(typeId); + if (provider != null) { + provider.init(this); + } + } + } + } + + private ILaunchTargetProvider getProvider(String typeId) { + ILaunchTargetProvider provider = typeProviders.get(typeId); + if (provider == null) { + IConfigurationElement element = typeElements.get(typeId); + if (element != null) { + try { + provider = (ILaunchTargetProvider) element.createExecutableExtension("provider"); //$NON-NLS-1$ + } catch (CoreException e) { + Activator.log(e); + } + } + + if (provider == null) { + provider = new ILaunchTargetProvider() { + @Override + public void init(ILaunchTargetManager targetManager) { + } + + @Override + public TargetStatus getStatus(ILaunchTarget target) { + return TargetStatus.OK_STATUS; + } + }; + } + } + return provider; + } + + @Override + public ILaunchTarget[] getLaunchTargets() { + initTargets(); + List targetList = new ArrayList<>(); + for (Map type : targets.values()) { + targetList.addAll(type.values()); + } + return targetList.toArray(new ILaunchTarget[targetList.size()]); + } + + @Override + public ILaunchTarget[] getLaunchTargetsOfType(String typeId) { + initTargets(); + Map type = targets.get(typeId); + if (type != null) { + return type.values().toArray(new ILaunchTarget[type.size()]); + } + return new ILaunchTarget[0]; + } + + @Override + public ILaunchTarget getLaunchTarget(String typeId, String name) { + initTargets(); + Map type = targets.get(typeId); + if (type != null) { + return type.get(name); + } + return null; + } + + @Override + public TargetStatus getStatus(ILaunchTarget target) { + return getProvider(target.getTypeId()).getStatus(target); + } + + @Override + public ILaunchTarget addLaunchTarget(String typeId, String name) { + initTargets(); + Map type = targets.get(typeId); + if (type == null) { + type = new HashMap<>(); + targets.put(typeId, type); + } + + ILaunchTarget target = new LaunchTarget(typeId, name); + type.put(name, target); + getTargetsPref().put(typeId, String.join(DELIMETER, type.keySet())); + + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetAdded(target); + } + + return target; + } + + @Override + public void removeLaunchTarget(ILaunchTarget target) { + initTargets(); + Map type = targets.get(target.getTypeId()); + if (type != null) { + type.remove(target.getName()); + if (type.isEmpty()) { + targets.remove(target.getTypeId()); + getTargetsPref().remove(target.getTypeId()); + } else { + getTargetsPref().put(target.getTypeId(), String.join(DELIMETER, type.keySet())); + } + + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetRemoved(target); + } + } + } + + @Override + public void targetStatusChanged(ILaunchTarget target) { + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetStatusChanged(target); + } + } + + @Override + public void addListener(ILaunchTargetListener listener) { + listeners.add(listener); + } + + @Override + public void removeListener(ILaunchTargetListener listener) { + listeners.remove(listener); + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java new file mode 100644 index 00000000000..eb7c130e6fe --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.internal.target; + +import org.eclipse.launchbar.core.internal.Messages; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.ILaunchTargetProvider; +import org.eclipse.launchbar.core.target.TargetStatus; + +public class LocalLaunchTargetProvider implements ILaunchTargetProvider { + + @Override + public void init(ILaunchTargetManager targetManager) { + if (targetManager.getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, + Messages.LocalTarget_name) == null) { + targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name); + } + } + + @Override + public TargetStatus getStatus(ILaunchTarget target) { + return TargetStatus.OK_STATUS; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java new file mode 100644 index 00000000000..147a9072187 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target; + +import org.eclipse.core.runtime.IAdaptable; + +/** + * A launch target is a thing that a launch will run on. Launch targets are + * simple objects with the intention that the launch delegates and launches will + * adapt this object to an object that will assist in performing the launch. + * + * @noimplement not to be implemented by clients + */ +public interface ILaunchTarget extends IAdaptable { + + /** + * The name of the target. + * + * @return name of the target + */ + String getName(); + + /** + * The type of the target. + * + * @return type of the target + */ + String getTypeId(); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java new file mode 100644 index 00000000000..c692370a5fe --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target; + +/** + * A listener to changes in the list and status of launch targets. + */ +public interface ILaunchTargetListener { + + /** + * A launch target was added. + * + * @param target + * the new launch target + */ + default void launchTargetAdded(ILaunchTarget target) { + } + + /** + * A launch target was removed. + * + * @param target + * the target about to be removed. + */ + default void launchTargetRemoved(ILaunchTarget target) { + } + + /** + * The status of a target has changed. Query the target to find out what the + * new status is. + * + * @param target + * the target whose status has changed + */ + default void launchTargetStatusChanged(ILaunchTarget target) { + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java new file mode 100644 index 00000000000..86dbe5e4ff4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target; + +/** + * The manager for the launch targets. It is registered as an OSGi service. + * + * @noimplement not to be implemented by clients + */ +public interface ILaunchTargetManager { + + /** + * The type id for the local launch target type. It is the default launch + * target type. It represents launching on the underlying machine on which + * we are running. There is only one launch target of this type which + * represents that machine. + */ + final String localLaunchTargetTypeId = "org.eclipse.launchbar.core.launchTargetType.local"; //$NON-NLS-1$ + + /** + * The list of all launch targets. + * + * @return list of launch targets + */ + ILaunchTarget[] getLaunchTargets(); + + /** + * The list of launch targets with a given type id. + * + * @param typeId + * the launch target type id + * @return list of launch targets + */ + ILaunchTarget[] getLaunchTargetsOfType(String typeId); + + /** + * Return the launch target with the given typeId and name + * + * @param typeId + * type of the launch target + * @param name + * name of the launch target + * @return the launch target + */ + ILaunchTarget getLaunchTarget(String typeId, String name); + + /** + * Return the status of the launch target. + * + * @param target + * the launch target + * @return status + */ + TargetStatus getStatus(ILaunchTarget target); + + /** + * Add a launch target with the given typeId and name. + * + * @param typeId + * type id of the launch target + * @param name + * name of the launch target + * @return the created launch target + */ + ILaunchTarget addLaunchTarget(String typeId, String name); + + /** + * Removes a launch target. + * + * @param target + * the launch target to remove + */ + void removeLaunchTarget(ILaunchTarget target); + + /** + * The status of the launch target has changed. + * + * @param target + */ + void targetStatusChanged(ILaunchTarget target); + + /** + * Add a listener. + * + * @param listener + */ + void addListener(ILaunchTargetListener listener); + + /** + * Remove a listener. + * + * @param listener + */ + void removeListener(ILaunchTargetListener listener); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java new file mode 100644 index 00000000000..62e571766a1 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java @@ -0,0 +1,29 @@ +package org.eclipse.launchbar.core.target; + +/** + * A launch target provider is responsible for managing the list and status of + * launch targets. Providers are associated with launch target types in the + * launchTargetTypes extension point. + */ +public interface ILaunchTargetProvider { + + /** + * Called by the launch target manager when it first sees a target of the + * type. Or on startup if the provider is enabled. It is expected the + * provider will sync the list of targets with it's internal list and alert + * the manager of any non-OK statuses. + * + * @param targetManager + */ + void init(ILaunchTargetManager targetManager); + + /** + * Fetch the status for the launch target. + * + * @param target + * the launch target + * @return status of the launch target + */ + TargetStatus getStatus(ILaunchTarget target); + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java new file mode 100644 index 00000000000..bc05387110f --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java @@ -0,0 +1,32 @@ +package org.eclipse.launchbar.core.target; + +import org.eclipse.launchbar.core.internal.Messages; + +/** + * The status for a launch target. + */ +public class TargetStatus { + + public enum Code { + OK, WARNING, ERROR + } + + private final TargetStatus.Code code; + private final String message; + + public static final TargetStatus OK_STATUS = new TargetStatus(Code.OK, Messages.OK); + + public TargetStatus(TargetStatus.Code code, String message) { + this.code = code; + this.message = message; + } + + public TargetStatus.Code getCode() { + return code; + } + + public String getMessage() { + return message; + } + +} \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java new file mode 100644 index 00000000000..7707d8a349c --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java @@ -0,0 +1,130 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target.launch; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * An ILaunchConfigurationDelegate2 converted to take ILaunchTarget as an + * additional parameter. + */ +public interface ILaunchConfigurationTargetedDelegate extends ILaunchConfigurationDelegate { + + /** + * Returns a launch object to use when launching the given launch + * configuration in the given mode, or null if a new default + * launch object should be created by the debug platform. If a launch object + * is returned, its launch mode must match that of the mode specified in + * this method call. + * + * @param configuration + * the configuration being launched + * @param mode + * the mode the configuration is being launched in + * @return a launch object or null + * @throws CoreException + * if unable to launch + */ + public ITargetedLaunch getLaunch(ILaunchConfiguration configuration, String mode, ILaunchTarget target) + throws CoreException; + + /** + * Optionally performs any required building before launching the given + * configuration in the specified mode, and returns whether the debug + * platform should perform an incremental workspace build before the launch + * continues. If false is returned the launch will proceed + * without further building, and if true is returned an + * incremental build will be performed on the workspace before launching. + *

+ * This method is only called if the launch is invoked with flag indicating + * building should take place before the launch. This is done via the method + * ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build) + * . + *

+ * + * @param configuration + * the configuration being launched + * @param mode + * the mode the configuration is being launched in + * @param monitor + * progress monitor, or null. A cancelable progress + * monitor is provided by the Job framework. It should be noted + * that the setCanceled(boolean) method should never be called on + * the provided monitor or the monitor passed to any delegates + * from this method; due to a limitation in the progress monitor + * framework using the setCanceled method can cause entire + * workspace batch jobs to be canceled, as the canceled flag is + * propagated up the top-level parent monitor. The provided + * monitor is not guaranteed to have been started. + * @return whether the debug platform should perform an incremental + * workspace build before the launch + * @throws CoreException + * if an exception occurs while building + */ + public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, ILaunchTarget target, + IProgressMonitor monitor) throws CoreException; + + /** + * Returns whether a launch should proceed. This method is called after + * preLaunchCheck() and buildForLaunch() providing + * a final chance for this launch delegate to abort a launch if required. + * For example, a delegate could cancel a launch if it discovered + * compilation errors that would prevent the launch from succeeding. + * + * @param configuration + * the configuration being launched + * @param mode + * launch mode + * @param monitor + * progress monitor, or null. A cancelable progress + * monitor is provided by the Job framework. It should be noted + * that the setCanceled(boolean) method should never be called on + * the provided monitor or the monitor passed to any delegates + * from this method; due to a limitation in the progress monitor + * framework using the setCanceled method can cause entire + * workspace batch jobs to be canceled, as the canceled flag is + * propagated up the top-level parent monitor. The provided + * monitor is not guaranteed to have been started. + * @return whether the launch should proceed + * @throws CoreException + * if an exception occurs during final checks + */ + public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, ILaunchTarget target, + IProgressMonitor monitor) throws CoreException; + + /** + * Returns whether a launch should proceed. This method is called first in + * the launch sequence providing an opportunity for this launch delegate to + * abort the launch. + * + * @param configuration + * configuration being launched + * @param mode + * launch mode + * @param monitor + * progress monitor, or null. A cancelable progress + * monitor is provided by the Job framework. It should be noted + * that the setCanceled(boolean) method should never be called on + * the provided monitor or the monitor passed to any delegates + * from this method; due to a limitation in the progress monitor + * framework using the setCanceled method can cause entire + * workspace batch jobs to be canceled, as the canceled flag is + * propagated up the top-level parent monitor. The provided + * monitor is not guaranteed to have been started. + * @return whether the launch should proceed + * @throws CoreException + * if an exception occurs while performing pre-launch checks + */ + public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, ILaunchTarget target, + IProgressMonitor monitor) throws CoreException; + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java new file mode 100644 index 00000000000..cd8c7f92ef6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target.launch; + +import org.eclipse.debug.core.ILaunch; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * A launch that knows what target it's running on. + */ +public interface ITargetedLaunch extends ILaunch { + + /** + * The target this launch will or is running on. + * + * @return launch target + */ + ILaunchTarget getLaunchTarget(); + +} diff --git a/bundles/org.eclipse.launchbar.ui/.classpath b/bundles/org.eclipse.launchbar.ui/.classpath index 098194ca4b7..eca7bdba8f0 100644 --- a/bundles/org.eclipse.launchbar.ui/.classpath +++ b/bundles/org.eclipse.launchbar.ui/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs index f42de363afa..0c68a61dca8 100644 --- a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 07287ff698f..0b327d70d39 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 1.0.1.qualifier +Bundle-Version: 2.0.0.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.ui, @@ -14,14 +14,9 @@ Require-Bundle: org.eclipse.ui, org.eclipse.osgi.services, org.eclipse.launchbar.core, org.eclipse.debug.ui, - org.eclipse.ui.workbench, org.eclipse.ui.ide, - org.eclipse.swt, - org.eclipse.ui.navigator, - org.eclipse.remote.core;bundle-version="2.0.0", - org.eclipse.remote.ui;bundle-version="1.1.0", org.eclipse.e4.core.contexts -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Export-Package: org.eclipse.launchbar.ui, diff --git a/bundles/org.eclipse.launchbar.ui/build.properties b/bundles/org.eclipse.launchbar.ui/build.properties index 088f01d1b5a..e106532f226 100644 --- a/bundles/org.eclipse.launchbar.ui/build.properties +++ b/bundles/org.eclipse.launchbar.ui/build.properties @@ -5,4 +5,5 @@ bin.includes = META-INF/,\ plugin.xml,\ icons/,\ plugin.properties,\ - about.html + about.html,\ + schema/ diff --git a/bundles/org.eclipse.launchbar.ui/icons/localTarget.png b/bundles/org.eclipse.launchbar.ui/icons/localTarget.png new file mode 100644 index 0000000000000000000000000000000000000000..ca77aee5bca40896edd73af579b012f818a107e5 GIT binary patch literal 452 zcmV;#0XzPQP)h)oM-&50 z^7i}>NooFn{_SsqI3m66KS(`_0Y=%|{)eWvfE5q|AOk?^Q4BCh-|#;=s~v1WS;zMO zSv70^#}zL8ACx-%zgtufiUDyso&Q1VQ4G*eS@l05zndr*Bo+4l2dPIfKsRB@|Fq&h zumSDU5B#s|+ws4wZNvY(x|RP^%NG8R$(!{*qhdbTfQ-@!|3T_e4A739_dmO0BG`a; zAHMy6`~K_y*YCdkfA#kB|Cg^n{eSW5!~d6WK7tL%t(yEFq#o6Pm^uFoYo`+Bh2r|@ z|3T`}TrlTvY2%Flm94Y?SG3H+i;Eg&{MU(_^8+;+j#Lf9^6h9k^XMHwA!bV^W zku!{+{lPGCo;^l#)=ro&p^-3OK|OYnqHEEb|5_1~;n=Ns?SGIQ2&+ZT6v5CO+OUev uwRr7st;i|=31PS5b-#TZHghoy3IG5hv&P^DAQPDY0000A!i literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/bundles/org.eclipse.launchbar.ui/plugin.xml index 8a63efff54a..2f0617fd581 100644 --- a/bundles/org.eclipse.launchbar.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.ui/plugin.xml @@ -2,6 +2,7 @@ + diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml index 62c18d01f02..56c66dd7a01 100644 --- a/bundles/org.eclipse.launchbar.ui/pom.xml +++ b/bundles/org.eclipse.launchbar.ui/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.ui - 1.0.1-SNAPSHOT + 2.0.0-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd new file mode 100644 index 00000000000..23a46f9f733 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd @@ -0,0 +1,112 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java deleted file mode 100644 index d7cf839da00..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/IHoverProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui; - -/** - * An extension to allow different object types to provide fancy hovers. - * - * TODO this does lead to inconsistency when different types provide different hover UI - * which can confuse users. We should provide good UI out of the box. - */ -public interface IHoverProvider { - - /** - * Display the hover item. - * - * @return true if hover item was displayed, otherwise false - */ - public abstract boolean displayHover(Object element); - - /** - * Dismiss the hover item. - * - * @param immediate - * if true, the hover item will be immediately dismissed, otherwise it may be be dismissed at a later time. - */ - public abstract void dismissHover(Object element, boolean immediate); - -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index f5164f7cd7a..267458300cc 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -24,6 +24,8 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.internal.target.LaunchTargetUIManager; +import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Event; import org.eclipse.ui.PlatformUI; @@ -45,6 +47,7 @@ public class Activator extends AbstractUIPlugin { public static final String IMG_BUTTON_BUILD = "build"; //$NON-NLS-1$ public static final String IMG_BUTTON_LAUNCH = "launch"; //$NON-NLS-1$ public static final String IMG_BUTTON_STOP = "stop"; //$NON-NLS-1$ + public static final String IMG_LOCAL_TARGET = "localTarget"; //$NON-NLS-1$ // Command ids public static final String CMD_BUILD = PLUGIN_ID + ".command.buildActive"; //$NON-NLS-1$ @@ -61,7 +64,7 @@ public class Activator extends AbstractUIPlugin { private static Activator plugin; // The cache of the Launch Bar UI Manager Object - private LaunchBarUIManager launchBarUIManager; + private LaunchBarUIManager launchBarUIManager; /** * The constructor @@ -77,6 +80,9 @@ public class Activator extends AbstractUIPlugin { imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_LOCAL_TARGET, imageDescriptorFromPlugin(PLUGIN_ID, "icons/localTarget.png")); //$NON-NLS-1$ + + context.registerService(ILaunchTargetUIManager.class, new LaunchTargetUIManager(), null); } public void stop(BundleContext context) throws Exception { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 1621a8ce5f8..7aef26870a3 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -58,8 +58,9 @@ public class Messages extends NLS { public static String NewLaunchConfigWizard_0; public static String StopActiveCommandHandler_0; public static String StopActiveCommandHandler_1; + public static String TargetSelector_ToolTipPrefix; public static String TargetSelector_CreateNewTarget; - + public static String DescriptorMustNotBeNull; public static String DescriptorMustNotBeNullDesc; public static String NoActiveTarget; @@ -72,9 +73,7 @@ public class Messages extends NLS { public static String LaunchConfigurationNotFoundDesc; public static String NoLaunchTabsDefined; public static String NoLaunchTabsDefinedDesc; - - - + static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index f11b404c9a0..346d32d4c65 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -28,10 +28,10 @@ import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog; -import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; @@ -46,83 +46,97 @@ public class ConfigureActiveLaunchHandler extends AbstractHandler { return Status.OK_STATUS; } - public static IStatus canOpenConfigurationEditor(ILaunchDescriptor desc) { if (desc == null) - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.DescriptorMustNotBeNull, new Exception(Messages.DescriptorMustNotBeNullDesc)); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.DescriptorMustNotBeNull, + new Exception(Messages.DescriptorMustNotBeNullDesc)); LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); ILaunchMode mode = manager.getActiveLaunchMode(); - IRemoteConnection target = manager.getActiveLaunchTarget(); + ILaunchTarget target = manager.getActiveLaunchTarget(); if (target == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoActiveTarget, new Exception(Messages.NoActiveTargetDesc)); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoActiveTarget, + new Exception(Messages.NoActiveTargetDesc)); } - + ILaunchConfigurationType configType = null; try { configType = manager.getLaunchConfigurationType(desc, target); - } catch(CoreException ce) {/* ignore */ }; + } catch (CoreException ce) { + /* ignore */ } + ; if (configType == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchConfigType, new Exception(Messages.CannotEditLaunchConfiguration)); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchConfigType, + new Exception(Messages.CannotEditLaunchConfiguration)); } - - if( mode == null ) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, new Exception(Messages.NoLaunchModeSelected)); + + if (mode == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, + new Exception(Messages.NoLaunchModeSelected)); } - - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); - if( group == null ) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchGroupSelected, new Exception(Messages.NoLaunchGroupSelected)); + + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, + mode.getIdentifier()); + if (group == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchGroupSelected, + new Exception(Messages.NoLaunchGroupSelected)); } - + String mode2 = group.getMode(); - if( mode2 == null ) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, new Exception(Messages.CannotEditLaunchConfiguration)); + if (mode2 == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, + new Exception(Messages.CannotEditLaunchConfiguration)); } - - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); + + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() + .getLaunchGroup(group.getIdentifier()); if (groupExt != null) { ILaunchConfiguration config = null; try { config = manager.getLaunchConfiguration(desc, target); - } catch(CoreException ce) { + } catch (CoreException ce) { // Ignore } if (config == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LaunchConfigurationNotFound, new Exception(Messages.LaunchConfigurationNotFoundDesc)); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LaunchConfigurationNotFound, + new Exception(Messages.LaunchConfigurationNotFoundDesc)); } try { LaunchConfigurationPresentationManager mgr = LaunchConfigurationPresentationManager.getDefault(); ILaunchConfigurationTabGroup tabgroup = mgr.getTabGroup(config, mode.getIdentifier()); - } catch(CoreException ce) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID,Messages.NoLaunchTabsDefined, new Exception(Messages.NoLaunchTabsDefinedDesc)); + } catch (CoreException ce) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchTabsDefined, + new Exception(Messages.NoLaunchTabsDefinedDesc)); } } else { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CannotEditLaunchConfiguration, new Exception(Messages.CannotEditLaunchConfiguration)); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CannotEditLaunchConfiguration, + new Exception(Messages.CannotEditLaunchConfiguration)); } return Status.OK_STATUS; } - - + public static void openConfigurationEditor(ILaunchDescriptor desc) { if (desc == null) return; - + // Display the error message Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); IStatus s = canOpenConfigurationEditor(desc); - if( !s.isOK()) { - MessageDialog.openError(shell, s.getMessage(), s.getException() == null ? s.getMessage() : s.getException().getMessage()); + if (!s.isOK()) { + MessageDialog.openError(shell, s.getMessage(), + s.getException() == null ? s.getMessage() : s.getException().getMessage()); return; } - - // At this point, no error handling should be needed. + + // At this point, no error handling should be needed. try { LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); ILaunchMode mode = manager.getActiveLaunchMode(); - IRemoteConnection target = manager.getActiveLaunchTarget(); + ILaunchTarget target = manager.getActiveLaunchTarget(); ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, + mode.getIdentifier()); + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() + .getLaunchGroup(group.getIdentifier()); ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { config = ((ILaunchConfigurationWorkingCopy) config).doSave(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 3b790248664..b98b5ccc911 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -23,7 +23,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.launchbar.ui.IHoverProvider; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; @@ -32,7 +31,6 @@ import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseTrackListener; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionAdapter; @@ -57,13 +55,10 @@ import org.eclipse.ui.PlatformUI; public abstract class CSelector extends Composite { private IStructuredContentProvider contentProvider; private ILabelProvider labelProvider; - private IHoverProvider hoverProvider; private Comparator sorter; private Comparator sorterTop; private Object input; private Composite buttonComposite; - private String toolTipText; - private boolean toolTipWasModified; // Used for the hover provider private static final int arrowMax = 2; private Transition arrowTransition; private Object selection; @@ -77,51 +72,7 @@ public abstract class CSelector extends Composite { private Shell popup; private LaunchBarListViewer listViewer; private Job delayJob; - private MouseTrackListener mouseTrackListener = new MouseTrackListener() { - @Override - public void mouseEnter(MouseEvent e) { - if (!mouseOver) { - mouseOver = true; - redraw(); - if (toolTipWasModified) { - buttonComposite.setToolTipText(toolTipText); - if (currentLabel != null) { - currentLabel.setToolTipText(toolTipText); - } - if (currentIcon != null) { - currentIcon.setToolTipText(toolTipText); - } - } - } - } - @Override - public void mouseHover(MouseEvent e) { - if (hoverProvider != null && (popup == null || popup.isDisposed())) { - final Object eventSource = e.getSource(); - if ((eventSource == currentLabel || eventSource == buttonComposite || eventSource == currentIcon)) { - if (hoverProvider.displayHover(selection)) { - buttonComposite.setToolTipText(""); //$NON-NLS-1$ - if (currentLabel != null) { - currentLabel.setToolTipText(""); //$NON-NLS-1$ - } - if (currentIcon != null) { - currentIcon.setToolTipText(""); //$NON-NLS-1$ - } - toolTipWasModified = true; - } - } - } - } - - @Override - public void mouseExit(MouseEvent e) { - if (mouseOver) { - mouseOver = false; - redraw(); - } - } - }; private MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(MouseEvent event) { @@ -159,8 +110,10 @@ public abstract class CSelector extends Composite { break; case SWT.FocusOut: if (isPopUpInFocus()) { - // we about to loose focus from popup children, but it may go - // to another child, lets schedule a job to wait before we close + // we about to loose focus from popup children, but it may + // go + // to another child, lets schedule a job to wait before we + // close if (closingJob != null) closingJob.cancel(); closingJob = new Job(Messages.CSelector_0) { @@ -212,7 +165,6 @@ public abstract class CSelector extends Composite { } }); addMouseListener(mouseListener); - addMouseTrackListener(mouseTrackListener); } private boolean isPopUpInFocus() { @@ -260,7 +212,7 @@ public abstract class CSelector extends Composite { this.selection = element; if (buttonComposite != null) buttonComposite.dispose(); - toolTipText = getToolTipText(); + String toolTipText = getToolTipText(); boolean editable = false; int columns = 2; Image image = labelProvider.getImage(element); @@ -276,19 +228,16 @@ public abstract class CSelector extends Composite { buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); buttonComposite.setBackground(backgroundColor); buttonComposite.addMouseListener(mouseListener); - buttonComposite.addMouseTrackListener(mouseTrackListener); buttonComposite.setToolTipText(toolTipText); if (element != null) { if (image != null) { Label icon = createImage(buttonComposite, image); icon.addMouseListener(mouseListener); - icon.addMouseTrackListener(mouseTrackListener); currentIcon = icon; currentIcon.setToolTipText(toolTipText); } Label label = createLabel(buttonComposite, element); label.addMouseListener(mouseListener); - label.addMouseTrackListener(mouseTrackListener); currentLabel = label; currentLabel.setToolTipText(toolTipText); } else { @@ -318,15 +267,11 @@ public abstract class CSelector extends Composite { Rectangle bounds = arrow.getBounds(); int arrowWidth = bounds.width - hPadding * 2; int current = arrowTransition.getCurrent(); - gc.drawPolyline(new int[] { hPadding, - bounds.height / 2 - current, - hPadding + (arrowWidth / 2), - bounds.height / 2 + current, hPadding + arrowWidth, - bounds.height / 2 - current }); + gc.drawPolyline(new int[] { hPadding, bounds.height / 2 - current, hPadding + (arrowWidth / 2), + bounds.height / 2 + current, hPadding + arrowWidth, bounds.height / 2 - current }); } }); arrow.addMouseListener(mouseListener); - arrow.addMouseTrackListener(mouseTrackListener); if (editable) { final EditButton editButton = new EditButton(buttonComposite, SWT.NONE); editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); @@ -359,10 +304,6 @@ public abstract class CSelector extends Composite { return mouseListener; } - public MouseTrackListener getMouseTrackListener() { - return mouseTrackListener; - } - protected void openPopup() { Object[] elements = contentProvider.getElements(input); if (elements.length == 0 && !hasActionArea()) @@ -374,7 +315,6 @@ public abstract class CSelector extends Composite { popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP | SWT.RESIZE); popup.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); - listViewer = new LaunchBarListViewer(popup); initializeListViewer(listViewer); listViewer.setFilterVisible(elements.length > 7); @@ -395,8 +335,7 @@ public abstract class CSelector extends Composite { if (hasActionArea()) createActionArea(popup); Rectangle buttonBounds = getBounds(); - Point popupLocation = popup.getDisplay().map(this, null, 0, - buttonBounds.height); + Point popupLocation = popup.getDisplay().map(this, null, 0, buttonBounds.height); popup.setLocation(popupLocation.x, popupLocation.y + 5); restoreShellSize(); @@ -415,9 +354,6 @@ public abstract class CSelector extends Composite { } }); - if (hoverProvider != null) { - hoverProvider.dismissHover(selection != null ? selection : null, true); - } } protected String getDialogPreferencePrefix() { @@ -432,8 +368,8 @@ public abstract class CSelector extends Composite { try { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); String prefName = getDialogPreferencePrefix(); - int w = store.getInt(prefName + ".shell.w"); - int h = store.getInt(prefName + ".shell.h"); + int w = store.getInt(prefName + ".shell.w"); //$NON-NLS-1$ + int h = store.getInt(prefName + ".shell.h"); //$NON-NLS-1$ size.x = Math.max(size.x, w); size.y = Math.max(size.y, h); } catch (Exception e) { @@ -446,8 +382,8 @@ public abstract class CSelector extends Composite { Point size = popup.getSize(); IPreferenceStore store = Activator.getDefault().getPreferenceStore(); String prefName = getDialogPreferencePrefix(); - store.setValue(prefName + ".shell.w", size.x); - store.setValue(prefName + ".shell.h", size.y); + store.setValue(prefName + ".shell.w", size.x); //$NON-NLS-1$ + store.setValue(prefName + ".shell.h", size.y); //$NON-NLS-1$ } protected void initializeListViewer(LaunchBarListViewer listViewer) { @@ -478,8 +414,7 @@ public abstract class CSelector extends Composite { GC gc = new GC(buttonImage); gc.setAntialias(SWT.ON); gc.setInterpolation(SWT.HIGH); - gc.drawImage(image, 0, 0, image.getBounds().width, - image.getBounds().height, 0, 0, 16, 16); + gc.drawImage(image, 0, 0, image.getBounds().width, image.getBounds().height, 0, 0, 16, 16); gc.dispose(); image = buttonImage; disposeImage = true; @@ -523,12 +458,18 @@ public abstract class CSelector extends Composite { return labelProvider; } - public void setHoverProvider(IHoverProvider hoverProvider) { - this.hoverProvider = hoverProvider; - } - - public IHoverProvider getHoverProvider() { - return hoverProvider; + @Override + public void setToolTipText(String toolTipText) { + super.setToolTipText(toolTipText); + if (buttonComposite != null) { + buttonComposite.setToolTipText(toolTipText); + } + if (currentLabel != null) { + currentLabel.setToolTipText(toolTipText); + } + if (currentIcon != null) { + currentIcon.setToolTipText(toolTipText); + } } /** @@ -561,7 +502,8 @@ public abstract class CSelector extends Composite { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { - update(selection); // update current selection - name or icon may have changed + update(selection); // update current selection - name or icon + // may have changed if (popup != null && !popup.isDisposed()) { listViewer.refresh(true); // update all labels in the popup } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index b527c1329bc..8a481f1316c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -19,9 +19,9 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; +import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; @@ -36,7 +36,8 @@ import org.eclipse.swt.widgets.ToolItem; public class LaunchBarControl implements Listener { public static final String ID = "org.eclipse.launchbar"; //$NON-NLS-1$ - public static final String CLASS_URI = "bundleclass://" + Activator.PLUGIN_ID + "/" + LaunchBarControl.class.getName(); //$NON-NLS-1$ //$NON-NLS-2$ + public static final String CLASS_URI = "bundleclass://" + Activator.PLUGIN_ID + "/" //$NON-NLS-1$ //$NON-NLS-2$ + + LaunchBarControl.class.getName(); private LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); @@ -82,7 +83,7 @@ public class LaunchBarControl implements Listener { Label label = new Label(container, SWT.NONE); label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); label.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ - + targetSelector = new TargetSelector(container, SWT.NONE); targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); targetSelector.setInput(manager); @@ -107,9 +108,10 @@ public class LaunchBarControl implements Listener { private void createButton(Composite parent, String imageName, String toolTipText, final String command) { ToolItem button = new ToolItem((ToolBar) parent, SWT.FLAT); - //button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); + // button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); Image srcImage = Activator.getDefault().getImage(imageName); - //Image image = new Image(parent.getDisplay(), srcImage, SWT.IMAGE_COPY); + // Image image = new Image(parent.getDisplay(), srcImage, + // SWT.IMAGE_COPY); button.setImage(srcImage); button.setToolTipText(toolTipText); button.addSelectionListener(new SelectionAdapter() { @@ -139,7 +141,7 @@ public class LaunchBarControl implements Listener { @Override public void activeLaunchTargetChanged() { if (targetSelector != null) { - final IRemoteConnection target = manager.getActiveLaunchTarget(); + final ILaunchTarget target = manager.getActiveLaunchTarget(); targetSelector.setDelayedSelection(target, SELECTION_DELAY); } } @@ -152,7 +154,7 @@ public class LaunchBarControl implements Listener { @Override public void launchTargetsChanged() { - if (targetSelector!=null){ + if (targetSelector != null) { targetSelector.refresh(); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 6543f7fa7f7..1a46006323f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -48,9 +48,11 @@ public class ModeSelector extends CSelector { @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public void dispose() { - } + } + @Override public Object[] getElements(Object inputElement) { try { @@ -66,6 +68,7 @@ public class ModeSelector extends CSelector { setLabelProvider(new LabelProvider() { private Map images = new HashMap<>(); + @Override public void dispose() { super.dispose(); @@ -73,13 +76,14 @@ public class ModeSelector extends CSelector { image.dispose(); } } + @Override public Image getImage(Object element) { if (element instanceof ILaunchMode) { ILaunchMode mode = (ILaunchMode) element; try { ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); - if( group == null ) { + if (group == null) { group = getDefaultLaunchGroup(mode.getIdentifier()); } if (group != null) { @@ -99,13 +103,14 @@ public class ModeSelector extends CSelector { } return super.getImage(element); } + @Override public String getText(Object element) { if (element instanceof ILaunchMode) { ILaunchMode mode = (ILaunchMode) element; try { ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); - if( group == null ) { + if (group == null) { group = getDefaultLaunchGroup(mode.getIdentifier()); } if (group != null) { @@ -123,8 +128,8 @@ public class ModeSelector extends CSelector { @Override public int compare(Object o1, Object o2) { if (o1 instanceof ILaunchMode && o2 instanceof ILaunchMode) { - String mode1 = ((ILaunchMode)o1).getIdentifier(); - String mode2 = ((ILaunchMode)o2).getIdentifier(); + String mode1 = ((ILaunchMode) o1).getIdentifier(); + String mode2 = ((ILaunchMode) o2).getIdentifier(); // run comes first, then debug, then the rest if (mode1.equals("run")) { //$NON-NLS-1$ if (mode2.equals("run")) //$NON-NLS-1$ @@ -152,18 +157,19 @@ public class ModeSelector extends CSelector { String groupId = null; if (mode.equals(ILaunchManager.DEBUG_MODE)) { groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP; - } else if( mode.equals(ILaunchManager.PROFILE_MODE)) { + } else if (mode.equals(ILaunchManager.PROFILE_MODE)) { groupId = IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP; } else { groupId = IDebugUIConstants.ID_RUN_LAUNCH_GROUP; } - if( groupId != null ) + if (groupId != null) return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupId); return null; } - + protected ILaunchGroup getLaunchGroup(String mode) throws CoreException { - ILaunchConfigurationType type = manager.getLaunchConfigurationType(manager.getActiveLaunchDescriptor(), manager.getActiveLaunchTarget()); + ILaunchConfigurationType type = manager.getLaunchConfigurationType(manager.getActiveLaunchDescriptor(), + manager.getActiveLaunchTarget()); if (type == null) return null; return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(type, mode); @@ -179,7 +185,8 @@ public class ModeSelector extends CSelector { } catch (CoreException e) { Activator.log(e.getStatus()); } catch (Exception e) { - // manager can throw illegal state exception hopefully we never get it + // manager can throw illegal state exception hopefully we never + // get it Activator.log(e); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index f8a72c3684c..eacbac7f41d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -13,54 +13,49 @@ package org.eclipse.launchbar.ui.internal.controls; import java.util.Comparator; import java.util.List; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.NotEnabledException; -import org.eclipse.core.commands.NotHandledException; -import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.resource.CompositeImageDescriptor; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.SameShellProvider; import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetListener; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.TargetStatus; +import org.eclipse.launchbar.core.target.TargetStatus.Code; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.ui.IRemoteUIConnectionService; -import org.eclipse.remote.ui.RemoteConnectionsLabelProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseTrackAdapter; -import org.eclipse.swt.events.MouseTrackListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.GC; +import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; +import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.dialogs.PropertyDialogAction; -public class TargetSelector extends CSelector { +public class TargetSelector extends CSelector implements ILaunchTargetListener { private final LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); + private final ILaunchTargetUIManager targetUIManager = Activator.getService(ILaunchTargetUIManager.class); + private final ILaunchTargetManager targetManager = Activator.getService(ILaunchTargetManager.class); private static final String[] noTargets = new String[] { "---" }; //$NON-NLS-1$ public TargetSelector(Composite parent, int style) { super(parent, style); + targetManager.addListener(this); + setContentProvider(new IStructuredContentProvider() { @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { @@ -73,19 +68,69 @@ public class TargetSelector extends CSelector { @Override public Object[] getElements(Object inputElement) { LaunchBarManager manager = uiManager.getManager(); - try { - List targets = manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); - if (!targets.isEmpty()) { - return targets.toArray(); - } - } catch (CoreException e) { - Activator.log(e); + List targets = manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); + if (!targets.isEmpty()) { + return targets.toArray(); } return noTargets; } }); - setLabelProvider(new RemoteConnectionsLabelProvider()); + setLabelProvider(new LabelProvider() { + @Override + public String getText(Object element) { + if (element instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) element; + ILabelProvider provider = targetUIManager.getLabelProvider(target); + return provider != null ? provider.getText(target) : target.getName(); + } + return super.getText(element); + } + + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchTarget) { + // TODO apply a status overlay + ILaunchTarget target = (ILaunchTarget) element; + ILabelProvider provider = targetUIManager.getLabelProvider(target); + if (provider != null) { + final Image baseImage = provider.getImage(target); + final TargetStatus status = targetManager.getStatus(target); + if (status.getCode() == Code.OK) { + return baseImage; + } else { + String compId = target.getTypeId() + + (status.getCode() == Code.ERROR ? ".error" : ".warning"); //$NON-NLS-1$ //$NON-NLS-2$ + Image image = Activator.getDefault().getImageRegistry().get(compId); + if (image == null) { + ImageDescriptor desc = new CompositeImageDescriptor() { + @Override + protected Point getSize() { + Rectangle bounds = baseImage.getBounds(); + return new Point(bounds.width, bounds.height); + } + + @Override + protected void drawCompositeImage(int width, int height) { + Image overlay = PlatformUI.getWorkbench().getSharedImages() + .getImage(status.getCode() == Code.ERROR + ? ISharedImages.IMG_DEC_FIELD_ERROR + : ISharedImages.IMG_DEC_FIELD_WARNING); + drawImage(baseImage.getImageData(), 0, 0); + int y = baseImage.getBounds().height - overlay.getBounds().height; + drawImage(overlay.getImageData(), 0, y); + } + }; + image = desc.createImage(); + Activator.getDefault().getImageRegistry().put(compId, image); + } + return image; + } + } + } + return super.getImage(element); + } + }); setSorter(new Comparator() { @Override @@ -100,11 +145,10 @@ public class TargetSelector extends CSelector { @Override public boolean isEditable(Object element) { - return true; } - private ISelectionProvider getSelectionProvider(){ + private ISelectionProvider getSelectionProvider() { return new ISelectionProvider() { @Override public void setSelection(ISelection selection) { @@ -127,83 +171,18 @@ public class TargetSelector extends CSelector { } }; } + @Override public void handleEdit(Object element) { // opens property dialog on a selected target - new PropertyDialogAction(new SameShellProvider(getShell()), getSelectionProvider()).run(); - } - - @Override - public boolean hasActionArea() { - return true; - } - - @Override - public void createActionArea(final Composite parent) { - Composite actionArea = new Composite(parent, SWT.NONE); - GridLayout actionLayout = new GridLayout(); - actionLayout.marginWidth = actionLayout.marginHeight = 0; - actionArea.setLayout(actionLayout); - actionArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - - final Composite createButton = new Composite(actionArea, SWT.NONE); - createButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - GridLayout buttonLayout = new GridLayout(); - buttonLayout.marginWidth = buttonLayout.marginHeight = 7; - createButton.setLayout(buttonLayout); - createButton.setBackground(backgroundColor); - createButton.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - Point size = createButton.getSize(); - GC gc = e.gc; - gc.setForeground(outlineColor); - gc.drawLine(0, 0, size.x, 0); - } - }); - - final Label createLabel = new Label(createButton, SWT.None); - createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - createLabel.setText(Messages.TargetSelector_CreateNewTarget); - createLabel.setBackground(backgroundColor); - - MouseListener mouseListener = new MouseAdapter() { - @Override - public void mouseUp(org.eclipse.swt.events.MouseEvent event) { - try { - ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); - Command newConnectionCmd = commandService.getCommand(IRemoteUIConnectionService.NEW_CONNECTION_COMMAND); - newConnectionCmd.executeWithChecks(new ExecutionEvent()); - } catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e) { - Activator.log(e); - } - } - }; - - createButton.addMouseListener(mouseListener); - createLabel.addMouseListener(mouseListener); - - MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { - @Override - public void mouseEnter(MouseEvent e) { - createButton.setBackground(highlightColor); - createLabel.setBackground(highlightColor); - } - @Override - public void mouseExit(MouseEvent e) { - createButton.setBackground(white); - createLabel.setBackground(white); - } - }; - createButton.addMouseTrackListener(mouseTrackListener); - createLabel.addMouseTrackListener(mouseTrackListener); + new PropertyDialogAction(new SameShellProvider(getShell()), getSelectionProvider()).run(); } @Override protected void fireSelectionChanged() { Object selection = getSelection(); - if (selection instanceof IRemoteConnection) { - IRemoteConnection target = (IRemoteConnection) selection; + if (selection instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) selection; try { uiManager.getManager().setActiveLaunchTarget(target); } catch (CoreException e) { @@ -212,6 +191,11 @@ public class TargetSelector extends CSelector { } } + public void setToolTipText(ILaunchTarget target) { + String text = Messages.TargetSelector_ToolTipPrefix + ": " + targetManager.getStatus(target).getMessage(); //$NON-NLS-1$ + setToolTipText(text); + } + @Override public Point computeSize(int wHint, int hHint, boolean changed) { return super.computeSize(200, hHint, changed); @@ -219,9 +203,35 @@ public class TargetSelector extends CSelector { @Override public void setSelection(Object element) { - if (element == null) + if (element == null) { element = noTargets[0]; + } else if (element instanceof ILaunchTarget) { + setToolTipText((ILaunchTarget) element); + } super.setSelection(element); } + @Override + public void dispose() { + super.dispose(); + targetManager.removeListener(this); + } + + @Override + public void update(Object element) { + super.update(element); + if (element != null && element instanceof ILaunchTarget) { + setToolTipText((ILaunchTarget) element); + } else { + setToolTipText(Messages.TargetSelector_ToolTipPrefix); + } + } + + @Override + public void launchTargetStatusChanged(ILaunchTarget target) { + if (target.equals(uiManager.getManager().getActiveLaunchTarget())) { + refresh(); + } + } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index d1d335eb26f..2e57068198c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -41,6 +41,7 @@ NewLaunchConfigTypePage_2=Select the type of launch configuration to create. NewLaunchConfigWizard_0=Create Launch Configuration StopActiveCommandHandler_0=Stopping launches StopActiveCommandHandler_1=Stopping build +TargetSelector_ToolTipPrefix=Launch Target TargetSelector_CreateNewTarget=Create New Connection... DescriptorMustNotBeNull=Descriptor must not be null diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java new file mode 100644 index 00000000000..751064e6c28 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; +import org.eclipse.swt.graphics.Image; + +public class LaunchTargetUIManager implements ILaunchTargetUIManager { + + private Map typeElements; + private Map labelProviders = new HashMap<>(); + + @Override + public ILabelProvider getLabelProvider(ILaunchTarget target) { + if (typeElements == null) { + // Load them up + typeElements = new HashMap<>(); + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint point = registry + .getExtensionPoint(Activator.getDefault().getBundle().getSymbolicName() + ".launchTargetTypeUI"); //$NON-NLS-1$ + for (IExtension extension : point.getExtensions()) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String id = element.getAttribute("id"); //$NON-NLS-1$ + if (id != null) { + typeElements.put(id, element); + } + } + } + } + + String typeId = target.getTypeId(); + ILabelProvider labelProvider = labelProviders.get(typeId); + if (labelProvider == null) { + IConfigurationElement element = typeElements.get(typeId); + if (element != null) { + try { + labelProvider = (ILabelProvider) element.createExecutableExtension("labelProvider"); //$NON-NLS-1$ + } catch (CoreException e) { + Activator.log(e); + } + } + + if (labelProvider == null) { + labelProvider = new LabelProvider() { + public String getText(Object element) { + if (element instanceof ILaunchTarget) { + return ((ILaunchTarget) element).getName(); + } + return super.getText(element); + } + + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchTarget) { + return Activator.getDefault().getImage(Activator.IMG_LOCAL_TARGET); + } + return super.getImage(element); + } + + }; + } + + } + return labelProvider; + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java new file mode 100644 index 00000000000..6cd2a5726d2 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.target; + +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * A manager for the launch target UI. + */ +public interface ILaunchTargetUIManager { + + /** + * Return a label provider that gives the test and image for the target. + * + * @param target + * the launch target + * @return the label provider for the launch target + */ + ILabelProvider getLabelProvider(ILaunchTarget target); + +} diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index 9f59c4d140a..f1211ff6627 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -18,7 +18,6 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import org.eclipse.core.runtime.CoreException; @@ -29,9 +28,8 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.internal.LaunchBarManager2Test; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionType; -import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.junit.After; import org.junit.Before; import org.junit.FixMethodOrder; @@ -41,10 +39,9 @@ import org.junit.runners.MethodSorters; @SuppressWarnings("nls") @FixMethodOrder(MethodSorters.JVM) public class PerTargetLaunchConfigProviderTest { - private IRemoteServicesManager remoteServiceManager; - private IRemoteConnection localTarget; + private ILaunchTarget localTarget; private String launchName; - private IRemoteConnection otherTarget; + private ILaunchTarget otherTarget; private ILaunchConfigurationType launchConfigType; private ILaunchDescriptorType descriptorType; private ILaunchDescriptor descriptor; @@ -52,14 +49,24 @@ public class PerTargetLaunchConfigProviderTest { @Before public void basicSetupOnly() throws CoreException { - remoteServiceManager = spy(Activator.getService(IRemoteServicesManager.class)); - localTarget = remoteServiceManager.getLocalConnectionType().getConnections().get(0); + ILaunchTargetManager targetManager = mock(ILaunchTargetManager.class); + Activator.getDefault().getBundle().getBundleContext().registerService(ILaunchTargetManager.class, targetManager, + null); + + localTarget = mock(ILaunchTarget.class); + doReturn("Local").when(localTarget).getName(); + doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); + doReturn(localTarget).when(targetManager).getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, + "Local"); + // other mocked remote connections - otherTarget = mock(IRemoteConnection.class); - IRemoteConnectionType rtype = mock(IRemoteConnectionType.class); - doReturn(rtype).when(otherTarget).getConnectionType(); - doReturn("otherTargetType").when(rtype).getId(); + otherTarget = mock(ILaunchTarget.class); + doReturn("otherTargetType").when(otherTarget).getTypeId(); doReturn("otherTarget").when(otherTarget).getName(); + doReturn(otherTarget).when(targetManager).getLaunchTarget("otherTargetType", "otherTarget"); + + doReturn(new ILaunchTarget[] { localTarget, otherTarget }).when(targetManager).getLaunchTargets(); + // launch stuff launchName = "test"; // launch config type @@ -90,18 +97,18 @@ public class PerTargetLaunchConfigProviderTest { private ILaunchBarManager manager; @Override - public boolean supports(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { + public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { return true; } @Override - public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, - IRemoteConnection target) throws CoreException { + public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) + throws CoreException { return launchConfigType; } @Override - protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target, + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { super.populateLaunchConfiguration(descriptor, target, workingCopy); workingCopy.setAttribute(CONNECTION_NAME_ATTR, target.getName()); @@ -113,7 +120,7 @@ public class PerTargetLaunchConfigProviderTest { } @Override - protected IRemoteConnection getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { + protected ILaunchTarget getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { String name = configuration.getAttribute(CONNECTION_NAME_ATTR, ""); if (localTarget.getName().equals(name)) { return localTarget; @@ -133,7 +140,7 @@ public class PerTargetLaunchConfigProviderTest { } @Override - public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, IRemoteConnection target) + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { ILaunchConfiguration config = super.getLaunchConfiguration(descriptor, target); // Since this provider isn't hooked in properly, need to manually diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 08842f3311d..b5833ecd082 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -23,7 +23,6 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; -import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; @@ -57,9 +56,8 @@ import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ProjectLaunchDescriptor; import org.eclipse.launchbar.core.ProjectPerTargetLaunchConfigProvider; import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionType; -import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; @@ -81,13 +79,12 @@ public class LaunchBarManager2Test { IEclipsePreferences store = new EclipsePreferences(); private ArrayList elements; private IExtension extension; - private static final String localTargetTypeId = "org.eclipse.remote.LocalServices"; private String descriptorTypeId; - private IRemoteConnection localTarget; + private ILaunchTargetManager targetManager; + private ILaunchTarget localTarget; private String launchObject; - private IRemoteServicesManager remoteServiceManager; - private IRemoteConnection otherTarget; - private List targets; + private ILaunchTarget otherTarget; + private ILaunchTarget[] targets; public class FixedLaunchBarManager extends LaunchBarManager { public FixedLaunchBarManager() throws CoreException { @@ -110,8 +107,8 @@ public class LaunchBarManager2Test { } @Override - IRemoteServicesManager getRemoteServicesManager() { - return remoteServiceManager; + ILaunchTargetManager getLaunchTargetManager() { + return targetManager; } }; @@ -129,7 +126,7 @@ public class LaunchBarManager2Test { } protected ILaunchConfigurationProvider mockConfigProviderElement(String descriptorTypeId, int priority, - ILaunchDescriptor descriptor, IRemoteConnection target, ILaunchConfiguration config, Object launchObj) + ILaunchDescriptor descriptor, ILaunchTarget target, ILaunchConfiguration config, Object launchObj) throws CoreException { ILaunchConfigurationProvider provider = mock(ILaunchConfigurationProvider.class); mockProviderElement(descriptorTypeId, priority, provider); @@ -166,7 +163,7 @@ public class LaunchBarManager2Test { protected void init() throws CoreException { doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); - doReturn(targets).when(remoteServiceManager).getAllRemoteConnections(); + doReturn(targets).when(targetManager).getLaunchTargets(); manager.init(); } @@ -219,13 +216,10 @@ public class LaunchBarManager2Test { * @param t2 * @return */ - private IRemoteConnection mockRemoteConnection(String t2) { - IRemoteConnection target = mock(IRemoteConnection.class); - IRemoteConnectionType type = mock(IRemoteConnectionType.class); - doReturn(t2).when(type).getName(); - doReturn(t2).when(type).getId(); + private ILaunchTarget mockRemoteConnection(String t2) { + ILaunchTarget target = mock(ILaunchTarget.class); + doReturn(t2).when(target).getTypeId(); doReturn(t2 + ".target").when(target).getName(); - doReturn(type).when(target).getConnectionType(); return target; } @@ -270,17 +264,18 @@ public class LaunchBarManager2Test { lman = mock(ILaunchManager.class); doReturn(globalmodes.toArray(new ILaunchMode[globalmodes.size()])).when(lman).getLaunchModes(); doReturn(new ILaunchConfiguration[] {}).when(lman).getLaunchConfigurations(); - remoteServiceManager = spy(Activator.getService(IRemoteServicesManager.class)); + targetManager = mock(ILaunchTargetManager.class); manager = new FixedLaunchBarManager(); - localTarget = manager.getRemoteServicesManager().getLocalConnectionType().getConnections().get(0); + localTarget = mock(ILaunchTarget.class); + doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); + doReturn("Local").when(localTarget).getName(); // mock launchObject = "test"; // remote connections - otherTarget = mock(IRemoteConnection.class); - IRemoteConnectionType rtype = mock(IRemoteConnectionType.class); - doReturn(rtype).when(otherTarget).getConnectionType(); - doReturn("otherTargetType").when(rtype).getId(); - targets = Arrays.asList(new IRemoteConnection[] { otherTarget, localTarget }); + otherTarget = mock(ILaunchTarget.class); + doReturn("otherTargetType").when(otherTarget).getTypeId(); + doReturn("otherTarget").when(otherTarget).getName(); + targets = new ILaunchTarget[] { otherTarget, localTarget }; // lc String launchConfigTypeId = "lctype1"; launchConfigType = mockLCType(launchConfigTypeId); @@ -329,7 +324,7 @@ public class LaunchBarManager2Test { @Test public void testAddConfigMappingTwo() throws CoreException { basicSetupOnly(); - IRemoteConnection target = mockRemoteConnection("t2"); + ILaunchTarget target = mockRemoteConnection("t2"); mockConfigProviderElement(descriptorTypeId, 10, descriptor, target, launchConfig, launchObject); // now create another lc type, which is not registered in config type ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); @@ -346,7 +341,7 @@ public class LaunchBarManager2Test { @Test public void testAddConfigProviderTwo2() throws CoreException { basicSetupOnly(); - IRemoteConnection target = mockRemoteConnection("t2"); + ILaunchTarget target = mockRemoteConnection("t2"); mockConfigProviderElement(descriptorTypeId, 15, descriptor, target, launchConfig, launchObject); ILaunchConfigurationType lctype2 = mockLCType("lctypeid2"); ILaunchConfiguration lc2 = mockLC("lc2", lctype2); @@ -360,7 +355,7 @@ public class LaunchBarManager2Test { public void testGetLaunchTargets() throws CoreException { manager.launchObjectAdded(launchObject); manager.setActiveLaunchDescriptor(descriptor); - List launchTargets = manager.getLaunchTargets(descriptor); + List launchTargets = manager.getLaunchTargets(descriptor); assertEquals(1, launchTargets.size()); assertEquals(otherTarget, launchTargets.get(0)); } @@ -374,7 +369,7 @@ public class LaunchBarManager2Test { init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); - List launchTargets = manager.getLaunchTargets(desc); + List launchTargets = manager.getLaunchTargets(desc); assertEquals(1, launchTargets.size()); } @@ -387,7 +382,7 @@ public class LaunchBarManager2Test { init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); - List launchTargets = manager.getLaunchTargets(desc); + List launchTargets = manager.getLaunchTargets(desc); assertEquals(1, launchTargets.size()); } @@ -577,7 +572,7 @@ public class LaunchBarManager2Test { provider = new ProjectPerTargetLaunchConfigProvider() { @Override public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, - IRemoteConnection target) throws CoreException { + ILaunchTarget target) throws CoreException { return launchConfigType; } @@ -592,7 +587,7 @@ public class LaunchBarManager2Test { } @Override - protected IRemoteConnection getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { + protected ILaunchTarget getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { return localTarget; } }; @@ -835,14 +830,6 @@ public class LaunchBarManager2Test { assertEquals(localTarget, manager.getActiveLaunchTarget()); } - @Test - public void testGetLaunchTarget() throws CoreException { - IRemoteConnectionType targetType = remoteServiceManager.getConnectionType(localTargetTypeId); - final List list = targetType.getConnections(); - assertEquals(1, list.size()); - assertEquals(localTarget, list.get(0)); - } - @Test public void testGetLaunchConfigurationType() throws CoreException { manager.launchObjectAdded(launchObject); diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 33105f6351a..af557564acf 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -34,9 +34,8 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionType; -import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -73,8 +72,18 @@ public class LaunchBarManagerTest { doReturn(true).when(launchConfigType).supportsMode("run"); doReturn(true).when(launchConfigType).supportsMode("debug"); + final ILaunchTargetManager targetManager = mock(ILaunchTargetManager.class); + ILaunchTarget localTarget = mock(ILaunchTarget.class); + doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); + doReturn("Local").when(localTarget).getName(); + doReturn(new ILaunchTarget[] { localTarget }).when(targetManager).getLaunchTargets(); + // Inject the launch config LaunchBarManager manager = new LaunchBarManager(false) { + @Override + ILaunchTargetManager getLaunchTargetManager() { + return targetManager; + } }; manager.init(); manager.launchConfigurationAdded(launchConfig); @@ -83,11 +92,9 @@ public class LaunchBarManagerTest { assertNotNull(manager.getActiveLaunchDescriptor()); assertEquals(launchConfig, manager.getActiveLaunchDescriptor().getAdapter(ILaunchConfiguration.class)); - IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); - IRemoteConnectionType localServices = remoteManager.getLocalConnectionType(); - IRemoteConnection localConnection = localServices.getConnections().get(0); assertNotNull(manager.getActiveLaunchTarget()); - assertEquals(localConnection, manager.getActiveLaunchTarget()); + assertEquals(ILaunchTargetManager.localLaunchTargetTypeId, manager.getActiveLaunchTarget().getTypeId()); + assertEquals("Local", manager.getActiveLaunchTarget().getName()); assertNotNull(manager.getActiveLaunchMode()); assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); @@ -156,18 +163,23 @@ public class LaunchBarManagerTest { ILaunchConfigurationProvider configProvider = mock(ILaunchConfigurationProvider.class); doReturn(configProvider).when(element).createExecutableExtension("class"); + final ILaunchTargetManager targetManager = mock(ILaunchTargetManager.class); + ILaunchTarget localTarget = mock(ILaunchTarget.class); + doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); + doReturn("Local").when(localTarget).getName(); + doReturn(new ILaunchTarget[] { localTarget }).when(targetManager).getLaunchTargets(); + ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); - doReturn(launchConfig).when(configProvider).getLaunchConfiguration(eq(descriptor), - any(IRemoteConnection.class)); + doReturn(launchConfig).when(configProvider).getLaunchConfiguration(eq(descriptor), any(ILaunchTarget.class)); doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(any(ILaunchDescriptor.class), - any(IRemoteConnection.class)); + any(ILaunchTarget.class)); doAnswer(new Answer() { @Override public Boolean answer(InvocationOnMock invocation) throws Throwable { - IRemoteConnection target = (IRemoteConnection) invocation.getArguments()[1]; - return target.getConnectionType().getId().equals("org.eclipse.remote.LocalServices"); + ILaunchTarget target = (ILaunchTarget) invocation.getArguments()[1]; + return target.getTypeId().equals(ILaunchTargetManager.localLaunchTargetTypeId); } - }).when(configProvider).supports(eq(descriptor), any(IRemoteConnection.class)); + }).when(configProvider).supports(eq(descriptor), any(ILaunchTarget.class)); doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); @@ -182,17 +194,20 @@ public class LaunchBarManagerTest { ILaunchManager getLaunchManager() { return launchManager; } + + @Override + ILaunchTargetManager getLaunchTargetManager() { + return targetManager; + } + }; manager.init(); manager.launchObjectAdded(launchObject); assertEquals(descriptor, manager.getActiveLaunchDescriptor()); assertEquals(runMode, manager.getActiveLaunchMode()); - IRemoteServicesManager remoteManager = Activator.getService(IRemoteServicesManager.class); - IRemoteConnectionType localServices = remoteManager.getLocalConnectionType(); - IRemoteConnection localConnection = localServices.getConnections().get(0); - assertNotNull(localConnection); - assertEquals(localConnection, manager.getActiveLaunchTarget()); + assertEquals(ILaunchTargetManager.localLaunchTargetTypeId, manager.getActiveLaunchTarget().getTypeId()); + assertEquals("Local", manager.getActiveLaunchTarget().getName()); assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); } From 503a393e4eafcd770aeef1c211f778b1d968b813 Mon Sep 17 00:00:00 2001 From: elaskavaia Date: Thu, 5 Nov 2015 15:42:17 -0500 Subject: [PATCH 060/198] launchbar - widget is disposed exception Change-Id: I059f5f30d34ab8858fdf6ac61d513f912a56ea19 --- .../org/eclipse/launchbar/ui/internal/controls/CSelector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index b98b5ccc911..cf84e2733fb 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -464,10 +464,10 @@ public abstract class CSelector extends Composite { if (buttonComposite != null) { buttonComposite.setToolTipText(toolTipText); } - if (currentLabel != null) { + if (currentLabel != null && !currentLabel.isDisposed()) { currentLabel.setToolTipText(toolTipText); } - if (currentIcon != null) { + if (currentIcon != null && !currentIcon.isDisposed()) { currentIcon.setToolTipText(toolTipText); } } From d5c63d386c130cfaf4495122cf055e6d4e46c24c Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 9 Nov 2015 10:27:07 -0500 Subject: [PATCH 061/198] [launchbar] Support launching without a target - we should not make assumption about the target and let delegate deal with it. For example if no targets are created and you run for the first time, delegate can offer to create a target - also if launch bar participants don't care about targets at all we should be able to still show modes, etc - so I removed filters on null target and let participant deal with it (note null target is not the same as Local). To avoid NPEs null target is actually an object ILaunchTarget.NULL_TARGET Change-Id: Ie2a4d3430284adbb137a4565d9976a0ba554d41f --- .../launchbar/core/internal/LaunchBarManager.java | 11 +++++------ .../eclipse/launchbar/core/target/ILaunchTarget.java | 8 +++++--- .../ui/internal/controls/TargetSelector.java | 5 ++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 4fef96cea76..312dd7e4940 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -490,7 +490,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } private void syncActiveMode() throws CoreException { - if (activeLaunchDesc == null || activeLaunchTarget == null) { + if (activeLaunchDesc == null) { setActiveLaunchMode(null); return; } @@ -574,9 +574,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } public ILaunchMode[] getLaunchModes() throws CoreException { - if (activeLaunchTarget == null) { - return new ILaunchMode[0]; - } ILaunchConfigurationType configType = getLaunchConfigurationType(activeLaunchDesc, activeLaunchTarget); if (configType == null) return new ILaunchMode[0]; @@ -689,6 +686,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } public void setActiveLaunchTarget(ILaunchTarget target) throws CoreException { + if (target == null) + target = ILaunchTarget.NULL_TARGET; if (activeLaunchTarget == target) { return; } @@ -699,7 +698,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } private void storeLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target) { - if (target == null) { + if (target == null || target == ILaunchTarget.NULL_TARGET) { // no point storing null, if stored id is invalid it won't be used // anyway return; @@ -722,7 +721,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { List targets = getLaunchTargets(descriptor); - return targets.isEmpty() ? null : targets.get(0); + return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(0); } public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 147a9072187..99817fc4689 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -8,26 +8,28 @@ package org.eclipse.launchbar.core.target; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.launchbar.core.internal.target.LaunchTarget; /** * A launch target is a thing that a launch will run on. Launch targets are * simple objects with the intention that the launch delegates and launches will * adapt this object to an object that will assist in performing the launch. - * + * * @noimplement not to be implemented by clients */ public interface ILaunchTarget extends IAdaptable { + public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---"); /** * The name of the target. - * + * * @return name of the target */ String getName(); /** * The type of the target. - * + * * @return type of the target */ String getTypeId(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index eacbac7f41d..cbbf39ebd6b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -49,7 +49,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { private final ILaunchTargetUIManager targetUIManager = Activator.getService(ILaunchTargetUIManager.class); private final ILaunchTargetManager targetManager = Activator.getService(ILaunchTargetManager.class); - private static final String[] noTargets = new String[] { "---" }; //$NON-NLS-1$ + private static final ILaunchTarget[] noTargets = new ILaunchTarget[] { ILaunchTarget.NULL_TARGET }; public TargetSelector(Composite parent, int style) { super(parent, style); @@ -89,6 +89,9 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { @Override public Image getImage(Object element) { + if (element == ILaunchTarget.NULL_TARGET) { + return null; + } if (element instanceof ILaunchTarget) { // TODO apply a status overlay ILaunchTarget target = (ILaunchTarget) element; From 9435e1f80271259498718def690a9a48a676aba2 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 23 Nov 2015 12:16:14 -0500 Subject: [PATCH 062/198] launchbar: fixing colors to be compatible with skinning it looked awful in dark skin, now it should be inheriting system colors properly Change-Id: If963a19651ac30b20c7a2cb100b285f33f799ca9 --- .../ui/internal/controls/CSelector.java | 36 +++++++++---------- .../ui/internal/controls/ConfigSelector.java | 20 +++++++---- .../controls/LaunchBarListViewer.java | 25 ++++++------- 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index cf84e2733fb..3c84cd069e7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -62,17 +62,12 @@ public abstract class CSelector extends Composite { private static final int arrowMax = 2; private Transition arrowTransition; private Object selection; - protected final Color backgroundColor; - protected final Color outlineColor; - protected final Color highlightColor; - protected final Color white; private boolean mouseOver; private Label currentIcon; private Label currentLabel; private Shell popup; private LaunchBarListViewer listViewer; private Job delayJob; - private MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(MouseEvent event) { @@ -91,7 +86,6 @@ public abstract class CSelector extends Composite { } return control == this; } - private Listener focusOutListener = new Listener() { private Job closingJob; @@ -121,7 +115,6 @@ public abstract class CSelector extends Composite { protected IStatus run(IProgressMonitor monitor) { if (monitor.isCanceled()) return Status.CANCEL_STATUS; - closePopup(); closingJob = null; return Status.OK_STATUS; @@ -141,23 +134,20 @@ public abstract class CSelector extends Composite { } } } - }; public CSelector(Composite parent, int style) { super(parent, style); - backgroundColor = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); - outlineColor = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); - highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); - white = getDisplay().getSystemColor(SWT.COLOR_WHITE); + setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); + GridLayout mainButtonLayout = new GridLayout(); setLayout(mainButtonLayout); addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { GC gc = e.gc; - gc.setBackground(backgroundColor); - gc.setForeground(outlineColor); + gc.setBackground(getBackground()); + gc.setForeground(getOutlineColor()); Point size = getSize(); final int arc = 3; gc.fillRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); @@ -226,7 +216,7 @@ public abstract class CSelector extends Composite { buttonLayout.marginHeight = buttonLayout.marginWidth = 0; buttonComposite.setLayout(buttonLayout); buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - buttonComposite.setBackground(backgroundColor); + buttonComposite.setBackground(getBackground()); buttonComposite.addMouseListener(mouseListener); buttonComposite.setToolTipText(toolTipText); if (element != null) { @@ -253,7 +243,8 @@ public abstract class CSelector extends Composite { } }; arrow.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); - arrow.setBackground(backgroundColor); + arrow.setBackground(getBackground()); + arrow.setForeground(getForeground()); arrowTransition = new Transition(arrow, arrowMax, 80); arrow.addPaintListener(new PaintListener() { @Override @@ -275,7 +266,7 @@ public abstract class CSelector extends Composite { if (editable) { final EditButton editButton = new EditButton(buttonComposite, SWT.NONE); editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); - editButton.setBackground(backgroundColor); + editButton.setBackground(getBackground()); editButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -314,7 +305,7 @@ public abstract class CSelector extends Composite { } popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP | SWT.RESIZE); popup.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); - + popup.setBackground(getBackground()); listViewer = new LaunchBarListViewer(popup); initializeListViewer(listViewer); listViewer.setFilterVisible(elements.length > 7); @@ -337,7 +328,6 @@ public abstract class CSelector extends Composite { Rectangle buttonBounds = getBounds(); Point popupLocation = popup.getDisplay().map(this, null, 0, buttonBounds.height); popup.setLocation(popupLocation.x, popupLocation.y + 5); - restoreShellSize(); popup.setVisible(true); popup.setFocus(); @@ -352,7 +342,6 @@ public abstract class CSelector extends Composite { getDisplay().removeFilter(SWT.MouseUp, focusOutListener); saveShellSize(); } - }); } @@ -541,4 +530,11 @@ public abstract class CSelector extends Composite { // nothing to do here } + public Color getOutlineColor() { + return getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); + } + + public Color getHighlightColor() { + return getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); + } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 5e648b536df..9a10dc1c384 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -38,6 +38,7 @@ import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; @@ -49,9 +50,9 @@ import org.eclipse.swt.widgets.Label; public class ConfigSelector extends CSelector { private LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); private DefaultDescriptorLabelProvider defaultProvider; - + private static final String[] noConfigs = new String[] { Messages.ConfigSelector_0 }; - + public ConfigSelector(Composite parent, int style) { super(parent, style); @@ -173,13 +174,13 @@ public class ConfigSelector extends CSelector { GridLayout buttonLayout = new GridLayout(); buttonLayout.marginWidth = buttonLayout.marginHeight = 7; createButton.setLayout(buttonLayout); - createButton.setBackground(backgroundColor); + createButton.setBackground(getBackground()); createButton.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { Point size = createButton.getSize(); GC gc = e.gc; - gc.setForeground(outlineColor); + gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); gc.drawLine(0, 0, size.x, 0); } }); @@ -187,14 +188,16 @@ public class ConfigSelector extends CSelector { final Label createLabel = new Label(createButton, SWT.None); createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); createLabel.setText(Messages.ConfigSelector_2); - createLabel.setBackground(backgroundColor); + createLabel.setBackground(getBackground()); MouseListener mouseListener = new MouseAdapter() { + @Override public void mouseUp(org.eclipse.swt.events.MouseEvent e) { final NewLaunchConfigWizard wizard = new NewLaunchConfigWizard(); WizardDialog dialog = new WizardDialog(getShell(), wizard); if (dialog.open() == Window.OK) { new Job(Messages.ConfigSelector_3) { + @Override protected IStatus run(IProgressMonitor monitor) { try { wizard.getWorkingCopy().doSave(); @@ -214,11 +217,13 @@ public class ConfigSelector extends CSelector { MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { + Color highlightColor = getHighlightColor(); createButton.setBackground(highlightColor); createLabel.setBackground(highlightColor); } @Override public void mouseExit(MouseEvent e) { + Color backgroundColor = getBackground(); createButton.setBackground(backgroundColor); createLabel.setBackground(backgroundColor); } @@ -238,9 +243,10 @@ public class ConfigSelector extends CSelector { element = noConfigs[0]; super.setSelection(element); } - + + @Override public void openPopup() { super.openPopup(); } - + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 8c510834789..bc57b740c95 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -172,9 +172,6 @@ public class LaunchBarListViewer extends StructuredViewer { private Label label; protected EditButton editButton; private int index; - private Color backgroundColor = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); - private Color outlineColor = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); - private Color highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); private ILabelProvider labelProvider; @Override @@ -187,12 +184,13 @@ public class LaunchBarListViewer extends StructuredViewer { this.index = index; this.labelProvider = labelProvider; setData(element); + setBackground(getParent().getBackground()); addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { Point size = getSize(); GC gc = e.gc; - gc.setForeground(outlineColor); + gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); gc.drawLine(0, size.y - 1, size.x, size.y - 1); if (label == null) lazyInit(); @@ -240,17 +238,17 @@ public class LaunchBarListViewer extends StructuredViewer { addTraverseListener(listItemTraverseListener); addKeyListener(lisItemKeyListener); - setBackground(backgroundColor); + layout(true); } public void setSelected(boolean selected) { if (selected) { - setBackground(highlightColor); + setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION)); int idx = getIndex(); if (idx != selIndex) { if (selIndex >= 0) { - listItems[selIndex].setBackground(backgroundColor); + listItems[selIndex].setBackground(getParent().getBackground()); scrollBucket = Math.max(Math.min(scrollBucket + idx - selIndex, maxScrollBucket), 0); } else { // initially scrollBucket = Math.min(idx, maxScrollBucket); @@ -258,7 +256,7 @@ public class LaunchBarListViewer extends StructuredViewer { } selIndex = idx; } else { - setBackground(backgroundColor); + setBackground(getParent().getBackground()); } if (editButton != null) { editButton.setSelected(selected); @@ -340,10 +338,13 @@ public class LaunchBarListViewer extends StructuredViewer { public LaunchBarListViewer(Composite parent) { filterControl = new FilterControl(parent); + filterControl.setBackground(parent.getBackground()); listScrolled = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.NO_BACKGROUND); listScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); listScrolled.setExpandHorizontal(true); + listScrolled.setBackground(parent.getBackground()); listComposite = new Composite(listScrolled, SWT.NONE); + listComposite.setBackground(parent.getBackground()); listScrolled.setContent(listComposite); listComposite.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); selIndex = -1; @@ -394,8 +395,8 @@ public class LaunchBarListViewer extends StructuredViewer { public void mouseDoubleClick(MouseEvent e) { // ignore } - - + + }); sash.setToolTipText(Messages.LaunchBarListViewer_0); } @@ -577,7 +578,7 @@ public class LaunchBarListViewer extends StructuredViewer { /** * Returns top element (provider element) in the begging on non-history list - * + * * @return */ public Object getTopFilteredElement() { @@ -603,7 +604,7 @@ public class LaunchBarListViewer extends StructuredViewer { /** * ViewerComparator comparator labels of elements by default - * + * * @param comp */ public void setHistoryComparator(ViewerComparator comp) { From 632980a73ada9f68fef8410bd85cfe9aa3bcba51 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 24 Nov 2015 13:56:19 -0500 Subject: [PATCH 063/198] Bug 482938 - Pass LaunchTarget to launch delegates. Creates a new standard delegate that implements the targeted launch delegate interface introduced earlier. Also provided a standard launch object that stores the launch target to be launched on. Adds storing of the config to target mapping in the launch target manager. Sets that mapping as close to build/launch time as we can. Change-Id: I78a1412af043f0be240d5617fcfc08b81c3fb3ea --- .../launchbar/core/internal/Activator.java | 21 ++++- .../core/internal/LaunchBarManager.java | 9 ++- .../internal/target/LaunchTargetManager.java | 24 ++++++ .../core/target/ILaunchTargetManager.java | 21 +++++ .../LaunchConfigurationTargetedDelegate.java | 81 +++++++++++++++++++ .../core/target/launch/TargetedLaunch.java | 34 ++++++++ .../commands/BuildActiveCommandHandler.java | 38 +++++++-- .../commands/LaunchActiveCommandHandler.java | 31 +++---- 8 files changed, 228 insertions(+), 31 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index 80b6cccacc9..5fbca406d0b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -26,22 +26,39 @@ public class Activator extends Plugin { public static final String PLUGIN_ID = "org.eclipse.launchbar.core"; //$NON-NLS-1$ private static Activator plugin; + private static LaunchTargetManager launchTargetManager; + private static LaunchBarManager launchBarManager; + public void start(BundleContext bundleContext) throws Exception { super.start(bundleContext); plugin = this; - bundleContext.registerService(ILaunchTargetManager.class, new LaunchTargetManager(), null); - bundleContext.registerService(ILaunchBarManager.class, new LaunchBarManager(), null); + + launchTargetManager = new LaunchTargetManager(); + bundleContext.registerService(ILaunchTargetManager.class, launchTargetManager, null); + + launchBarManager = new LaunchBarManager(); + bundleContext.registerService(ILaunchBarManager.class, launchBarManager, null); } public void stop(BundleContext bundleContext) throws Exception { super.stop(bundleContext); plugin = null; + launchTargetManager = null; + launchBarManager = null; } public static Activator getDefault() { return plugin; } + public static LaunchBarManager getLaunchBarManager() { + return launchBarManager; + } + + public static LaunchTargetManager getLaunchTargetManager() { + return launchTargetManager; + } + /** * Return the OSGi service with the given service interface. * diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 312dd7e4940..67738817eb0 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -725,7 +725,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { - return getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); + ILaunchConfiguration configuration = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); + + // This is the only concrete time we have the mapping from launch + // configuration to launch target. Record it in the target manager for + // the launch delegates to use. + launchTargetManager.setDefaultLaunchTarget(configuration, activeLaunchTarget); + + return configuration; } public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index d08ce033232..69fefabb0a9 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetListener; @@ -198,6 +199,29 @@ public class LaunchTargetManager implements ILaunchTargetManager { } } + @Override + public ILaunchTarget getDefaultLaunchTarget(ILaunchConfiguration configuration) { + Preferences prefs = getTargetsPref().node("configs"); //$NON-NLS-1$ + String targetId = prefs.get(configuration.getName(), null); + if (targetId != null) { + String[] parts = targetId.split(":"); //$NON-NLS-1$ + return getLaunchTarget(parts[0], parts[1]); + } + return null; + } + + @Override + public void setDefaultLaunchTarget(ILaunchConfiguration configuration, ILaunchTarget target) { + Preferences prefs = getTargetsPref().node("configs"); //$NON-NLS-1$ + String targetId = String.join(":", target.getTypeId(), target.getName()); //$NON-NLS-1$ + prefs.put(configuration.getName(), targetId); + try { + prefs.flush(); + } catch (BackingStoreException e) { + Activator.log(e); + } + } + @Override public void addListener(ILaunchTargetListener listener) { listeners.add(listener); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java index 86dbe5e4ff4..4e792874287 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java @@ -7,6 +7,8 @@ *******************************************************************************/ package org.eclipse.launchbar.core.target; +import org.eclipse.debug.core.ILaunchConfiguration; + /** * The manager for the launch targets. It is registered as an OSGi service. * @@ -84,6 +86,25 @@ public interface ILaunchTargetManager { */ void targetStatusChanged(ILaunchTarget target); + /** + * What is the default target to use for this launch configuration. + * + * @param configuration + * launch configuration or null if not set + * @return default target for this launch configuration + */ + ILaunchTarget getDefaultLaunchTarget(ILaunchConfiguration configuration); + + /** + * Set the default target for the given launch configuraiton. + * + * @param configuration + * launch configuration + * @param target + * default target for this launch configuration + */ + void setDefaultLaunchTarget(ILaunchConfiguration configuration, ILaunchTarget target); + /** * Add a listener. * diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java new file mode 100644 index 00000000000..4ee845742dd --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target.launch; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.model.LaunchConfigurationDelegate; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * An implementation of the ILaunchConfigurationTargetedDelegate. + * + * Implements the ILaunchConfigurationDelegate2 interfaces to pick out the + * default target and pass it the targeted delegate methods. + * + * The default for the targeted delegate methods is to call the non targeted + * methods in the super class. + * + */ +public abstract class LaunchConfigurationTargetedDelegate extends LaunchConfigurationDelegate + implements ILaunchConfigurationTargetedDelegate { + + @Override + public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException { + ILaunchTarget target = Activator.getLaunchTargetManager().getDefaultLaunchTarget(configuration); + return getLaunch(configuration, mode, target); + } + + @Override + public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) + throws CoreException { + ILaunchTarget target = Activator.getLaunchTargetManager().getDefaultLaunchTarget(configuration); + return buildForLaunch(configuration, mode, target, monitor); + } + + @Override + public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, ILaunchTarget target, + IProgressMonitor monitor) throws CoreException { + return super.buildForLaunch(configuration, mode, monitor); + } + + public boolean superBuildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) + throws CoreException { + return super.buildForLaunch(configuration, mode, monitor); + } + + @Override + public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) + throws CoreException { + ILaunchTarget target = Activator.getLaunchTargetManager().getDefaultLaunchTarget(configuration); + return preLaunchCheck(configuration, mode, target, monitor); + } + + @Override + public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, ILaunchTarget target, + IProgressMonitor monitor) throws CoreException { + return super.preLaunchCheck(configuration, mode, monitor); + } + + @Override + public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) + throws CoreException { + ILaunchTarget target = Activator.getLaunchTargetManager().getDefaultLaunchTarget(configuration); + return finalLaunchCheck(configuration, mode, target, monitor); + } + + @Override + public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, ILaunchTarget target, + IProgressMonitor monitor) throws CoreException { + return super.finalLaunchCheck(configuration, mode, monitor); + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java new file mode 100644 index 00000000000..e022e7b9c37 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target.launch; + +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.Launch; +import org.eclipse.debug.core.model.ISourceLocator; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * A ITargetedLaunch implementation that simply extends the standard Launch + * class to store the launch target. + */ +public class TargetedLaunch extends Launch implements ITargetedLaunch { + + private final ILaunchTarget launchTarget; + + public TargetedLaunch(ILaunchConfiguration launchConfiguration, String mode, ILaunchTarget launchTarget, + ISourceLocator locator) { + super(launchConfiguration, mode, locator); + this.launchTarget = launchTarget; + } + + @Override + public ILaunchTarget getLaunchTarget() { + return launchTarget; + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index 2c26c8be95a..e37b944353e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -35,6 +35,8 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.launch.ILaunchConfigurationTargetedDelegate; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.widgets.Display; @@ -55,8 +57,9 @@ public class BuildActiveCommandHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { try { LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - final ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); - final ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); + ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + ILaunchTarget target = launchBarManager.getActiveLaunchTarget(); new UIJob(Display.getDefault(), Messages.BuildActiveCommandHandler_0) { @Override @@ -71,12 +74,18 @@ public class BuildActiveCommandHandler extends AbstractHandler { } new Job(Messages.BuildActiveCommandHandler_1) { + @Override + public boolean belongsTo(Object family) { + return ResourcesPlugin.FAMILY_MANUAL_BUILD.equals(family); + } + @Override protected IStatus run(IProgressMonitor monitor) { try { if (config == null) { // Default, build the workspace - ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); + ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, + monitor); return Status.OK_STATUS; } @@ -87,8 +96,18 @@ public class BuildActiveCommandHandler extends AbstractHandler { if (delegate == null) delegate = config.getType().getDelegates(modes)[0]; ILaunchConfigurationDelegate configDel = delegate.getDelegate(); - if (configDel instanceof ILaunchConfigurationDelegate2) { - ILaunchConfigurationDelegate2 configDel2 = (ILaunchConfigurationDelegate2)configDel; + if (configDel instanceof ILaunchConfigurationTargetedDelegate) { + ILaunchConfigurationTargetedDelegate configDel2 = (ILaunchConfigurationTargetedDelegate) configDel; + boolean ret; + ret = configDel2.preLaunchCheck(config, mode, target, monitor); + if (!ret) { + return Status.CANCEL_STATUS; + } + if (!configDel2.buildForLaunch(config, mode, target, monitor)) { + return Status.OK_STATUS; + } + } else if (configDel instanceof ILaunchConfigurationDelegate2) { + ILaunchConfigurationDelegate2 configDel2 = (ILaunchConfigurationDelegate2) configDel; boolean ret; ret = configDel2.preLaunchCheck(config, mode, monitor); if (!ret) { @@ -101,12 +120,15 @@ public class BuildActiveCommandHandler extends AbstractHandler { // Fall through, do a normal build if (projects.isEmpty()) { - ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); + ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, + monitor); } else { Collection buildConfigs = getBuildConfigs(projects); - ResourcesPlugin.getWorkspace().build(buildConfigs.toArray(new IBuildConfiguration[buildConfigs.size()]), + ResourcesPlugin.getWorkspace().build( + buildConfigs.toArray(new IBuildConfiguration[buildConfigs.size()]), IncrementalProjectBuilder.INCREMENTAL_BUILD, true, monitor); - // TODO, may need to get the buildReferences argument from the descriptor + // TODO, may need to get the buildReferences + // argument from the descriptor } return Status.OK_STATUS; } catch (CoreException e) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java index 3373ce19dfc..78e91221edd 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -14,42 +14,33 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.ui.DebugUITools; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.progress.UIJob; public class LaunchActiveCommandHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { - new UIJob(Display.getDefault(), "Launching Active Configuration") { - public IStatus runInUIThread(IProgressMonitor monitor) { - try { - LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); - if (config == null) - return Status.OK_STATUS; - ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); - DebugUITools.launch(config, launchMode.getIdentifier()); - } catch (CoreException e) { - return e.getStatus(); - } + try { + LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); + if (config == null) return Status.OK_STATUS; - }; - }.schedule(); + ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + DebugUITools.launch(config, launchMode.getIdentifier()); - return Status.OK_STATUS; + return Status.OK_STATUS; + } catch (CoreException e) { + return e.getStatus(); + } } protected String getMode(ILaunchMode launchMode) { - return launchMode.getIdentifier(); //$NON-NLS-1$ + return launchMode.getIdentifier(); } } From 1df3be627f2056ca74972149c3ba0ceef60c0b31 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 23 Nov 2015 16:43:23 -0500 Subject: [PATCH 064/198] launchbar: API to get text of the custom control for UI testing Change-Id: I8824070c562dc830b6791e6e7670ed9ebf42b758 --- .../launchbar/ui/internal/controls/CSelector.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 3c84cd069e7..2d581782a2c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -514,6 +514,16 @@ public abstract class CSelector extends Composite { } } + /** + * Returns the text currently visible in the selector + */ + public String getText() { + if (currentLabel != null) { + currentLabel.getText(); + } + return ""; + } + protected boolean hasActionArea() { return false; } From 7b5cdff64f8f0540989d67327b89bea8be7d25f3 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 26 Nov 2015 16:10:37 -0500 Subject: [PATCH 065/198] Bug 482938 - Add missing getLaunch method to return the TargetedLaunch. Change-Id: Ifea22b29a24e7afbdd6e60f7e32369b29fe11a5c --- .../target/launch/LaunchConfigurationTargetedDelegate.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java index 4ee845742dd..53976bbfd47 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java @@ -34,6 +34,12 @@ public abstract class LaunchConfigurationTargetedDelegate extends LaunchConfigur return getLaunch(configuration, mode, target); } + @Override + public ITargetedLaunch getLaunch(ILaunchConfiguration configuration, String mode, ILaunchTarget target) + throws CoreException { + return new TargetedLaunch(configuration, mode, target, null); + } + @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { From b63caf6c7221fabb9f9becee8f667d1f74a58bc0 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 11 Dec 2015 16:17:33 -0500 Subject: [PATCH 066/198] launchbar: fixed some visual glitches in custom widget list - list background was not inherited creating spotty list - removed rectangle around list items which was very custom and non stylable - removed paint lister after lazy item initialization to prevent lag Change-Id: I4e458c816dcb96138871b906e43806b0cf2e72e8 --- .../ui/internal/controls/LaunchBarListViewer.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index bc57b740c95..7f667d91989 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -46,7 +46,6 @@ import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -184,19 +183,16 @@ public class LaunchBarListViewer extends StructuredViewer { this.index = index; this.labelProvider = labelProvider; setData(element); - setBackground(getParent().getBackground()); + setBackground(parent.getBackground()); addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { - Point size = getSize(); - GC gc = e.gc; - gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); - gc.drawLine(0, size.y - 1, size.x, size.y - 1); - if (label == null) + removePaintListener(this); + if (label == null) { lazyInit(); + } } }); - // lazyInit(); } // end ListItem(..) protected void lazyInit() { @@ -321,6 +317,7 @@ public class LaunchBarListViewer extends StructuredViewer { } }); } + icon.setBackground(parent.getBackground()); return icon; } @@ -332,6 +329,7 @@ public class LaunchBarListViewer extends StructuredViewer { if (labelProvider instanceof IFontProvider) { label.setFont(((IFontProvider) labelProvider).getFont(element)); } + label.setBackground(parent.getBackground()); return label; } } // end ListItem class From 2b373042a4c47763fd9a5ed2f067f3c65e3742cf Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 29 Dec 2015 18:29:56 -0500 Subject: [PATCH 067/198] Bug 484993 - Add support for IRemoteConnection launch targets. Creates a new core plug-in that bridges the gap between ILaunchTarget and IRemoteConnection. Also adds unique id's to ILaunchTarget that are separate from the user visible name. This is to allow for unique names in o.e.remote which include the connection type and the connection name. The launch target type is for all o.e.remote targets. Change-Id: I08d4c3534fc0947f946bfcdec3f13df04fc4ec98 --- .../core/ProjectLaunchConfigProvider.java | 90 +++++++++++++++++++ .../core/internal/LaunchBarManager.java | 4 +- .../core/internal/target/LaunchTarget.java | 17 ++-- .../internal/target/LaunchTargetManager.java | 35 +++++--- .../target/LocalLaunchTargetProvider.java | 3 +- .../launchbar/core/target/ILaunchTarget.java | 11 ++- .../core/target/ILaunchTargetManager.java | 28 ++++-- .../.classpath | 7 ++ .../.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../META-INF/MANIFEST.MF | 12 +++ .../about.html | 24 +++++ .../build.properties | 6 ++ .../plugin.xml | 22 +++++ .../remote/core/internal/Activator.java | 56 ++++++++++++ .../remote/core/internal/Messages.java | 23 +++++ .../internal/RemoteConnectionListener.java | 38 ++++++++ .../internal/RemoteLaunchTargetProvider.java | 64 +++++++++++++ .../internal/RemoteTargetAdapterFactory.java | 43 +++++++++ .../remote/core/internal/messages.properties | 9 ++ 20 files changed, 500 insertions(+), 27 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java create mode 100644 bundles/org.eclipse.launchbar.remote.core/.classpath create mode 100644 bundles/org.eclipse.launchbar.remote.core/.project create mode 100644 bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF create mode 100644 bundles/org.eclipse.launchbar.remote.core/about.html create mode 100644 bundles/org.eclipse.launchbar.remote.core/build.properties create mode 100644 bundles/org.eclipse.launchbar.remote.core/plugin.xml create mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java create mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java create mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java create mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java create mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java create mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java new file mode 100644 index 00000000000..7d3dae8bb00 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +public abstract class ProjectLaunchConfigProvider extends AbstractLaunchConfigProvider { + + private Map configs = new HashMap<>(); + + @Override + public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) + throws CoreException { + ILaunchConfiguration config = null; + IProject project = descriptor.getAdapter(IProject.class); + if (project != null) { + config = configs.get(project); + if (config == null) { + config = createLaunchConfiguration(descriptor, target); + // launch config added will get called below to add it to the + // configs map + } + } + return config; + } + + @Override + protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target, + ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { + super.populateLaunchConfiguration(descriptor, target, workingCopy); + + // Set the project + workingCopy.setMappedResources(new IResource[] { descriptor.getAdapter(IProject.class) }); + } + + @Override + public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException { + if (ownsLaunchConfiguration(configuration)) { + IProject project = configuration.getMappedResources()[0].getProject(); + configs.put(project, configuration); + return true; + } + return false; + } + + @Override + public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException { + for (Entry entry : configs.entrySet()) { + if (configuration.equals(entry.getValue())) { + configs.remove(entry.getKey()); + return true; + } + } + return false; + } + + @Override + public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException { + return false; + } + + @Override + public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException { + IProject project = descriptor.getAdapter(IProject.class); + if (project != null) { + configs.remove(project); + } + } + + @Override + public void launchTargetRemoved(ILaunchTarget target) throws CoreException { + // nothing to do since this provider isn't associated with a single + // target. + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 67738817eb0..5f5e48d08f1 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -730,7 +730,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene // This is the only concrete time we have the mapping from launch // configuration to launch target. Record it in the target manager for // the launch delegates to use. - launchTargetManager.setDefaultLaunchTarget(configuration, activeLaunchTarget); + if (configuration != null) { + launchTargetManager.setDefaultLaunchTarget(configuration, activeLaunchTarget); + } return configuration; } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index 49c6e4ef0b3..a5b7da1f75a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -13,13 +13,20 @@ import org.eclipse.launchbar.core.target.ILaunchTarget; public class LaunchTarget extends PlatformObject implements ILaunchTarget { private final String typeId; + private final String id; private final String name; - public LaunchTarget(String typeId, String name) { + public LaunchTarget(String typeId, String id, String name) { this.typeId = typeId; + this.id = id; this.name = name; } + @Override + public String getId() { + return id; + } + @Override public String getName() { return name; @@ -34,7 +41,7 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((typeId == null) ? 0 : typeId.hashCode()); return result; } @@ -48,10 +55,10 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { if (getClass() != obj.getClass()) return false; LaunchTarget other = (LaunchTarget) obj; - if (name == null) { - if (other.name != null) + if (id == null) { + if (other.id != null) return false; - } else if (!name.equals(other.name)) + } else if (!id.equals(other.id)) return false; if (typeId == null) { if (other.typeId != null) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 69fefabb0a9..26a6b9640a9 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -12,6 +12,7 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -37,7 +38,9 @@ public class LaunchTargetManager implements ILaunchTargetManager { private Map typeProviders = new HashMap<>(); private List listeners = new LinkedList<>(); - private static final String DELIMETER = ","; //$NON-NLS-1$ + private static final String DELIMETER1 = ","; //$NON-NLS-1$ + private static final String DELIMETER2 = "!"; //$NON-NLS-1$ + private static final String DELIMETER3 = ":"; //$NON-NLS-1$ private Preferences getTargetsPref() { return InstanceScope.INSTANCE.getNode(Activator.getDefault().getBundle().getSymbolicName()) @@ -71,8 +74,13 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.put(typeId, type); } - for (String name : prefs.get(typeId, "").split(DELIMETER)) { //$NON-NLS-1$ - type.put(name, new LaunchTarget(typeId, name)); + for (String name : prefs.get(typeId, "").split(DELIMETER1)) { //$NON-NLS-1$ + if (name.contains(DELIMETER2)) { + String[] list = name.split(DELIMETER2); + type.put(list[0], new LaunchTarget(typeId, list[0], list[1])); + } else { + type.put(name, new LaunchTarget(typeId, name, name)); + } } } } catch (BackingStoreException e) { @@ -139,11 +147,11 @@ public class LaunchTargetManager implements ILaunchTargetManager { } @Override - public ILaunchTarget getLaunchTarget(String typeId, String name) { + public ILaunchTarget getLaunchTarget(String typeId, String id) { initTargets(); Map type = targets.get(typeId); if (type != null) { - return type.get(name); + return type.get(id); } return null; } @@ -154,7 +162,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } @Override - public ILaunchTarget addLaunchTarget(String typeId, String name) { + public ILaunchTarget addLaunchTarget(String typeId, String id, String name) { initTargets(); Map type = targets.get(typeId); if (type == null) { @@ -162,9 +170,11 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.put(typeId, type); } - ILaunchTarget target = new LaunchTarget(typeId, name); - type.put(name, target); - getTargetsPref().put(typeId, String.join(DELIMETER, type.keySet())); + ILaunchTarget target = new LaunchTarget(typeId, id, name); + type.put(id, target); + + getTargetsPref().put(typeId, type.values().stream().map(t -> t.getId() + DELIMETER2 + t.getName()) + .collect(Collectors.joining(DELIMETER1))); for (ILaunchTargetListener listener : listeners) { listener.launchTargetAdded(target); @@ -183,7 +193,8 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.remove(target.getTypeId()); getTargetsPref().remove(target.getTypeId()); } else { - getTargetsPref().put(target.getTypeId(), String.join(DELIMETER, type.keySet())); + getTargetsPref().put(target.getTypeId(), type.values().stream() + .map(t -> t.getId() + DELIMETER2 + t.getName()).collect(Collectors.joining(DELIMETER1))); } for (ILaunchTargetListener listener : listeners) { @@ -204,7 +215,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { Preferences prefs = getTargetsPref().node("configs"); //$NON-NLS-1$ String targetId = prefs.get(configuration.getName(), null); if (targetId != null) { - String[] parts = targetId.split(":"); //$NON-NLS-1$ + String[] parts = targetId.split(DELIMETER3); return getLaunchTarget(parts[0], parts[1]); } return null; @@ -213,7 +224,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { @Override public void setDefaultLaunchTarget(ILaunchConfiguration configuration, ILaunchTarget target) { Preferences prefs = getTargetsPref().node("configs"); //$NON-NLS-1$ - String targetId = String.join(":", target.getTypeId(), target.getName()); //$NON-NLS-1$ + String targetId = String.join(DELIMETER3, target.getTypeId(), target.getId()); prefs.put(configuration.getName(), targetId); try { prefs.flush(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java index eb7c130e6fe..701231b83f7 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java @@ -19,7 +19,8 @@ public class LocalLaunchTargetProvider implements ILaunchTargetProvider { public void init(ILaunchTargetManager targetManager) { if (targetManager.getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name) == null) { - targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name); + targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name, + Messages.LocalTarget_name); } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 99817fc4689..3c3215a49a4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -18,10 +18,17 @@ import org.eclipse.launchbar.core.internal.target.LaunchTarget; * @noimplement not to be implemented by clients */ public interface ILaunchTarget extends IAdaptable { - public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---"); + public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "null", "---"); /** - * The name of the target. + * The id for the target. It is unique for each type. + * + * @return id for the target. + */ + String getId(); + + /** + * The user consumable name of the target. * * @return name of the target */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java index 4e792874287..db1510f6a27 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java @@ -45,11 +45,11 @@ public interface ILaunchTargetManager { * * @param typeId * type of the launch target - * @param name - * name of the launch target + * @param id + * id of the launch target * @return the launch target */ - ILaunchTarget getLaunchTarget(String typeId, String name); + ILaunchTarget getLaunchTarget(String typeId, String id); /** * Return the status of the launch target. @@ -61,7 +61,21 @@ public interface ILaunchTargetManager { TargetStatus getStatus(ILaunchTarget target); /** - * Add a launch target with the given typeId and name. + * Add a launch target with the given typeId, id, and name. + * + * @param typeId + * type id of the launch target + * @param id + * id for the target. + * @param name + * name of the launch target + * @return the created launch target + */ + ILaunchTarget addLaunchTarget(String typeId, String id, String name); + + /** + * Add a launch target with the given typeId and name. The name is also the + * id for the target. * * @param typeId * type id of the launch target @@ -69,7 +83,9 @@ public interface ILaunchTargetManager { * name of the launch target * @return the created launch target */ - ILaunchTarget addLaunchTarget(String typeId, String name); + default ILaunchTarget addLaunchTarget(String typeId, String name) { + return addLaunchTarget(typeId, name, name); + } /** * Removes a launch target. @@ -96,7 +112,7 @@ public interface ILaunchTargetManager { ILaunchTarget getDefaultLaunchTarget(ILaunchConfiguration configuration); /** - * Set the default target for the given launch configuraiton. + * Set the default target for the given launch configuration. * * @param configuration * launch configuration diff --git a/bundles/org.eclipse.launchbar.remote.core/.classpath b/bundles/org.eclipse.launchbar.remote.core/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.launchbar.remote.core/.project b/bundles/org.eclipse.launchbar.remote.core/.project new file mode 100644 index 00000000000..74f0f93e954 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.remote.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..436092919fc --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: LaunchBar Remote Core +Bundle-SymbolicName: org.eclipse.launchbar.remote.core;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.launchbar.remote.core.internal.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.launchbar.core;bundle-version="2.0.0", + org.eclipse.remote.core;bundle-version="2.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.launchbar.remote.core/about.html b/bundles/org.eclipse.launchbar.remote.core/about.html new file mode 100644 index 00000000000..d7c511887d6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/about.html @@ -0,0 +1,24 @@ + + +About + + +

About This Content

+ +

June 22, 2007

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.remote.core/build.properties b/bundles/org.eclipse.launchbar.remote.core/build.properties new file mode 100644 index 00000000000..bdcc25a2886 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.xml diff --git a/bundles/org.eclipse.launchbar.remote.core/plugin.xml b/bundles/org.eclipse.launchbar.remote.core/plugin.xml new file mode 100644 index 00000000000..d8af7c00df5 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/plugin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java new file mode 100644 index 00000000000..13fa89635b7 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.core.internal; + +import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.launchbar.remote.core"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + private static RemoteConnectionListener remoteConnectionListener; + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + remoteConnectionListener = new RemoteConnectionListener(); + getService(IRemoteServicesManager.class).addRemoteConnectionChangeListener(remoteConnectionListener); + } + + @Override + public void stop(BundleContext context) throws Exception { + getService(IRemoteServicesManager.class).removeRemoteConnectionChangeListener(remoteConnectionListener); + remoteConnectionListener = null; + + plugin = null; + super.stop(context); + } + + public static Activator getDefault() { + return plugin; + } + + public static T getService(Class service) { + BundleContext context = plugin.getBundle().getBundleContext(); + ServiceReference ref = context.getServiceReference(service); + return ref != null ? context.getService(ref) : null; + } + +} diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java new file mode 100644 index 00000000000..9ef2e4f98a3 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.core.internal; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.launchbar.remote.core.internal.messages"; //$NON-NLS-1$ + public static String RemoteLaunchTargetProvider_Closed; + public static String RemoteLaunchTargetProvider_Missing; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java new file mode 100644 index 00000000000..026b1725889 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.core.internal; + +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionChangeListener; +import org.eclipse.remote.core.RemoteConnectionChangeEvent; + +public class RemoteConnectionListener implements IRemoteConnectionChangeListener { + + private ILaunchTargetManager targetManager = Activator.getService(ILaunchTargetManager.class); + + @Override + public void connectionChanged(RemoteConnectionChangeEvent event) { + IRemoteConnection connection = event.getConnection(); + switch (event.getType()) { + case RemoteConnectionChangeEvent.CONNECTION_ADDED: + targetManager.addLaunchTarget(RemoteLaunchTargetProvider.TYPE_ID, + RemoteLaunchTargetProvider.getTargetId(connection), connection.getName()); + break; + case RemoteConnectionChangeEvent.CONNECTION_REMOVED: + ILaunchTarget target = targetManager.getLaunchTarget(RemoteLaunchTargetProvider.TYPE_ID, + RemoteLaunchTargetProvider.getTargetId(connection)); + if (target != null) { + targetManager.removeLaunchTarget(target); + } + break; + } + } + +} diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java new file mode 100644 index 00000000000..1fee2b5576f --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.core.internal; + +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.ILaunchTargetProvider; +import org.eclipse.launchbar.core.target.TargetStatus; +import org.eclipse.launchbar.core.target.TargetStatus.Code; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteServicesManager; + +public class RemoteLaunchTargetProvider implements ILaunchTargetProvider { + + static final String TYPE_ID = "org.eclipse.launchbar.remote.core.launchTargetType"; //$NON-NLS-1$ + static final String DELIMITER = "|"; //$NON-NLS-1$ + + private static final TargetStatus CLOSED = new TargetStatus(Code.ERROR, Messages.RemoteLaunchTargetProvider_Closed); + + @Override + public void init(ILaunchTargetManager targetManager) { + IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); + + // Remove missing ones + for (ILaunchTarget target : targetManager.getLaunchTargetsOfType(TYPE_ID)) { + IRemoteConnection connection = target.getAdapter(IRemoteConnection.class); + if (connection == null) { + targetManager.removeLaunchTarget(target); + } + } + + // Add new ones + // TODO filter out the Local connection? + for (IRemoteConnection connection : manager.getAllRemoteConnections()) { + String id = getTargetId(connection); + if (targetManager.getLaunchTarget(TYPE_ID, id) == null) { + targetManager.addLaunchTarget(TYPE_ID, id, connection.getName()); + } + } + } + + public static String getTargetId(IRemoteConnection connection) { + return connection.getConnectionType().getId() + DELIMITER + connection.getName(); + } + + @Override + public TargetStatus getStatus(ILaunchTarget target) { + IRemoteConnection connection = target.getAdapter(IRemoteConnection.class); + if (connection != null) { + if (connection.isOpen()) { + return TargetStatus.OK_STATUS; + } else { + return CLOSED; + } + } + return new TargetStatus(Code.ERROR, Messages.RemoteLaunchTargetProvider_Missing); + } + +} diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java new file mode 100644 index 00000000000..2bd8c032518 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.core.internal; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteServicesManager; + +public class RemoteTargetAdapterFactory implements IAdapterFactory { + + private static final IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); + + @SuppressWarnings("unchecked") + @Override + public T getAdapter(Object adaptableObject, Class adapterType) { + if (adaptableObject instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) adaptableObject; + if (target.getTypeId().equals(RemoteLaunchTargetProvider.TYPE_ID)) { + String[] list = target.getId().split("\\" + RemoteLaunchTargetProvider.DELIMITER); //$NON-NLS-1$ + if (list.length == 2) { + IRemoteConnectionType type = manager.getConnectionType(list[0]); + if (type != null) { + return (T) type.getConnection(list[1]); + } + } + } + } + return null; + } + + @Override + public Class[] getAdapterList() { + return new Class[] { IRemoteConnection.class }; + } + +} diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties new file mode 100644 index 00000000000..1cd2d0574f1 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties @@ -0,0 +1,9 @@ +#****************************************************************************** +# Copyright (c) 2015 QNX Software Systems 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 +#****************************************************************************** +RemoteLaunchTargetProvider_Closed=Closed +RemoteLaunchTargetProvider_Missing=Connection missing From b588b08034e846e1b1020e287a1918d2a61427a1 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 29 Dec 2015 18:55:11 -0500 Subject: [PATCH 068/198] Bug 484993 - Feature and build for Remote Launch Target support. Change-Id: Id07df46546e7852443377f0abd68bd8592e5f9e6 --- .../org.eclipse.launchbar.remote.core/pom.xml | 18 ++++++++++ .../org.eclipse.launchbar.remote/.project | 17 ++++++++++ .../build.properties | 1 + .../feature.properties | 33 +++++++++++++++++++ .../org.eclipse.launchbar.remote/feature.xml | 29 ++++++++++++++++ features/org.eclipse.launchbar.remote/pom.xml | 19 +++++++++++ features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- pom.xml | 4 +++ repo/category.xml | 3 ++ 10 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.remote.core/pom.xml create mode 100644 features/org.eclipse.launchbar.remote/.project create mode 100644 features/org.eclipse.launchbar.remote/build.properties create mode 100644 features/org.eclipse.launchbar.remote/feature.properties create mode 100644 features/org.eclipse.launchbar.remote/feature.xml create mode 100644 features/org.eclipse.launchbar.remote/pom.xml diff --git a/bundles/org.eclipse.launchbar.remote.core/pom.xml b/bundles/org.eclipse.launchbar.remote.core/pom.xml new file mode 100644 index 00000000000..a02aca3e5f3 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.remote.core + 1.0.0-SNAPSHOT + + eclipse-plugin + diff --git a/features/org.eclipse.launchbar.remote/.project b/features/org.eclipse.launchbar.remote/.project new file mode 100644 index 00000000000..d9d66858d17 --- /dev/null +++ b/features/org.eclipse.launchbar.remote/.project @@ -0,0 +1,17 @@ + + + org.eclipse.launchbar.remote-feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/features/org.eclipse.launchbar.remote/build.properties b/features/org.eclipse.launchbar.remote/build.properties new file mode 100644 index 00000000000..64f93a9f0b7 --- /dev/null +++ b/features/org.eclipse.launchbar.remote/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/features/org.eclipse.launchbar.remote/feature.properties b/features/org.eclipse.launchbar.remote/feature.properties new file mode 100644 index 00000000000..8ec49e9a8a8 --- /dev/null +++ b/features/org.eclipse.launchbar.remote/feature.properties @@ -0,0 +1,33 @@ +############################################################################### +# Copyright (c) 2005, 2010 IBM Corporation 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: +# IBM Corporation - initial API and implementation +############################################################################### +# features.properties +# contains externalized strings for feature.xml +# "%foo" in feature.xml corresponds to the key "foo" in this file +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file should be translated. + +# "featureName" property - name of the feature +featureName=Remote Launch Targets + +# "providerName" property - name of the company that provides the feature +providerName=Eclipse CDT + +# "description" property - description of the feature +description=Support for IRemoteConnections as ILaunchTargets + +# copyright +copyright=\ +Copyright (c) 2015 QNX Software Systems and others\n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html + diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml new file mode 100644 index 00000000000..988d9acc32c --- /dev/null +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -0,0 +1,29 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + diff --git a/features/org.eclipse.launchbar.remote/pom.xml b/features/org.eclipse.launchbar.remote/pom.xml new file mode 100644 index 00000000000..e2879f4a5fd --- /dev/null +++ b/features/org.eclipse.launchbar.remote/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.features + org.eclipse.launchbar.remote + 1.0.0-SNAPSHOT + + eclipse-feature + diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 5e8f84c18df..b985d758bfe 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index 6591751cf0d..cd2f48216b4 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 1.0.1-SNAPSHOT + 2.0.0-SNAPSHOT eclipse-feature diff --git a/pom.xml b/pom.xml index ee3c80c5ffe..937ef731652 100644 --- a/pom.xml +++ b/pom.xml @@ -70,6 +70,10 @@ bundles/org.eclipse.launchbar.ui features/org.eclipse.launchbar tests/org.eclipse.launchbar.core.tests + + bundles/org.eclipse.launchbar.remote.core + features/org.eclipse.launchbar.remote + repo diff --git a/repo/category.xml b/repo/category.xml index 348ed2527d8..2407cc4dc13 100644 --- a/repo/category.xml +++ b/repo/category.xml @@ -3,5 +3,8 @@ + + + From 7a1e27eb12b045e091e9e3eca053818129d8fadf Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 30 Dec 2015 21:59:29 -0500 Subject: [PATCH 069/198] Bug 484993 - Hook up label provider to remote launch target Since we're using label providers to provide the name and image for ILaunchTargets, we don't need the dual id, name in the launch target. Switching to id instead of name tho. Change-Id: I96071cfd40873494d4cf73f0e845d62bc46ea1cb --- .../core/internal/target/LaunchTarget.java | 9 +-- .../internal/target/LaunchTargetManager.java | 28 ++++------ .../target/LocalLaunchTargetProvider.java | 3 +- .../launchbar/core/target/ILaunchTarget.java | 10 +++- .../core/target/ILaunchTargetManager.java | 18 +----- .../META-INF/MANIFEST.MF | 1 + .../internal/RemoteConnectionListener.java | 2 +- .../internal/RemoteLaunchTargetProvider.java | 6 +- .../.classpath | 7 +++ .../org.eclipse.launchbar.remote.ui/.project | 28 ++++++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 +++ .../META-INF/MANIFEST.MF | 16 ++++++ .../build.properties | 5 ++ .../plugin.xml | 12 ++++ .../remote/ui/internal/Activator.java | 47 ++++++++++++++++ .../RemoteLaunchTargetLabelProvider.java | 55 +++++++++++++++++++ 16 files changed, 203 insertions(+), 51 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.classpath create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.project create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF create mode 100644 bundles/org.eclipse.launchbar.remote.ui/build.properties create mode 100644 bundles/org.eclipse.launchbar.remote.ui/plugin.xml create mode 100644 bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java create mode 100644 bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index a5b7da1f75a..55ab598d645 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -14,12 +14,10 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { private final String typeId; private final String id; - private final String name; - public LaunchTarget(String typeId, String id, String name) { + public LaunchTarget(String typeId, String id) { this.typeId = typeId; this.id = id; - this.name = name; } @Override @@ -27,11 +25,6 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { return id; } - @Override - public String getName() { - return name; - } - @Override public String getTypeId() { return typeId; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 26a6b9640a9..d485a0d130c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -39,8 +39,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { private List listeners = new LinkedList<>(); private static final String DELIMETER1 = ","; //$NON-NLS-1$ - private static final String DELIMETER2 = "!"; //$NON-NLS-1$ - private static final String DELIMETER3 = ":"; //$NON-NLS-1$ + private static final String DELIMETER2 = ":"; //$NON-NLS-1$ private Preferences getTargetsPref() { return InstanceScope.INSTANCE.getNode(Activator.getDefault().getBundle().getSymbolicName()) @@ -75,12 +74,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } for (String name : prefs.get(typeId, "").split(DELIMETER1)) { //$NON-NLS-1$ - if (name.contains(DELIMETER2)) { - String[] list = name.split(DELIMETER2); - type.put(list[0], new LaunchTarget(typeId, list[0], list[1])); - } else { - type.put(name, new LaunchTarget(typeId, name, name)); - } + type.put(name, new LaunchTarget(typeId, name)); } } } catch (BackingStoreException e) { @@ -162,7 +156,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } @Override - public ILaunchTarget addLaunchTarget(String typeId, String id, String name) { + public ILaunchTarget addLaunchTarget(String typeId, String id) { initTargets(); Map type = targets.get(typeId); if (type == null) { @@ -170,11 +164,11 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.put(typeId, type); } - ILaunchTarget target = new LaunchTarget(typeId, id, name); + ILaunchTarget target = new LaunchTarget(typeId, id); type.put(id, target); - getTargetsPref().put(typeId, type.values().stream().map(t -> t.getId() + DELIMETER2 + t.getName()) - .collect(Collectors.joining(DELIMETER1))); + getTargetsPref().put(typeId, + type.values().stream().map(t -> t.getId()).collect(Collectors.joining(DELIMETER1))); for (ILaunchTargetListener listener : listeners) { listener.launchTargetAdded(target); @@ -188,13 +182,13 @@ public class LaunchTargetManager implements ILaunchTargetManager { initTargets(); Map type = targets.get(target.getTypeId()); if (type != null) { - type.remove(target.getName()); + type.remove(target.getId()); if (type.isEmpty()) { targets.remove(target.getTypeId()); getTargetsPref().remove(target.getTypeId()); } else { - getTargetsPref().put(target.getTypeId(), type.values().stream() - .map(t -> t.getId() + DELIMETER2 + t.getName()).collect(Collectors.joining(DELIMETER1))); + getTargetsPref().put(target.getTypeId(), + type.values().stream().map(t -> t.getId()).collect(Collectors.joining(DELIMETER1))); } for (ILaunchTargetListener listener : listeners) { @@ -215,7 +209,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { Preferences prefs = getTargetsPref().node("configs"); //$NON-NLS-1$ String targetId = prefs.get(configuration.getName(), null); if (targetId != null) { - String[] parts = targetId.split(DELIMETER3); + String[] parts = targetId.split(DELIMETER2); return getLaunchTarget(parts[0], parts[1]); } return null; @@ -224,7 +218,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { @Override public void setDefaultLaunchTarget(ILaunchConfiguration configuration, ILaunchTarget target) { Preferences prefs = getTargetsPref().node("configs"); //$NON-NLS-1$ - String targetId = String.join(DELIMETER3, target.getTypeId(), target.getId()); + String targetId = String.join(DELIMETER2, target.getTypeId(), target.getId()); prefs.put(configuration.getName(), targetId); try { prefs.flush(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java index 701231b83f7..eb7c130e6fe 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java @@ -19,8 +19,7 @@ public class LocalLaunchTargetProvider implements ILaunchTargetProvider { public void init(ILaunchTargetManager targetManager) { if (targetManager.getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name) == null) { - targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name, - Messages.LocalTarget_name); + targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name); } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 3c3215a49a4..1c9ad3173fa 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -18,7 +18,7 @@ import org.eclipse.launchbar.core.internal.target.LaunchTarget; * @noimplement not to be implemented by clients */ public interface ILaunchTarget extends IAdaptable { - public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "null", "---"); + public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---"); //$NON-NLS-1$ //$NON-NLS-2$ /** * The id for the target. It is unique for each type. @@ -29,10 +29,14 @@ public interface ILaunchTarget extends IAdaptable { /** * The user consumable name of the target. - * + * + * @deprecated this will be the same as the id * @return name of the target */ - String getName(); + @Deprecated + default String getName() { + return getId(); + } /** * The type of the target. diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java index db1510f6a27..68e90cbc7c5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java @@ -67,25 +67,9 @@ public interface ILaunchTargetManager { * type id of the launch target * @param id * id for the target. - * @param name - * name of the launch target * @return the created launch target */ - ILaunchTarget addLaunchTarget(String typeId, String id, String name); - - /** - * Add a launch target with the given typeId and name. The name is also the - * id for the target. - * - * @param typeId - * type id of the launch target - * @param name - * name of the launch target - * @return the created launch target - */ - default ILaunchTarget addLaunchTarget(String typeId, String name) { - return addLaunchTarget(typeId, name, name); - } + ILaunchTarget addLaunchTarget(String typeId, String id); /** * Removes a launch target. diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF index 436092919fc..e24c43302b8 100644 --- a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF @@ -10,3 +10,4 @@ Require-Bundle: org.eclipse.ui, org.eclipse.remote.core;bundle-version="2.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy +Export-Package: org.eclipse.launchbar.remote.core.internal;x-friends:="org.eclipse.launchbar.remote.ui" diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java index 026b1725889..fe40f6e43c4 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java @@ -23,7 +23,7 @@ public class RemoteConnectionListener implements IRemoteConnectionChangeListener switch (event.getType()) { case RemoteConnectionChangeEvent.CONNECTION_ADDED: targetManager.addLaunchTarget(RemoteLaunchTargetProvider.TYPE_ID, - RemoteLaunchTargetProvider.getTargetId(connection), connection.getName()); + RemoteLaunchTargetProvider.getTargetId(connection)); break; case RemoteConnectionChangeEvent.CONNECTION_REMOVED: ILaunchTarget target = targetManager.getLaunchTarget(RemoteLaunchTargetProvider.TYPE_ID, diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java index 1fee2b5576f..db18463e54f 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteLaunchTargetProvider.java @@ -17,8 +17,8 @@ import org.eclipse.remote.core.IRemoteServicesManager; public class RemoteLaunchTargetProvider implements ILaunchTargetProvider { - static final String TYPE_ID = "org.eclipse.launchbar.remote.core.launchTargetType"; //$NON-NLS-1$ - static final String DELIMITER = "|"; //$NON-NLS-1$ + public static final String TYPE_ID = "org.eclipse.launchbar.remote.core.launchTargetType"; //$NON-NLS-1$ + public static final String DELIMITER = "|"; //$NON-NLS-1$ private static final TargetStatus CLOSED = new TargetStatus(Code.ERROR, Messages.RemoteLaunchTargetProvider_Closed); @@ -39,7 +39,7 @@ public class RemoteLaunchTargetProvider implements ILaunchTargetProvider { for (IRemoteConnection connection : manager.getAllRemoteConnections()) { String id = getTargetId(connection); if (targetManager.getLaunchTarget(TYPE_ID, id) == null) { - targetManager.addLaunchTarget(TYPE_ID, id, connection.getName()); + targetManager.addLaunchTarget(TYPE_ID, id); } } } diff --git a/bundles/org.eclipse.launchbar.remote.ui/.classpath b/bundles/org.eclipse.launchbar.remote.ui/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.launchbar.remote.ui/.project b/bundles/org.eclipse.launchbar.remote.ui/.project new file mode 100644 index 00000000000..ec6ff73a3ae --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.remote.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..0bc662f06a8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Remote Launch Target UI +Bundle-SymbolicName: org.eclipse.launchbar.remote.ui;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.launchbar.remote.ui.internal.Activator +Bundle-Vendor: Eclipse CDT +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.remote.core;bundle-version="2.0.0", + org.eclipse.remote.ui;bundle-version="2.0.0", + org.eclipse.launchbar.core;bundle-version="2.0.0", + org.eclipse.launchbar.ui;bundle-version="2.0.0", + org.eclipse.launchbar.remote.core;bundle-version="1.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.launchbar.remote.ui/build.properties b/bundles/org.eclipse.launchbar.remote.ui/build.properties new file mode 100644 index 00000000000..e9863e281ea --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/bundles/org.eclipse.launchbar.remote.ui/plugin.xml b/bundles/org.eclipse.launchbar.remote.ui/plugin.xml new file mode 100644 index 00000000000..21bc68e520e --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/plugin.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java new file mode 100644 index 00000000000..5db112b94ee --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.ui.internal; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.launchbar.remote.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + public static Activator getDefault() { + return plugin; + } + + public static T getService(Class service) { + BundleContext context = plugin.getBundle().getBundleContext(); + ServiceReference ref = context.getServiceReference(service); + return ref != null ? context.getService(ref) : null; + } + +} diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java new file mode 100644 index 00000000000..776b98a9028 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.ui.internal; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.remote.core.internal.RemoteLaunchTargetProvider; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.ui.IRemoteUIConnectionService; +import org.eclipse.swt.graphics.Image; + +public class RemoteLaunchTargetLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + IRemoteConnection connection = getConnection(element); + if (connection != null) { + IRemoteUIConnectionService uiService = connection.getConnectionType() + .getService(IRemoteUIConnectionService.class); + if (uiService != null) { + return uiService.getLabelProvider().getText(connection); + } + } + return super.getText(element); + } + + @Override + public Image getImage(Object element) { + IRemoteConnection connection = getConnection(element); + if (connection != null) { + IRemoteUIConnectionService uiService = connection.getConnectionType() + .getService(IRemoteUIConnectionService.class); + if (uiService != null) { + return uiService.getLabelProvider().getImage(connection); + } + } + return super.getImage(element); + } + + private IRemoteConnection getConnection(Object element) { + if (element instanceof ILaunchTarget) { + ILaunchTarget target = (ILaunchTarget) element; + if (target.getTypeId().equals(RemoteLaunchTargetProvider.TYPE_ID)) { + IRemoteConnection connection = target.getAdapter(IRemoteConnection.class); + return connection; + } + } + return null; + } +} From 83ecb792db946299bb2f24b83fcb2ad8683ad7ef Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 31 Dec 2015 00:06:11 -0500 Subject: [PATCH 070/198] Bug 484993 - Add remote ui feature to the build. Change-Id: I4c1e48fd8018c952d6f743c91b64022274c7e81a --- .../org.eclipse.launchbar.remote.ui/pom.xml | 18 ++++++++++++++++++ .../org.eclipse.launchbar.remote/feature.xml | 7 +++++++ pom.xml | 1 + 3 files changed, 26 insertions(+) create mode 100644 bundles/org.eclipse.launchbar.remote.ui/pom.xml diff --git a/bundles/org.eclipse.launchbar.remote.ui/pom.xml b/bundles/org.eclipse.launchbar.remote.ui/pom.xml new file mode 100644 index 00000000000..d10b2c206c4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.remote.ui + 1.0.0-SNAPSHOT + + eclipse-plugin + diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 988d9acc32c..e22b58b1cca 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -26,4 +26,11 @@ version="0.0.0" unpack="false"/> + + diff --git a/pom.xml b/pom.xml index 937ef731652..d65f2738475 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,7 @@ tests/org.eclipse.launchbar.core.tests bundles/org.eclipse.launchbar.remote.core + bundles/org.eclipse.launchbar.remote.ui features/org.eclipse.launchbar.remote repo From e9db9389f2c0c20ddb07be20730b24d7a22ec52e Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 7 Jan 2016 13:21:53 -0500 Subject: [PATCH 071/198] launchbar: fixed widget is disposed exception Change-Id: I8c39e7bc55e88b8b93f6d445b9b94face7f4d1f1 Signed-off-by: Alena Laskavaia --- .../org/eclipse/launchbar/ui/internal/controls/CSelector.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index 2d581782a2c..ade71106fec 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -491,6 +491,7 @@ public abstract class CSelector extends Composite { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { + if (isDisposed()) return; update(selection); // update current selection - name or icon // may have changed if (popup != null && !popup.isDisposed()) { From cec2cbf4dca7c5d2e1ef24613dde9d3b45b99fbe Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 11 Jan 2016 11:37:20 -0500 Subject: [PATCH 072/198] launchbar: more reasonable launch target defaults - if new descriptor is created check first of current target is suitable before calling getDefaultTarget - change method getDefaultTarget to return last target from the list rather then first, since list is kept in order of addition, meaning last entry is the most recent Change-Id: I0d9a7760cf52c7dff761f760f3fce05d9ca4c540 Signed-off-by: Alena Laskavaia --- .../launchbar/core/internal/LaunchBarManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 5f5e48d08f1..277888a0a40 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -474,7 +474,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene setActiveLaunchTarget(null); return; } - // last stored target from persistent storage String activeTargetId = getPerDescriptorStore().get(PREF_ACTIVE_LAUNCH_TARGET, null); if (activeTargetId != null) { @@ -484,6 +483,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene setActiveLaunchTarget(storedTarget); return; } + } else { + // current active target, check if it is supported + if (activeLaunchTarget != null && supportsTarget(activeLaunchDesc, activeLaunchTarget)) { + setActiveLaunchTarget(activeLaunchTarget); + return; + } } // default target for descriptor setActiveLaunchTarget(getDefaultLaunchTarget(activeLaunchDesc)); @@ -721,7 +726,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { List targets = getLaunchTargets(descriptor); - return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(0); + // chances are that better target is most recently added, rather then the oldest + return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size()-1); } public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { From cd852c72c580b97deb99ac39c3087826265bfc21 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 11 Jan 2016 14:47:25 -0500 Subject: [PATCH 073/198] launchbar: use LinkedHashMap to avoid random order order of targets returned by target manager some-what important, use linked hash maps everywhere to avoid randomness of hashmap Change-Id: I670859854f10006c8591c3ebaa8f036d3127b5b8 --- .../core/internal/target/LaunchTargetManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index d485a0d130c..5ad555d9974 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -8,7 +8,7 @@ package org.eclipse.launchbar.core.internal.target; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -35,7 +35,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { private Map> targets; private Map typeElements; - private Map typeProviders = new HashMap<>(); + private Map typeProviders = new LinkedHashMap<>(); private List listeners = new LinkedList<>(); private static final String DELIMETER1 = ","; //$NON-NLS-1$ @@ -49,7 +49,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { private synchronized void initTargets() { if (targets == null) { // load target type elements from registry - typeElements = new HashMap<>(); + typeElements = new LinkedHashMap<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry .getExtensionPoint(Activator.getDefault().getBundle().getSymbolicName() + ".launchTargetTypes"); //$NON-NLS-1$ @@ -63,13 +63,13 @@ public class LaunchTargetManager implements ILaunchTargetManager { } // load targets from preference store - targets = new HashMap<>(); + targets = new LinkedHashMap<>(); Preferences prefs = getTargetsPref(); try { for (String typeId : prefs.keys()) { Map type = targets.get(typeId); if (type == null) { - type = new HashMap<>(); + type = new LinkedHashMap<>(); targets.put(typeId, type); } @@ -160,7 +160,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { initTargets(); Map type = targets.get(typeId); if (type == null) { - type = new HashMap<>(); + type = new LinkedHashMap<>(); targets.put(typeId, type); } From 79724185516a1b38941a8f4c92597e879261924f Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 14 Jan 2016 13:58:34 -0500 Subject: [PATCH 074/198] launchbar: open stanard eclipse launch configs dialog on edit - when we click gear on launch descriptor we open a custom dialog, there is no really need for it we can just open standard eclipse launch configuration dialog and select configuration from the descriptor Change-Id: I40f52baa5cc161a7281231600c29a4f5609733a5 --- .../ConfigureActiveLaunchHandler.java | 10 +- .../LaunchConfigurationEditDialog.java | 165 ------------------ 2 files changed, 4 insertions(+), 171 deletions(-) delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index 346d32d4c65..09d2d166a02 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -26,12 +26,12 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; @@ -135,15 +135,13 @@ public class ConfigureActiveLaunchHandler extends AbstractHandler { ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() - .getLaunchGroup(group.getIdentifier()); ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { config = ((ILaunchConfigurationWorkingCopy) config).doSave(); } - final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); - dialog.setInitialStatus(Status.OK_STATUS); - dialog.open(); + // open real eclipse launch configurations dialog + DebugUIPlugin.openLaunchConfigurationsDialog(shell, new StructuredSelection(config), + group.getIdentifier(), false); } catch (CoreException e2) { Activator.log(e2); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java deleted file mode 100644 index 067035ca4f1..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/LaunchConfigurationEditDialog.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 QNX Software Systems 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: - * Doug Schaefer - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.dialogs; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.progress.UIJob; - -@SuppressWarnings("restriction") -public class LaunchConfigurationEditDialog extends LaunchConfigurationPropertiesDialog { - - private static final int DELETE_ID = 64; - private static final int DUPLICATE_ID = 65; - private static final int LAUNCH_ID = 66; - - public LaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group) { - super(shell, launchConfiguration, group); - } - - @Override - public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { - PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable); - } - - @Override - protected Control createButtonBar(Composite parent) { - // Clone super's implementation, removes the monitor since we don't run from here - // And adds in the left button bar. - Font font = parent.getFont(); - Composite composite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); - layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); - layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - composite.setFont(font); - - // create help control if needed - if (isHelpAvailable()) { - createHelpControl(composite); - } - - Composite leftButtonComp = new Composite(composite, SWT.NULL); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - layout.numColumns = 0; - leftButtonComp.setLayout(layout); - leftButtonComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - leftButtonComp.setFont(parent.getFont()); - - createButton(leftButtonComp, DELETE_ID, Messages.LaunchConfigurationEditDialog_0, false); - createButton(leftButtonComp, DUPLICATE_ID, Messages.LaunchConfigurationEditDialog_1, false); - // launch button text same as in eclipse LaunchConfigurationDialog - mode name - createButton(leftButtonComp, LAUNCH_ID, getLaunchButtonText(), false); - - Composite mainButtonComp = new Composite(composite, SWT.NONE); - layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - layout.numColumns = 0; - mainButtonComp.setLayout(layout); - mainButtonComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); - mainButtonComp.setFont(parent.getFont()); - - createButton(mainButtonComp, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(mainButtonComp, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - - return composite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - // Do nothing since we now have the buttons created above. - } - - @Override - protected void buttonPressed(int buttonId) { - switch (buttonId) { - case DELETE_ID: - ILaunchConfiguration c = getLaunchConfiguration(); - if (c.isWorkingCopy()) - c = ((ILaunchConfigurationWorkingCopy)c).getOriginal(); - final ILaunchConfiguration config = c; - if (MessageDialog.openConfirm(getShell(), Messages.LaunchConfigurationEditDialog_3, - Messages.LaunchConfigurationEditDialog_4 + config.getName())) { - new Job(Messages.LaunchConfigurationEditDialog_5) { - protected IStatus run(IProgressMonitor monitor) { - try { - config.delete(); - return Status.OK_STATUS; - } catch (CoreException e) { - return e.getStatus(); - } - }; - }.schedule(); - cancelPressed(); - } - break; - case DUPLICATE_ID: - final ILaunchConfiguration original = getLaunchConfiguration(); - final String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(original.getName()); - final Shell shell = getParentShell(); - final LaunchGroupExtension group = getLaunchGroup(); - - new UIJob(Messages.LaunchConfigurationEditDialog_6) { - @Override - public IStatus runInUIThread(IProgressMonitor monitor) { - try { - final ILaunchConfigurationWorkingCopy newWorkingCopy = original.copy(newName); - final ILaunchConfiguration newConfig = newWorkingCopy.doSave(); - new LaunchConfigurationEditDialog(shell, newConfig, group).open(); - } catch (CoreException e) { - return e.getStatus(); - } - return Status.OK_STATUS; - } - }.schedule(); - cancelPressed(); - break; - case LAUNCH_ID: - okPressed(); - Activator.runCommand(Activator.CMD_LAUNCH); - break; - default: - super.buttonPressed(buttonId); - } - } -} From ab9ad3ffba72400c0aec3e1dade13bd7d5100dc0 Mon Sep 17 00:00:00 2001 From: Rafael Peria de Sene Date: Tue, 19 Jan 2016 13:00:55 -0200 Subject: [PATCH 075/198] launchbar: fix url to eclipse updates Fix the wrong URL which was braking the build. - http://download.eclipse.org/eclipse/updates/4.5milestones/ + http://download.eclipse.org/eclipse/updates/4.5/ Change-Id: I647301fe72432df0a347f7541605eba41bb8baa0 Signed-off-by: Rafael Peria de Sene --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d65f2738475..db8e90dc5dd 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.5milestones/ + http://download.eclipse.org/eclipse/updates/4.5/ p2 From f16f7a86c8c5704fa2d5bad65cc684609db9c74a Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 15 Jan 2016 12:37:33 -0500 Subject: [PATCH 076/198] launchbar: launch button - mode overlay - when mode select - change button to match mode, change tooltip to show mode name - also added errors settings Change-Id: Id537e0fe65d8632dbd97183680d2bc1b3d635c86 Signed-off-by: Alena Laskavaia --- .../.settings/org.eclipse.jdt.core.prefs | 94 ++++++++++++++ .../icons/icon_debug_32x32.png | Bin 0 -> 620 bytes .../icons/icon_profile_32x32.png | Bin 0 -> 2019 bytes .../icons/icon_run_32x32.png | Bin 0 -> 466 bytes .../icons/launch_base_blank.png | Bin 0 -> 323 bytes .../launchbar/ui/internal/Messages.java | 1 + .../ui/internal/controls/CSelector.java | 2 +- .../internal/controls/LaunchBarControl.java | 9 +- .../ui/internal/controls/ModeSelector.java | 115 +++++++++++++++++- .../launchbar/ui/internal/messages.properties | 1 + 10 files changed, 210 insertions(+), 12 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/icons/icon_debug_32x32.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/icon_profile_32x32.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/icon_run_32x32.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/launch_base_blank.png diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..4a1ace7a1ef 100644 --- a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,101 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=error +org.eclipse.jdt.core.compiler.problem.deadCode=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.launchbar.ui/icons/icon_debug_32x32.png b/bundles/org.eclipse.launchbar.ui/icons/icon_debug_32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..eb33867315537f4e63f1deca42f0747ec5312815 GIT binary patch literal 620 zcmV-y0+aoTP)4lLy8I(L6JgO@=DL$=#A6ftrD6FHiq zZR&{ORfVHQ3z?f73 zN-upo&LPOrPP{t@Sw7f#g7HAZqm}PlT{+ z1osDavq`|-62 zKt2)V5(gVjYF+UD+e<>F;Q5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8KW+g=7RhMR$W{Yl!|Z$R@KEJl?AE#L8-<0 zrA5iW_()TRX$FQJev3c~fv&OgFUkZ)N@9*nesXDUYF>$_i>(q+MlU5Z#mdRm)!5n1 z)!f{`$kfcj(9puj$kENj+|k6$%+1ll!U$#tR=q}+t}Z4frk1WwK%K5ej!uTgPL9Ur zCdP(lrY>%9y`Fi+C5d^-sW5vpLH0uQn&8!ID+CL zUoU&?Y@bwpob-9Nmfx46X6|6Dlytq48nPj3ZN|G5PM`0KUoiim-*wNXYjJ4xg8s;! zGp*8scDhpU*W7C7%GJq=_Ww~;I-@JfaQnHJ_e{iIggyAXb-wf3O`$nw-^Ldl`>;3J zE=0Jo@nBtaF023H+uCIcwRL)KYZw1mxJsg2J~r6sz>04d`ecQc@QLN6f07GUKlPel zDLc?kFjK~=tSIpElJftB+OOV+b$ndb6Z=S(OXv_=OOh4t znMZ6+k?xr?K|HFiEm}dl7o1WPgIOm^3OX8VrZVzwHtY+a1V|!`xXlAfxk@BtC;m<0r{aO&$SwF!x;iFmg z({q}FZ7*+0#AMmN`_QrCzoPQG`>RzJ?K8~w(XR@u{hhwC&GzWh)e6pCY+q))Tl}uS z$S`j17Rhd5qgu1_Z(QN6FJ|qZ-YKBj(dwKqDSnS!>+QUnBQ`3pE`5mm#<>6c&24(j zdfQ|^FHKA0FVW5{Fr9L(rfFIA)Vj&{U#wVWT7B2+dUMIgv=FyuUB+Jun#uez{13z@ zI_moCG*0@QRT-1T#ZakSeB1h=-?{CcD(UND&#m1tZNuDzc`QYnpR6jr%k9OPZE2`B zVNYbyl&agjub*gozO0aY*}UZZ;g5F|Chxr&`qQ3~jX~pfVD_qF7dcS1>*?y}vd$@? F2>?HDB-H=_ literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/icon_run_32x32.png b/bundles/org.eclipse.launchbar.ui/icons/icon_run_32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..d704b703b719540e5a5740679d068bf92ea6d307 GIT binary patch literal 466 zcmV;@0WJQCP)*h(c5wcsGR{!(9}Lqz@7=3)dmVEFi|0& zQvw`Vh*inYt-~NC=)v&q=VOM4uUAsd1w=c*PHPEOMts(8wGtD#p}|DWJVj1uFwr7& zv$F7mF;%l6F#uFXoCRjj*Po72zZ@V0?!1`IaQ#US!|y*IX;TnU)7MmU0J**<%K^Xt zeu9^Vl=_-12OPQ<1h0&qz28BRugP)%sN$hU<%6vpI52?ifdfp?PQyTf2Taf&%RqsH zAO~!KHj(KKKz43mg7(!K2fzWKF4~8|(KQ&r{hX4Qo07*qo IM6N<$f+n-L8vp<>&pIsk)Kc1q{gdp4p8WVr;B4q#NoHsH|8=KO0+$EZo{ZN z!83uSpW$t2V$%yV4_9fo4;%)b5(kx+{8Uz)ka1#e@DJVEqu+nkMSn8i@i=15gpCKK zqSqH56BVCgxO%&M`|c0rH3_M5TFVT7*9cgM#ovf*yFBBq;@vkjD+_M8E>leVXZtw6 z-mGuC2z%bkf{8PO=X?vx35wYow&t?@ozLMn)Oues#V+73Y1F&Gy33)fygIls`|zLO zu49+Fyq!ALKV1r$A`+XMrC`t-`B(lbPtrq!&lXyI`ycYZ-QjBcpOG=&l-v5QNg&W~ N44$rjF6*2UngBfpeYXGr literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 7aef26870a3..be31a049e01 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -42,6 +42,7 @@ public class Messages extends NLS { public static String LaunchConfigurationEditDialog_5; public static String LaunchConfigurationEditDialog_6; public static String ModeSelector_0; + public static String ModeSelector_ToolTip; public static String NewLaunchConfigEditPage_0; public static String NewLaunchConfigEditPage_1; public static String NewLaunchConfigEditPage_2; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java index ade71106fec..b9d4808157d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java @@ -522,7 +522,7 @@ public abstract class CSelector extends Composite { if (currentLabel != null) { currentLabel.getText(); } - return ""; + return ""; //$NON-NLS-1$ } protected boolean hasActionArea() { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 8a481f1316c..b375dc331d4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -7,7 +7,7 @@ * * Contributors: * Doug Schaefer - * Torkild U. Resheim - add preference to control target selector + * Torkild U. Resheim - add preference to control target selector *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; @@ -106,20 +106,19 @@ public class LaunchBarControl implements Listener { manager.removeListener(this); } - private void createButton(Composite parent, String imageName, String toolTipText, final String command) { + private ToolItem createButton(Composite parent, String imageName, String toolTipText, final String command) { ToolItem button = new ToolItem((ToolBar) parent, SWT.FLAT); - // button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); Image srcImage = Activator.getDefault().getImage(imageName); - // Image image = new Image(parent.getDisplay(), srcImage, - // SWT.IMAGE_COPY); button.setImage(srcImage); button.setToolTipText(toolTipText); + button.setData("command", command); //$NON-NLS-1$ button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { Activator.runCommand(command); }; }); + return button; } @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 1a46006323f..b44e8bb3cb4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; +import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.Map; @@ -21,6 +22,7 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -28,22 +30,25 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.swt.widgets.ToolItem; @SuppressWarnings("restriction") public class ModeSelector extends CSelector { - private static final String[] noModes = new String[] { "---" }; //$NON-NLS-1$ - private final LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); public ModeSelector(Composite parent, int style) { super(parent, style); - setToolTipText(Messages.ModeSelector_0); - setContentProvider(new IStructuredContentProvider() { @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { @@ -65,7 +70,6 @@ public class ModeSelector extends CSelector { return noModes; } }); - setLabelProvider(new LabelProvider() { private Map images = new HashMap<>(); @@ -123,7 +127,6 @@ public class ModeSelector extends CSelector { return super.getText(element); } }); - setSorter(new Comparator() { @Override public int compare(Object o1, Object o2) { @@ -202,6 +205,106 @@ public class ModeSelector extends CSelector { if (element == null) element = noModes[0]; super.setSelection(element); + updateLaunchButton(findLaunchButton()); } + private ToolItem findLaunchButton() { + String commandId = Activator.CMD_LAUNCH; + for (Control control : getParent().getChildren()) { + if (control instanceof ToolBar) { + for (ToolItem toolItem : ((ToolBar) control).getItems()) { + if (commandId.equals(toolItem.getData("command"))) { //$NON-NLS-1$ + // found launch button + return toolItem; + } + } + } + } + Activator.log(new RuntimeException("Launch button is not found in toolbar")); //$NON-NLS-1$ + return null; + } + + private void updateLaunchButton(ToolItem toolItem) { + if (toolItem == null) { + return; + } + toolItem.setImage(Activator.getDefault().getImage(Activator.IMG_BUTTON_LAUNCH)); + Object selection = getSelection(); + if (selection instanceof ILaunchMode) { + ILaunchMode lmode = (ILaunchMode) selection; + toolItem.setToolTipText(NLS.bind(Messages.ModeSelector_ToolTip, lmode.getLabel())); + String mode = lmode.getIdentifier(); + String iconPath = "icons/icon_" + mode + "_32x32.png"; //$NON-NLS-1$ //$NON-NLS-2$ + Image modeBigImage = Activator.getDefault().getImage(iconPath); + if (modeBigImage == null) { + // no icon for the mode, lets do an overlay + Image modeImageOrig = getLabelProvider().getImage(lmode); + if (modeImageOrig != null) { + ImageDescriptor composite = new ReversedCenterOverlay(modeImageOrig.getImageData()); + Activator.getDefault().getImageRegistry().put(iconPath, composite); + modeBigImage = Activator.getDefault().getImage(iconPath); + } + } + if (modeBigImage != null) { + toolItem.setImage(modeBigImage); + } + } + } + + private final class ReversedCenterOverlay extends CompositeImageDescriptor { + private ImageData small; + + public ReversedCenterOverlay(ImageData small) { + this.small = small; + } + + @Override + protected Point getSize() { + return new Point(32, 32); + } + + @Override + protected void drawCompositeImage(int width, int height) { + ImageDescriptor base = Activator.getImageDescriptor("icons/launch_base_blank.png"); //$NON-NLS-1$ + ImageData baseData = base.getImageData(); + int baseColor = baseData.getPixel(16, 16); + ImageData data = getReversed(small, baseData.palette.getRGB(baseColor)); + drawImage(baseData, 0, 0); + drawImage(data, 8, 8); + } + + private ImageData getReversed(ImageData imageData, RGB baseColor) { + int width = imageData.width; + PaletteData palette = imageData.palette; + RGB whiteColor = new RGB(255, 255, 255); + if (!palette.isDirect) { + palette.colors = Arrays.copyOf(palette.colors, palette.colors.length + 2); + palette.colors[palette.colors.length - 1] = baseColor; + palette.colors[palette.colors.length - 2] = whiteColor; + } + int whitePixel = palette.getPixel(whiteColor); + int basePixed = palette.getPixel(baseColor); + int transPixed = imageData.transparentPixel; + int[] lineData = new int[imageData.width]; + for (int y = 0; y < imageData.height; y++) { + imageData.getPixels(0, y, width, lineData, 0); + for (int x = 0; x < lineData.length; x++) { + int pixelValue = lineData[x]; + if (pixelValue == transPixed) { + imageData.setPixel(x, y, basePixed); + continue; + } + RGB rgb = palette.getRGB(pixelValue); + float brightness = rgb.getHSB()[2]; + if (brightness > 0.97) { + imageData.setPixel(x, y, basePixed); + } else { + imageData.setPixel(x, y, whitePixel); + } + } + } + imageData.transparentPixel = -1; + return imageData; + } + } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 2e57068198c..122b2e13e27 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -25,6 +25,7 @@ LaunchConfigurationEditDialog_4=Are you sure you want to delete LaunchConfigurationEditDialog_5=Deleting launch configuration LaunchConfigurationEditDialog_6=Duplicating launch configuration ModeSelector_0=Launch Mode +ModeSelector_ToolTip=Launch in ''{0}'' mode NewLaunchConfigEditPage_0=NewLaunchConfigEditPage NewLaunchConfigEditPage_1=Launch Configuration Properties NewLaunchConfigEditPage_2=Edit the new launch configuration properties From 92d08ca43014882b846efdada9a4153f7d316679 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 20 Jan 2016 16:55:53 -0500 Subject: [PATCH 077/198] Bug 466489 - Filter out external tools builders. Change-Id: Id14a01246c013fc47c76f693dc7f9d063f361163 --- .../core/internal/DefaultLaunchDescriptorType.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index ed7cc5bc1d3..840c0fda82d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -15,6 +15,7 @@ import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; @@ -34,8 +35,15 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { if (launchObject instanceof ILaunchConfiguration) { ILaunchConfiguration config = (ILaunchConfiguration) launchObject; try { - if (config.getType() != null && config.getType().isPublic() - && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false))) { + ILaunchConfigurationType type = config.getType(); + if (type == null) { + return null; + } + + // Filter out private and external tools builders + String category = type.getCategory(); + if (type.isPublic() && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false)) + && !("org.eclipse.ui.externaltools.builder".equals(category))) { //$NON-NLS-1$ DefaultLaunchDescriptor descriptor = descriptors.get(config); if (descriptor == null) { From 99da8cee74ae665fa2d8f6a2b3cb03b71a66c6e4 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 25 Jan 2016 10:23:30 -0500 Subject: [PATCH 078/198] launchar: action to invoke new launch target wizard - new extension to contribute a wizard to launchTypeUI extension point - copied bunch of wizards from platform ui since they cannot be extended Change-Id: I45f2801fe04a24e7f8d2bbbd3f31ada1de4a1fc3 --- .../META-INF/MANIFEST.MF | 3 +- bundles/org.eclipse.launchbar.ui/plugin.xml | 9 + .../schema/launchTargetTypeUI.exsd | 95 ++++ .../ui/internal/controls/ConfigSelector.java | 37 +- .../ui/internal/controls/TargetSelector.java | 60 +- .../launchbar/ui/internal/messages.properties | 2 +- .../target/LaunchTargetUIManager.java | 22 +- .../target/NewLaunchTargetWizard.java | 97 ++++ .../target/NewLaunchTargetWizardAction.java | 149 +++++ .../target/NewLaunchTargetWizardNewPage.java | 518 ++++++++++++++++++ .../NewLaunchTargetWizardSelectionPage.java | 120 ++++ .../ui/target/ILaunchTargetUIManager.java | 4 +- 12 files changed, 1078 insertions(+), 38 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 0b327d70d39..ea9b0354427 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -15,7 +15,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.launchbar.core, org.eclipse.debug.ui, org.eclipse.ui.ide, - org.eclipse.e4.core.contexts + org.eclipse.e4.core.contexts, + org.eclipse.ui.workbench Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/bundles/org.eclipse.launchbar.ui/plugin.xml index 2f0617fd581..7050eeb425c 100644 --- a/bundles/org.eclipse.launchbar.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.ui/plugin.xml @@ -71,5 +71,14 @@ labelProvider="org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider"> + + + + + + diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd index 23a46f9f733..8173b9db2c3 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd @@ -19,6 +19,7 @@ + @@ -72,6 +73,100 @@ + + + + + + + + + a unique name that can be used to identify this wizard + + + + + + + a translatable name of the wizard that will be used in the dialog box + + + + + + + + + + a relative path of an icon that will be used together with the name to represent the wizard +as one of the choices in the creation dialog box. + + + + + + + + + + a fully qualified name of the Java class implementing <samp>org.eclipse.ui.INewWizard</samp>. + + + + + + + + + + a help url that can describe this wizard in detail. +<p> +Since 3.0 +</p> + + + + + + + a larger image that can help describe this wizard. +<p> +Since 3.0 +</p> + + + + + + + + + + whether the wizard is capable of finishing without ever showing pages to the user. + + + + + + + whether the wizard provides any pages. + + + + + + + + + + + + + an optional subelement whose body contains a short text describing what the wizard will do when started + + + + diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java index 9a10dc1c384..ef7712a0cc0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java @@ -17,6 +17,8 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -36,14 +38,9 @@ import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; @@ -163,32 +160,16 @@ public class ConfigSelector extends CSelector { @Override public void createActionArea(Composite parent) { - Composite actionArea = new Composite(parent, SWT.NONE); - GridLayout actionLayout = new GridLayout(); - actionLayout.marginWidth = actionLayout.marginHeight = 0; - actionArea.setLayout(actionLayout); - actionArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - - final Composite createButton = new Composite(actionArea, SWT.NONE); - createButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - GridLayout buttonLayout = new GridLayout(); - buttonLayout.marginWidth = buttonLayout.marginHeight = 7; - createButton.setLayout(buttonLayout); + final Composite createButton = new Composite(parent, SWT.BORDER); + GridDataFactory.fillDefaults().grab(true, false).applyTo(createButton); + GridLayoutFactory.fillDefaults().margins(7, 7).applyTo(createButton); createButton.setBackground(getBackground()); - createButton.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - Point size = createButton.getSize(); - GC gc = e.gc; - gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); - gc.drawLine(0, 0, size.x, 0); - } - }); - final Label createLabel = new Label(createButton, SWT.None); - createLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - createLabel.setText(Messages.ConfigSelector_2); + final Label createLabel = new Label(createButton, SWT.NONE); + GridDataFactory.fillDefaults().grab(true, false).applyTo(createLabel); createLabel.setBackground(getBackground()); + createLabel.setText(Messages.ConfigSelector_2); + MouseListener mouseListener = new MouseAdapter() { @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index cbbf39ebd6b..305f935c322 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -12,8 +12,9 @@ package org.eclipse.launchbar.ui.internal.controls; import java.util.Comparator; import java.util.List; - import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.ILabelProvider; @@ -34,11 +35,20 @@ import org.eclipse.launchbar.core.target.TargetStatus.Code; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.launchbar.ui.internal.target.NewLaunchTargetWizardAction; import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseTrackAdapter; +import org.eclipse.swt.events.MouseTrackListener; +import org.eclipse.swt.graphics.Color; 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.Label; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.PropertyDialogAction; @@ -181,6 +191,54 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { new PropertyDialogAction(new SameShellProvider(getShell()), getSelectionProvider()).run(); } + @Override + public boolean hasActionArea() { + return true; + } + + @Override + public void createActionArea(final Composite parent) { + final Composite createButton = new Composite(parent, SWT.BORDER); + GridDataFactory.fillDefaults().grab(true, false).applyTo(createButton); + GridLayoutFactory.fillDefaults().margins(7, 7).applyTo(createButton); + createButton.setBackground(getBackground()); + + final Label createLabel = new Label(createButton, SWT.NONE); + GridDataFactory.fillDefaults().grab(true, false).applyTo(createLabel); + createLabel.setBackground(getBackground()); + createLabel.setText(Messages.TargetSelector_CreateNewTarget); + + MouseListener mouseListener = new MouseAdapter() { + @Override + public void mouseUp(org.eclipse.swt.events.MouseEvent event) { + NewLaunchTargetWizardAction newWizardAction = new NewLaunchTargetWizardAction( + PlatformUI.getWorkbench().getActiveWorkbenchWindow(), + targetUIManager.getLaunchTargetWizards()); + newWizardAction.run(); + } + }; + + createButton.addMouseListener(mouseListener); + createLabel.addMouseListener(mouseListener); + + MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { + @Override + public void mouseEnter(MouseEvent e) { + Color highlightColor = getHighlightColor(); + createButton.setBackground(highlightColor); + createLabel.setBackground(highlightColor); + } + @Override + public void mouseExit(MouseEvent e) { + Color backgroundColor = getBackground(); + createButton.setBackground(backgroundColor); + createLabel.setBackground(backgroundColor); + } + }; + createButton.addMouseTrackListener(mouseTrackListener); + createLabel.addMouseTrackListener(mouseTrackListener); + } + @Override protected void fireSelectionChanged() { Object selection = getSelection(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 122b2e13e27..f63a71d1b4d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -43,7 +43,7 @@ NewLaunchConfigWizard_0=Create Launch Configuration StopActiveCommandHandler_0=Stopping launches StopActiveCommandHandler_1=Stopping build TargetSelector_ToolTipPrefix=Launch Target -TargetSelector_CreateNewTarget=Create New Connection... +TargetSelector_CreateNewTarget=New Launch Target... DescriptorMustNotBeNull=Descriptor must not be null DescriptorMustNotBeNullDesc=The launch descriptor must not be null. diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java index 751064e6c28..4e15553fcb3 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java @@ -22,14 +22,17 @@ import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.internal.dialogs.WizardCollectionElement; +import org.eclipse.ui.internal.registry.WizardsRegistryReader; +import org.eclipse.ui.wizards.IWizardDescriptor; public class LaunchTargetUIManager implements ILaunchTargetUIManager { - private Map typeElements; private Map labelProviders = new HashMap<>(); + private IWizardDescriptor[] wizards; @Override - public ILabelProvider getLabelProvider(ILaunchTarget target) { + public synchronized ILabelProvider getLabelProvider(ILaunchTarget target) { if (typeElements == null) { // Load them up typeElements = new HashMap<>(); @@ -45,7 +48,6 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { } } } - String typeId = target.getTypeId(); ILabelProvider labelProvider = labelProviders.get(typeId); if (labelProvider == null) { @@ -57,9 +59,9 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { Activator.log(e); } } - if (labelProvider == null) { labelProvider = new LabelProvider() { + @Override public String getText(Object element) { if (element instanceof ILaunchTarget) { return ((ILaunchTarget) element).getName(); @@ -74,12 +76,20 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { } return super.getImage(element); } - }; } - } return labelProvider; } + @Override + public synchronized IWizardDescriptor[] getLaunchTargetWizards() { + if (wizards != null) + return wizards; + WizardsRegistryReader reader = new WizardsRegistryReader(Activator.PLUGIN_ID, "launchTargetTypeUI"); //$NON-NLS-1$ + WizardCollectionElement wizardElements = reader.getWizardElements(); + WizardCollectionElement otherCategory = (WizardCollectionElement) wizardElements.getChildren(null)[0]; + wizards = otherCategory.getWizards(); + return wizards; + } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java new file mode 100644 index 00000000000..0d79e1c0579 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * Copyright (c) 2000, 2015 IBM Corporation 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.IWizard; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.IWorkbench; +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.wizards.IWizardCategory; +import org.eclipse.ui.wizards.IWizardDescriptor; + +/** + * The new wizard is responsible for allowing the user to choose which new + * (nested) wizard to run. The set of available new wizards comes from the new + * extension point. + */ +public class NewLaunchTargetWizard extends Wizard { + private NewLaunchTargetWizardSelectionPage mainPage; + private IWorkbench workbench; + + /** + * Create the wizard pages + */ + @Override + public void addPages() { + mainPage = new NewLaunchTargetWizardSelectionPage(workbench, getWizardDescriptors()); + addPage(mainPage); + } + + public IWizardDescriptor[] getWizardDescriptors() { + IWizardCategory launchCategory = WorkbenchPlugin.getDefault().getNewWizardRegistry() + .findCategory("org.eclipse.launchbar.ui.targetWizards"); //$NON-NLS-1$ + if (launchCategory != null) + return launchCategory.getWizards(); + return new IWizardDescriptor[0]; + } + + /** + * Lazily create the wizards pages + * @param aWorkbench the workbench + * @param currentSelection the current selection + */ + public void init(IWorkbench aWorkbench, + IStructuredSelection currentSelection) { + this.workbench = aWorkbench; + if (getWindowTitle() == null) { + setWindowTitle(WorkbenchMessages.NewWizard_title); + } + setDefaultPageImageDescriptor(WorkbenchImages + .getImageDescriptor(IWorkbenchGraphicConstants.IMG_WIZBAN_NEW_WIZ)); + setNeedsProgressMonitor(true); + } + + /** + * The user has pressed Finish. Instruct self's pages to finish, and answer + * a boolean indicating success. + * + * @return boolean + */ + @Override + public boolean performFinish() { + //save our selection state + mainPage.saveWidgetValues(); + // if we're finishing from the main page then perform finish on the selected wizard. + if (getContainer().getCurrentPage() == mainPage) { + if (mainPage.canFinishEarly()) { + IWizard wizard = mainPage.getSelectedNode().getWizard(); + wizard.setContainer(getContainer()); + return wizard.performFinish(); + } + } + return true; + } + + @Override + public boolean canFinish() { + // we can finish if the first page is current and the the page can finish early. + if (getContainer().getCurrentPage() == mainPage) { + if (mainPage.canFinishEarly()) { + return true; + } + } + return super.canFinish(); + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java new file mode 100644 index 00000000000..004c8b44b00 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java @@ -0,0 +1,149 @@ +/******************************************************************************* + * Copyright (c) 2000, 2015 IBM Corporation 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.*; +import org.eclipse.ui.internal.IWorkbenchHelpContextIds; +import org.eclipse.ui.internal.WorkbenchMessages; +import org.eclipse.ui.internal.WorkbenchPlugin; +import org.eclipse.ui.wizards.IWizardDescriptor; + +/** + * Invoke the resource creation wizard selection Wizard. + *

+ * This class may be instantiated; it is not intended to be subclassed. + *

+ *

+ * This method automatically registers listeners so that it can keep its + * enablement state up to date. Ordinarily, the window's references to these + * listeners will be dropped automatically when the window closes. However, + * if the client needs to get rid of an action while the window is still open, + * the client must call #dispose() to give the + * action an opportunity to deregister its listeners and to perform any other + * cleanup. + *

+ * @noextend This class is not intended to be subclassed by clients. + */ +public class NewLaunchTargetWizardAction extends Action implements + ActionFactory.IWorkbenchAction { + /** + * The wizard dialog width + */ + private static final int SIZING_WIZARD_WIDTH = 500; + /** + * The wizard dialog height + */ + private static final int SIZING_WIZARD_HEIGHT = 500; + /** + * The title of the wizard window or null to use the default + * wizard window title. + */ + private String windowTitle = null; + /** + * The workbench window; or null if this + * action has been disposed. + */ + private IWorkbenchWindow workbenchWindow; + private IWizardDescriptor[] desc; + + /** + * Create a new instance of this class. + * @param window + * @param iWizardDescriptors + */ + public NewLaunchTargetWizardAction(IWorkbenchWindow window, IWizardDescriptor[] desc) { + super(WorkbenchMessages.NewWizardAction_text); + if (window == null) { + throw new IllegalArgumentException(); + } + this.workbenchWindow = window; + this.desc = desc; + // @issues should be IDE-specific images + ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); + setImageDescriptor(images + .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); + setDisabledImageDescriptor(images + .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED)); + setToolTipText(WorkbenchMessages.NewWizardAction_toolTip); + PlatformUI.getWorkbench().getHelpSystem().setHelp(this, + IWorkbenchHelpContextIds.NEW_ACTION); + } + + /** + *

+ * Sets the title of the wizard window + *

+ * + *

+ * If the title of the wizard window is null, the default + * wizard window title will be used. + *

+ * + * @param windowTitle + * The title of the wizard window, otherwise null + * (default wizard window title). + * + * @since 3.6 + */ + public void setWizardWindowTitle(String windowTitle) { + this.windowTitle = windowTitle; + } + + @Override + public void run() { + if (workbenchWindow == null) { + // action has been disposed + return; + } + NewLaunchTargetWizard wizard = new NewLaunchTargetWizard() { + @Override + public IWizardDescriptor[] getWizardDescriptors() { + return desc; + } + }; + wizard.setWindowTitle(windowTitle); + wizard.init(workbenchWindow.getWorkbench(), null); + IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault() + .getDialogSettings(); + IDialogSettings wizardSettings = workbenchSettings + .getSection("NewLaunchTargetWizardAction"); //$NON-NLS-1$ + if (wizardSettings == null) { + wizardSettings = workbenchSettings.addNewSection("NewLaunchTargetWizardAction"); //$NON-NLS-1$ + } + wizard.setDialogSettings(wizardSettings); + wizard.setForcePreviousAndNextButtons(true); + Shell parent = workbenchWindow.getShell(); + WizardDialog dialog = new WizardDialog(parent, wizard); + dialog.create(); + dialog.getShell().setSize( + Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), + SIZING_WIZARD_HEIGHT); + PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), + IWorkbenchHelpContextIds.NEW_WIZARD); + dialog.open(); + } + + @Override + public void dispose() { + if (workbenchWindow == null) { + // action has already been disposed + return; + } + workbenchWindow = null; + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java new file mode 100644 index 00000000000..8cdb42b1811 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java @@ -0,0 +1,518 @@ +/******************************************************************************* + * Copyright (c) 2000, 2015 IBM Corporation 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.wizard.IWizardContainer; +import org.eclipse.jface.wizard.IWizardContainer2; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.IWorkbenchWizard; +import org.eclipse.ui.activities.WorkbenchActivityHelper; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.internal.WorkbenchMessages; +import org.eclipse.ui.internal.dialogs.DialogUtil; +import org.eclipse.ui.internal.dialogs.WizardActivityFilter; +import org.eclipse.ui.internal.dialogs.WizardContentProvider; +import org.eclipse.ui.internal.dialogs.WizardPatternFilter; +import org.eclipse.ui.internal.dialogs.WorkbenchWizardElement; +import org.eclipse.ui.internal.dialogs.WorkbenchWizardNode; +import org.eclipse.ui.model.AdaptableList; +import org.eclipse.ui.model.WorkbenchLabelProvider; +import org.eclipse.ui.wizards.IWizardCategory; +import org.eclipse.ui.wizards.IWizardDescriptor; + +/** + * New wizard selection tab that allows the user to select a registered 'New' + * wizard to be launched. + */ +class NewLaunchTargetWizardNewPage implements ISelectionChangedListener { + // id constants + private static final String DIALOG_SETTING_SECTION_NAME = "NewWizardSelectionPage."; //$NON-NLS-1$ + private final static int SIZING_LISTS_HEIGHT = 200; + private final static int SIZING_VIEWER_WIDTH = 300; + private final static String STORE_EXPANDED_CATEGORIES_ID = DIALOG_SETTING_SECTION_NAME + + "STORE_EXPANDED_CATEGORIES_ID"; //$NON-NLS-1$ + private final static String STORE_SELECTED_ID = DIALOG_SETTING_SECTION_NAME + + "STORE_SELECTED_ID"; //$NON-NLS-1$ + private NewLaunchTargetWizardSelectionPage page; + private FilteredTree filteredTree; + private WizardPatternFilter filteredTreeFilter; + //Keep track of the wizards we have previously selected + private Hashtable selectedWizards = new Hashtable(); + private IDialogSettings settings; + private Button showAllCheck; + private IWizardDescriptor[] primaryWizards; + private CLabel descImageCanvas; + private Map imageTable = new HashMap(); + private IWizardDescriptor selectedElement; + private WizardActivityFilter filter = new WizardActivityFilter(); + private boolean needShowAll; + + /** + * Create an instance of this class + * @param mainPage + * @param wizardCategories + * @param primaryWizards + * @param projectsOnly + */ + public NewLaunchTargetWizardNewPage(NewLaunchTargetWizardSelectionPage mainPage, + IWizardCategory wizardCategories, + IWizardDescriptor[] primaryWizards) { + this.page = mainPage; + this.primaryWizards = primaryWizards; + needShowAll = !allActivityEnabled(primaryWizards); + } + + /** + * @param category the wizard category + * @return whether all of the wizards in the category are enabled via activity filtering + */ + private boolean allActivityEnabled(IWizardDescriptor[] wizards) { + for (int i = 0; i < wizards.length; i++) { + IWizardDescriptor wizard = wizards[i]; + if (WorkbenchActivityHelper.filterItem(wizard)) { + return false; + } + } + return true; + } + + /** + * @since 3.0 + */ + public void activate() { + page.setDescription(WorkbenchMessages.NewWizardNewPage_description); + } + + /** + * Create this tab's visual components + * + * @param parent Composite + * @return Control + */ + protected Control createControl(Composite parent) { + Font wizardFont = parent.getFont(); + // top level group + Composite outerContainer = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + outerContainer.setLayout(layout); + Label wizardLabel = new Label(outerContainer, SWT.NONE); + GridData data = new GridData(SWT.BEGINNING, SWT.FILL, false, true); + outerContainer.setLayoutData(data); + wizardLabel.setFont(wizardFont); + wizardLabel.setText(WorkbenchMessages.NewWizardNewPage_wizardsLabel); + Composite innerContainer = new Composite(outerContainer, SWT.NONE); + layout = new GridLayout(2, false); + layout.marginHeight = 0; + layout.marginWidth = 0; + innerContainer.setLayout(layout); + innerContainer.setFont(wizardFont); + data = new GridData(SWT.FILL, SWT.FILL, true, true); + innerContainer.setLayoutData(data); + filteredTree = createFilteredTree(innerContainer); + createOptionsButtons(innerContainer); + createImage(innerContainer); + updateDescription(null); + // wizard actions pane...create SWT table directly to + // get single selection mode instead of multi selection. + restoreWidgetValues(); + return outerContainer; + } + + /** + * Create a new FilteredTree in the parent. + * + * @param parent the parent Composite. + * @since 3.0 + */ + protected FilteredTree createFilteredTree(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginHeight = 0; + layout.marginWidth = 0; + composite.setLayout(layout); + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + data.widthHint = SIZING_VIEWER_WIDTH; + data.horizontalSpan = 2; + data.grabExcessHorizontalSpace = true; + data.grabExcessVerticalSpace = true; + boolean needsHint = DialogUtil.inRegularFontMode(parent); + //Only give a height hint if the dialog is going to be too small + if (needsHint) { + data.heightHint = SIZING_LISTS_HEIGHT; + } + composite.setLayoutData(data); + filteredTreeFilter = new WizardPatternFilter(); + FilteredTree filterTree = new FilteredTree(composite, + SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, filteredTreeFilter, true); + filterTree.setQuickSelectionMode(true); + final TreeViewer treeViewer = filterTree.getViewer(); + treeViewer.setContentProvider(new WizardContentProvider()); + treeViewer.setLabelProvider(new WorkbenchLabelProvider()); + //treeViewer.setComparator(NewWizardCollectionComparator.INSTANCE); + treeViewer.addSelectionChangedListener(this); + ArrayList inputArray = new ArrayList(); + for (int i = 0; i < primaryWizards.length; i++) { + inputArray.add(primaryWizards[i]); + } + boolean expandTop = false; + // ensure the category is expanded. If there is a remembered expansion it will be set later. + if (expandTop) { + treeViewer.setAutoExpandLevel(2); + } + AdaptableList input = new AdaptableList(inputArray); + treeViewer.setInput(input); + filterTree.setBackground(parent.getDisplay().getSystemColor( + SWT.COLOR_WIDGET_BACKGROUND)); + treeViewer.getTree().setFont(parent.getFont()); + treeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override + public void doubleClick(DoubleClickEvent event) { + IStructuredSelection s = (IStructuredSelection) event + .getSelection(); + selectionChanged(new SelectionChangedEvent(event.getViewer(), s)); + Object element = s.getFirstElement(); + if (treeViewer.isExpandable(element)) { + treeViewer.setExpandedState(element, !treeViewer + .getExpandedState(element)); + } else if (element instanceof WorkbenchWizardElement) { + page.advanceToNextPageOrFinish(); + } + } + }); + treeViewer.addFilter(filter); + Dialog.applyDialogFont(filterTree); + return filterTree; + } + + /** + * Create the Show All and help buttons at the bottom of the page. + * + * @param parent the parent composite on which to create the widgets + */ + private void createOptionsButtons(Composite parent) { + if (needShowAll) { + showAllCheck = new Button(parent, SWT.CHECK); + GridData data = new GridData(); + showAllCheck.setLayoutData(data); + showAllCheck.setFont(parent.getFont()); + showAllCheck.setText(WorkbenchMessages.NewWizardNewPage_showAll); + showAllCheck.setSelection(false); + // flipping tabs updates the selected node + showAllCheck.addSelectionListener(new SelectionAdapter() { + // the delta of expanded elements between the last 'show all' + // and the current 'no show all' + private Object[] delta = new Object[0]; + + @Override + public void widgetSelected(SelectionEvent e) { + boolean showAll = showAllCheck.getSelection(); + if (showAll) { + filteredTree.getViewer().getControl().setRedraw(false); + } else { + // get the inital expanded elements when going from show + // all-> no show all. + // this isnt really the delta yet, we're just reusing + // the variable. + delta = filteredTree.getViewer().getExpandedElements(); + } + try { + if (showAll) { + filteredTree.getViewer().resetFilters(); + filteredTree.getViewer().addFilter(filteredTreeFilter); + // restore the expanded elements that were present + // in the last show all state but not in the 'no + // show all' state. + Object[] currentExpanded = filteredTree.getViewer() + .getExpandedElements(); + Object[] expanded = new Object[delta.length + + currentExpanded.length]; + System.arraycopy(currentExpanded, 0, expanded, 0, + currentExpanded.length); + System.arraycopy(delta, 0, expanded, + currentExpanded.length, delta.length); + filteredTree.getViewer().setExpandedElements(expanded); + } else { + filteredTree.getViewer().addFilter(filter); + } + filteredTree.getViewer().refresh(false); + if (!showAll) { + // if we're going from show all -> no show all + // record the elements that were expanded in the + // 'show all' state but not the 'no show all' state + // (because they didnt exist). + Object[] newExpanded = filteredTree.getViewer().getExpandedElements(); + List deltaList = new ArrayList(Arrays.asList(delta)); + deltaList.removeAll(Arrays.asList(newExpanded)); + } + } finally { + if (showAll) { + filteredTree.getViewer().getControl().setRedraw(true); + } + } + } + }); + } + } + + /** + * Create the image controls. + * + * @param parent the parent Composite. + * @since 3.0 + */ + private void createImage(Composite parent) { + descImageCanvas = new CLabel(parent, SWT.NONE); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING + | GridData.VERTICAL_ALIGN_BEGINNING); + data.widthHint = 0; + data.heightHint = 0; + descImageCanvas.setLayoutData(data); + // hook a listener to get rid of cached images. + descImageCanvas.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + for (Iterator i = imageTable.values().iterator(); i.hasNext();) { + ((Image) i.next()).dispose(); + } + imageTable.clear(); + } + }); + } + + /** + * Returns the single selected object contained in the passed + * selectionEvent, or null if the selectionEvent contains + * either 0 or 2+ selected objects. + */ + protected Object getSingleSelection(IStructuredSelection selection) { + return selection.size() == 1 ? selection.getFirstElement() : null; + } + + /** + * Set self's widgets to the values that they held last time this page was + * open + * + */ + protected void restoreWidgetValues() { + //expandPreviouslyExpandedCategories(); + selectPreviouslySelected(); + } + + /** + * Store the current values of self's widgets so that they can be restored + * in the next instance of self + * + */ + public void saveWidgetValues() { + storeSelectedCategoryAndWizard(); + } + + /** + * The user selected either new wizard category(s) or wizard element(s). + * Proceed accordingly. + * + * @param selectionEvent ISelection + */ + @Override + public void selectionChanged(SelectionChangedEvent selectionEvent) { + page.setErrorMessage(null); + page.setMessage(null); + Object selectedObject = getSingleSelection((IStructuredSelection) selectionEvent + .getSelection()); + if (selectedObject instanceof IWizardDescriptor) { + if (selectedObject == selectedElement) { + return; + } + updateWizardSelection((IWizardDescriptor) selectedObject); + } else { + selectedElement = null; + page.setHasPages(false); + page.setCanFinishEarly(false); + page.selectWizardNode(null); + updateDescription(null); + } + } + + /** + * Selects the wizard category and wizard in this page that were selected + * last time this page was used. If a category or wizard that was + * previously selected no longer exists then it is ignored. + */ + protected void selectPreviouslySelected() { + String selectedId = settings.get(STORE_SELECTED_ID); + if (selectedId == null) { + return; + } + Object selected = null; + for (int i = 0; i < primaryWizards.length; i++) { + IWizardDescriptor wizard = primaryWizards[i]; + if (wizard.getId().equals(selectedId)) { + selected = wizard; + break; + } + } + if (selected == null) { + // if we cant find either a category or a wizard, abort. + return; + } + //work around for 62039 + final StructuredSelection selection = new StructuredSelection(selected); + filteredTree.getViewer().getControl().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + filteredTree.getViewer().setSelection(selection, true); + } + }); + } + + /** + * Set the dialog store to use for widget value storage and retrieval + * + * @param settings IDialogSettings + */ + public void setDialogSettings(IDialogSettings settings) { + this.settings = settings; + } + + + /** + * Stores the currently-selected element in this page's dialog store, in + * order to recreate this page's state in the next instance of this page. + */ + protected void storeSelectedCategoryAndWizard() { + Object selected = getSingleSelection((IStructuredSelection) filteredTree + .getViewer().getSelection()); + if (selected != null) { + if (selected instanceof IWizardCategory) { + settings.put(STORE_SELECTED_ID, + ((IWizardCategory) selected).getPath() + .toString()); + } else { + // else its a wizard + settings.put(STORE_SELECTED_ID, + ((IWizardDescriptor) selected).getId()); + } + } + } + + /** + * Update the current description controls. + * + * @param selectedObject the new wizard + * @since 3.0 + */ + private void updateDescription(IWizardDescriptor selectedObject) { + String string = ""; //$NON-NLS-1$ + if (selectedObject != null) { + string = selectedObject.getDescription(); + } + page.setDescription(string); + if (hasImage(selectedObject)) { + ImageDescriptor descriptor = null; + if (selectedObject != null) { + descriptor = selectedObject.getDescriptionImage(); + } + if (descriptor != null) { + GridData data = (GridData) descImageCanvas.getLayoutData(); + data.widthHint = SWT.DEFAULT; + data.heightHint = SWT.DEFAULT; + Image image = (Image) imageTable.get(descriptor); + if (image == null) { + image = descriptor.createImage(false); + imageTable.put(descriptor, image); + } + descImageCanvas.setImage(image); + } + } else { + GridData data = (GridData) descImageCanvas.getLayoutData(); + data.widthHint = 0; + data.heightHint = 0; + descImageCanvas.setImage(null); + } + descImageCanvas.getParent().layout(true); + filteredTree.getViewer().getTree().showSelection(); + IWizardContainer container = page.getWizard().getContainer(); + if (container instanceof IWizardContainer2) { + ((IWizardContainer2) container).updateSize(); + } + } + + /** + * Tests whether the given wizard has an associated image. + * + * @param selectedObject the wizard to test + * @return whether the given wizard has an associated image + */ + private boolean hasImage(IWizardDescriptor selectedObject) { + if (selectedObject == null) { + return false; + } + if (selectedObject.getDescriptionImage() != null) { + return true; + } + return false; + } + + /** + * @param selectedObject + */ + private void updateWizardSelection(IWizardDescriptor selectedObject) { + selectedElement = selectedObject; + WorkbenchWizardNode selectedNode; + if (selectedWizards.containsKey(selectedObject)) { + selectedNode = (WorkbenchWizardNode) selectedWizards + .get(selectedObject); + } else { + selectedNode = new WorkbenchWizardNode(page, selectedObject) { + @Override + public IWorkbenchWizard createWizard() throws CoreException { + return wizardElement.createWizard(); + } + }; + selectedWizards.put(selectedObject, selectedNode); + } + page.setCanFinishEarly(selectedObject.canFinishEarly()); + page.setHasPages(selectedObject.hasPages()); + page.selectWizardNode(selectedNode); + updateDescription(selectedObject); + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java new file mode 100644 index 00000000000..4e13b15d821 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -0,0 +1,120 @@ +/******************************************************************************* + * Copyright (c) 2000, 2015 IBM Corporation 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.internal.IWorkbenchHelpContextIds; +import org.eclipse.ui.internal.WorkbenchMessages; +import org.eclipse.ui.internal.activities.ws.WorkbenchTriggerPoints; +import org.eclipse.ui.internal.dialogs.WorkbenchWizardSelectionPage; +import org.eclipse.ui.wizards.IWizardDescriptor; + +/** + * New wizard selection tab that allows the user to either select a + * registered 'New' wizard to be launched, or to select a solution or + * projects to be retrieved from an available server. This page + * contains two visual tabs that allow the user to perform these tasks. + * + * Temporarily has two inner pages. The new format page is used if the system + * is currently aware of activity categories. + */ +class NewLaunchTargetWizardSelectionPage extends WorkbenchWizardSelectionPage { + // widgets + private NewLaunchTargetWizardNewPage newResourcePage; + private IWizardDescriptor[] wizards; + private boolean canFinishEarly = false, hasPages = true; + + /** + * Create an instance of this class. + * + * @param workbench the workbench + * @param wizards the primary wizard elements + */ + public NewLaunchTargetWizardSelectionPage(IWorkbench workbench, + IWizardDescriptor[] wizards) { + super("newWizardSelectionPage", workbench, null, null, WorkbenchTriggerPoints.NEW_WIZARDS);//$NON-NLS-1$ + setTitle(WorkbenchMessages.NewWizardSelectionPage_description); + this.wizards = wizards; + } + + /** + * Makes the next page visible. + */ + public void advanceToNextPageOrFinish() { + if (canFlipToNextPage()) { + getContainer().showPage(getNextPage()); + } else if (canFinishEarly()) { + if (getWizard().performFinish()) { + ((WizardDialog) getContainer()).close(); + } + } + } + + @Override + public void createControl(Composite parent) { + IDialogSettings settings = getDialogSettings(); + newResourcePage = new NewLaunchTargetWizardNewPage(this, null, wizards); + newResourcePage.setDialogSettings(settings); + Control control = newResourcePage.createControl(parent); + getWorkbench().getHelpSystem().setHelp(control, + IWorkbenchHelpContextIds.NEW_WIZARD_SELECTION_WIZARD_PAGE); + setControl(control); + } + + /** + * Since Finish was pressed, write widget values to the dialog store so that they + *will persist into the next invocation of this wizard page + */ + protected void saveWidgetValues() { + newResourcePage.saveWidgetValues(); + } + + @Override + public boolean canFlipToNextPage() { + // if the current page advertises that it does have pages then ask it via the super call + if (hasPages) { + return super.canFlipToNextPage(); + } + return false; + } + + /** + * Sets whether the selected wizard advertises that it does provide pages. + * + * @param newValue whether the selected wizard has pages + * @since 3.1 + */ + public void setHasPages(boolean newValue) { + hasPages = newValue; + } + + /** + * Sets whether the selected wizard advertises that it can finish early. + * + * @param newValue whether the selected wizard can finish early + */ + public void setCanFinishEarly(boolean newValue) { + canFinishEarly = newValue; + } + + /** + * Answers whether the currently selected page, if any, advertises that it may finish early. + * + * @return whether the page can finish early + */ + public boolean canFinishEarly() { + return canFinishEarly; + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java index 6cd2a5726d2..f29dde373d9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java @@ -9,6 +9,7 @@ package org.eclipse.launchbar.ui.target; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.ui.wizards.IWizardDescriptor; /** * A manager for the launch target UI. @@ -17,11 +18,12 @@ public interface ILaunchTargetUIManager { /** * Return a label provider that gives the test and image for the target. - * + * * @param target * the launch target * @return the label provider for the launch target */ ILabelProvider getLabelProvider(ILaunchTarget target); + public IWizardDescriptor[] getLaunchTargetWizards(); } From ca538d05a59df408b5d76a3d3c568cc08c3df23b Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 26 Jan 2016 09:47:48 -0500 Subject: [PATCH 079/198] launchar: launch target wizard fixes - removed hack with overloading wizard classes - added wizard contribution, so it can be bound to command or used without launchbar - removed hack with using category to identify launch target wizard - added more comments in schema - fixed hack when parsing wizard if they categorized Change-Id: I791679ef30c395db10ec2528a6e2b90370e56a75 --- bundles/org.eclipse.launchbar.ui/plugin.xml | 13 ++++++-- .../schema/launchTargetTypeUI.exsd | 22 ++++++++++++-- .../ui/internal/controls/TargetSelector.java | 5 +--- .../target/LaunchTargetUIManager.java | 20 +++++++++++-- .../target/NewLaunchTargetWizard.java | 30 ++++++++++++++----- .../target/NewLaunchTargetWizardAction.java | 24 +++++---------- 6 files changed, 80 insertions(+), 34 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/bundles/org.eclipse.launchbar.ui/plugin.xml index 7050eeb425c..34f16b217a4 100644 --- a/bundles/org.eclipse.launchbar.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.ui/plugin.xml @@ -72,13 +72,22 @@ - + + name="Launch Targets"> + + + diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd index 8173b9db2c3..cb66eccd31b 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd @@ -6,7 +6,8 @@
- [Enter description of this extension point.] + This extension point allow to contribute UI element for launch targets, specifically target label provider +and target creation wizard.
@@ -74,6 +75,11 @@ + + + Contribute a wizard that can create a launch target, normally it would be a wizard per target type. + + @@ -181,7 +187,19 @@ Since 3.0 - [Enter extension point usage example here.] + <extension + point="org.eclipse.launchbar.ui.launchTargetTypeUI"> + <launchTargetTypeUI + id="com.qnx.tools.ide.target.qconn" + labelProvider="com.qnx.tools.ide.target.qconn.internal.ui.QConnLaunchTargetLabelProvider"> + + </launchTargetTypeUI> + <wizard + class="com.qnx.tools.ide.target.qconn.internal.ui.wizards.NewQconnTargetWizard" + id="com.qnx.tools.ide.target.qconn.ui.NewQNXTarget" + name="New QNX Target"> + </wizard> + </extension> diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index 305f935c322..cc19b25bc2a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -211,10 +211,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(org.eclipse.swt.events.MouseEvent event) { - NewLaunchTargetWizardAction newWizardAction = new NewLaunchTargetWizardAction( - PlatformUI.getWorkbench().getActiveWorkbenchWindow(), - targetUIManager.getLaunchTargetWizards()); - newWizardAction.run(); + new NewLaunchTargetWizardAction().run(); } }; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java index 4e15553fcb3..7c4a10a4431 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java @@ -7,7 +7,9 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.eclipse.core.runtime.CoreException; @@ -88,8 +90,22 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { return wizards; WizardsRegistryReader reader = new WizardsRegistryReader(Activator.PLUGIN_ID, "launchTargetTypeUI"); //$NON-NLS-1$ WizardCollectionElement wizardElements = reader.getWizardElements(); - WizardCollectionElement otherCategory = (WizardCollectionElement) wizardElements.getChildren(null)[0]; - wizards = otherCategory.getWizards(); + List result = collectWizards(wizardElements, new ArrayList<>()); + wizards = result.toArray(new IWizardDescriptor[result.size()]); return wizards; } + + /* we don't show categories we have to flatten the wizards */ + private List collectWizards(WizardCollectionElement element, List result) { + Object[] children = element.getChildren(null); // children are categories + IWizardDescriptor[] wizards = element.getWizards(); + for (IWizardDescriptor desc : wizards) { + result.add(desc); + } + for (Object cat : children) { + WizardCollectionElement category = (WizardCollectionElement) cat; + collectWizards(category, result); + } + return result; + } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java index 0d79e1c0579..7fb746f169e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java @@ -10,15 +10,18 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; +import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchWizard; 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.wizards.IWizardCategory; import org.eclipse.ui.wizards.IWizardDescriptor; /** @@ -26,9 +29,10 @@ import org.eclipse.ui.wizards.IWizardDescriptor; * (nested) wizard to run. The set of available new wizards comes from the new * extension point. */ -public class NewLaunchTargetWizard extends Wizard { +public class NewLaunchTargetWizard extends Wizard implements IWorkbenchWizard { private NewLaunchTargetWizardSelectionPage mainPage; private IWorkbench workbench; + private final ILaunchTargetUIManager targetUIManager = Activator.getService(ILaunchTargetUIManager.class); /** * Create the wizard pages @@ -40,11 +44,7 @@ public class NewLaunchTargetWizard extends Wizard { } public IWizardDescriptor[] getWizardDescriptors() { - IWizardCategory launchCategory = WorkbenchPlugin.getDefault().getNewWizardRegistry() - .findCategory("org.eclipse.launchbar.ui.targetWizards"); //$NON-NLS-1$ - if (launchCategory != null) - return launchCategory.getWizards(); - return new IWizardDescriptor[0]; + return targetUIManager.getLaunchTargetWizards(); } /** @@ -52,6 +52,7 @@ public class NewLaunchTargetWizard extends Wizard { * @param aWorkbench the workbench * @param currentSelection the current selection */ + @Override public void init(IWorkbench aWorkbench, IStructuredSelection currentSelection) { this.workbench = aWorkbench; @@ -84,6 +85,21 @@ public class NewLaunchTargetWizard extends Wizard { return true; } + @Override + public IDialogSettings getDialogSettings() { + IDialogSettings wizardSettings = super.getDialogSettings(); + if (wizardSettings == null) { + IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings(); + String settingsSection = getClass().getSimpleName(); + wizardSettings = workbenchSettings.getSection(settingsSection); + if (wizardSettings == null) { + wizardSettings = workbenchSettings.addNewSection(settingsSection); + } + setDialogSettings(wizardSettings); + } + return wizardSettings; + } + @Override public boolean canFinish() { // we can finish if the first page is current and the the page can finish early. diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java index 004c8b44b00..ec026074e81 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java @@ -21,7 +21,6 @@ import org.eclipse.ui.actions.*; import org.eclipse.ui.internal.IWorkbenchHelpContextIds; import org.eclipse.ui.internal.WorkbenchMessages; import org.eclipse.ui.internal.WorkbenchPlugin; -import org.eclipse.ui.wizards.IWizardDescriptor; /** * Invoke the resource creation wizard selection Wizard. @@ -59,20 +58,17 @@ public class NewLaunchTargetWizardAction extends Action implements * action has been disposed. */ private IWorkbenchWindow workbenchWindow; - private IWizardDescriptor[] desc; /** * Create a new instance of this class. - * @param window - * @param iWizardDescriptors */ - public NewLaunchTargetWizardAction(IWorkbenchWindow window, IWizardDescriptor[] desc) { + public NewLaunchTargetWizardAction() { super(WorkbenchMessages.NewWizardAction_text); + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) { throw new IllegalArgumentException(); } this.workbenchWindow = window; - this.desc = desc; // @issues should be IDE-specific images ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); setImageDescriptor(images @@ -110,20 +106,14 @@ public class NewLaunchTargetWizardAction extends Action implements // action has been disposed return; } - NewLaunchTargetWizard wizard = new NewLaunchTargetWizard() { - @Override - public IWizardDescriptor[] getWizardDescriptors() { - return desc; - } - }; + NewLaunchTargetWizard wizard = new NewLaunchTargetWizard(); wizard.setWindowTitle(windowTitle); wizard.init(workbenchWindow.getWorkbench(), null); - IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault() - .getDialogSettings(); - IDialogSettings wizardSettings = workbenchSettings - .getSection("NewLaunchTargetWizardAction"); //$NON-NLS-1$ + IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings(); + String settingsSection = getClass().getSimpleName(); + IDialogSettings wizardSettings = workbenchSettings.getSection(settingsSection); if (wizardSettings == null) { - wizardSettings = workbenchSettings.addNewSection("NewLaunchTargetWizardAction"); //$NON-NLS-1$ + wizardSettings = workbenchSettings.addNewSection(settingsSection); } wizard.setDialogSettings(wizardSettings); wizard.setForcePreviousAndNextButtons(true); From 3eb77d17f67d01a5c5987036200e1da2723eaedc Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 29 Jan 2016 09:52:36 -0500 Subject: [PATCH 080/198] launchbar: track non launch bar launches - when user runs something not from launch bar, launch bar won't updade which creates unplesent gap in experience. This fix makes launchbar track launches and update active descriptor/mode/target depending on what was launched. Change-Id: Ie70c6927997bba8ee06a393e767e02ccb4cf4cb7 --- .../core/AbstractLaunchConfigProvider.java | 8 + .../core/DefaultLaunchConfigProvider.java | 10 +- .../core/ILaunchConfigurationProvider.java | 36 +++- .../core/internal/LaunchBarManager.java | 168 +++++++++++++----- 4 files changed, 162 insertions(+), 60 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index 6203abb43bc..19cef3b7bb5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -47,6 +47,14 @@ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurati workingCopy.setAttribute(ATTR_PROVIDER_CLASS, getClass().getName()); } + @Override + public boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, ILaunchTarget target) throws CoreException { + ILaunchConfiguration lc = descriptor.getAdapter(ILaunchConfiguration.class); + if (lc == null) + return false; + return configuration.getName().equals(lc.getName()); + } + protected boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException { if (!configuration.exists()) { // can't own it if it doesn't exist diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index ab26e5e83c7..faafd04690b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -19,12 +19,11 @@ import org.eclipse.launchbar.core.target.ILaunchTargetManager; /** * The launch config provider for the default descriptor which is the launch * config itself. - * + * * Override this class and register an extension if you want to support targets * other than the local connection. */ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider { - @Override public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { // Only supports Local connection @@ -69,4 +68,11 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider // nothing to do } + @Override + public boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, ILaunchTarget target) throws CoreException { + ILaunchConfiguration lc = descriptor.getAdapter(ILaunchConfiguration.class); + if (lc == null) + return false; + return configuration.getName().equals(lc.getName()); + } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index ef7c9f473f2..ba918e550f8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -18,7 +18,7 @@ import org.eclipse.launchbar.core.target.ILaunchTarget; /** * The provider of launch configurations of a given type for a given descriptor * type and a given target type. - * + * * It is recommended to extend {@link AbstractLaunchConfigProvider} or one of * it's subclasses instead of implementing this directly. */ @@ -26,10 +26,10 @@ public interface ILaunchConfigurationProvider { /** * Does this config provider provide launch configurations for the * combination of descriptor and target. - * + * * Note: this is called when filtering targets for a descriptor. Processing * should be minimal. - * + * * @param descriptor * @param target * @return true if target is supported, false otherwise. @@ -38,7 +38,7 @@ public interface ILaunchConfigurationProvider { /** * Return the launch configuation type for the descriptor and target. - * + * * @param descriptor * @param target * launch configuration type or null if not supported @@ -61,11 +61,29 @@ public interface ILaunchConfigurationProvider { ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException; + /** + * Return true if given descriptor is associated with given launch configuration. + * I.e. if getLaunchConfiguration(descriptor, target) returns a launch configuration, + * calling launchDescriptorMatches(descriptor, configuration, target) should return true. + * + * This method is used to activate descriptor when launch happens, return false all the time would mean + * launch would track launches of this specific descriptor (if they occur outside of launchbar). + * @param configuration + * launch configuration in question + * @param target - target to match, it can be null if launch bar cannot determine target, + * in this case it should act as wildcard + * + * @return launch configuration + * @throws CoreException + */ + boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, ILaunchTarget target) + throws CoreException; + /** * A launch configuration has been added. Provider can inspect it and * associate with internal map. Provider should make sure it owns this * launch configuration or it can modify it to take over. - * + * * @return true of provider owns this launch configuration */ boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException; @@ -76,7 +94,7 @@ public interface ILaunchConfigurationProvider { * configuration has been removed from file system, so accessing its * attributes won't work. If provider cannot determine if it owns it it * should return false. - * + * * @param configuration * @return true if provider owns this launch configuration * @throws CoreException @@ -87,7 +105,7 @@ public interface ILaunchConfigurationProvider { * A launch configuration has been changed. Provider can inspect it to * re-evaluate its internal map. Provider should make sure it owns this * launch configuration or it can modify it to take over. - * + * * @return true of provider owns this launch configuration */ boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException; @@ -95,7 +113,7 @@ public interface ILaunchConfigurationProvider { /** * A launch descriptor has been removed. Remove any launch configurations * that were created for it. - * + * * @param descriptor * @throws CoreException */ @@ -104,7 +122,7 @@ public interface ILaunchConfigurationProvider { /** * A launch target has been removed. Remove any launch configurations that * were created for it. - * + * * @param target * @throws CoreException */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 277888a0a40..9908602ddb8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -32,8 +32,10 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchListener; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.ILaunchBarManager; @@ -44,6 +46,7 @@ import org.eclipse.launchbar.core.ILaunchObjectProvider; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetListener; import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.launch.ITargetedLaunch; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; @@ -51,7 +54,6 @@ import org.osgi.service.prefs.Preferences; * The brains of the launch bar. */ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListener { - public interface Listener { default void activeLaunchDescriptorChanged() { } @@ -68,39 +70,29 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene default void launchTargetsChanged() { } } - private final List listeners = new LinkedList<>(); - // The launch object providers private final List objectProviders = new ArrayList<>(); - // The descriptor types private final Map descriptorTypes = new HashMap<>(); - // Descriptor types ordered from highest priority to lowest private List orderedDescriptorTypes; - // the extended info for loaded descriptor types private final Map descriptorTypeInfo = new HashMap<>(); private final Map> configProviders = new HashMap<>(); - // Descriptors in MRU order, key is desc type id and desc name. private final Map, ILaunchDescriptor> descriptors = new LinkedHashMap<>(); - // Map of launch objects to launch descriptors private final Map objectDescriptorMap = new HashMap<>(); - private ILaunchTargetManager launchTargetManager; - private ILaunchDescriptor activeLaunchDesc; private ILaunchMode activeLaunchMode; private ILaunchTarget activeLaunchTarget; - // private static final String PREF_ACTIVE_CONFIG_DESC = "activeConfigDesc"; private static final String PREF_ACTIVE_LAUNCH_MODE = "activeLaunchMode"; //$NON-NLS-1$ private static final String PREF_ACTIVE_LAUNCH_TARGET = "activeLaunchTarget"; //$NON-NLS-1$ private static final String PREF_CONFIG_DESC_ORDER = "configDescList"; //$NON-NLS-1$ - + private static final String PREF_TRACK_LAUNCHES = "trackLaunches"; //$NON-NLS-1$ boolean initialized = false; public LaunchBarManager() { @@ -146,17 +138,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene // Fetch the desc order before the init messes it up IEclipsePreferences store = getPreferenceStore(); String configDescIds = store.get(PREF_CONFIG_DESC_ORDER, ""); //$NON-NLS-1$ - // Load up the types loadExtensions(); - // Hook up the existing launch configurations and listen ILaunchManager launchManager = getLaunchManager(); for (ILaunchConfiguration configuration : launchManager.getLaunchConfigurations()) { launchConfigurationAdded(configuration); } launchManager.addLaunchConfigurationListener(this); - // Reorder the descriptors based on the preference if (!configDescIds.isEmpty()) { String[] split = configDescIds.split(","); //$NON-NLS-1$ @@ -170,12 +159,51 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene last = desc; } } - // Set the active desc, with MRU, it should be the last one if (last != null) { setActiveLaunchDescriptor(last); } } + launchManager.addLaunchListener(new ILaunchListener() { + @Override + public void launchRemoved(ILaunch launch) { + // ignore + } + + @Override + public void launchAdded(ILaunch launch) { + if (!getPreferenceStore().getBoolean(PREF_TRACK_LAUNCHES, true)) + return; + ILaunchConfiguration lc = launch.getLaunchConfiguration(); + String mode = launch.getLaunchMode(); + ILaunchTarget target = null; + if (launch instanceof ITargetedLaunch) { + target = ((ITargetedLaunch) launch).getLaunchTarget(); + } + try { + setActive(lc, mode, target); + } catch (CoreException e) { + Activator.log(e); + } + } + + @Override + public void launchChanged(ILaunch launch) { + ILaunchConfiguration lc = launch.getLaunchConfiguration(); + ILaunchTarget target = null; + if (launch instanceof ITargetedLaunch) { + target = ((ITargetedLaunch) launch).getLaunchTarget(); + } + if (launchDescriptorMatches(activeLaunchDesc, lc, target)) { + // active launch delegate may have changed target + try { + setActiveLaunchTarget(target); + } catch (CoreException e) { + Activator.log(e); + } + } + } + }); } finally { initialized = true; } @@ -188,7 +216,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void loadExtensions() throws CoreException { IExtensionPoint point = getExtensionPoint(); IExtension[] extensions = point.getExtensions(); - // Load up the types for (IExtension extension : extensions) { for (IConfigurationElement element : extension.getConfigurationElements()) { @@ -196,9 +223,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene String elementName = element.getName(); if (elementName.equals("descriptorType")) { //$NON-NLS-1$ LaunchDescriptorTypeInfo typeInfo = new LaunchDescriptorTypeInfo(element); - descriptorTypes.put(typeInfo.getId(), typeInfo); - if (configProviders.get(typeInfo.getId()) == null) { // Make sure we initialize the list configProviders.put(typeInfo.getId(), new ArrayList()); @@ -217,7 +242,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } } - // Sort things orderedDescriptorTypes = new ArrayList<>(descriptorTypes.values()); Collections.sort(orderedDescriptorTypes, new Comparator() { @@ -234,7 +258,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } }); - for (List providers : configProviders.values()) { Collections.sort(providers, new Comparator() { @Override @@ -250,9 +273,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } }); - } - // Now that all the types are loaded, the object providers which now // populate the descriptors for (IExtension extension : extensions) { @@ -282,7 +303,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (i < 0) { return null; } - return new Pair(key.substring(0, i), key.substring(i + 1)); } @@ -308,7 +328,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene throws CoreException { if (descriptor == null) return null; - for (LaunchConfigProviderInfo providerInfo : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) { ILaunchConfigurationType type = providerInfo.getProvider().getLaunchConfigurationType(descriptor, @@ -318,7 +337,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } } - return null; } @@ -329,7 +347,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (desc != null) { return desc; } - for (LaunchDescriptorTypeInfo descriptorInfo : orderedDescriptorTypes) { try { if (descriptorInfo.enabled(launchObject)) { @@ -343,13 +360,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene addDescriptor(launchObject, desc); return desc; } - } } catch (Throwable e) { Activator.log(e); } } - return null; } @@ -362,7 +377,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (descriptor.equals(activeLaunchDesc)) { setActiveLaunchDescriptor(getLastUsedDescriptor()); } - for (LaunchConfigProviderInfo providerInfo : configProviders .get(getDescriptorTypeId(descriptor.getType()))) { if (providerInfo.enabled(descriptor)) { @@ -375,14 +389,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene @Override public void launchObjectChanged(Object launchObject) throws CoreException { // TODO deal with object renames here, somehow - ILaunchDescriptor origDesc = objectDescriptorMap.get(launchObject); if (origDesc == null) { // See if anyone wants it now launchObjectAdded(launchObject); return; } - // check if descriptor still wants it ILaunchDescriptorType origDescType = origDesc.getType(); try { @@ -419,6 +431,38 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return activeLaunchDesc; } + private void setActive(ILaunchConfiguration config, String mode, ILaunchTarget target) throws CoreException { + ILaunchDescriptor descriptor = getLaunchDescriptor(config, target); + if (descriptor == null) + return; // not found + // we do not call setActiveLaunchTarget because it will cause mode/target switch and cause flickering + boolean changeDesc = activeLaunchDesc != descriptor; + boolean changeTarget = target != null && activeLaunchTarget != target; + if (changeDesc) { + doSetActiveLaunchDescriptor(descriptor); + // store in persistent storage + storeActiveDescriptor(activeLaunchDesc); + } + if (changeTarget) { + activeLaunchTarget = target; + storeLaunchTarget(activeLaunchDesc, target); + } + ILaunchMode[] supportedModes = getLaunchModes(); + for (ILaunchMode launchMode : supportedModes) { + if (launchMode.getIdentifier().equals(mode)) { + setActiveLaunchMode(launchMode); + break; + } + } + // send delayed notification about descriptor change + if (changeDesc) { + fireActiveLaunchDescriptorChanged(); + } + if (changeTarget) { + fireActiveLaunchTargetChanged(); // notify target listeners + } + } + public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws CoreException { Activator.trace("set active descriptor " + descriptor); //$NON-NLS-1$ if (activeLaunchDesc == descriptor) { @@ -436,16 +480,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene // do not set to null unless no descriptors descriptor = getLastUsedDescriptor(); } - activeLaunchDesc = descriptor; - if (descriptor != null) { - // keeps most used descriptor last - Pair id = getDescriptorId(descriptor); - descriptors.remove(id); - descriptors.put(id, descriptor); - } + doSetActiveLaunchDescriptor(descriptor); // store in persistent storage storeActiveDescriptor(activeLaunchDesc); - // Send notifications fireActiveLaunchDescriptorChanged(); // Set active target @@ -454,9 +491,18 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene syncActiveMode(); } + private void doSetActiveLaunchDescriptor(ILaunchDescriptor descriptor) { + activeLaunchDesc = descriptor; + if (descriptor != null) { + // keeps most used descriptor last + Pair id = getDescriptorId(descriptor); + descriptors.remove(id); + descriptors.put(id, descriptor); + } + } + private void storeActiveDescriptor(ILaunchDescriptor descriptor) { Activator.trace("new active config is stored " + descriptor); //$NON-NLS-1$ - // Store the desc order, active one is the last one StringBuffer buff = new StringBuffer(); // TODO: this can be very long string @@ -644,14 +690,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene public List getLaunchTargets(ILaunchDescriptor descriptor) { if (descriptor == null) return Arrays.asList(launchTargetManager.getLaunchTargets()); - List targets = new ArrayList<>(); for (ILaunchTarget target : launchTargetManager.getLaunchTargets()) { if (supportsTarget(descriptor, target)) { targets.add(target); } } - return targets; } @@ -727,19 +771,17 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { List targets = getLaunchTargets(descriptor); // chances are that better target is most recently added, rather then the oldest - return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size()-1); + return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size() - 1); } public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { ILaunchConfiguration configuration = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); - // This is the only concrete time we have the mapping from launch // configuration to launch target. Record it in the target manager for // the launch delegates to use. if (configuration != null) { launchTargetManager.setDefaultLaunchTarget(configuration, activeLaunchTarget); } - return configuration; } @@ -748,7 +790,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (descriptor == null) { return null; } - String descTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeId)) { try { @@ -767,7 +808,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene Activator.log(e); } } - return null; } @@ -809,7 +849,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } catch (Throwable e) { Activator.log(e); } - for (LaunchDescriptorTypeInfo descTypeInfo : orderedDescriptorTypes) { for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeInfo.getId())) { try { @@ -900,4 +939,35 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } + private ILaunchDescriptor getLaunchDescriptor(ILaunchConfiguration configuration, ILaunchTarget target) { + // shortcut - check active first + if (launchDescriptorMatches(activeLaunchDesc, configuration, target)) { + return activeLaunchDesc; + } + for (ILaunchDescriptor desc : getLaunchDescriptors()) { // this should be in MRU, most used first + if (launchDescriptorMatches(desc, configuration, target)) { + return desc; + } + } + return null; + } + + private boolean launchDescriptorMatches(ILaunchDescriptor desc, ILaunchConfiguration configuration, + ILaunchTarget target) { + if (desc == null || configuration == null) + return false; + try { + String descriptorTypeId = getDescriptorTypeId(desc.getType()); + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descriptorTypeId)) { + if (providerInfo.enabled(desc) && (target == null || providerInfo.enabled(target))) { + if (providerInfo.getProvider().launchDescriptorMatches(desc, configuration, target)) { + return true; + } + } + } + } catch (CoreException e) { + Activator.log(e); + } + return false; + } } From 3a66908e57272ff649cc340b85acb977d8170f89 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 29 Jan 2016 10:57:02 -0500 Subject: [PATCH 081/198] launchbar: public API for launch bar listeners Change-Id: Ic33a181f679708de2b78aa7a49bde1ab45578b39 --- .../launchbar/core/ILaunchBarListener.java | 44 +++++++++++++++++++ .../launchbar/core/ILaunchBarManager.java | 18 ++++++-- .../core/internal/LaunchBarManager.java | 42 +++++++----------- .../internal/controls/LaunchBarControl.java | 19 +++----- .../core/internal/LaunchBarManager2Test.java | 35 ++++++++------- 5 files changed, 97 insertions(+), 61 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java new file mode 100644 index 00000000000..2db287409a0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) Jan 29, 2016 QNX Software Systems. All Rights Reserved. + * + * You must obtain a written license from and pay applicable license fees to QNX + * Software Systems before you may reproduce, modify or distribute this software, + * or any work that includes all or part of this software. Free development + * licenses are available for evaluation and non-commercial purposes. For more + * information visit [http://licensing.qnx.com] or email licensing@qnx.com. + * + * This file may contain contributions from others. Please review this entire + * file for other proprietary rights or license notices, as well as the QNX + * Development Suite License Guide at [http://licensing.qnx.com/license-guide/] + * for other information. + *******************************************************************************/ +package org.eclipse.launchbar.core; + +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * Listener that can be installed on launch bar to listen for state changes. + * {@link ILaunchBarManager#addListener(ILaunchBarListener)}. + * + * + * Activator.getService(ILaunchBarManager.class).addListener(new ILaunchBarListener(){ + * public void activeLaunchTargetChanged(ILaunchTarget target) { + * // do something + * } + * }); + * + */ +public interface ILaunchBarListener { + default void activeLaunchDescriptorChanged(ILaunchDescriptor descriptor) { + } + + default void activeLaunchModeChanged(ILaunchMode mode) { + } + + default void activeLaunchTargetChanged(ILaunchTarget target) { + } + + default void launchTargetsChanged() { + } +} \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index 9f6f4387d35..6817509f546 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -23,7 +23,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * A launch object has been added. Create a matching launch descriptor if * available. - * + * * @param element * launch object * @return the launch descriptor that got created, null of none was @@ -34,7 +34,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * A launch object has been removed. Remove the associated launch descriptor * if there is one. - * + * * @param element * launch object * @throws CoreException @@ -43,10 +43,22 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * A launch object has changed in some way that affects the launch bar. - * + * * @param launchObject * @throws CoreException */ void launchObjectChanged(Object launchObject) throws CoreException; + + /** + * Add a linstener that can react to launch bar changes + * @param listener + */ + public void addListener(ILaunchBarListener listener); + + /** + * Remove a linstener + * @param listener + */ + public void removeListener(ILaunchBarListener listener); } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 9908602ddb8..eca2691ddcb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -38,6 +38,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchListener; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.ILaunchBarListener; import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; @@ -54,23 +55,7 @@ import org.osgi.service.prefs.Preferences; * The brains of the launch bar. */ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListener { - public interface Listener { - default void activeLaunchDescriptorChanged() { - } - - default void activeLaunchModeChanged() { - } - - default void activeLaunchTargetChanged() { - } - - default void launchDescriptorRemoved(ILaunchDescriptor descriptor) { - } - - default void launchTargetsChanged() { - } - } - private final List listeners = new LinkedList<>(); + private final List listeners = new LinkedList<>(); // The launch object providers private final List objectProviders = new ArrayList<>(); // The descriptor types @@ -615,9 +600,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchDescriptorChanged() { if (!initialized) return; - for (Listener listener : listeners) { + for (ILaunchBarListener listener : listeners) { try { - listener.activeLaunchDescriptorChanged(); + listener.activeLaunchDescriptorChanged(activeLaunchDesc); } catch (Exception e) { Activator.log(e); } @@ -671,9 +656,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchModeChanged() { if (!initialized) return; - for (Listener listener : listeners) { + for (ILaunchBarListener listener : listeners) { try { - listener.activeLaunchModeChanged(); + listener.activeLaunchModeChanged(activeLaunchMode); } catch (Exception e) { Activator.log(e); } @@ -759,9 +744,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchTargetChanged() { if (!initialized) return; - for (Listener listener : listeners) { + for (ILaunchBarListener listener : listeners) { try { - listener.activeLaunchTargetChanged(); + listener.activeLaunchTargetChanged(activeLaunchTarget); } catch (Exception e) { Activator.log(e); } @@ -811,13 +796,16 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return null; } - public void addListener(Listener listener) { + @Override + public void addListener(ILaunchBarListener listener) { if (listener == null) return; - listeners.add(listener); + if (!listeners.contains(listener)) // cannot add duplicates + listeners.add(listener); } - public void removeListener(Listener listener) { + @Override + public void removeListener(ILaunchBarListener listener) { if (listener == null) return; listeners.remove(listener); @@ -901,7 +889,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireLaunchTargetsChanged() { if (!initialized) return; - for (Listener listener : listeners) { + for (ILaunchBarListener listener : listeners) { try { listener.launchTargetsChanged(); } catch (Exception e) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index b375dc331d4..b3a9b0d1cbd 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -16,9 +16,9 @@ import javax.annotation.PreDestroy; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.launchbar.core.ILaunchBarListener; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; @@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; -public class LaunchBarControl implements Listener { +public class LaunchBarControl implements ILaunchBarListener { public static final String ID = "org.eclipse.launchbar"; //$NON-NLS-1$ public static final String CLASS_URI = "bundleclass://" + Activator.PLUGIN_ID + "/" //$NON-NLS-1$ //$NON-NLS-2$ + LaunchBarControl.class.getName(); @@ -122,35 +122,26 @@ public class LaunchBarControl implements Listener { } @Override - public void activeLaunchDescriptorChanged() { + public void activeLaunchDescriptorChanged(ILaunchDescriptor descriptor) { if (configSelector != null) { - final ILaunchDescriptor descriptor = manager.getActiveLaunchDescriptor(); configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); } } @Override - public void activeLaunchModeChanged() { + public void activeLaunchModeChanged(ILaunchMode mode) { if (modeSelector != null) { - final ILaunchMode mode = manager.getActiveLaunchMode(); modeSelector.setDelayedSelection(mode, SELECTION_DELAY); } } @Override - public void activeLaunchTargetChanged() { + public void activeLaunchTargetChanged(ILaunchTarget target) { if (targetSelector != null) { - final ILaunchTarget target = manager.getActiveLaunchTarget(); targetSelector.setDelayedSelection(target, SELECTION_DELAY); } } - @Override - public void launchDescriptorRemoved(ILaunchDescriptor descriptor) { - // TODO Auto-generated method stub - - } - @Override public void launchTargetsChanged() { if (targetSelector != null) { diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index b5833ecd082..2e000a0d190 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -50,12 +50,12 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.DefaultLaunchConfigProvider; +import org.eclipse.launchbar.core.ILaunchBarListener; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.ProjectLaunchDescriptor; import org.eclipse.launchbar.core.ProjectPerTargetLaunchConfigProvider; -import org.eclipse.launchbar.core.internal.LaunchBarManager.Listener; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.junit.Before; @@ -670,12 +670,12 @@ public class LaunchBarManager2Test { @Test public void testGetActiveLaunchDescriptor() throws CoreException { - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); manager.launchObjectAdded(launchObject); // manager.setActiveLaunchDescriptor(desc); assertEquals(descriptor, manager.getActiveLaunchDescriptor()); - verify(lis).activeLaunchDescriptorChanged(); + verify(lis).activeLaunchDescriptorChanged(descriptor); } @Test @@ -697,12 +697,12 @@ public class LaunchBarManager2Test { @Test public void testSetActiveLaunchDescriptorLisBad() throws CoreException { - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); - doThrow(new NullPointerException()).when(lis).activeLaunchDescriptorChanged(); + doThrow(new NullPointerException()).when(lis).activeLaunchDescriptorChanged(any(ILaunchDescriptor.class)); manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); - verify(lis).activeLaunchDescriptorChanged(); + verify(lis).activeLaunchDescriptorChanged(descriptor); } @Test @@ -774,22 +774,23 @@ public class LaunchBarManager2Test { public void testSetActiveLaunchModeLis() throws CoreException { ILaunchMode mode = mock(ILaunchMode.class); doReturn("bla").when(mode).getIdentifier(); - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); manager.setActiveLaunchMode(mode); manager.setActiveLaunchMode(null); - verify(lis, times(2)).activeLaunchModeChanged(); + verify(lis, times(1)).activeLaunchModeChanged(mode); + verify(lis, times(1)).activeLaunchModeChanged(null); } @Test public void testSetActiveLaunchModeLisBad() throws CoreException { ILaunchMode mode = mock(ILaunchMode.class); doReturn("bla").when(mode).getIdentifier(); - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); - doThrow(new NullPointerException()).when(lis).activeLaunchModeChanged(); + doThrow(new NullPointerException()).when(lis).activeLaunchModeChanged(mode); manager.setActiveLaunchMode(mode); - verify(lis).activeLaunchModeChanged(); + verify(lis).activeLaunchModeChanged(mode); } @Test @@ -857,28 +858,28 @@ public class LaunchBarManager2Test { @Test public void testAddListener() throws CoreException { - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); // check events manager.launchObjectAdded(launchObject); manager.setActiveLaunchDescriptor(descriptor); - verify(lis).activeLaunchTargetChanged(); + verify(lis).activeLaunchTargetChanged(any(ILaunchTarget.class)); } @Test public void testAddListenerBad() throws CoreException { - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); - doThrow(new NullPointerException()).when(lis).activeLaunchTargetChanged(); + doThrow(new NullPointerException()).when(lis).activeLaunchTargetChanged(any(ILaunchTarget.class)); // check events manager.launchObjectAdded(launchObject); manager.setActiveLaunchDescriptor(descriptor); - verify(lis).activeLaunchTargetChanged(); + verify(lis).activeLaunchTargetChanged(any(ILaunchTarget.class)); } @Test public void testRemoveListener() { - Listener lis = mock(Listener.class); + ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); manager.removeListener(lis); verifyZeroInteractions(lis); From da4bfe781f66602034fd95de034e64153f4de26b Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 1 Feb 2016 10:34:58 -0500 Subject: [PATCH 082/198] launchbar: fixed compilation error with neon M5 NOTE: there is nasty fix in ViewerComparator that now requires comparator to be working on strings, we don't use it this way this has to be fixed at some point Change-Id: I0199a830546cf1e9bad5c45bec67e17daf42d558 --- .../launchbar/ui/internal/controls/LaunchBarListViewer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index 7f667d91989..cf3a08eaf8b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -75,7 +75,7 @@ public class LaunchBarListViewer extends StructuredViewer { private String historyPref; private static class LaunchBarListViewerComparator extends ViewerComparator { - public LaunchBarListViewerComparator(Comparator comp) { + public LaunchBarListViewerComparator(Comparator comp) { super(comp); } @@ -83,7 +83,7 @@ public class LaunchBarListViewer extends StructuredViewer { @SuppressWarnings("unchecked") @Override public int compare(Viewer viewer, Object e1, Object e2) { - return getComparator().compare(e1, e2); + return ((Comparator)getComparator()).compare(e1, e2); } } From e39d6946cfd7c874fe8fcbdae5cc88db3741cdd2 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 1 Feb 2016 11:20:08 -0500 Subject: [PATCH 083/198] launchbar: widget is disposed exceptions in tests Change-Id: I1b921ffeeb931c19059a14825b3ebc4e26bd14d1 --- .../eclipse/launchbar/ui/internal/controls/ModeSelector.java | 2 +- .../eclipse/launchbar/ui/internal/controls/TargetSelector.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index b44e8bb3cb4..9bee28361ac 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -225,7 +225,7 @@ public class ModeSelector extends CSelector { } private void updateLaunchButton(ToolItem toolItem) { - if (toolItem == null) { + if (toolItem == null || isDisposed()) { return; } toolItem.setImage(Activator.getDefault().getImage(Activator.IMG_BUTTON_LAUNCH)); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java index cc19b25bc2a..ead2d16d02c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java @@ -261,6 +261,8 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { @Override public void setSelection(Object element) { + if (isDisposed()) + return; if (element == null) { element = noTargets[0]; } else if (element instanceof ILaunchTarget) { From 2b940d6fea08fe5bdfe2683719b970c2f4501739 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 1 Feb 2016 12:10:01 -0500 Subject: [PATCH 084/198] Check for null when getting launch config provider. Change-Id: I60a8dae467885dea5685515b40a658f3328b3ec3 --- .../core/internal/LaunchBarManager.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index eca2691ddcb..b4787ae4c9b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -315,10 +315,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return null; for (LaunchConfigProviderInfo providerInfo : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) { - ILaunchConfigurationType type = providerInfo.getProvider().getLaunchConfigurationType(descriptor, - target); - if (type != null) { - return type; + ILaunchConfigurationProvider provider = providerInfo.getProvider(); + if (provider != null && provider.supports(descriptor, target)) { + ILaunchConfigurationType type = provider.getLaunchConfigurationType(descriptor, target); + if (type != null) { + return type; + } } } } @@ -420,7 +422,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene ILaunchDescriptor descriptor = getLaunchDescriptor(config, target); if (descriptor == null) return; // not found - // we do not call setActiveLaunchTarget because it will cause mode/target switch and cause flickering + // we do not call setActiveLaunchTarget because it will cause + // mode/target switch and cause flickering boolean changeDesc = activeLaunchDesc != descriptor; boolean changeTarget = target != null && activeLaunchTarget != target; if (changeDesc) { @@ -755,7 +758,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { List targets = getLaunchTargets(descriptor); - // chances are that better target is most recently added, rather then the oldest + // chances are that better target is most recently added, rather then + // the oldest return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size() - 1); } @@ -932,7 +936,10 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (launchDescriptorMatches(activeLaunchDesc, configuration, target)) { return activeLaunchDesc; } - for (ILaunchDescriptor desc : getLaunchDescriptors()) { // this should be in MRU, most used first + for (ILaunchDescriptor desc : getLaunchDescriptors()) { // this should + // be in MRU, + // most used + // first if (launchDescriptorMatches(desc, configuration, target)) { return desc; } From 353fe4089775e795567bb1bf0cabe7b6e7c8be6d Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 4 Feb 2016 13:02:58 -0500 Subject: [PATCH 085/198] launchbar: fixed unsafe cast - instead of doing method check and then casting without check, just do a instance check which would gurantee the result and won't rely on that method Change-Id: I153f3113d15d6b145e41ee8c3d48cfe0a5c296d8 --- .../ui/internal/commands/ConfigureActiveLaunchHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index 09d2d166a02..df7cd0cebc1 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -136,7 +136,7 @@ public class ConfigureActiveLaunchHandler extends AbstractHandler { ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); - if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { + if (config instanceof ILaunchConfigurationWorkingCopy && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { config = ((ILaunchConfigurationWorkingCopy) config).doSave(); } // open real eclipse launch configurations dialog From 584728a7aea947910ca4c799eb5a5bc7cc71d52f Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 8 Feb 2016 09:13:41 -0500 Subject: [PATCH 086/198] Bug 487386 - [LaunchBar] Launching default configs resets target to no target Change-Id: If0d9724fe5f23d633dc1f5ab4d46363e1c00d3cf --- .../org/eclipse/launchbar/core/internal/LaunchBarManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index b4787ae4c9b..2e3917e8ae6 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -179,6 +179,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (launch instanceof ITargetedLaunch) { target = ((ITargetedLaunch) launch).getLaunchTarget(); } + if (target == null) + return; if (launchDescriptorMatches(activeLaunchDesc, lc, target)) { // active launch delegate may have changed target try { From 91369b4692ad88b7f856c6e18774228419d5989e Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 8 Feb 2016 13:20:48 -0500 Subject: [PATCH 087/198] Bug 487471 - Improve look and feel of Launch Bar. New icons that have transparent backgrounds and are 24 pixels square and have hot image counterparts. The Launch button now looks different enough to turn off the mode specific icons for now. Change-Id: Iaa8454ffde5e5c6660a5d0d144ae2af971a7b8c6 --- bundles/org.eclipse.launchbar.ui/.options | 2 ++ .../icons/build2_24.png | Bin 0 -> 1341 bytes .../icons/build2_hot_24.png | Bin 0 -> 1349 bytes .../icons/launch2_24.png | Bin 0 -> 1330 bytes .../icons/launch2_hot_24.png | Bin 0 -> 1328 bytes .../icons/stop2_24.png | Bin 0 -> 1229 bytes .../icons/stop2_hot_24.png | Bin 0 -> 1229 bytes .../launchbar/ui/internal/Activator.java | 34 ++++++++++++++---- .../internal/controls/LaunchBarControl.java | 14 +++++--- .../ui/internal/controls/ModeSelector.java | 8 +++-- 10 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/.options create mode 100644 bundles/org.eclipse.launchbar.ui/icons/build2_24.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/launch2_24.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/launch2_hot_24.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/stop2_24.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/stop2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui/.options b/bundles/org.eclipse.launchbar.ui/.options new file mode 100644 index 00000000000..ed790682059 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.options @@ -0,0 +1,2 @@ +org.eclipse.launchbar.ui/iconSize32=false +org.eclipse.launchbar.ui/launchIconUpdater=false diff --git a/bundles/org.eclipse.launchbar.ui/icons/build2_24.png b/bundles/org.eclipse.launchbar.ui/icons/build2_24.png new file mode 100644 index 0000000000000000000000000000000000000000..d917acea6ab34601d14b2709bc25224d3bb7d2bc GIT binary patch literal 1341 zcmV-D1;YA?P)4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q z>q$gGR7efAm2DD)AP9!noo-}jsx#G@>P&9$m_e>7IK+dqEQF{2fIHPW@;iG0y>ed96%yB z%FBJlOaR!DNQZzA%XAd!ic)QxG6xaPv3{cdNb@o280}6W@DB%KUhyU4WelN#mTF!N z&O4eKFO{w!2U0j)Fu^g?cp^PKc05H@5$J(a6v=xKuz^23ksZ7sU<=O#?BPt{9r!8m z9vlM2MvLuFwTz9uc9tncVF}MJCHskIhnmA5rA=o{I{ur=00000NkvXXu0mjfM`VQx literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png b/bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png new file mode 100644 index 0000000000000000000000000000000000000000..e77ea27915e0caa7be87fbf64b2137b768890dff GIT binary patch literal 1349 zcmV-L1-kl)P)4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q z^GQTOR7efAm4Ok1APfLQuN$$GLuDssvP6uDHef*Ht~H?i6EJ50cZ;h$nu5gb=-a-{ zcjLM&kvo70S>}^`j#(W+kx@oED;wZWm0>y)LL#R8U(cpPz$-j&*PUcQKuEu2=nOa) zeU)?3qX5$cgta6Cg1kL3A8f+&QY*dAGuYu878l*y;__xum_moZfM*0IDL_K%*O)~9 zN~UeOv;x;PAce>E;W&fV$~9c<45yKsE$WAtiWhN1Fann>II0Ndz$;rc4{iwN!Y_jP za3y#Lz6;)ilfW#r{|co?A2rGXwjX~QAK~oDzK^&)w?6s4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q z;7LS5R7efAmH`ffAPhyzvJ=Uj^i1wfoXJ7S4~Ri%fh7|i~baeA_=w+rFJxs2L5J1JUtTp@HIAxGI4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q z-bqA3R7efAmH`ffAPhyzvJ=Uj^i1wfoXH9G2gEUGfhJmw@?ZM}B9Wyd95g3hUe>Pm zJk0@_P&bQn3yu>x;%C>bHoYGM&t|STLhb}T0gxXAiZ-M+0g`5=b>$9HaeuAss2u>H z5EL!qD*c*}Ma4RK2RS|#^mEqr0{|?5?iTr%&)KxB%Z_oHY{+cx!`_9hLL<^T=H5YV zEwrd+AAQ_6$b?Z#KcFBCK(t6|Pem92c?XTca)3}60Ji9#JxXB!$`*ABmjQ!>0SH@z m-7WuFc&mm7`#(XLEByjF1v;FeHg$^t0000?0^ga literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop2_24.png b/bundles/org.eclipse.launchbar.ui/icons/stop2_24.png new file mode 100644 index 0000000000000000000000000000000000000000..88ba331b3e2dc7bc90ebc6e52862651553fa8f3b GIT binary patch literal 1229 zcmV;;1Ty=HP)4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q zdr3q=R7eeDU>NFv5t|2$85sU!6DK5gmVp7oJPZMl;WLeaBpD$6>{$kMOHeGJ#Bi8< z&@F*mKn=sOS;7Ppq!m4C0l|4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q zdr3q=R7eeDU>NFv5t|2$85sU!6DK5gmVp7oJQj3KAj5%}T<{;=5)>OLG#u?B7#8#FHJ!zsZpXLm!u#wQ7oX; r5_H3{S^%>IM3V}TD;iSu4qo*D;rSC+o76Yn00000NkvXXu0mjf2WL## literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index 267458300cc..faefee75261 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -19,6 +19,7 @@ import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; @@ -43,10 +44,17 @@ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.launchbar.ui"; //$NON-NLS-1$ + // Options + public static final String OPTION_ICON_SIZE32 = Activator.PLUGIN_ID + "/iconSize32"; //$NON-NLS-1$ + public static final String OPTION_LAUNCH_ICON_UPDATER = Activator.PLUGIN_ID + "/launchIconUpdater"; //$NON-NLS-1$ + // Images public static final String IMG_BUTTON_BUILD = "build"; //$NON-NLS-1$ + public static final String IMG_BUTTON_BUILD_HOT = "build.hot"; //$NON-NLS-1$ public static final String IMG_BUTTON_LAUNCH = "launch"; //$NON-NLS-1$ + public static final String IMG_BUTTON_LAUNCH_HOT = "launch.hot"; //$NON-NLS-1$ public static final String IMG_BUTTON_STOP = "stop"; //$NON-NLS-1$ + public static final String IMG_BUTTON_STOP_HOT = "stop.hot"; //$NON-NLS-1$ public static final String IMG_LOCAL_TARGET = "localTarget"; //$NON-NLS-1$ // Command ids @@ -72,19 +80,33 @@ public class Activator extends AbstractUIPlugin { public Activator() { } + @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; ImageRegistry imageRegistry = getImageRegistry(); - imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + if ("true".equals(Platform.getDebugOption(OPTION_ICON_SIZE32))) { //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + } else { + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build2_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build2_hot_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch2_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch2_hot_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop2_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop2_hot_24.png")); //$NON-NLS-1$ + } imageRegistry.put(IMG_LOCAL_TARGET, imageDescriptorFromPlugin(PLUGIN_ID, "icons/localTarget.png")); //$NON-NLS-1$ context.registerService(ILaunchTargetUIManager.class, new LaunchTargetUIManager(), null); } + @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); @@ -124,12 +146,10 @@ public class Activator extends AbstractUIPlugin { } public static void runCommand(String commandId, String... params) { - final ICommandService commandService = (ICommandService) PlatformUI.getWorkbench() - .getService(ICommandService.class); + final ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); Command command = commandService.getCommand(commandId); final Event trigger = new Event(); - final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench() - .getService(IHandlerService.class); + final IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class); ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, trigger); if (params.length == 0) { try { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index b3a9b0d1cbd..d697a95a5b4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -65,9 +65,12 @@ public class LaunchBarControl implements ILaunchBarListener { }); ToolBar toolBar = new ToolBar(container, SWT.FLAT); - createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); - createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); - createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); + createButton(toolBar, Activator.IMG_BUTTON_BUILD, Activator.IMG_BUTTON_BUILD_HOT, + Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Activator.IMG_BUTTON_LAUNCH_HOT, + Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); + createButton(toolBar, Activator.IMG_BUTTON_STOP, Activator.IMG_BUTTON_STOP_HOT, Messages.LaunchBarControl_Stop, + Activator.CMD_STOP); modeSelector = new ModeSelector(container, SWT.NONE); modeSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); @@ -106,10 +109,13 @@ public class LaunchBarControl implements ILaunchBarListener { manager.removeListener(this); } - private ToolItem createButton(Composite parent, String imageName, String toolTipText, final String command) { + private ToolItem createButton(Composite parent, String imageName, String hotImageName, String toolTipText, + final String command) { ToolItem button = new ToolItem((ToolBar) parent, SWT.FLAT); Image srcImage = Activator.getDefault().getImage(imageName); button.setImage(srcImage); + Image hotImage = Activator.getDefault().getImage(hotImageName); + button.setHotImage(hotImage); button.setToolTipText(toolTipText); button.setData("command", command); //$NON-NLS-1$ button.addSelectionListener(new SelectionAdapter() { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 9bee28361ac..28127fbb82f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Platform; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; @@ -156,7 +157,7 @@ public class ModeSelector extends CSelector { }); } - protected ILaunchGroup getDefaultLaunchGroup(String mode) throws CoreException { + protected ILaunchGroup getDefaultLaunchGroup(String mode) { String groupId = null; if (mode.equals(ILaunchManager.DEBUG_MODE)) { groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP; @@ -205,7 +206,9 @@ public class ModeSelector extends CSelector { if (element == null) element = noModes[0]; super.setSelection(element); - updateLaunchButton(findLaunchButton()); + if ("true".equals(Platform.getDebugOption(Activator.OPTION_LAUNCH_ICON_UPDATER))) { //$NON-NLS-1$ + updateLaunchButton(findLaunchButton()); + } } private ToolItem findLaunchButton() { @@ -229,6 +232,7 @@ public class ModeSelector extends CSelector { return; } toolItem.setImage(Activator.getDefault().getImage(Activator.IMG_BUTTON_LAUNCH)); + Object selection = getSelection(); if (selection instanceof ILaunchMode) { ILaunchMode lmode = (ILaunchMode) selection; From 68da3d3a3804f5e0a4a88d7656da29c25d80793e Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 16 Feb 2016 14:08:42 -0500 Subject: [PATCH 088/198] Bug 487471 - 16 pixel button icons in 32x24 pixels space. Brings back the switching since we're using the launch group icons in the Launch button. The Build and Stop buttons are also made 16-bit and should be familiar. Warning clean-up in CSelector. Change-Id: I05e4b912d0470eb3f533d462b402faa3002bddd2 --- .../.settings/org.eclipse.jdt.core.prefs | 5 +- .../icons/bgButton.png | Bin 0 -> 1163 bytes .../icons/build_16.png | Bin 0 -> 3539 bytes .../icons/launch_16.png | Bin 0 -> 620 bytes .../icons/stop_16.png | Bin 0 -> 330 bytes .../launchbar/ui/internal/Activator.java | 28 +--- .../ui/internal/controls/CSelector.java | 14 +- .../internal/controls/LaunchBarControl.java | 44 +++++-- .../ui/internal/controls/ModeSelector.java | 124 ++++++------------ 9 files changed, 92 insertions(+), 123 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/icons/bgButton.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/build_16.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/launch_16.png create mode 100644 bundles/org.eclipse.launchbar.ui/icons/stop_16.png diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs index 4a1ace7a1ef..a787de69683 100644 --- a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs @@ -2,8 +2,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate @@ -48,7 +51,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning org.eclipse.jdt.core.compiler.problem.nullReference=error diff --git a/bundles/org.eclipse.launchbar.ui/icons/bgButton.png b/bundles/org.eclipse.launchbar.ui/icons/bgButton.png new file mode 100644 index 0000000000000000000000000000000000000000..e951bd34a153dfe905a255e28ce45004e1c6024c GIT binary patch literal 1163 zcmV;61a$j}P)4Tx062|}Rb6NtRTMtEb7vzY&QokOg>Hg1+lHrgWS zWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6wD^Ni=!>T7nL9I? zX}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8rehoBb*p;u8ID_yBf z0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J`jH<$>RKN5V(7Oq zK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYvwjAKwmYb0gKL(K8 z-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z>!FI&AHCpoWI|RUq zx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVTrI(b06~u#xf1yS} z_UGdMvD``!0~u->P=lA4?YN`hilQ|3tHka)7T{2CGqw zjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3-SOXDcC_o0^7T9R1gAN8V6s;5) zieI5-7aQlmJn}lUna#nz!j%5V$X|o`xX!dHWQRV27P1=rj;t2bW$~+pTw@bIek?Zv zKPDL<64`^#UNTAck#RBsB6*5DP4<%UA_FqU$I>2EH_cM;u)Q~SI+rg`Rn{L_AC5qq~L$#SMj%U z$6Cz0vP{G5Y*=%5RT^yu;}-DInZ=349rJPVM6C3K^oO)8y(fJr{l>k`ead~!ea?NsT>_Ci%bnxC;Vy6=b6>{xYV#Ue-+LB$ z7`JEXmTRm^AtP)R9u{)KHsMiWGV&)32xCG~*nyU<>-!d;FP=Re4r3qYr~6#KE>;1F z`>_J_P5xC?ROxV(DIHdCO*p$HRQI@7^PwV@Pvuf+5K}u-6REM(K@W$s zrgorh0{i?O)v0c>QtHxU-hBdD(>iYJ4b2sIOVX2K8m~4gmYVA5h^QEb$V`rCQ-|7Z zS{nuL-t>?3n=-o(6I(7vocj#GzCZEo`!3>+v;dYIfPu#&ZWzzX2i^rZ^Mu;6+rb@? zNPG+6)c5T6zxpzGe*M(x+{AON=PiJ>H#?ob-|uwRK0yDg0B4PV0id6JRZw95ZvX%Q zIY~r8R7ef&*0Bu$Fbo2)rvHnVTjdHC=K+W(CdoU^YZln-+kAer6(B%>009C72oNAJ d%~iak^aJ5;3encFAQ%7u002ovPDHLkV1fqPHPZk9 literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/build_16.png b/bundles/org.eclipse.launchbar.ui/icons/build_16.png new file mode 100644 index 0000000000000000000000000000000000000000..c0272bb5d88fc2871e41567c03d9a7c450e5d722 GIT binary patch literal 3539 zcmV;^4J`7BP)00009a7bBm000XU z000XU0RWnu7ytkYO=&|zP*7-ZbZ>KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cqrPALg8E|(vWA65poU1JRAaZs8I2(p#xiB`SVGovRs-uS zYnV-9TeA7=Om+qP8+I>yOjAR1s%ETak!GFdam@h^# z)@rS0t$wXH+Irf)+G6c;?H29p+V6F6oj{!|o%K3xI`?%6x;DB|x`n#ibhIR?(H}Q3Gzd138Ei2)WAMz7W9Vy`X}HnwgyEn!VS)>mv$8&{hQn>w4zwy3R}t;BYlZQm5)6pty=DfLrs+A-|>>;~;Q z_F?uV_HFjh9n2gO9o9Q^JA86v({H5aB!kjoO6 zc9$1ZZKsN-Zl8L~mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde00d`2O+f$vv5tKEQIh}w03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(` z>RI+y?e7jKeZ#YO-C0`N&hK~#9!V)XL#WZ>c9`On0_z#y1p_>BPo00960Vhjrn z{m;O_z{v9D%NGr~4+j_l00030|6&Xa4gK%t?#^&#ZZ0DO0|NuomoHx!&&OV|NmlynZm%p08!!L>G@w%ON-&lmoE%LPqr|y965ZL!HoAFgDLZq|1TLB z7@59&`NDYT`ZY%X=x7E828OKw00030|AL#5l$^{kZ|+=Q1!bOk+Xz!@Jk7`2Vnrd=!z9XVCuiJrhNefq~)EvYAt-FfcIW zFfcGQ1IQ$QUk1Ve3_p5}P+!ti1OwNBCJYuynG7``7Gm-T=wPxp2BL|PnCfq^laO36 z++gY=PSa9St`13?UiF9TeWpte&-M=Q@Vt5bON|L3@&JAuGGFfdIMP17iw=CTmt%-iNKK|pRKlSnDibsg7rsnu$99EWjfoVH8leIV7(f0Sr6 zI+V-h;;O2W&1TWBwQcwIWPW{ViU~EsKuDQuG+I0LW?KLk{<7yB1U7+l;9jjFX z?f<+xh5u(<&;MU{IOTuD^042M<#yl2OYM?yYL>5Y{8)W3>HpH39sf7qpY^}*d=?4@ z$*DKFd=x9P&BSoFc$wXov<*@JYY!&>pLenAKM3r)w+75d#>Kl5{sX=9RhgEM+cAJKmMPz zJQc167}#%x${b|C28fo}{IKow`VYf-tIGdl0~7bpgsTC1`=dmGg90QBN^Bq5^m_ky znBW7(1#2o%H2(ba^MB*EPPn{npZ9-}Vw>LxFO=9$(`$A6>pa=_KL{7CtAcBO`}N)b zoYf`&VR9gB(&+*8g6$Ew0iY-mFR}UPJjL(7+cf|GB^w}NaR2SY|FMfx!D2A%0#qYW zZu?E7#Kr+NA(hyc%2hdjbe$UTKW#r% literal 0 HcmV?d00001 diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop_16.png b/bundles/org.eclipse.launchbar.ui/icons/stop_16.png new file mode 100644 index 0000000000000000000000000000000000000000..3544673b6896bb23b647944436a07b398c165967 GIT binary patch literal 330 zcmV-Q0k!^#P)HWWthq_^V5`=f3`bKy?qW8gNiVIsK@N*2hx@Hve(q!; modeButtonImages = new HashMap<>(); public ModeSelector(Composite parent, int style) { super(parent, style); @@ -157,6 +154,15 @@ public class ModeSelector extends CSelector { }); } + @Override + public void dispose() { + super.dispose(); + + for (Image image : modeButtonImages.values()) { + image.dispose(); + } + } + protected ILaunchGroup getDefaultLaunchGroup(String mode) { String groupId = null; if (mode.equals(ILaunchManager.DEBUG_MODE)) { @@ -206,9 +212,7 @@ public class ModeSelector extends CSelector { if (element == null) element = noModes[0]; super.setSelection(element); - if ("true".equals(Platform.getDebugOption(Activator.OPTION_LAUNCH_ICON_UPDATER))) { //$NON-NLS-1$ - updateLaunchButton(findLaunchButton()); - } + updateLaunchButton(findLaunchButton()); } private ToolItem findLaunchButton() { @@ -231,84 +235,42 @@ public class ModeSelector extends CSelector { if (toolItem == null || isDisposed()) { return; } - toolItem.setImage(Activator.getDefault().getImage(Activator.IMG_BUTTON_LAUNCH)); Object selection = getSelection(); if (selection instanceof ILaunchMode) { - ILaunchMode lmode = (ILaunchMode) selection; - toolItem.setToolTipText(NLS.bind(Messages.ModeSelector_ToolTip, lmode.getLabel())); - String mode = lmode.getIdentifier(); - String iconPath = "icons/icon_" + mode + "_32x32.png"; //$NON-NLS-1$ //$NON-NLS-2$ - Image modeBigImage = Activator.getDefault().getImage(iconPath); - if (modeBigImage == null) { - // no icon for the mode, lets do an overlay - Image modeImageOrig = getLabelProvider().getImage(lmode); - if (modeImageOrig != null) { - ImageDescriptor composite = new ReversedCenterOverlay(modeImageOrig.getImageData()); - Activator.getDefault().getImageRegistry().put(iconPath, composite); - modeBigImage = Activator.getDefault().getImage(iconPath); - } - } - if (modeBigImage != null) { - toolItem.setImage(modeBigImage); + ILaunchMode mode = (ILaunchMode) selection; + toolItem.setToolTipText(NLS.bind(Messages.ModeSelector_ToolTip, mode.getLabel())); + + Image image = modeButtonImages.get(mode.getIdentifier()); + if (image == null) { + Image bgImage = Activator.getDefault().getImage(Activator.IMG_BUTTON_BACKGROUND); + Image modeImage = getLabelProvider().getImage(mode); + + ImageDescriptor imageDesc = new CompositeImageDescriptor() { + @Override + protected Point getSize() { + Rectangle bounds = bgImage.getBounds(); + return new Point(bounds.width - bounds.y, bounds.height - bounds.x); + } + + @Override + protected void drawCompositeImage(int width, int height) { + drawImage(bgImage.getImageData(), 0, 0); + + Rectangle bgBounds = bgImage.getBounds(); + Rectangle modeBounds = modeImage.getBounds(); + int x = ((bgBounds.width - bgBounds.x) - (modeBounds.width - modeBounds.x)) / 2; + int y = ((bgBounds.height - bgBounds.y) - (modeBounds.height - modeBounds.y)) / 2; + drawImage(modeImage.getImageData(), x, y); + } + }; + + image = imageDesc.createImage(); + modeButtonImages.put(mode.getIdentifier(), image); } + + toolItem.setImage(image); } } - private final class ReversedCenterOverlay extends CompositeImageDescriptor { - private ImageData small; - - public ReversedCenterOverlay(ImageData small) { - this.small = small; - } - - @Override - protected Point getSize() { - return new Point(32, 32); - } - - @Override - protected void drawCompositeImage(int width, int height) { - ImageDescriptor base = Activator.getImageDescriptor("icons/launch_base_blank.png"); //$NON-NLS-1$ - ImageData baseData = base.getImageData(); - int baseColor = baseData.getPixel(16, 16); - ImageData data = getReversed(small, baseData.palette.getRGB(baseColor)); - drawImage(baseData, 0, 0); - drawImage(data, 8, 8); - } - - private ImageData getReversed(ImageData imageData, RGB baseColor) { - int width = imageData.width; - PaletteData palette = imageData.palette; - RGB whiteColor = new RGB(255, 255, 255); - if (!palette.isDirect) { - palette.colors = Arrays.copyOf(palette.colors, palette.colors.length + 2); - palette.colors[palette.colors.length - 1] = baseColor; - palette.colors[palette.colors.length - 2] = whiteColor; - } - int whitePixel = palette.getPixel(whiteColor); - int basePixed = palette.getPixel(baseColor); - int transPixed = imageData.transparentPixel; - int[] lineData = new int[imageData.width]; - for (int y = 0; y < imageData.height; y++) { - imageData.getPixels(0, y, width, lineData, 0); - for (int x = 0; x < lineData.length; x++) { - int pixelValue = lineData[x]; - if (pixelValue == transPixed) { - imageData.setPixel(x, y, basePixed); - continue; - } - RGB rgb = palette.getRGB(pixelValue); - float brightness = rgb.getHSB()[2]; - if (brightness > 0.97) { - imageData.setPixel(x, y, basePixed); - } else { - imageData.setPixel(x, y, whitePixel); - } - } - } - imageData.transparentPixel = -1; - return imageData; - } - } } From d87141b0f97bab5d7e1e29bc544c9b86bbe45267 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 18 Feb 2016 12:16:18 -0500 Subject: [PATCH 089/198] launchbar: prevent widget is disposed exception Change-Id: I5afe239ed7b594a2f7fb3be7bae4120d84c879b2 --- .../eclipse/launchbar/ui/internal/controls/ModeSelector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 4bbfc8be50a..63c70e14dc1 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -211,6 +211,8 @@ public class ModeSelector extends CSelector { public void setSelection(Object element) { if (element == null) element = noModes[0]; + if (isDisposed()) + return; super.setSelection(element); updateLaunchButton(findLaunchButton()); } From 302c601bac4934b5f5c6584ce75e5d73b41f8813 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 18 Feb 2016 11:00:59 -0500 Subject: [PATCH 090/198] Enable double click selection in New Launch Config Wizard. Also set the title on the edit page so we can tell what type we're editing. Change-Id: Ia526eae2cdb906e8ab115a3a74585db8b3c5de2c --- .../eclipse/launchbar/ui/internal/Messages.java | 1 + .../internal/dialogs/NewLaunchConfigEditPage.java | 10 ++++++---- .../internal/dialogs/NewLaunchConfigModePage.java | 10 ++++++++-- .../internal/dialogs/NewLaunchConfigTypePage.java | 14 +++++++++++--- .../launchbar/ui/internal/messages.properties | 1 + 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index be31a049e01..55684221c1f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -50,6 +50,7 @@ public class Messages extends NLS { public static String NewLaunchConfigEditPage_4; public static String NewLaunchConfigEditPage_5; public static String NewLaunchConfigEditPage_6; + public static String NewLaunchConfigEditPage_7; public static String NewLaunchConfigModePage_0; public static String NewLaunchConfigModePage_1; public static String NewLaunchConfigModePage_2; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 5dd8ff1f801..1c888382b89 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -81,6 +81,7 @@ public class NewLaunchConfigEditPage extends WizardPage { workingCopy = type.newInstance(null, name); launchConfigurationDialog.doSetDefaults(workingCopy); tabViewer.setInput(workingCopy); + setTitle(String.format(Messages.NewLaunchConfigEditPage_7, type.getName())); } } catch (CoreException e) { Activator.log(e); @@ -152,13 +153,14 @@ public class NewLaunchConfigEditPage extends WizardPage { public void updateButtons() { // Launch button getTabViewer().refresh(); - // getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithModes() & !getTabViewer().hasDuplicateDelegates()); + // getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() + // & getTabViewer().canLaunchWithModes() & + // !getTabViewer().hasDuplicateDelegates()); } @Override - public void run(boolean fork, boolean cancelable, - IRunnableWithProgress runnable) - throws InvocationTargetException, InterruptedException { + public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) + throws InvocationTargetException, InterruptedException { // ignore } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java index 6ae6734e692..30536c6ff2b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -91,8 +91,14 @@ public class NewLaunchConfigModePage extends WizardPage { table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - selectedGroup = (ILaunchGroup)table.getSelection()[0].getData(); - ((NewLaunchConfigWizard)getWizard()).typePage.populateItems(); + selectedGroup = (ILaunchGroup) table.getSelection()[0].getData(); + ((NewLaunchConfigWizard) getWizard()).typePage.populateItems(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + getContainer().showPage(getNextPage()); } }); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java index 2a610ed2f13..ad24719705f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -19,6 +19,8 @@ import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -43,21 +45,27 @@ public class NewLaunchConfigTypePage extends WizardPage { GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); data.heightHint = 500; table.setLayoutData(data); - + table.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetDefaultSelected(SelectionEvent e) { + getContainer().showPage(getNextPage()); + } + }); populateItems(); setControl(comp); } void populateItems() { - ILaunchGroup group = ((NewLaunchConfigWizard)getWizard()).modePage.selectedGroup; + ILaunchGroup group = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup; if (group == null) return; table.removeAll(); boolean haveItems = false; - for (ILaunchConfigurationType type : DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes()) { + for (ILaunchConfigurationType type : DebugPlugin.getDefault().getLaunchManager() + .getLaunchConfigurationTypes()) { if (!type.isPublic() || type.getCategory() != null || !type.supportsMode(group.getMode())) continue; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index f63a71d1b4d..eb1436f270c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -33,6 +33,7 @@ NewLaunchConfigEditPage_3=Name NewLaunchConfigEditPage_4=Name can not be empty NewLaunchConfigEditPage_5=A configuration with this name already exists NewLaunchConfigEditPage_6=New Configuration +NewLaunchConfigEditPage_7=%s Launch Configuration Properties NewLaunchConfigModePage_0=Select Initial Launch Mode NewLaunchConfigModePage_1=Initial Launch Mode NewLaunchConfigModePage_2=Select initial launch mode. From 32bcbba8bbd738803fe499ac639cab5d31dd6819 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 22 Feb 2016 21:05:44 -0500 Subject: [PATCH 091/198] Change remote target to new strategy. Allows individual types to reg. Remote connection type providers must also register as target types if they want to show up in the launch bar. This change eliminates the autoregistering we were doing and instead provides reusable classes to handle the interface. Arduino does that coming up. Change-Id: Iafb9305225f1ba3b97640bb3b15bfb671888a914 --- .../META-INF/MANIFEST.MF | 3 +- .../plugin.xml | 7 --- .../RemoteLaunchTargetProvider.java | 53 +++++++++++++----- .../remote/core/internal/Activator.java | 9 --- .../internal/RemoteConnectionListener.java | 38 ------------- .../internal/RemoteTargetAdapterFactory.java | 13 ++--- .../META-INF/MANIFEST.MF | 1 + .../plugin.xml | 7 --- .../ui/RemoteLaunchTargetLabelProvider.java | 48 ++++++++++++++++ .../RemoteLaunchTargetLabelProvider.java | 55 ------------------- 10 files changed, 93 insertions(+), 141 deletions(-) rename bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/{internal => }/RemoteLaunchTargetProvider.java (51%) delete mode 100644 bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteConnectionListener.java create mode 100644 bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java delete mode 100644 bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF index e24c43302b8..6ad3819382f 100644 --- a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF @@ -10,4 +10,5 @@ Require-Bundle: org.eclipse.ui, org.eclipse.remote.core;bundle-version="2.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.launchbar.remote.core.internal;x-friends:="org.eclipse.launchbar.remote.ui" +Export-Package: org.eclipse.launchbar.remote.core, + org.eclipse.launchbar.remote.core.internal;x-friends:="org.eclipse.launchbar.remote.ui" diff --git a/bundles/org.eclipse.launchbar.remote.core/plugin.xml b/bundles/org.eclipse.launchbar.remote.core/plugin.xml index d8af7c00df5..326a151ef5e 100644 --- a/bundles/org.eclipse.launchbar.remote.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.remote.core/plugin.xml @@ -1,13 +1,6 @@ - - - - T getAdapter(Object adaptableObject, Class adapterType) { if (adaptableObject instanceof ILaunchTarget) { ILaunchTarget target = (ILaunchTarget) adaptableObject; - if (target.getTypeId().equals(RemoteLaunchTargetProvider.TYPE_ID)) { - String[] list = target.getId().split("\\" + RemoteLaunchTargetProvider.DELIMITER); //$NON-NLS-1$ - if (list.length == 2) { - IRemoteConnectionType type = manager.getConnectionType(list[0]); - if (type != null) { - return (T) type.getConnection(list[1]); - } - } + IRemoteConnectionType remoteType = remoteManager.getConnectionType(target.getTypeId()); + if (remoteType != null) { + return (T) remoteType.getConnection(target.getId()); } } return null; diff --git a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF index 0bc662f06a8..99c55974a49 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF @@ -14,3 +14,4 @@ Require-Bundle: org.eclipse.ui, org.eclipse.launchbar.remote.core;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy +Export-Package: org.eclipse.launchbar.remote.ui diff --git a/bundles/org.eclipse.launchbar.remote.ui/plugin.xml b/bundles/org.eclipse.launchbar.remote.ui/plugin.xml index 21bc68e520e..5535690d377 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.remote.ui/plugin.xml @@ -1,12 +1,5 @@ - - - - diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java new file mode 100644 index 00000000000..0b412bc4f0b --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.remote.ui; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.ui.IRemoteUIConnectionService; +import org.eclipse.swt.graphics.Image; + +public class RemoteLaunchTargetLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + if (element instanceof ILaunchTarget) { + IRemoteConnection connection = ((ILaunchTarget) element).getAdapter(IRemoteConnection.class); + if (connection != null) { + IRemoteUIConnectionService uiService = connection.getConnectionType() + .getService(IRemoteUIConnectionService.class); + if (uiService != null) { + return uiService.getLabelProvider().getText(connection); + } + } + } + return super.getText(element); + } + + @Override + public Image getImage(Object element) { + if (element instanceof ILaunchTarget) { + IRemoteConnection connection = ((ILaunchTarget) element).getAdapter(IRemoteConnection.class); + if (connection != null) { + IRemoteUIConnectionService uiService = connection.getConnectionType() + .getService(IRemoteUIConnectionService.class); + if (uiService != null) { + return uiService.getLabelProvider().getImage(connection); + } + } + } + return super.getImage(element); + } + +} diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java deleted file mode 100644 index 776b98a9028..00000000000 --- a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/RemoteLaunchTargetLabelProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 QNX Software Systems 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 - *******************************************************************************/ -package org.eclipse.launchbar.remote.ui.internal; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.launchbar.core.target.ILaunchTarget; -import org.eclipse.launchbar.remote.core.internal.RemoteLaunchTargetProvider; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.ui.IRemoteUIConnectionService; -import org.eclipse.swt.graphics.Image; - -public class RemoteLaunchTargetLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - IRemoteConnection connection = getConnection(element); - if (connection != null) { - IRemoteUIConnectionService uiService = connection.getConnectionType() - .getService(IRemoteUIConnectionService.class); - if (uiService != null) { - return uiService.getLabelProvider().getText(connection); - } - } - return super.getText(element); - } - - @Override - public Image getImage(Object element) { - IRemoteConnection connection = getConnection(element); - if (connection != null) { - IRemoteUIConnectionService uiService = connection.getConnectionType() - .getService(IRemoteUIConnectionService.class); - if (uiService != null) { - return uiService.getLabelProvider().getImage(connection); - } - } - return super.getImage(element); - } - - private IRemoteConnection getConnection(Object element) { - if (element instanceof ILaunchTarget) { - ILaunchTarget target = (ILaunchTarget) element; - if (target.getTypeId().equals(RemoteLaunchTargetProvider.TYPE_ID)) { - IRemoteConnection connection = target.getAdapter(IRemoteConnection.class); - return connection; - } - } - return null; - } -} From 4b42a1d05047a49fa2604da5eb95c8bbe8436bd6 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 24 Feb 2016 09:43:35 -0500 Subject: [PATCH 092/198] Bug 457086" launchbar: proper support for launch groups - unfortunately same mode is re-used for different launch group, which have different images - so we cannot cash icons by mode since it show wrong icon - we also has to notify mode select that mode change event it is "equals" so it can update launch group image - also fixed resource leak for launch bar button Change-Id: Iaa7b80d74963e4d0d1ccef5e6e4cd54a3ae5a4d4 --- .../core/internal/LaunchBarManager.java | 6 +- .../LaunchBarButtonImageDescriptor.java | 51 ++++++++++ .../internal/controls/LaunchBarControl.java | 32 ++----- .../ui/internal/controls/ModeSelector.java | 92 +++++++------------ 4 files changed, 99 insertions(+), 82 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 2e3917e8ae6..040838b3a20 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -648,8 +648,12 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } public void setActiveLaunchMode(ILaunchMode mode) throws CoreException { - if (activeLaunchMode == mode) + if (activeLaunchMode == mode) { + // we have to modify listeners here because same mode does not mean + // same launch group. ModeSelector has to update. + fireActiveLaunchModeChanged(); // notify listeners return; + } if (activeLaunchDesc != null && mode != null && !supportsMode(mode)) throw new IllegalStateException(Messages.LaunchBarManager_2); // change mode diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java new file mode 100644 index 00000000000..302cf789806 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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: + * Doug Schaefer - initial API and implementation + * Elena Laskavaia - moved to a separate class + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.controls; + +import org.eclipse.jface.resource.CompositeImageDescriptor; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; + +/** + * This class will take two images and create descriptor that will overlay them, mainImage will be centered + */ +public class LaunchBarButtonImageDescriptor extends CompositeImageDescriptor { + private Image bgImage; + private Image mainImage; + + /** + * @param mainImage - main image, will be centered + * @param bgImage - background image + */ + public LaunchBarButtonImageDescriptor(Image mainImage, Image bgImage) { + super(); + this.bgImage = bgImage; + this.mainImage = mainImage; + } + + @Override + protected Point getSize() { + Rectangle bounds = bgImage.getBounds(); + return new Point(bounds.width - bounds.y, bounds.height - bounds.x); + } + + @Override + protected void drawCompositeImage(int width, int height) { + drawImage(bgImage.getImageData(), 0, 0); + Rectangle bgBounds = bgImage.getBounds(); + Rectangle modeBounds = mainImage.getBounds(); + int x = ((bgBounds.width - bgBounds.x) - (modeBounds.width - modeBounds.x)) / 2; + int y = ((bgBounds.height - bgBounds.y) - (modeBounds.height - modeBounds.y)) / 2; + drawImage(mainImage.getImageData(), x, y); + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 1587f028b5f..2e234d1ed5e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -16,7 +16,6 @@ import javax.annotation.PreDestroy; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.launchbar.core.ILaunchBarListener; import org.eclipse.launchbar.core.ILaunchDescriptor; @@ -29,8 +28,6 @@ import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -116,26 +113,9 @@ public class LaunchBarControl implements ILaunchBarListener { Image bgImage = Activator.getDefault().getImage(Activator.IMG_BUTTON_BACKGROUND); Image fgImage = Activator.getDefault().getImage(imageName); - ImageDescriptor imageDesc = new CompositeImageDescriptor() { - @Override - protected Point getSize() { - Rectangle bounds = bgImage.getBounds(); - return new Point(bounds.width - bounds.y, bounds.height - bounds.x); - } - - @Override - protected void drawCompositeImage(int width, int height) { - drawImage(bgImage.getImageData(), 0, 0); - - Rectangle bgBounds = bgImage.getBounds(); - Rectangle modeBounds = fgImage.getBounds(); - int x = ((bgBounds.width - bgBounds.x) - (modeBounds.width - modeBounds.x)) / 2; - int y = ((bgBounds.height - bgBounds.y) - (modeBounds.height - modeBounds.y)) / 2; - drawImage(fgImage.getImageData(), x, y); - } - }; - - button.setImage(imageDesc.createImage()); + ImageDescriptor imageDesc = new LaunchBarButtonImageDescriptor(fgImage, bgImage); + Image image = imageDesc.createImage(); + button.setImage(image); button.setToolTipText(toolTipText); button.setData("command", command); //$NON-NLS-1$ button.addSelectionListener(new SelectionAdapter() { @@ -144,6 +124,12 @@ public class LaunchBarControl implements ILaunchBarListener { Activator.runCommand(command); }; }); + button.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + image.dispose(); + } + }); return button; } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 63c70e14dc1..7b6212f8c13 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -21,7 +21,6 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.debug.ui.ILaunchGroup; -import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -32,7 +31,6 @@ import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.osgi.util.NLS; 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.ToolBar; @@ -83,24 +81,17 @@ public class ModeSelector extends CSelector { public Image getImage(Object element) { if (element instanceof ILaunchMode) { ILaunchMode mode = (ILaunchMode) element; - try { - ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); - if (group == null) { - group = getDefaultLaunchGroup(mode.getIdentifier()); + ILaunchGroup group = getLaunchGroup(mode); + if (group != null) { + ImageDescriptor imageDesc = group.getImageDescriptor(); + if (imageDesc == null) + return null; + Image image = images.get(imageDesc); + if (image == null) { + image = imageDesc.createImage(); + images.put(imageDesc, image); } - if (group != null) { - ImageDescriptor imageDesc = group.getImageDescriptor(); - if (imageDesc == null) - return null; - Image image = images.get(imageDesc); - if (image == null) { - image = imageDesc.createImage(); - images.put(imageDesc, image); - } - return image; - } - } catch (CoreException e) { - Activator.log(e.getStatus()); + return image; } } return super.getImage(element); @@ -110,16 +101,9 @@ public class ModeSelector extends CSelector { public String getText(Object element) { if (element instanceof ILaunchMode) { ILaunchMode mode = (ILaunchMode) element; - try { - ILaunchGroup group = getLaunchGroup(mode.getIdentifier()); - if (group == null) { - group = getDefaultLaunchGroup(mode.getIdentifier()); - } - if (group != null) { - return group.getLabel().replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$ - } - } catch (CoreException e) { - Activator.log(e.getStatus()); + ILaunchGroup group = getLaunchGroup(mode); + if (group != null) { + return group.getLabel().replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$ } } return super.getText(element); @@ -164,7 +148,7 @@ public class ModeSelector extends CSelector { } protected ILaunchGroup getDefaultLaunchGroup(String mode) { - String groupId = null; + String groupId; if (mode.equals(ILaunchManager.DEBUG_MODE)) { groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP; } else if (mode.equals(ILaunchManager.PROFILE_MODE)) { @@ -172,9 +156,7 @@ public class ModeSelector extends CSelector { } else { groupId = IDebugUIConstants.ID_RUN_LAUNCH_GROUP; } - if (groupId != null) - return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupId); - return null; + return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupId); } protected ILaunchGroup getLaunchGroup(String mode) throws CoreException { @@ -237,42 +219,36 @@ public class ModeSelector extends CSelector { if (toolItem == null || isDisposed()) { return; } - Object selection = getSelection(); if (selection instanceof ILaunchMode) { ILaunchMode mode = (ILaunchMode) selection; toolItem.setToolTipText(NLS.bind(Messages.ModeSelector_ToolTip, mode.getLabel())); - - Image image = modeButtonImages.get(mode.getIdentifier()); + ILaunchGroup group = getLaunchGroup(mode); + // we cannot use mode id as id, since external tool group and run group have same "run" id for the mode + // but different images + String id = group.getIdentifier(); + Image image = modeButtonImages.get(id); if (image == null) { Image bgImage = Activator.getDefault().getImage(Activator.IMG_BUTTON_BACKGROUND); Image modeImage = getLabelProvider().getImage(mode); - - ImageDescriptor imageDesc = new CompositeImageDescriptor() { - @Override - protected Point getSize() { - Rectangle bounds = bgImage.getBounds(); - return new Point(bounds.width - bounds.y, bounds.height - bounds.x); - } - - @Override - protected void drawCompositeImage(int width, int height) { - drawImage(bgImage.getImageData(), 0, 0); - - Rectangle bgBounds = bgImage.getBounds(); - Rectangle modeBounds = modeImage.getBounds(); - int x = ((bgBounds.width - bgBounds.x) - (modeBounds.width - modeBounds.x)) / 2; - int y = ((bgBounds.height - bgBounds.y) - (modeBounds.height - modeBounds.y)) / 2; - drawImage(modeImage.getImageData(), x, y); - } - }; - + ImageDescriptor imageDesc = new LaunchBarButtonImageDescriptor(modeImage, bgImage); image = imageDesc.createImage(); - modeButtonImages.put(mode.getIdentifier(), image); + modeButtonImages.put(id, image); } - toolItem.setImage(image); } } + public ILaunchGroup getLaunchGroup(ILaunchMode mode) { + ILaunchGroup group = null; + try { + group = getLaunchGroup(mode.getIdentifier()); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + if (group == null) { + group = getDefaultLaunchGroup(mode.getIdentifier()); + } + return group; + } } From 93cdb07d8c802a7224c24317d28ca4ab60771618 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Sat, 27 Feb 2016 20:15:07 -0500 Subject: [PATCH 093/198] Do a stop launch when doing a launch active. Remote fixes. This is the first step towards cleaning up the actions. Also make sure teh remote target provider only acts on remotes of the type it's associated with. Change-Id: Ifb2e39620e7d62b075c3d18dd338694071dc5720 --- .../core/RemoteLaunchTargetProvider.java | 20 ++++++++++--------- .../commands/LaunchActiveCommandHandler.java | 1 + .../commands/StopActiveCommandHandler.java | 15 ++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java index be61188f102..1f5275e9053 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java @@ -71,16 +71,18 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide @Override public void connectionChanged(RemoteConnectionChangeEvent event) { IRemoteConnection connection = event.getConnection(); - switch (event.getType()) { - case RemoteConnectionChangeEvent.CONNECTION_ADDED: - targetManager.addLaunchTarget(getTypeId(), connection.getName()); - break; - case RemoteConnectionChangeEvent.CONNECTION_REMOVED: - ILaunchTarget target = targetManager.getLaunchTarget(getTypeId(), connection.getName()); - if (target != null) { - targetManager.removeLaunchTarget(target); + if (connection.getConnectionType().getId().equals(getTypeId())) { + switch (event.getType()) { + case RemoteConnectionChangeEvent.CONNECTION_ADDED: + targetManager.addLaunchTarget(getTypeId(), connection.getName()); + break; + case RemoteConnectionChangeEvent.CONNECTION_REMOVED: + ILaunchTarget target = targetManager.getLaunchTarget(getTypeId(), connection.getName()); + if (target != null) { + targetManager.removeLaunchTarget(target); + } + break; } - break; } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java index 78e91221edd..25e954978d6 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -27,6 +27,7 @@ public class LaunchActiveCommandHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { try { LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + StopActiveCommandHandler.stopActiveLaunches(launchBarManager); ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); if (config == null) return Status.OK_STATUS; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index f6a6c3fb1f3..bc7dd66af10 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -29,11 +29,6 @@ import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; public class StopActiveCommandHandler extends AbstractHandler { - private LaunchBarManager launchBarManager; - - public StopActiveCommandHandler() { - launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - } @Override public Object execute(ExecutionEvent event) throws ExecutionException { @@ -43,10 +38,10 @@ public class StopActiveCommandHandler extends AbstractHandler { public void stop() { stopBuild(); - stopActiveLaunches(); + stopActiveLaunches(Activator.getDefault().getLaunchBarUIManager().getManager()); } - protected void stopActiveLaunches() { + static void stopActiveLaunches(LaunchBarManager launchBarManager) { final ILaunch[] activeLaunches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); if (activeLaunches != null && activeLaunches.length > 0) { new Job(Messages.StopActiveCommandHandler_0) { @@ -64,8 +59,10 @@ public class StopActiveCommandHandler extends AbstractHandler { continue; } if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { - // There are evil delegates that use a working copy for scratch storage - if (activeConfig.equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) { + // There are evil delegates that use a working + // copy for scratch storage + if (activeConfig + .equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) { launch.terminate(); continue; } From 4a76061d66201a9300c9abdaa2ba75290b81430f Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Tue, 15 Mar 2016 19:07:05 -0400 Subject: [PATCH 094/198] Bug 489699 - ILaunchTargetProvider is not cached or stored after creation Change-Id: I9c3cf19d5fe1dd6a41ec3c6a7d230028ee88501d Signed-off-by: Rob Stryker --- .../launchbar/core/internal/target/LaunchTargetManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 5ad555d9974..8b2a3d03706 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -116,6 +116,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } }; } + typeProviders.put(typeId, provider); } return provider; } From 0f76cd21715b45c5f46c5d4e275859874d36b473 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 4 Apr 2016 11:21:52 -0400 Subject: [PATCH 095/198] Fix NPE on new workspace startup. Call initTargets in getProvider(). Change-Id: I717428e92d85114c61026eb18ca61def6bbb973b --- .../launchbar/core/internal/target/LaunchTargetManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 8b2a3d03706..ddb86fe8ffc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -93,6 +93,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } private ILaunchTargetProvider getProvider(String typeId) { + initTargets(); ILaunchTargetProvider provider = typeProviders.get(typeId); if (provider == null) { IConfigurationElement element = typeElements.get(typeId); From 9a170471ad88f213de9d5886aeeb28423abeb73a Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 8 Apr 2016 16:37:19 -0400 Subject: [PATCH 096/198] Bug 491357 - Support Renamed Remote Connnections Change-Id: Ibfb0399135561c35a16c26cdc07c6914198400e2 Signed-off-by: Jonathan Williams --- .../remote/core/RemoteLaunchTargetProvider.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java index 1f5275e9053..eb32493d936 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java @@ -17,6 +17,7 @@ import org.eclipse.launchbar.remote.core.internal.Messages; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.RemoteConnectionChangeEvent; @@ -82,7 +83,19 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide targetManager.removeLaunchTarget(target); } break; + case RemoteConnectionChangeEvent.CONNECTION_RENAMED: + if (connection instanceof IRemoteConnectionWorkingCopy) { + IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) connection; + IRemoteConnection original = ((IRemoteConnectionWorkingCopy) connection).getOriginal(); + target = targetManager.getLaunchTarget(getTypeId(), original.getName()); + if (target != null ) { + targetManager.removeLaunchTarget(target); + } + targetManager.addLaunchTarget(getTypeId(), wc.getName()); + } + break; } + } } From 77fda006a5627ac0fff431bb38512fd68aa1bb45 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 13 Apr 2016 19:25:11 -0400 Subject: [PATCH 097/198] Add attributes to launch targets. Follows the working copy pattern to ensure changes to the target are transactional. Change-Id: Iff4fda10bcebc80efa11bc15f75ad7df7d4f4bca --- .../core/internal/target/LaunchTarget.java | 28 +++++++ .../internal/target/LaunchTargetManager.java | 37 +++++++-- .../target/LaunchTargetWorkingCopy.java | 75 +++++++++++++++++++ .../target/LocalLaunchTargetProvider.java | 8 +- .../launchbar/core/target/ILaunchTarget.java | 35 ++++++++- .../core/target/ILaunchTargetWorkingCopy.java | 39 ++++++++++ .../core/tests/TargetAttributesTest.java | 36 +++++++++ 7 files changed, 248 insertions(+), 10 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index 55ab598d645..987414558bc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -9,15 +9,29 @@ package org.eclipse.launchbar.core.internal.target; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; +import org.osgi.service.prefs.Preferences; public class LaunchTarget extends PlatformObject implements ILaunchTarget { private final String typeId; private final String id; + final Preferences attributes; + /** + * This should only be used to create the null target. There are no attributes supported on the + * null target. + */ public LaunchTarget(String typeId, String id) { this.typeId = typeId; this.id = id; + this.attributes = null; + } + + public LaunchTarget(String typeId, String id, Preferences attributes) { + this.typeId = typeId; + this.id = id; + this.attributes = attributes; } @Override @@ -30,6 +44,20 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { return typeId; } + @Override + public ILaunchTargetWorkingCopy getWorkingCopy() { + return new LaunchTargetWorkingCopy(this); + } + + @Override + public String getAttribute(String key, String defValue) { + if (attributes != null) { + return attributes.get(key, defValue); + } else { + return defValue; + } + } + @Override public int hashCode() { final int prime = 31; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index ddb86fe8ffc..6e313b74d1b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -66,6 +66,24 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets = new LinkedHashMap<>(); Preferences prefs = getTargetsPref(); try { + // For backwards compat pre-attributes, load targets from type keys + for (String childName : prefs.childrenNames()) { + String[] segments = childName.split(DELIMETER1); + if (segments.length == 2) { + String typeId = segments[0]; + String name = segments[1]; + + Map type = targets.get(typeId); + if (type == null) { + type = new LinkedHashMap<>(); + targets.put(typeId, type); + } + + // Creates the node. Will flush when attributes are added + type.put(name, new LaunchTarget(typeId, name, prefs.node(childName))); + } + } + for (String typeId : prefs.keys()) { Map type = targets.get(typeId); if (type == null) { @@ -74,8 +92,13 @@ public class LaunchTargetManager implements ILaunchTargetManager { } for (String name : prefs.get(typeId, "").split(DELIMETER1)) { //$NON-NLS-1$ - type.put(name, new LaunchTarget(typeId, name)); + if (!type.containsKey(name)) { + type.put(name, new LaunchTarget(typeId, name, prefs.node(typeId + DELIMETER1 + name))); + } } + + // Use children going forward + prefs.remove(typeId); } } catch (BackingStoreException e) { Activator.log(e); @@ -166,11 +189,15 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.put(typeId, type); } - ILaunchTarget target = new LaunchTarget(typeId, id); + Preferences prefs = getTargetsPref(); + String childName = typeId + DELIMETER1 + id; + ILaunchTarget target = new LaunchTarget(typeId, id, prefs.node(childName)); type.put(id, target); - - getTargetsPref().put(typeId, - type.values().stream().map(t -> t.getId()).collect(Collectors.joining(DELIMETER1))); + try { + prefs.flush(); + } catch (BackingStoreException e) { + Activator.log(e); + } for (ILaunchTargetListener listener : listeners) { listener.launchTargetAdded(target); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java new file mode 100644 index 00000000000..380b5ce2985 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.internal.target; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; +import org.osgi.service.prefs.BackingStoreException; + +public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTargetWorkingCopy { + + private final LaunchTarget original; + private final Map changes = new HashMap<>(); + + public LaunchTargetWorkingCopy(LaunchTarget original) { + this.original = original; + } + + @Override + public ILaunchTarget getOriginal() { + return original; + } + + @Override + public String getTypeId() { + return original.getTypeId(); + } + + @Override + public String getId() { + return original.getId(); + } + + @Override + public ILaunchTargetWorkingCopy getWorkingCopy() { + return this; + } + + @Override + public String getAttribute(String key, String defValue) { + if (changes.containsKey(key)) { + return changes.get(key); + } else { + return original.getAttribute(key, defValue); + } + } + + @Override + public void setAttribute(String key, String value) { + changes.put(key, value); + } + + @Override + public ILaunchTarget save() { + try { + for (Map.Entry entry : changes.entrySet()) { + original.attributes.put(entry.getKey(), entry.getValue()); + } + original.attributes.flush(); + } catch (BackingStoreException e) { + Activator.log(e); + } + return original; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java index eb7c130e6fe..2e3b600b488 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java @@ -7,10 +7,12 @@ *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; +import org.eclipse.core.runtime.Platform; import org.eclipse.launchbar.core.internal.Messages; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.eclipse.launchbar.core.target.ILaunchTargetProvider; +import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; import org.eclipse.launchbar.core.target.TargetStatus; public class LocalLaunchTargetProvider implements ILaunchTargetProvider { @@ -19,7 +21,11 @@ public class LocalLaunchTargetProvider implements ILaunchTargetProvider { public void init(ILaunchTargetManager targetManager) { if (targetManager.getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name) == null) { - targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name); + ILaunchTarget target = targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name); + ILaunchTargetWorkingCopy wc = target.getWorkingCopy(); + wc.setAttribute(ILaunchTarget.ATTR_OS, Platform.getOS()); + wc.setAttribute(ILaunchTarget.ATTR_ARCH, Platform.getOSArch()); + wc.save(); } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 1c9ad3173fa..9aee390223c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 QNX Software Systems and others. + * Copyright (c) 2015, 2016 QNX Software Systems 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 @@ -11,13 +11,21 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.launchbar.core.internal.target.LaunchTarget; /** - * A launch target is a thing that a launch will run on. Launch targets are - * simple objects with the intention that the launch delegates and launches will - * adapt this object to an object that will assist in performing the launch. + * A launch target is a thing that a launch will run on. Launch targets are simple objects with the + * intention that the launch delegates and launches will adapt this object to an object that will + * assist in performing the launch. * * @noimplement not to be implemented by clients */ public interface ILaunchTarget extends IAdaptable { + + // Standard attributes + public static final String ATTR_OS = "os"; //$NON-NLS-1$ + public static final String ATTR_ARCH = "arch"; //$NON-NLS-1$ + + /** + * The null target, which is the default when no other target is available. + */ public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---"); //$NON-NLS-1$ //$NON-NLS-2$ /** @@ -45,4 +53,23 @@ public interface ILaunchTarget extends IAdaptable { */ String getTypeId(); + /** + * Return a string attribute of this target + * + * @param key + * key + * @param defValue + * default value + * @return value of attribute + */ + String getAttribute(String key, String defValue); + + /** + * Create a working copy of this launch target to allow setting of attributes. Note that when + * saving the attributes this target is updated. A new one is not created. + * + * @return launch target working copy + */ + ILaunchTargetWorkingCopy getWorkingCopy(); + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java new file mode 100644 index 00000000000..f425270a7cf --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target; + +/** + * Working copy to set attributes on a target and then save them. + */ +public interface ILaunchTargetWorkingCopy extends ILaunchTarget { + + /** + * Get the original launch target. + * + * @return the original launch target + */ + ILaunchTarget getOriginal(); + + /** + * Set an attribute. + * + * @param key + * key + * @param value + * value + */ + void setAttribute(String key, String value); + + /** + * Save the changed attributes to the original working copy. + * + * @return original launch target + */ + ILaunchTarget save(); + +} diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java new file mode 100644 index 00000000000..29eff1a2886 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java @@ -0,0 +1,36 @@ +package org.eclipse.launchbar.core.tests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +import org.eclipse.launchbar.core.internal.Activator; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; +import org.junit.Test; + +@SuppressWarnings("nls") +public class TargetAttributesTest { + + @Test + public void testAttribute() { + ILaunchTargetManager manager = Activator.getLaunchTargetManager(); + String targetType = "testType"; + String targetId = "testTarget"; + ILaunchTarget target = manager.getLaunchTarget(targetType, targetId); + if (target != null) { + manager.removeLaunchTarget(target); + } + target = manager.addLaunchTarget(targetType, targetId); + String attributeKey = "testKey"; + String attributeValue = "testValue"; + assertEquals(target.getAttribute(attributeKey, ""), ""); + ILaunchTargetWorkingCopy wc = target.getWorkingCopy(); + assertNotEquals(target, wc); + wc.setAttribute(attributeKey, attributeValue); + assertEquals(wc.getAttribute(attributeKey, ""), attributeValue); + ILaunchTarget savedTarget = wc.save(); + assertEquals(target, savedTarget); + assertEquals(target.getAttribute(attributeKey, ""), attributeValue); + } +} From c3f9546a473318e099f855d286ba8a12c27c6513 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 14 Apr 2016 10:26:14 -0400 Subject: [PATCH 098/198] Fix removing of targets. Make sure we clear their attributes. Change-Id: Ie2c6e4bd6168fae95db1680143d4c4cafc159369 --- .../internal/target/LaunchTargetManager.java | 50 +++++++++++-------- .../core/tests/TargetAttributesTest.java | 15 +++++- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 6e313b74d1b..4345aa23f85 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -12,7 +12,6 @@ import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -66,7 +65,6 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets = new LinkedHashMap<>(); Preferences prefs = getTargetsPref(); try { - // For backwards compat pre-attributes, load targets from type keys for (String childName : prefs.childrenNames()) { String[] segments = childName.split(DELIMETER1); if (segments.length == 2) { @@ -79,26 +77,30 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.put(typeId, type); } - // Creates the node. Will flush when attributes are added type.put(name, new LaunchTarget(typeId, name, prefs.node(childName))); } } - for (String typeId : prefs.keys()) { - Map type = targets.get(typeId); - if (type == null) { - type = new LinkedHashMap<>(); - targets.put(typeId, type); - } - - for (String name : prefs.get(typeId, "").split(DELIMETER1)) { //$NON-NLS-1$ - if (!type.containsKey(name)) { - type.put(name, new LaunchTarget(typeId, name, prefs.node(typeId + DELIMETER1 + name))); + // convert old type keys + if (prefs.keys().length > 0) { + for (String typeId : prefs.keys()) { + Map type = targets.get(typeId); + if (type == null) { + type = new LinkedHashMap<>(); + targets.put(typeId, type); } - } - // Use children going forward - prefs.remove(typeId); + for (String name : prefs.get(typeId, "").split(DELIMETER1)) { //$NON-NLS-1$ + if (!type.containsKey(name)) { + type.put(name, new LaunchTarget(typeId, name, prefs.node(typeId + DELIMETER1 + name))); + } + } + + // Use children going forward + prefs.remove(typeId); + } + + prefs.flush(); } } catch (BackingStoreException e) { Activator.log(e); @@ -209,17 +211,21 @@ public class LaunchTargetManager implements ILaunchTargetManager { @Override public void removeLaunchTarget(ILaunchTarget target) { initTargets(); - Map type = targets.get(target.getTypeId()); + String typeId = target.getTypeId(); + Map type = targets.get(typeId); if (type != null) { - type.remove(target.getId()); + type.remove(target); if (type.isEmpty()) { targets.remove(target.getTypeId()); - getTargetsPref().remove(target.getTypeId()); - } else { - getTargetsPref().put(target.getTypeId(), - type.values().stream().map(t -> t.getId()).collect(Collectors.joining(DELIMETER1))); } + // Remove the attribute node + try { + getTargetsPref().node(typeId + DELIMETER1 + target.getId()).removeNode(); + } catch (BackingStoreException e) { + Activator.log(e); + } + for (ILaunchTargetListener listener : listeners) { listener.launchTargetRemoved(target); } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java index 29eff1a2886..4a393b9ebc2 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java @@ -17,20 +17,31 @@ public class TargetAttributesTest { ILaunchTargetManager manager = Activator.getLaunchTargetManager(); String targetType = "testType"; String targetId = "testTarget"; + String attributeKey = "testKey"; + String attributeValue = "testValue"; + // Make sure the target doesn't exist ILaunchTarget target = manager.getLaunchTarget(targetType, targetId); if (target != null) { manager.removeLaunchTarget(target); } + // Add the target target = manager.addLaunchTarget(targetType, targetId); - String attributeKey = "testKey"; - String attributeValue = "testValue"; + // Attribute should be empty assertEquals(target.getAttribute(attributeKey, ""), ""); + // Set the attribute and make sure it's set ILaunchTargetWorkingCopy wc = target.getWorkingCopy(); assertNotEquals(target, wc); wc.setAttribute(attributeKey, attributeValue); assertEquals(wc.getAttribute(attributeKey, ""), attributeValue); ILaunchTarget savedTarget = wc.save(); + // Make sure we get our original back assertEquals(target, savedTarget); assertEquals(target.getAttribute(attributeKey, ""), attributeValue); + // Make sure remove removes the attribute + manager.removeLaunchTarget(target); + target = manager.addLaunchTarget(targetType, targetId); + assertEquals(target.getAttribute(attributeKey, ""), ""); + // Cleanup + manager.removeLaunchTarget(target); } } From 3ad5cd3e421bcddf3c3fbd43a4b30406ec7e58e3 Mon Sep 17 00:00:00 2001 From: Vincent Guignot Date: Tue, 5 Apr 2016 11:31:51 +0200 Subject: [PATCH 099/198] Bug 491062: [Launchbar] Add preference to control Build button https://bugs.eclipse.org/bugs/show_bug.cgi?id=491062 Signed-off-by: Vincent Guignot Change-Id: I4de5a684b4d694db81c6cd782bdbc9c03b4a4747 --- .../launchbar/ui/internal/Activator.java | 2 ++ .../ui/internal/LaunchBarInjector.java | 17 +++++++++-------- .../LaunchBarPreferenceInitializer.java | 6 ++++-- .../ui/internal/LaunchBarPreferencePage.java | 4 +++- .../eclipse/launchbar/ui/internal/Messages.java | 4 +++- .../ui/internal/controls/LaunchBarControl.java | 10 ++++++++-- .../launchbar/ui/internal/messages.properties | 11 ++++++----- 7 files changed, 35 insertions(+), 19 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index a5e40883cdb..9c18a7ab3b7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -8,6 +8,7 @@ * Contributors: * Doug Schaefer * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -59,6 +60,7 @@ public class Activator extends AbstractUIPlugin { // Preference ids public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$ public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$ + public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$ public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$ // The shared instance diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java index ce87ead0b42..f5c5629073a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java @@ -8,6 +8,7 @@ * Contributors: * Doug Schaefer * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -36,16 +37,16 @@ public class LaunchBarInjector { @Inject MApplication application; - + @Inject IEventBroker eventBroker; - + @Execute void execute() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); injectIntoAll(enabled); - + // Watch for new trimmed windows and inject there too. eventBroker.subscribe(UIEvents.TrimmedWindow.TOPIC_TRIMBARS, new EventHandler() { @Override @@ -72,13 +73,13 @@ public class LaunchBarInjector { boolean enabled = Boolean.parseBoolean(event.getNewValue().toString()); injectIntoAll(enabled); } - if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)) { + if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)|| event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); + boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); if (enabled){ injectIntoAll(false); injectIntoAll(true); - } + } } } }); @@ -99,7 +100,7 @@ public class LaunchBarInjector { private void injectLaunchBar(MTrimBar trimBar, boolean enabled) { // are we enabled or not - + // Search for control in trimbar MTrimElement launchBarElement = null; for (MTrimElement trimElement : trimBar.getChildren()) { @@ -129,5 +130,5 @@ public class LaunchBarInjector { trimBar.getChildren().add(0, launchBar); } } - + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java index 3cde32d1a02..26369dd1e3a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 QNX Software Systems and others. + * Copyright (c) 2014, 2016 QNX Software Systems 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 @@ -7,7 +7,8 @@ * * Contributors: * Doug Schaefer - * Torkild U. Resheim - add preference to control target selector + * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -19,6 +20,7 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize @Override public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true); store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true); store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true); store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java index 814222893aa..96e4d818234 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java @@ -8,6 +8,7 @@ * Contributors: * Doug Schaefer * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -33,6 +34,7 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement protected void createFieldEditors() { addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent())); addField(new BooleanFieldEditor(Activator.PREF_ENABLE_TARGETSELECTOR, Messages.LaunchBarPreferencePage_EnableTargetSelector, getFieldEditorParent())); + addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON, Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent())); } - + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 55684221c1f..15a3c18d6e8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -7,7 +7,8 @@ * * Contributors: * Doug Schaefer - * Torkild U. Resheim - add preference to control target selector + * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -34,6 +35,7 @@ public class Messages extends NLS { public static String LaunchBarPreferencePage_0; public static String LaunchBarPreferencePage_1; public static String LaunchBarPreferencePage_EnableTargetSelector; + public static String LaunchBarPreferencePage_EnableBuildButton; public static String LaunchConfigurationEditDialog_0; public static String LaunchConfigurationEditDialog_1; public static String LaunchConfigurationEditDialog_2; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index 2e234d1ed5e..503f691c9eb 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -8,6 +8,7 @@ * Contributors: * Doug Schaefer * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal.controls; @@ -66,7 +67,12 @@ public class LaunchBarControl implements ILaunchBarListener { }); ToolBar toolBar = new ToolBar(container, SWT.FLAT); - createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean buildEnabled = store.getBoolean(Activator.PREF_ENABLE_BUILDBUTTON); + if (buildEnabled) { + createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + } + createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); @@ -78,7 +84,7 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); configSelector.setInput(manager); - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR); if (enabled) { Label label = new Label(container, SWT.NONE); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index eb1436f270c..0dcac33a4db 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -14,14 +14,15 @@ LaunchBarControl_Build=Build LaunchBarControl_Launch=Launch LaunchBarControl_Stop=Stop LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane -LaunchBarPreferencePage_0=Preferences for the Launch Bar. -LaunchBarPreferencePage_1=Enable the Launch Bar. -LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector. +LaunchBarPreferencePage_0=Preferences for the Launch Bar +LaunchBarPreferencePage_1=Enable the Launch Bar +LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector +LaunchBarPreferencePage_EnableBuildButton=Enable the Build button LaunchConfigurationEditDialog_0=Delete LaunchConfigurationEditDialog_1=Duplicate LaunchConfigurationEditDialog_2=Launch LaunchConfigurationEditDialog_3=Confirm Delete -LaunchConfigurationEditDialog_4=Are you sure you want to delete +LaunchConfigurationEditDialog_4=Are you sure you want to delete LaunchConfigurationEditDialog_5=Deleting launch configuration LaunchConfigurationEditDialog_6=Duplicating launch configuration ModeSelector_0=Launch Mode @@ -53,7 +54,7 @@ NoActiveTargetDesc=You must create a target to edit this launch configuration. NoLaunchConfigType=No launch configuration type matches selected launch descriptor. CannotEditLaunchConfiguration=Cannot edit this configuration. NoLaunchModeSelected=No launch mode selected. -NoLaunchGroupSelected=No launch group found for the current selection. +NoLaunchGroupSelected=No launch group found for the current selection. LaunchConfigurationNotFound=Launch Configuration Not Found LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target. NoLaunchTabsDefined=No launch tabs defined. From 1f95c6cd61c4c8024128b903bd40cca5a572a551 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Sat, 23 Apr 2016 21:15:14 -0400 Subject: [PATCH 100/198] Allow rename of launch targets. Add property tester for target type. Change-Id: I1e87f8012e4c5bcd11cf1fce62c8a0dcf1d25e1e --- bundles/org.eclipse.launchbar.core/plugin.xml | 10 ++++++ .../target/LaunchTargetPropertyTester.java | 25 +++++++++++++++ .../target/LaunchTargetWorkingCopy.java | 32 ++++++++++++++++--- .../launchbar/core/target/ILaunchTarget.java | 4 +-- .../core/target/ILaunchTargetWorkingCopy.java | 12 +++++-- 5 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index a85371f601e..13b7ef1dfd0 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -33,5 +33,15 @@ provider="org.eclipse.launchbar.core.internal.target.LocalLaunchTargetProvider"> + + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java new file mode 100644 index 00000000000..82269f5abf5 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.internal.target; + +import org.eclipse.core.expressions.PropertyTester; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +public class LaunchTargetPropertyTester extends PropertyTester { + + @Override + public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { + if (receiver instanceof ILaunchTarget) { + if (property.equals("launchTargetType")) { //$NON-NLS-1$ + return ((ILaunchTarget) receiver).getTypeId().equals(expectedValue); + } + } + return false; + } + +} diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java index 380b5ce2985..b256188df89 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java @@ -13,6 +13,7 @@ import java.util.Map; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; import org.osgi.service.prefs.BackingStoreException; @@ -20,6 +21,7 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa private final LaunchTarget original; private final Map changes = new HashMap<>(); + private String newId; public LaunchTargetWorkingCopy(LaunchTarget original) { this.original = original; @@ -37,7 +39,12 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa @Override public String getId() { - return original.getId(); + return newId != null ? newId : original.getId(); + } + + @Override + public void setId(String id) { + newId = id; } @Override @@ -62,14 +69,29 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa @Override public ILaunchTarget save() { try { - for (Map.Entry entry : changes.entrySet()) { - original.attributes.put(entry.getKey(), entry.getValue()); + LaunchTarget target; + if (newId == null) { + target = original; + } else { + // make a new one and remove the old one + ILaunchTargetManager manager = Activator.getLaunchTargetManager(); + target = (LaunchTarget) manager.addLaunchTarget(original.getTypeId(), newId); + for (String key : original.attributes.keys()) { + target.attributes.put(key, original.getAttribute(key, "")); //$NON-NLS-1$ + } + manager.removeLaunchTarget(original); } - original.attributes.flush(); + + // set the changed attributes + for (Map.Entry entry : changes.entrySet()) { + target.attributes.put(entry.getKey(), entry.getValue()); + } + target.attributes.flush(); + return target; } catch (BackingStoreException e) { Activator.log(e); + return original; } - return original; } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 9aee390223c..6cb14a1fb4d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -65,8 +65,8 @@ public interface ILaunchTarget extends IAdaptable { String getAttribute(String key, String defValue); /** - * Create a working copy of this launch target to allow setting of attributes. Note that when - * saving the attributes this target is updated. A new one is not created. + * Create a working copy of this launch target to allow setting of attributes. It also allows + * changing the id, which results in a new launch target when saved. * * @return launch target working copy */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java index f425270a7cf..25823e2a15e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java @@ -19,6 +19,14 @@ public interface ILaunchTargetWorkingCopy extends ILaunchTarget { */ ILaunchTarget getOriginal(); + /** + * Gives the target a new ID. The save method will return a new target with the given name.e + * + * @param id + * new target ID + */ + void setId(String id); + /** * Set an attribute. * @@ -30,9 +38,9 @@ public interface ILaunchTargetWorkingCopy extends ILaunchTarget { void setAttribute(String key, String value); /** - * Save the changed attributes to the original working copy. + * Save the changes to the original working copy. * - * @return original launch target + * @return original launch target unless the id was changed in which case returns a new target */ ILaunchTarget save(); From c6eca5a1032e92ba926402b96d0eb937cb42c436 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 5 May 2016 12:49:22 +0300 Subject: [PATCH 101/198] Update Maven machinery. * Update Tycho to 0.25. * Jarsigner plugin to 1.1.3. * Resource plugin to 2.7. * Antrun plugin to 1.8. * Findbugs plugin to 3.0.3. * PMD plugin to 3.6. Change-Id: I6ac8b6dd7d70e856ba5a54387485363f881aaa03 Signed-off-by: Alexander Kurtakov --- pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index db8e90dc5dd..4e1521bd7fd 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ pom - 0.22.0 - 0.22.0 + 0.25.0 + 0.25.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -146,7 +146,7 @@ org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin - 1.1.1 + 1.1.3 sign @@ -295,7 +295,7 @@ org.apache.maven.plugins maven-resources-plugin - 2.4.1 + 2.7 ISO-8859-1 @@ -303,12 +303,12 @@ org.apache.maven.plugins maven-antrun-plugin - 1.3 + 1.8 org.codehaus.mojo findbugs-maven-plugin - 2.3.2 + 3.0.3 true false @@ -324,7 +324,7 @@ org.apache.maven.plugins maven-pmd-plugin - 2.5 + 3.6 utf-8 100 From 91be36a418ba1bd1e3e1b238ed504c401d051f27 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 5 May 2016 11:35:59 -0400 Subject: [PATCH 102/198] Bug 488348 - fix target remove. Change-Id: I50d08fcfc46d723aa59fc6cc2f909de73f74d3de --- .../internal/target/LaunchTargetManager.java | 2 +- .../core/internal/LaunchTargetTest.java | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 4345aa23f85..2ad11c32936 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -214,7 +214,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { String typeId = target.getTypeId(); Map type = targets.get(typeId); if (type != null) { - type.remove(target); + type.remove(target.getId()); if (type.isEmpty()) { targets.remove(target.getTypeId()); } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java new file mode 100644 index 00000000000..65c7209fa65 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.junit.Test; + +@SuppressWarnings("nls") +public class LaunchTargetTest { + + @Test + public void testRemoveLaunchTarget() throws CoreException { + ILaunchTargetManager manager = Activator.getLaunchTargetManager(); + // Account for pre-populated targets + int baseSize = manager.getLaunchTargets().length; + ILaunchTarget target1 = manager.addLaunchTarget("mytype", "target1"); + ILaunchTarget target2 = manager.addLaunchTarget("mytype", "target2"); + Set targetSet = new HashSet<>(Arrays.asList(manager.getLaunchTargets())); + assertEquals(baseSize + 2, targetSet.size()); + assertTrue(targetSet.contains(target1)); + assertTrue(targetSet.contains(target2)); + manager.removeLaunchTarget(target2); + targetSet = new HashSet<>(Arrays.asList(manager.getLaunchTargets())); + assertEquals(baseSize + 1, targetSet.size()); + assertTrue(targetSet.contains(target1)); + assertFalse(targetSet.contains(target2)); + manager.removeLaunchTarget(target1); + targetSet = new HashSet<>(Arrays.asList(manager.getLaunchTargets())); + assertEquals(baseSize, targetSet.size()); + assertFalse(targetSet.contains(target1)); + assertFalse(targetSet.contains(target2)); + } + +} From 83f6bf8deb6ca5e5462f54dc236b885b9dc16dfa Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 9 May 2016 10:41:02 -0400 Subject: [PATCH 103/198] Refactor LaunchBar Control into it's own plug-in. Adjust APIs. Added a whole bunch of APIs to the managers to enable this without exposing internals to the control. Documentation will be added before release. Change-Id: I7a643eca3d48643e7a1202d83c7b4818722c54f0 --- .../META-INF/MANIFEST.MF | 2 +- .../launchbar/core/ILaunchBarManager.java | 56 +++++- .../core/internal/LaunchBarManager.java | 30 +++- .../.classpath | 7 + .../.project | 28 +++ .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 22 +++ .../about.html | 24 +++ .../build.properties | 8 + .../icons/bgButton.png | Bin .../icons/build.png | Bin .../icons/build2_24.png | Bin .../icons/build2_hot_24.png | Bin .../icons/build_16.png | Bin .../icons/config_config.png | Bin .../icons/connected.png | Bin .../icons/disconnected.png | Bin .../icons/edit_cold.png | Bin .../icons/icon_debug_32x32.png | Bin .../icons/icon_profile_32x32.png | Bin .../icons/icon_run_32x32.png | Bin .../icons/launch.png | Bin .../icons/launch2_24.png | Bin .../icons/launch2_hot_24.png | Bin .../icons/launch_16.png | Bin .../icons/launch_base_blank.png | Bin .../icons/stop.png | Bin .../icons/stop2_24.png | Bin .../icons/stop2_hot_24.png | Bin .../icons/stop_16.png | Bin .../plugin.properties | 3 + .../plugin.xml | 38 ++++ .../org.eclipse.launchbar.ui.controls/pom.xml | 18 ++ .../ui/controls/internal/Activator.java | 83 +++++++++ .../ui/controls/internal}/CButton.java | 2 +- .../ui/controls/internal}/CSelector.java | 4 +- .../ui/controls/internal}/ConfigSelector.java | 45 ++--- .../ui/controls/internal}/EditButton.java | 10 +- .../ui/controls/internal}/FilterControl.java | 3 +- .../LaunchBarButtonImageDescriptor.java | 2 +- .../controls/internal}/LaunchBarControl.java | 65 ++++--- .../controls}/internal/LaunchBarInjector.java | 15 +- .../internal}/LaunchBarListViewer.java | 4 +- .../LaunchBarPreferenceInitializer.java | 4 +- .../internal/LaunchBarPreferencePage.java | 2 +- .../ui/controls/internal/Messages.java | 56 ++++++ .../ui/controls/internal}/ModeSelector.java | 20 +-- .../internal}/OpenLaunchSelector.java | 3 +- .../ui/controls/internal}/TargetSelector.java | 36 ++-- .../ui/controls/internal}/Transition.java | 2 +- .../ui/controls/internal/messages.properties | 36 ++++ .../META-INF/MANIFEST.MF | 20 +-- bundles/org.eclipse.launchbar.ui/plugin.xml | 32 +--- .../DefaultDescriptorLabelProvider.java | 4 +- .../launchbar/ui/ILaunchBarUIConstants.java | 8 + .../launchbar/ui/ILaunchBarUIManager.java | 21 +++ .../dialogs => }/NewLaunchConfigWizard.java | 86 ++++++++-- .../launchbar/ui/internal/Activator.java | 75 +------- .../ui/internal/LaunchBarUIManager.java | 162 +++++++++++++++--- .../launchbar/ui/internal/Messages.java | 42 +---- .../commands/BuildActiveCommandHandler.java | 5 +- .../ConfigureActiveLaunchHandler.java | 138 ++------------- .../commands/LaunchActiveCommandHandler.java | 4 +- .../commands/StopActiveCommandHandler.java | 6 +- .../dialogs/NewLaunchConfigEditPage.java | 69 ++++---- .../dialogs/NewLaunchConfigModePage.java | 28 ++- .../dialogs/NewLaunchConfigTypePage.java | 27 +-- .../launchbar/ui/internal/messages.properties | 41 ++--- .../target/LaunchTargetUIManager.java | 2 +- .../target/NewLaunchTargetWizardAction.java | 3 +- features/org.eclipse.launchbar/feature.xml | 7 + pom.xml | 17 +- .../core/internal/LaunchBarManager2Test.java | 15 +- 73 files changed, 886 insertions(+), 561 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.classpath create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.project create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF create mode 100644 bundles/org.eclipse.launchbar.ui.controls/about.html create mode 100644 bundles/org.eclipse.launchbar.ui.controls/build.properties rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/bgButton.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/build.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/build2_24.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/build2_hot_24.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/build_16.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/config_config.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/connected.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/disconnected.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/edit_cold.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/icon_debug_32x32.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/icon_profile_32x32.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/icon_run_32x32.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/launch.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/launch2_24.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/launch2_hot_24.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/launch_16.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/launch_base_blank.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/stop.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/stop2_24.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/stop2_hot_24.png (100%) rename bundles/{org.eclipse.launchbar.ui => org.eclipse.launchbar.ui.controls}/icons/stop_16.png (100%) create mode 100644 bundles/org.eclipse.launchbar.ui.controls/plugin.properties create mode 100644 bundles/org.eclipse.launchbar.ui.controls/plugin.xml create mode 100644 bundles/org.eclipse.launchbar.ui.controls/pom.xml create mode 100644 bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/CButton.java (98%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/CSelector.java (99%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/ConfigSelector.java (85%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/EditButton.java (68%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/FilterControl.java (99%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/LaunchBarButtonImageDescriptor.java (97%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/LaunchBarControl.java (72%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls}/internal/LaunchBarInjector.java (91%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/LaunchBarListViewer.java (99%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls}/internal/LaunchBarPreferenceInitializer.java (96%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls}/internal/LaunchBarPreferencePage.java (97%) create mode 100644 bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/ModeSelector.java (92%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/OpenLaunchSelector.java (93%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/TargetSelector.java (91%) rename bundles/{org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls => org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal}/Transition.java (96%) create mode 100644 bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties rename bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/{internal => }/DefaultDescriptorLabelProvider.java (92%) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java rename bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/{internal/dialogs => }/NewLaunchConfigWizard.java (56%) rename bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/{internal => }/target/NewLaunchTargetWizardAction.java (97%) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index dad42f94192..ede7d846f4b 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -11,6 +11,6 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, - org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui", + org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests", org.eclipse.launchbar.core.target, org.eclipse.launchbar.core.target.launch diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index 6817509f546..b80b6ef1734 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -11,7 +11,11 @@ package org.eclipse.launchbar.core; import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationListener; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.target.ILaunchTarget; /** * Interface to the Launch Bar Manager. @@ -21,8 +25,7 @@ import org.eclipse.debug.core.ILaunchConfigurationListener; public interface ILaunchBarManager extends ILaunchConfigurationListener { /** - * A launch object has been added. Create a matching launch descriptor if - * available. + * A launch object has been added. Create a matching launch descriptor if available. * * @param element * launch object @@ -32,8 +35,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { ILaunchDescriptor launchObjectAdded(Object launchObject) throws CoreException; /** - * A launch object has been removed. Remove the associated launch descriptor - * if there is one. + * A launch object has been removed. Remove the associated launch descriptor if there is one. * * @param element * launch object @@ -49,16 +51,52 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { */ void launchObjectChanged(Object launchObject) throws CoreException; - /** - * Add a linstener that can react to launch bar changes + * Add a listener that can react to launch bar changes + * * @param listener */ - public void addListener(ILaunchBarListener listener); + void addListener(ILaunchBarListener listener); /** - * Remove a linstener + * Remove a listener + * * @param listener */ - public void removeListener(ILaunchBarListener listener); + void removeListener(ILaunchBarListener listener); + + /** + * Return the type id for the given launch descriptor type. This is defined in the extension + * point that defines the type. + * + * @param descType + * descriptor type + * @return the type id for the descriptor type + */ + String getDescriptorTypeId(ILaunchDescriptorType descType) throws CoreException; + + ILaunchDescriptor getActiveLaunchDescriptor() throws CoreException; + + ILaunchMode getActiveLaunchMode() throws CoreException; + + ILaunchTarget getActiveLaunchTarget() throws CoreException; + + ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException; + + ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor desc, ILaunchTarget target) throws CoreException; + + ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor desc, ILaunchTarget target) throws CoreException; + + ILaunchDescriptor[] getLaunchDescriptors() throws CoreException; + + void setActiveLaunchDescriptor(ILaunchDescriptor desc) throws CoreException; + + ILaunchMode[] getLaunchModes() throws CoreException; + + void setActiveLaunchMode(ILaunchMode mode) throws CoreException; + + ILaunchTarget[] getLaunchTargets(ILaunchDescriptor desc) throws CoreException; + + void setActiveLaunchTarget(ILaunchTarget target) throws CoreException; + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 040838b3a20..99aa6346ac2 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -11,7 +11,6 @@ package org.eclipse.launchbar.core.internal; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -290,19 +289,20 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (i < 0) { return null; } - return new Pair(key.substring(0, i), key.substring(i + 1)); + return new Pair<>(key.substring(0, i), key.substring(i + 1)); } + @Override public String getDescriptorTypeId(ILaunchDescriptorType type) { return descriptorTypeInfo.get(type).getId(); } private Pair getDescriptorId(ILaunchDescriptor descriptor) { - return new Pair(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); + return new Pair<>(getDescriptorTypeId(descriptor.getType()), descriptor.getName()); } private Pair getTargetId(ILaunchTarget target) { - return new Pair(target.getTypeId(), target.getName()); + return new Pair<>(target.getTypeId(), target.getId()); } private void addDescriptor(Object launchObject, ILaunchDescriptor descriptor) throws CoreException { @@ -311,6 +311,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene setActiveLaunchDescriptor(descriptor); } + @Override public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { if (descriptor == null) @@ -408,6 +409,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return descs[descs.length - 1]; } + @Override public ILaunchDescriptor[] getLaunchDescriptors() { // return descriptor in usage order (most used first). UI can sort them // later as it wishes @@ -416,6 +418,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return values.toArray(new ILaunchDescriptor[values.size()]); } + @Override public ILaunchDescriptor getActiveLaunchDescriptor() { return activeLaunchDesc; } @@ -453,6 +456,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } + @Override public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws CoreException { Activator.trace("set active descriptor " + descriptor); //$NON-NLS-1$ if (activeLaunchDesc == descriptor) { @@ -614,6 +618,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } + @Override public ILaunchMode[] getLaunchModes() throws CoreException { ILaunchConfigurationType configType = getLaunchConfigurationType(activeLaunchDesc, activeLaunchTarget); if (configType == null) @@ -628,6 +633,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return modeList.toArray(new ILaunchMode[modeList.size()]); } + @Override public ILaunchMode getActiveLaunchMode() { return activeLaunchMode; } @@ -647,6 +653,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } + @Override public void setActiveLaunchMode(ILaunchMode mode) throws CoreException { if (activeLaunchMode == mode) { // we have to modify listeners here because same mode does not mean @@ -681,16 +688,17 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } - public List getLaunchTargets(ILaunchDescriptor descriptor) { + @Override + public ILaunchTarget[] getLaunchTargets(ILaunchDescriptor descriptor) { if (descriptor == null) - return Arrays.asList(launchTargetManager.getLaunchTargets()); + return launchTargetManager.getLaunchTargets(); List targets = new ArrayList<>(); for (ILaunchTarget target : launchTargetManager.getLaunchTargets()) { if (supportsTarget(descriptor, target)) { targets.add(target); } } - return targets; + return targets.toArray(new ILaunchTarget[targets.size()]); } boolean supportsTarget(ILaunchDescriptor descriptor, ILaunchTarget target) { @@ -709,6 +717,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return false; } + @Override public ILaunchTarget getActiveLaunchTarget() { return activeLaunchTarget; } @@ -728,6 +737,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } + @Override public void setActiveLaunchTarget(ILaunchTarget target) throws CoreException { if (target == null) target = ILaunchTarget.NULL_TARGET; @@ -763,12 +773,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { - List targets = getLaunchTargets(descriptor); + ILaunchTarget[] targets = getLaunchTargets(descriptor); // chances are that better target is most recently added, rather then // the oldest - return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size() - 1); + return targets.length == 0 ? ILaunchTarget.NULL_TARGET : targets[targets.length - 1]; } + @Override public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { ILaunchConfiguration configuration = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); // This is the only concrete time we have the mapping from launch @@ -780,6 +791,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return configuration; } + @Override public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { if (descriptor == null) { diff --git a/bundles/org.eclipse.launchbar.ui.controls/.classpath b/bundles/org.eclipse.launchbar.ui.controls/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.launchbar.ui.controls/.project b/bundles/org.eclipse.launchbar.ui.controls/.project new file mode 100644 index 00000000000..16aad7cf740 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.ui.controls + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a872488efe2 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Launch Bar UI Controls +Bundle-SymbolicName: org.eclipse.launchbar.ui.controls;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.launchbar.ui.controls.internal.Activator +Bundle-Vendor: Eclipse CDT +Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", + org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.e4.core.di.annotations;bundle-version="1.5.0", + org.eclipse.e4.core.contexts;bundle-version="1.5.0", + org.eclipse.e4.core.services;bundle-version="2.0.0", + org.eclipse.e4.ui.model.workbench;bundle-version="1.2.0", + org.eclipse.e4.ui.workbench;bundle-version="1.4.0", + org.eclipse.debug.ui;bundle-version="3.11.200", + org.eclipse.launchbar.core;bundle-version="2.0.0", + org.eclipse.launchbar.ui;bundle-version="2.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Bundle-Localization: plugin +Export-Package: org.eclipse.launchbar.ui.controls.internal;x-internal:=true diff --git a/bundles/org.eclipse.launchbar.ui.controls/about.html b/bundles/org.eclipse.launchbar.ui.controls/about.html new file mode 100644 index 00000000000..d7c511887d6 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/about.html @@ -0,0 +1,24 @@ + + +About + + +

About This Content

+ +

June 22, 2007

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.ui.controls/build.properties b/bundles/org.eclipse.launchbar.ui.controls/build.properties new file mode 100644 index 00000000000..5ac60bf9b00 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.xml,\ + plugin.properties,\ + icons/ diff --git a/bundles/org.eclipse.launchbar.ui/icons/bgButton.png b/bundles/org.eclipse.launchbar.ui.controls/icons/bgButton.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/bgButton.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/bgButton.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/build.png b/bundles/org.eclipse.launchbar.ui.controls/icons/build.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/build.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/build.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/build2_24.png b/bundles/org.eclipse.launchbar.ui.controls/icons/build2_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/build2_24.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/build2_24.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png b/bundles/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/build_16.png b/bundles/org.eclipse.launchbar.ui.controls/icons/build_16.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/build_16.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/build_16.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/config_config.png b/bundles/org.eclipse.launchbar.ui.controls/icons/config_config.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/config_config.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/config_config.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/connected.png b/bundles/org.eclipse.launchbar.ui.controls/icons/connected.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/connected.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/connected.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/disconnected.png b/bundles/org.eclipse.launchbar.ui.controls/icons/disconnected.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/disconnected.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/disconnected.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/edit_cold.png b/bundles/org.eclipse.launchbar.ui.controls/icons/edit_cold.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/edit_cold.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/edit_cold.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/icon_debug_32x32.png b/bundles/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/icon_debug_32x32.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/icon_profile_32x32.png b/bundles/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/icon_profile_32x32.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/icon_run_32x32.png b/bundles/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/icon_run_32x32.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch.png b/bundles/org.eclipse.launchbar.ui.controls/icons/launch.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/launch.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/launch.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch2_24.png b/bundles/org.eclipse.launchbar.ui.controls/icons/launch2_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/launch2_24.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/launch2_24.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch2_hot_24.png b/bundles/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/launch2_hot_24.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch_16.png b/bundles/org.eclipse.launchbar.ui.controls/icons/launch_16.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/launch_16.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/launch_16.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch_base_blank.png b/bundles/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/launch_base_blank.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop.png b/bundles/org.eclipse.launchbar.ui.controls/icons/stop.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/stop.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/stop.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop2_24.png b/bundles/org.eclipse.launchbar.ui.controls/icons/stop2_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/stop2_24.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/stop2_24.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop2_hot_24.png b/bundles/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/stop2_hot_24.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop_16.png b/bundles/org.eclipse.launchbar.ui.controls/icons/stop_16.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/stop_16.png rename to bundles/org.eclipse.launchbar.ui.controls/icons/stop_16.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/plugin.properties b/bundles/org.eclipse.launchbar.ui.controls/plugin.properties new file mode 100644 index 00000000000..1a942c2caa3 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/plugin.properties @@ -0,0 +1,3 @@ +launchToolBar.label = LaunchBar +targetsView.name = Launch Targets +targetsContent.name = Launch Targets diff --git a/bundles/org.eclipse.launchbar.ui.controls/plugin.xml b/bundles/org.eclipse.launchbar.ui.controls/plugin.xml new file mode 100644 index 00000000000..653a81b1021 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/plugin.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/bundles/org.eclipse.launchbar.ui.controls/pom.xml b/bundles/org.eclipse.launchbar.ui.controls/pom.xml new file mode 100644 index 00000000000..5d02eb5e7c8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + org.eclipse.launchbar.ui.controls + 1.0.0-SNAPSHOT + + eclipse-plugin + diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java new file mode 100644 index 00000000000..4e6169d8a52 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.controls.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.launchbar.ui.controls"; //$NON-NLS-1$ + + // images + public static final String IMG_BUTTON_BACKGROUND = "bgButton"; //$NON-NLS-1$ + public static final String IMG_BUTTON_BUILD = "build"; //$NON-NLS-1$ + public static final String IMG_BUTTON_LAUNCH = "launch"; //$NON-NLS-1$ + public static final String IMG_BUTTON_STOP = "stop"; //$NON-NLS-1$ + public static final String IMG_CONFIG_CONFIG = "config_config"; //$NON-NLS-1$ + public static final String IMG_EDIT_COLD = "edit_cold"; //$NON-NLS-1$ + + // Preference ids + public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$ + public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$ + public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$ + public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + ImageRegistry imageRegistry = getImageRegistry(); + imageRegistry.put(IMG_BUTTON_BACKGROUND, imageDescriptorFromPlugin(PLUGIN_ID, "icons/bgButton.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build_16.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch_16.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop_16.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_CONFIG_CONFIG, imageDescriptorFromPlugin(PLUGIN_ID, "icons/config_config.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_EDIT_COLD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/edit_cold.png")); //$NON-NLS-1$ + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + public static Activator getDefault() { + return plugin; + } + + public static T getService(Class service) { + BundleContext context = plugin.getBundle().getBundleContext(); + ServiceReference ref = context.getServiceReference(service); + return ref != null ? context.getService(ref) : null; + } + + public static void log(Throwable e) { + IStatus status; + if (e instanceof CoreException) { + status = ((CoreException) e).getStatus(); + } else { + status = new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e); + } + plugin.getLog().log(status); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java similarity index 98% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java index df1dbe4443d..24d53787c51 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CButton.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java similarity index 99% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index 37ed62b8647..55948f7745c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import java.util.Comparator; @@ -23,8 +23,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java similarity index 85% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java index ef7712a0cc0..a0107cdc858 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import java.util.Comparator; @@ -25,13 +25,11 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.Window; import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.DefaultDescriptorLabelProvider; -import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; -import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.launchbar.ui.internal.commands.ConfigureActiveLaunchHandler; -import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigWizard; +import org.eclipse.launchbar.ui.DefaultDescriptorLabelProvider; +import org.eclipse.launchbar.ui.ILaunchBarUIManager; +import org.eclipse.launchbar.ui.NewLaunchConfigWizard; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -45,7 +43,8 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; public class ConfigSelector extends CSelector { - private LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); + private ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); + private ILaunchBarUIManager uiManager = Activator.getService(ILaunchBarUIManager.class); private DefaultDescriptorLabelProvider defaultProvider; private static final String[] noConfigs = new String[] { Messages.ConfigSelector_0 }; @@ -60,16 +59,21 @@ public class ConfigSelector extends CSelector { @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public void dispose() { } @Override public Object[] getElements(Object inputElement) { - ILaunchDescriptor[] descs = uiManager.getManager().getLaunchDescriptors(); - if (descs.length == 0) + try { + ILaunchDescriptor[] descs = manager.getLaunchDescriptors(); + if (descs.length == 0) + return noConfigs; + return descs; + } catch (CoreException e) { return noConfigs; - return descs; + } } }); @@ -78,7 +82,7 @@ public class ConfigSelector extends CSelector { public Image getImage(Object element) { if (element instanceof ILaunchDescriptor) { try { - ILaunchDescriptor configDesc = (ILaunchDescriptor)element; + ILaunchDescriptor configDesc = (ILaunchDescriptor) element; ILabelProvider labelProvider = uiManager.getLabelProvider(configDesc); if (labelProvider != null) { Image img = labelProvider.getImage(element); @@ -86,18 +90,19 @@ public class ConfigSelector extends CSelector { return img; } } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } } return defaultProvider.getImage(element); } + @Override public String getText(Object element) { if (element instanceof String) { - return (String)element; + return (String) element; } else if (element instanceof ILaunchDescriptor) { try { - ILaunchDescriptor configDesc = (ILaunchDescriptor)element; + ILaunchDescriptor configDesc = (ILaunchDescriptor) element; ILabelProvider labelProvider = uiManager.getLabelProvider(configDesc); if (labelProvider != null) { String text = labelProvider.getText(element); @@ -105,7 +110,7 @@ public class ConfigSelector extends CSelector { return text; } } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } } return defaultProvider.getText(element); @@ -136,9 +141,9 @@ public class ConfigSelector extends CSelector { if (selected instanceof ILaunchDescriptor) { ILaunchDescriptor configDesc = (ILaunchDescriptor) selected; try { - uiManager.getManager().setActiveLaunchDescriptor(configDesc); + manager.setActiveLaunchDescriptor(configDesc); } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } } } @@ -150,7 +155,7 @@ public class ConfigSelector extends CSelector { @Override public void handleEdit(Object element) { - ConfigureActiveLaunchHandler.openConfigurationEditor((ILaunchDescriptor) element); + uiManager.openConfigurationEditor((ILaunchDescriptor) element); } @Override @@ -170,7 +175,6 @@ public class ConfigSelector extends CSelector { createLabel.setBackground(getBackground()); createLabel.setText(Messages.ConfigSelector_2); - MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(org.eclipse.swt.events.MouseEvent e) { @@ -202,6 +206,7 @@ public class ConfigSelector extends CSelector { createButton.setBackground(highlightColor); createLabel.setBackground(highlightColor); } + @Override public void mouseExit(MouseEvent e) { Color backgroundColor = getBackground(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java similarity index 68% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java index f66a173c3b2..287188b5a36 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/EditButton.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java @@ -8,17 +8,17 @@ * Contributors: * Alena Laskavaia *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.widgets.Composite; public class EditButton extends CButton { + public EditButton(Composite parent, int style) { super(parent, style); - setHotImage(Activator.getDefault().getImage("icons/config_config.png")); //$NON-NLS-1$ - setColdImage(Activator.getDefault().getImage("icons/edit_cold.png")); //$NON-NLS-1$ + setHotImage(Activator.getDefault().getImageRegistry().get(Activator.IMG_CONFIG_CONFIG)); + setColdImage(Activator.getDefault().getImageRegistry().get(Activator.IMG_EDIT_COLD)); setToolTipText(Messages.EditButton_0); } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java similarity index 99% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java index 718da8e3e4f..491d03ebe68 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java @@ -8,7 +8,7 @@ * Contributors: * Alena Laskavaia *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; @@ -20,7 +20,6 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.AccessibleAdapter; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java similarity index 97% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java index 302cf789806..6fc5dca1c31 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarButtonImageDescriptor.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java @@ -9,7 +9,7 @@ * Doug Schaefer - initial API and implementation * Elena Laskavaia - moved to a separate class *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.swt.graphics.Image; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java similarity index 72% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 503f691c9eb..80668df5945 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -10,20 +10,23 @@ * Torkild U. Resheim - add preference to control target selector * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.launchbar.core.ILaunchBarListener; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.internal.LaunchBarManager; import org.eclipse.launchbar.core.target.ILaunchTarget; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.launchbar.ui.ILaunchBarUIConstants; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; @@ -32,16 +35,20 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.handlers.IHandlerService; public class LaunchBarControl implements ILaunchBarListener { public static final String ID = "org.eclipse.launchbar"; //$NON-NLS-1$ public static final String CLASS_URI = "bundleclass://" + Activator.PLUGIN_ID + "/" //$NON-NLS-1$ //$NON-NLS-2$ + LaunchBarControl.class.getName(); - private LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); + private ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); private ConfigSelector configSelector; private ModeSelector modeSelector; @@ -70,11 +77,14 @@ public class LaunchBarControl implements ILaunchBarListener { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); boolean buildEnabled = store.getBoolean(Activator.PREF_ENABLE_BUILDBUTTON); if (buildEnabled) { - createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, + ILaunchBarUIConstants.CMD_BUILD); } - createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); - createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); + createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, + ILaunchBarUIConstants.CMD_LAUNCH); + createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, + ILaunchBarUIConstants.CMD_STOP); modeSelector = new ModeSelector(container, SWT.NONE); modeSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); @@ -84,7 +94,6 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); configSelector.setInput(manager); - boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR); if (enabled) { Label label = new Label(container, SWT.NONE); @@ -100,12 +109,16 @@ public class LaunchBarControl implements ILaunchBarListener { } protected void syncSelectors() { - if (configSelector != null) - configSelector.setSelection(manager.getActiveLaunchDescriptor()); - if (modeSelector != null) - modeSelector.setSelection(manager.getActiveLaunchMode()); - if (targetSelector != null) - targetSelector.setSelection(manager.getActiveLaunchTarget()); + try { + if (configSelector != null) + configSelector.setSelection(manager.getActiveLaunchDescriptor()); + if (modeSelector != null) + modeSelector.setSelection(manager.getActiveLaunchMode()); + if (targetSelector != null) + targetSelector.setSelection(manager.getActiveLaunchTarget()); + } catch (CoreException e) { + Activator.log(e); + } } @PreDestroy @@ -113,21 +126,32 @@ public class LaunchBarControl implements ILaunchBarListener { manager.removeListener(this); } - private ToolItem createButton(Composite parent, String imageName, String toolTipText, final String command) { + private ToolItem createButton(Composite parent, String imageName, String toolTipText, final String commandId) { ToolItem button = new ToolItem((ToolBar) parent, SWT.FLAT); - Image bgImage = Activator.getDefault().getImage(Activator.IMG_BUTTON_BACKGROUND); - Image fgImage = Activator.getDefault().getImage(imageName); + Image bgImage = Activator.getDefault().getImageRegistry().get(Activator.IMG_BUTTON_BACKGROUND); + Image fgImage = Activator.getDefault().getImageRegistry().get(imageName); ImageDescriptor imageDesc = new LaunchBarButtonImageDescriptor(fgImage, bgImage); Image image = imageDesc.createImage(); button.setImage(image); button.setToolTipText(toolTipText); - button.setData("command", command); //$NON-NLS-1$ + button.setData("command", commandId); //$NON-NLS-1$ button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { - Activator.runCommand(command); + final ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); + Command command = commandService.getCommand(commandId); + final Event trigger = new Event(); + final IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class); + ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, trigger); + try { + command.executeWithChecks(executionEvent); + } catch (OperationCanceledException ex) { + // abort + } catch (Exception ex) { + Activator.log(ex); + } }; }); button.addDisposeListener(new DisposeListener() { @@ -170,4 +194,5 @@ public class LaunchBarControl implements ILaunchBarListener { public ConfigSelector getConfigSelector() { return configSelector; } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java similarity index 91% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java index f5c5629073a..b8161e898f7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java @@ -10,7 +10,7 @@ * Torkild U. Resheim - add preference to control target selector * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ -package org.eclipse.launchbar.ui.internal; +package org.eclipse.launchbar.ui.controls.internal; import javax.inject.Inject; @@ -28,7 +28,6 @@ import org.eclipse.e4.ui.workbench.UIEvents; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.launchbar.ui.internal.controls.LaunchBarControl; import org.eclipse.swt.widgets.Widget; import org.osgi.service.event.Event; import org.osgi.service.event.EventHandler; @@ -100,19 +99,25 @@ public class LaunchBarInjector { private void injectLaunchBar(MTrimBar trimBar, boolean enabled) { // are we enabled or not + // and fix up the class URI for 2.0 // Search for control in trimbar - MTrimElement launchBarElement = null; + MToolControl launchBarElement = null; for (MTrimElement trimElement : trimBar.getChildren()) { if (LaunchBarControl.ID.equals(trimElement.getElementId())) { - launchBarElement = trimElement; + launchBarElement = (MToolControl) trimElement; break; } } if (launchBarElement != null) { + // Fix up class name + if (!LaunchBarControl.CLASS_URI.equals(launchBarElement.getContributionURI())) { + launchBarElement.setContributionURI(LaunchBarControl.CLASS_URI); + } + + // remove it if we're disabled if (!enabled) { - // remove it if we're disabled trimBar.getChildren().remove(launchBarElement); // This seems to be a bug in the platform but for now, dispose of the widget Widget widget = (Widget)launchBarElement.getWidget(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java similarity index 99% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java index cf3a08eaf8b..3bd71a4cb2c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java @@ -8,7 +8,7 @@ * Contributors: * Alena Laskavaia *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import java.util.ArrayList; import java.util.Comparator; @@ -26,8 +26,6 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.DisposeEvent; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java similarity index 96% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java index 26369dd1e3a..077ecacf4b9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java @@ -10,7 +10,7 @@ * Torkild U. Resheim - add preference to control target selector * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ -package org.eclipse.launchbar.ui.internal; +package org.eclipse.launchbar.ui.controls.internal; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.jface.preference.IPreferenceStore; @@ -20,8 +20,8 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize @Override public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true); store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true); + store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true); store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true); store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java similarity index 97% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java index 96e4d818234..b1ab27fdd0a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java @@ -10,7 +10,7 @@ * Torkild U. Resheim - add preference to control target selector * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ -package org.eclipse.launchbar.ui.internal; +package org.eclipse.launchbar.ui.controls.internal; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java new file mode 100644 index 00000000000..d39471e3a17 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2014, 2015 QNX Software Systems 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: + * Doug Schaefer + * Torkild U. Resheim - add preference to control target selector + * Vincent Guignot - Ingenico - add preference to control Build button + *******************************************************************************/ +package org.eclipse.launchbar.ui.controls.internal; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.launchbar.ui.controls.internal.messages"; //$NON-NLS-1$ + public static String ConfigSelector_0; + public static String ConfigSelector_1; + public static String ConfigSelector_2; + public static String ConfigSelector_3; + public static String CSelector_0; + public static String CSelector_1; + public static String EditButton_0; + public static String FilterControl_0; + public static String FilterControl_1; + public static String LaunchBarControl_0; + public static String LaunchBarControl_Build; + public static String LaunchBarControl_Launch; + public static String LaunchBarControl_Stop; + public static String LaunchBarListViewer_0; + public static String LaunchBarPreferencePage_0; + public static String LaunchBarPreferencePage_1; + public static String LaunchBarPreferencePage_EnableTargetSelector; + public static String LaunchBarPreferencePage_EnableBuildButton; + public static String LaunchConfigurationEditDialog_0; + public static String LaunchConfigurationEditDialog_1; + public static String LaunchConfigurationEditDialog_2; + public static String LaunchConfigurationEditDialog_3; + public static String LaunchConfigurationEditDialog_4; + public static String LaunchConfigurationEditDialog_5; + public static String LaunchConfigurationEditDialog_6; + public static String ModeSelector_0; + public static String ModeSelector_ToolTip; + public static String TargetSelector_ToolTipPrefix; + public static String TargetSelector_CreateNewTarget; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java similarity index 92% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java index 7b6212f8c13..04f93de342a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import java.util.Comparator; import java.util.HashMap; @@ -25,9 +25,8 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; -import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.ui.ILaunchBarUIConstants; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; @@ -36,10 +35,9 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; -@SuppressWarnings("restriction") public class ModeSelector extends CSelector { private static final String[] noModes = new String[] { "---" }; //$NON-NLS-1$ - private final LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); + private final ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); private Map modeButtonImages = new HashMap<>(); public ModeSelector(Composite parent, int style) { @@ -61,7 +59,7 @@ public class ModeSelector extends CSelector { if (modes.length > 0) return modes; } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } return noModes; } @@ -175,7 +173,7 @@ public class ModeSelector extends CSelector { try { manager.setActiveLaunchMode(mode); } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } catch (Exception e) { // manager can throw illegal state exception hopefully we never // get it @@ -200,7 +198,7 @@ public class ModeSelector extends CSelector { } private ToolItem findLaunchButton() { - String commandId = Activator.CMD_LAUNCH; + String commandId = ILaunchBarUIConstants.CMD_LAUNCH; for (Control control : getParent().getChildren()) { if (control instanceof ToolBar) { for (ToolItem toolItem : ((ToolBar) control).getItems()) { @@ -229,7 +227,7 @@ public class ModeSelector extends CSelector { String id = group.getIdentifier(); Image image = modeButtonImages.get(id); if (image == null) { - Image bgImage = Activator.getDefault().getImage(Activator.IMG_BUTTON_BACKGROUND); + Image bgImage = Activator.getDefault().getImageRegistry().get(Activator.IMG_BUTTON_BACKGROUND); Image modeImage = getLabelProvider().getImage(mode); ImageDescriptor imageDesc = new LaunchBarButtonImageDescriptor(modeImage, bgImage); image = imageDesc.createImage(); @@ -244,7 +242,7 @@ public class ModeSelector extends CSelector { try { group = getLaunchGroup(mode.getIdentifier()); } catch (CoreException e) { - Activator.log(e.getStatus()); + Activator.log(e); } if (group == null) { group = getDefaultLaunchGroup(mode.getIdentifier()); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/OpenLaunchSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java similarity index 93% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/OpenLaunchSelector.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java index dce499ae1b4..e24f46084f7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/OpenLaunchSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java @@ -8,7 +8,7 @@ * Contributors: * Alena Laskavaia *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.commands; +package org.eclipse.launchbar.ui.controls.internal; import java.util.List; @@ -21,7 +21,6 @@ import org.eclipse.e4.ui.internal.workbench.E4Workbench; import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.e4.ui.model.application.ui.menu.MToolControl; import org.eclipse.e4.ui.workbench.modeling.EModelService; -import org.eclipse.launchbar.ui.internal.controls.LaunchBarControl; public class OpenLaunchSelector extends AbstractHandler { @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java similarity index 91% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java index ead2d16d02c..edc1313d3ca 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java @@ -8,10 +8,10 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import java.util.Comparator; -import java.util.List; + import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -26,17 +26,14 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.SameShellProvider; -import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetListener; import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.eclipse.launchbar.core.target.TargetStatus; import org.eclipse.launchbar.core.target.TargetStatus.Code; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.LaunchBarUIManager; -import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.launchbar.ui.internal.target.NewLaunchTargetWizardAction; import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; +import org.eclipse.launchbar.ui.target.NewLaunchTargetWizardAction; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -55,7 +52,7 @@ import org.eclipse.ui.dialogs.PropertyDialogAction; public class TargetSelector extends CSelector implements ILaunchTargetListener { - private final LaunchBarUIManager uiManager = Activator.getDefault().getLaunchBarUIManager(); + private final ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); private final ILaunchTargetUIManager targetUIManager = Activator.getService(ILaunchTargetUIManager.class); private final ILaunchTargetManager targetManager = Activator.getService(ILaunchTargetManager.class); @@ -77,12 +74,12 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { @Override public Object[] getElements(Object inputElement) { - LaunchBarManager manager = uiManager.getManager(); - List targets = manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); - if (!targets.isEmpty()) { - return targets.toArray(); + try { + return manager.getLaunchTargets(manager.getActiveLaunchDescriptor()); + } catch (CoreException e) { + Activator.log(e); + return noTargets; } - return noTargets; } }); @@ -92,7 +89,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { if (element instanceof ILaunchTarget) { ILaunchTarget target = (ILaunchTarget) element; ILabelProvider provider = targetUIManager.getLabelProvider(target); - return provider != null ? provider.getText(target) : target.getName(); + return provider != null ? provider.getText(target) : target.getId(); } return super.getText(element); } @@ -225,6 +222,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { createButton.setBackground(highlightColor); createLabel.setBackground(highlightColor); } + @Override public void mouseExit(MouseEvent e) { Color backgroundColor = getBackground(); @@ -242,7 +240,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { if (selection instanceof ILaunchTarget) { ILaunchTarget target = (ILaunchTarget) selection; try { - uiManager.getManager().setActiveLaunchTarget(target); + manager.setActiveLaunchTarget(target); } catch (CoreException e) { Activator.log(e); } @@ -289,8 +287,12 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { @Override public void launchTargetStatusChanged(ILaunchTarget target) { - if (target.equals(uiManager.getManager().getActiveLaunchTarget())) { - refresh(); + try { + if (target.equals(manager.getActiveLaunchTarget())) { + refresh(); + } + } catch (CoreException e) { + Activator.log(e); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java similarity index 96% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java rename to bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java index 63c01d0c2a8..1fa7b023ff8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/Transition.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.controls; +package org.eclipse.launchbar.ui.controls.internal; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties new file mode 100644 index 00000000000..391f607abda --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties @@ -0,0 +1,36 @@ +################################################################################ +# Copyright (c) 2016 QNX Software Systems 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 +################################################################################ +ConfigSelector_0=No Launch Configurations +ConfigSelector_1=Launch Configuration +ConfigSelector_2=New Launch Configuration... +ConfigSelector_3=Create Launch Configuration +CSelector_0=Closing popup +CSelector_1=Updating launch bar selection +EditButton_0=Edit +FilterControl_0=type filter text +FilterControl_1={0} {1} matches. +LaunchBarControl_0=on +LaunchBarControl_Build=Build +LaunchBarControl_Launch=Launch +LaunchBarControl_Stop=Stop +LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane +LaunchBarPreferencePage_0=Preferences for the Launch Bar +LaunchBarPreferencePage_1=Enable the Launch Bar +LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector +LaunchBarPreferencePage_EnableBuildButton=Enable the Build button +LaunchConfigurationEditDialog_0=Delete +LaunchConfigurationEditDialog_1=Duplicate +LaunchConfigurationEditDialog_2=Launch +LaunchConfigurationEditDialog_3=Confirm Delete +LaunchConfigurationEditDialog_4=Are you sure you want to delete +LaunchConfigurationEditDialog_5=Deleting launch configuration +LaunchConfigurationEditDialog_6=Duplicating launch configuration +ModeSelector_0=Launch Mode +ModeSelector_ToolTip=Launch in ''{0}'' mode +TargetSelector_ToolTipPrefix=Launch Target +TargetSelector_CreateNewTarget=New Launch Target... diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index ea9b0354427..9cb89b14495 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -5,24 +5,16 @@ Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true Bundle-Version: 2.0.0.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.e4.ui.workbench, - org.eclipse.e4.ui.model.workbench, - org.eclipse.e4.core.di, - org.eclipse.e4.core.services, - org.eclipse.osgi.services, - org.eclipse.launchbar.core, - org.eclipse.debug.ui, +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ui, org.eclipse.ui.ide, - org.eclipse.e4.core.contexts, - org.eclipse.ui.workbench + org.eclipse.debug.ui, + org.eclipse.launchbar.core Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Export-Package: org.eclipse.launchbar.ui, org.eclipse.launchbar.ui.internal;x-internal:=true, org.eclipse.launchbar.ui.internal.commands;x-internal:=true, - org.eclipse.launchbar.ui.internal.controls;x-internal:=true, - org.eclipse.launchbar.ui.internal.dialogs;x-internal:=true -Import-Package: javax.inject + org.eclipse.launchbar.ui.internal.dialogs;x-internal:=true, + org.eclipse.launchbar.ui.target diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/bundles/org.eclipse.launchbar.ui/plugin.xml index 34f16b217a4..da51d5e03f3 100644 --- a/bundles/org.eclipse.launchbar.ui/plugin.xml +++ b/bundles/org.eclipse.launchbar.ui/plugin.xml @@ -3,15 +3,6 @@ - - - - - - - - - - - - - - + labelProvider="org.eclipse.launchbar.ui.DefaultDescriptorLabelProvider"> diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java similarity index 92% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java rename to bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java index 848b96195d6..284c698b5ee 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/DefaultDescriptorLabelProvider.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal; +package org.eclipse.launchbar.ui; import java.util.HashMap; import java.util.Map; @@ -38,7 +38,7 @@ public class DefaultDescriptorLabelProvider extends LabelProvider { @Override public Image getImage(Object element) { if (element instanceof ILaunchDescriptor) { - ILaunchConfiguration config = (ILaunchConfiguration) ((ILaunchDescriptor) element).getAdapter(ILaunchConfiguration.class); + ILaunchConfiguration config = ((ILaunchDescriptor) element).getAdapter(ILaunchConfiguration.class); if (config != null) { try { ILaunchConfigurationType type = config.getType(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java index d41cd7e49df..8a204e10696 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.launchbar.ui; +import org.eclipse.launchbar.ui.internal.Activator; + public interface ILaunchBarUIConstants { /** @@ -17,4 +19,10 @@ public interface ILaunchBarUIConstants { */ public static final String TARGET_NAME = "targetName"; //$NON-NLS-1$ + // Command ids + public static final String CMD_BUILD = Activator.PLUGIN_ID + ".command.buildActive"; //$NON-NLS-1$ + public static final String CMD_LAUNCH = Activator.PLUGIN_ID + ".command.launchActive"; //$NON-NLS-1$ + public static final String CMD_STOP = Activator.PLUGIN_ID + ".command.stop"; //$NON-NLS-1$ + public static final String CMD_CONFIG = Activator.PLUGIN_ID + ".command.configureActiveLaunch"; //$NON-NLS-1$ + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java new file mode 100644 index 00000000000..f677a1deb8d --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.launchbar.core.ILaunchDescriptor; + +public interface ILaunchBarUIManager { + + ILabelProvider getLabelProvider(ILaunchDescriptor descriptor) throws CoreException; + + IStatus openConfigurationEditor(ILaunchDescriptor descriptor); + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java similarity index 56% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java rename to bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java index ea52f0bdfc0..b6adf46ac13 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.dialogs; +package org.eclipse.launchbar.ui; import java.util.ArrayList; import java.util.List; @@ -19,28 +19,92 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationListener; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.wizard.IWizardContainer; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigEditPage; +import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigModePage; +import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigTypePage; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Composite; public class NewLaunchConfigWizard extends Wizard implements ILaunchConfigurationListener { - NewLaunchConfigModePage modePage = new NewLaunchConfigModePage(); - NewLaunchConfigTypePage typePage = new NewLaunchConfigTypePage(); - NewLaunchConfigEditPage editPage = new NewLaunchConfigEditPage(); + private NewLaunchConfigModePage modePage = new NewLaunchConfigModePage(); + private NewLaunchConfigTypePage typePage = new NewLaunchConfigTypePage(); + private NewLaunchConfigEditPage editPage = new NewLaunchConfigEditPage(); private List configsToDelete = new ArrayList<>(); public NewLaunchConfigWizard() { setWindowTitle(Messages.NewLaunchConfigWizard_0); - initListeners(); + + // while the wizard is open, some ill behaved launch config tabs save the working copy. + // We need to make sure those saves are deleted when the dialog is finished. + // We also need to turn off listening in the tool bar manager so that we don't treat these + // as real launch configs. + DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this); + } + + @Override + public void createPageControls(Composite pageContainer) { + super.createPageControls(pageContainer); + + // Link the pages + SelectionListener modePageListener = new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + ILaunchGroup selectedGroup = modePage.getSelectedGroup(); + typePage.setLaunchGroup(selectedGroup); + editPage.setLaunchGroup(selectedGroup); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + getContainer().showPage(modePage.getNextPage()); + } + }; + modePage.addGroupSelectionListener(modePageListener); + modePageListener.widgetSelected(null); + + SelectionListener typePageListener = new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + editPage.setLaunchConfigType(typePage.getSelectedType()); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + getContainer().showPage(typePage.getNextPage()); + } + }; + typePage.addTypeSelectionListener(typePageListener); + typePageListener.widgetSelected(null); + + editPage.setLaunchConfigType(typePage.getSelectedType()); + } + + @Override + public void setContainer(IWizardContainer wizardContainer) { + super.setContainer(wizardContainer); + + if (wizardContainer != null) { + // Edit page wants to know when it's about to change to itself + ((WizardDialog) wizardContainer).addPageChangingListener(editPage); + } } @Override public void addPages() { addPage(modePage); addPage(typePage); - //addPage(editPage); // add dynamically on the types page + addPage(editPage); } @Override @@ -56,7 +120,7 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio } public ILaunchMode getLaunchMode() { - String initMode = modePage.selectedGroup.getMode(); + String initMode = modePage.getSelectedGroup().getMode(); return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(initMode); } @@ -72,14 +136,6 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio return super.performCancel(); } - private void initListeners() { - // while the wizard is open, some ill behaved launch config tabs save the working copy. - // We need to make sure those saves are deleted when the dialog is finished. - // We also need to turn off listening in the tool bar manager so that we don't treat these - // as real launch configs. - DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this); - } - void cleanUpConfigs() { DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this); for (ILaunchConfiguration config : configsToDelete) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index 9c18a7ab3b7..85b8303cf52 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -12,26 +12,15 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.IParameter; -import org.eclipse.core.commands.Parameterization; -import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.launchbar.core.ILaunchBarManager; -import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.ui.ILaunchBarUIManager; import org.eclipse.launchbar.ui.internal.target.LaunchTargetUIManager; import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Event; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -45,30 +34,11 @@ public class Activator extends AbstractUIPlugin { public static final String PLUGIN_ID = "org.eclipse.launchbar.ui"; //$NON-NLS-1$ // Images - public static final String IMG_BUTTON_BACKGROUND = "bgButton"; //$NON-NLS-1$ - public static final String IMG_BUTTON_BUILD = "build"; //$NON-NLS-1$ - public static final String IMG_BUTTON_LAUNCH = "launch"; //$NON-NLS-1$ - public static final String IMG_BUTTON_STOP = "stop"; //$NON-NLS-1$ public static final String IMG_LOCAL_TARGET = "localTarget"; //$NON-NLS-1$ - // Command ids - public static final String CMD_BUILD = PLUGIN_ID + ".command.buildActive"; //$NON-NLS-1$ - public static final String CMD_LAUNCH = PLUGIN_ID + ".command.launchActive"; //$NON-NLS-1$ - public static final String CMD_STOP = PLUGIN_ID + ".command.stop"; //$NON-NLS-1$ - public static final String CMD_CONFIG = PLUGIN_ID + ".command.configureActiveLaunch"; //$NON-NLS-1$ - - // Preference ids - public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$ - public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$ - public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$ - public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$ - // The shared instance private static Activator plugin; - // The cache of the Launch Bar UI Manager Object - private LaunchBarUIManager launchBarUIManager; - /** * The constructor */ @@ -81,13 +51,10 @@ public class Activator extends AbstractUIPlugin { plugin = this; ImageRegistry imageRegistry = getImageRegistry(); - imageRegistry.put(IMG_BUTTON_BACKGROUND, imageDescriptorFromPlugin(PLUGIN_ID, "icons/bgButton.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build_16.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch_16.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop_16.png")); //$NON-NLS-1$ imageRegistry.put(IMG_LOCAL_TARGET, imageDescriptorFromPlugin(PLUGIN_ID, "icons/localTarget.png")); //$NON-NLS-1$ context.registerService(ILaunchTargetUIManager.class, new LaunchTargetUIManager(), null); + context.registerService(ILaunchBarUIManager.class, new LaunchBarUIManager(), null); } @Override @@ -105,14 +72,6 @@ public class Activator extends AbstractUIPlugin { return plugin; } - public LaunchBarUIManager getLaunchBarUIManager() { - if (launchBarUIManager == null) { - LaunchBarManager manager = (LaunchBarManager) getService(ILaunchBarManager.class); - launchBarUIManager = new LaunchBarUIManager(manager); - } - return launchBarUIManager; - } - public Image getImage(String id) { Image im = getImageRegistry().get(id); if (im == null) { @@ -129,36 +88,6 @@ public class Activator extends AbstractUIPlugin { return imageDescriptorFromPlugin(PLUGIN_ID, path); } - public static void runCommand(String commandId, String... params) { - final ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); - Command command = commandService.getCommand(commandId); - final Event trigger = new Event(); - final IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class); - ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, trigger); - if (params.length == 0) { - try { - command.executeWithChecks(executionEvent); - } catch (OperationCanceledException e) { - // abort - } catch (Exception e) { - log(e); - } - } else { - try { - final Parameterization[] parameterizations = new Parameterization[params.length / 2]; - for (int i = 0; i < params.length; i += 2) { - IParameter param = command.getParameter(params[i]); - Parameterization parm = new Parameterization(param, params[i + 1]); - parameterizations[i / 2] = parm; - } - ParameterizedCommand parmCommand = new ParameterizedCommand(command, parameterizations); - handlerService.executeCommand(parmCommand, null); - } catch (Exception e) { - log(e); - } - } - } - public static void log(IStatus status) { plugin.getLog().log(status); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 904e16c9499..907ad6234b3 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -17,41 +17,163 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; +import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.ExecutableExtension; -import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.ui.ILaunchBarUIManager; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; -public class LaunchBarUIManager { +public class LaunchBarUIManager implements ILaunchBarUIManager { - private LaunchBarManager manager; - private Map> descriptorLabelProviders = new HashMap<>(); + private Map> descriptorLabelProviders = null; + private ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); - public LaunchBarUIManager(LaunchBarManager manager) { - this.manager = manager; - - IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); //$NON-NLS-1$ - IExtension[] extensions = point.getExtensions(); - for (IExtension extension : extensions) { - for (IConfigurationElement element : extension.getConfigurationElements()) { - String elementName = element.getName(); - if (elementName.equals("descriptorUI")) { //$NON-NLS-1$ - String descriptorTypeId = element.getAttribute("descriptorTypeId"); //$NON-NLS-1$ - ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); //$NON-NLS-1$ - descriptorLabelProviders.put(descriptorTypeId, labelProvider); + private void init() { + if (descriptorLabelProviders == null) { + descriptorLabelProviders = new HashMap<>(); + IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); //$NON-NLS-1$ + IExtension[] extensions = point.getExtensions(); + for (IExtension extension : extensions) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String elementName = element.getName(); + if (elementName.equals("descriptorUI")) { //$NON-NLS-1$ + String descriptorTypeId = element.getAttribute("descriptorTypeId"); //$NON-NLS-1$ + ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); //$NON-NLS-1$ + descriptorLabelProviders.put(descriptorTypeId, labelProvider); + } } } } } - public LaunchBarManager getManager() { - return manager; - } - + @Override public ILabelProvider getLabelProvider(ILaunchDescriptor descriptor) throws CoreException { + init(); ExecutableExtension provider = descriptorLabelProviders.get(manager.getDescriptorTypeId(descriptor.getType())); return provider != null ? provider.get() : null; } + @Override + public IStatus openConfigurationEditor(ILaunchDescriptor descriptor) { + if (descriptor == null) + return Status.OK_STATUS; + + // Display the error message + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + IStatus s = canOpenConfigurationEditor(descriptor); + if (!s.isOK()) { + MessageDialog.openError(shell, s.getMessage(), + s.getException() == null ? s.getMessage() : s.getException().getMessage()); + return s; + } + + // At this point, no error handling should be needed. + try { + ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); + ILaunchMode mode = manager.getActiveLaunchMode(); + ILaunchTarget target = manager.getActiveLaunchTarget(); + ILaunchConfigurationType configType = manager.getLaunchConfigurationType(descriptor, target); + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, + mode.getIdentifier()); + ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); + if (config instanceof ILaunchConfigurationWorkingCopy + && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { + config = ((ILaunchConfigurationWorkingCopy) config).doSave(); + } + // open real eclipse launch configurations dialog + DebugUIPlugin.openLaunchConfigurationsDialog(shell, new StructuredSelection(config), + group.getIdentifier(), false); + return Status.OK_STATUS; + } catch (CoreException e2) { + return e2.getStatus(); + } + } + + private IStatus canOpenConfigurationEditor(ILaunchDescriptor desc) { + if (desc == null) + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.DescriptorMustNotBeNull, + new Exception(Messages.DescriptorMustNotBeNullDesc)); + ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); + ILaunchMode mode = null; + ILaunchTarget target = null; + try { + mode = manager.getActiveLaunchMode(); + target = manager.getActiveLaunchTarget(); + } catch (CoreException e) { + return e.getStatus(); + } + if (target == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoActiveTarget, + new Exception(Messages.NoActiveTargetDesc)); + } + + ILaunchConfigurationType configType = null; + try { + configType = manager.getLaunchConfigurationType(desc, target); + } catch (CoreException ce) { + return ce.getStatus(); + } + + if (mode == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, + new Exception(Messages.NoLaunchModeSelected)); + } + + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, + mode.getIdentifier()); + if (group == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchGroupSelected, + new Exception(Messages.NoLaunchGroupSelected)); + } + + String mode2 = group.getMode(); + if (mode2 == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, + new Exception(Messages.CannotEditLaunchConfiguration)); + } + + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() + .getLaunchGroup(group.getIdentifier()); + if (groupExt != null) { + ILaunchConfiguration config = null; + try { + config = manager.getLaunchConfiguration(desc, target); + } catch (CoreException ce) { + // Ignore + } + if (config == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LaunchConfigurationNotFound, + new Exception(Messages.LaunchConfigurationNotFoundDesc)); + } + try { + LaunchConfigurationPresentationManager mgr = LaunchConfigurationPresentationManager.getDefault(); + ILaunchConfigurationTabGroup tabgroup = mgr.getTabGroup(config, mode.getIdentifier()); + } catch (CoreException ce) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchTabsDefined, + new Exception(Messages.NoLaunchTabsDefinedDesc)); + } + } else { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CannotEditLaunchConfiguration, + new Exception(Messages.CannotEditLaunchConfiguration)); + } + return Status.OK_STATUS; + } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 15a3c18d6e8..ed4c60c346e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -1,14 +1,9 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 QNX Software Systems and others. + * Copyright (c) 2014, 2016 QNX Software Systems 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: - * Doug Schaefer - * Torkild U. Resheim - add preference to control target selector - * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; @@ -16,35 +11,12 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.launchbar.ui.internal.messages"; //$NON-NLS-1$ + public static String BuildActiveCommandHandler_0; public static String BuildActiveCommandHandler_1; - public static String ConfigSelector_0; - public static String ConfigSelector_1; - public static String ConfigSelector_2; - public static String ConfigSelector_3; - public static String CSelector_0; - public static String CSelector_1; - public static String EditButton_0; - public static String FilterControl_0; - public static String FilterControl_1; - public static String LaunchBarControl_0; - public static String LaunchBarControl_Build; - public static String LaunchBarControl_Launch; - public static String LaunchBarControl_Stop; - public static String LaunchBarListViewer_0; - public static String LaunchBarPreferencePage_0; - public static String LaunchBarPreferencePage_1; - public static String LaunchBarPreferencePage_EnableTargetSelector; - public static String LaunchBarPreferencePage_EnableBuildButton; - public static String LaunchConfigurationEditDialog_0; - public static String LaunchConfigurationEditDialog_1; - public static String LaunchConfigurationEditDialog_2; - public static String LaunchConfigurationEditDialog_3; - public static String LaunchConfigurationEditDialog_4; - public static String LaunchConfigurationEditDialog_5; - public static String LaunchConfigurationEditDialog_6; - public static String ModeSelector_0; - public static String ModeSelector_ToolTip; + public static String StopActiveCommandHandler_0; + public static String StopActiveCommandHandler_1; + public static String NewLaunchConfigEditPage_0; public static String NewLaunchConfigEditPage_1; public static String NewLaunchConfigEditPage_2; @@ -60,10 +32,6 @@ public class Messages extends NLS { public static String NewLaunchConfigTypePage_1; public static String NewLaunchConfigTypePage_2; public static String NewLaunchConfigWizard_0; - public static String StopActiveCommandHandler_0; - public static String StopActiveCommandHandler_1; - public static String TargetSelector_ToolTipPrefix; - public static String TargetSelector_CreateNewTarget; public static String DescriptorMustNotBeNull; public static String DescriptorMustNotBeNullDesc; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index e37b944353e..b1f18f4968e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -34,7 +34,7 @@ import org.eclipse.debug.core.ILaunchDelegate; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; -import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.launch.ILaunchConfigurationTargetedDelegate; import org.eclipse.launchbar.ui.internal.Activator; @@ -56,7 +56,7 @@ public class BuildActiveCommandHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { try { - LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + ILaunchBarManager launchBarManager = Activator.getService(ILaunchBarManager.class); ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); ILaunchTarget target = launchBarManager.getActiveLaunchTarget(); @@ -67,6 +67,7 @@ public class BuildActiveCommandHandler extends AbstractHandler { return ResourcesPlugin.FAMILY_MANUAL_BUILD.equals(family); } + @Override public IStatus runInUIThread(IProgressMonitor monitor) { final Collection projects = getProjects(config); if (BuildAction.isSaveAllSet()) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index df7cd0cebc1..a7b3c593f0f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -1,12 +1,9 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014,2016 QNX Software Systems 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: - * Doug Schaefer *******************************************************************************/ package org.eclipse.launchbar.ui.internal.commands; @@ -14,136 +11,23 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchMode; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; -import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; -import org.eclipse.debug.ui.ILaunchGroup; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.internal.LaunchBarManager; -import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.ui.ILaunchBarUIManager; import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; public class ConfigureActiveLaunchHandler extends AbstractHandler { + @Override public Object execute(ExecutionEvent event) throws ExecutionException { - LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); - ILaunchDescriptor launchDesc = launchBarManager.getActiveLaunchDescriptor(); - if (launchDesc == null) - return Status.OK_STATUS; - openConfigurationEditor(launchDesc); - return Status.OK_STATUS; - } - - public static IStatus canOpenConfigurationEditor(ILaunchDescriptor desc) { - if (desc == null) - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.DescriptorMustNotBeNull, - new Exception(Messages.DescriptorMustNotBeNullDesc)); - LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); - ILaunchMode mode = manager.getActiveLaunchMode(); - ILaunchTarget target = manager.getActiveLaunchTarget(); - if (target == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoActiveTarget, - new Exception(Messages.NoActiveTargetDesc)); - } - - ILaunchConfigurationType configType = null; try { - configType = manager.getLaunchConfigurationType(desc, target); - } catch (CoreException ce) { - /* ignore */ } - ; - if (configType == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchConfigType, - new Exception(Messages.CannotEditLaunchConfiguration)); - } - - if (mode == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, - new Exception(Messages.NoLaunchModeSelected)); - } - - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, - mode.getIdentifier()); - if (group == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchGroupSelected, - new Exception(Messages.NoLaunchGroupSelected)); - } - - String mode2 = group.getMode(); - if (mode2 == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchModeSelected, - new Exception(Messages.CannotEditLaunchConfiguration)); - } - - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() - .getLaunchGroup(group.getIdentifier()); - if (groupExt != null) { - ILaunchConfiguration config = null; - try { - config = manager.getLaunchConfiguration(desc, target); - } catch (CoreException ce) { - // Ignore - } - if (config == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LaunchConfigurationNotFound, - new Exception(Messages.LaunchConfigurationNotFoundDesc)); - } - try { - LaunchConfigurationPresentationManager mgr = LaunchConfigurationPresentationManager.getDefault(); - ILaunchConfigurationTabGroup tabgroup = mgr.getTabGroup(config, mode.getIdentifier()); - } catch (CoreException ce) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NoLaunchTabsDefined, - new Exception(Messages.NoLaunchTabsDefinedDesc)); - } - } else { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CannotEditLaunchConfiguration, - new Exception(Messages.CannotEditLaunchConfiguration)); - } - return Status.OK_STATUS; - } - - public static void openConfigurationEditor(ILaunchDescriptor desc) { - if (desc == null) - return; - - // Display the error message - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - IStatus s = canOpenConfigurationEditor(desc); - if (!s.isOK()) { - MessageDialog.openError(shell, s.getMessage(), - s.getException() == null ? s.getMessage() : s.getException().getMessage()); - return; - } - - // At this point, no error handling should be needed. - try { - LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); - ILaunchMode mode = manager.getActiveLaunchMode(); - ILaunchTarget target = manager.getActiveLaunchTarget(); - ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, - mode.getIdentifier()); - ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); - if (config instanceof ILaunchConfigurationWorkingCopy && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { - config = ((ILaunchConfigurationWorkingCopy) config).doSave(); - } - // open real eclipse launch configurations dialog - DebugUIPlugin.openLaunchConfigurationsDialog(shell, new StructuredSelection(config), - group.getIdentifier(), false); - } catch (CoreException e2) { - Activator.log(e2); + ILaunchBarManager launchBarManager = Activator.getService(ILaunchBarManager.class); + ILaunchDescriptor launchDesc = launchBarManager.getActiveLaunchDescriptor(); + ILaunchBarUIManager uiManager = Activator.getService(ILaunchBarUIManager.class); + return uiManager.openConfigurationEditor(launchDesc); + } catch (CoreException e) { + return e.getStatus(); } } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java index 25e954978d6..45ff856928e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; public class LaunchActiveCommandHandler extends AbstractHandler { @@ -26,7 +26,7 @@ public class LaunchActiveCommandHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { try { - LaunchBarManager launchBarManager = Activator.getDefault().getLaunchBarUIManager().getManager(); + ILaunchBarManager launchBarManager = Activator.getService(ILaunchBarManager.class); StopActiveCommandHandler.stopActiveLaunches(launchBarManager); ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); if (config == null) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index bc7dd66af10..06276c71420 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -24,7 +24,7 @@ import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.launchbar.core.internal.LaunchBarManager; +import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; @@ -38,10 +38,10 @@ public class StopActiveCommandHandler extends AbstractHandler { public void stop() { stopBuild(); - stopActiveLaunches(Activator.getDefault().getLaunchBarUIManager().getManager()); + stopActiveLaunches(Activator.getService(ILaunchBarManager.class)); } - static void stopActiveLaunches(LaunchBarManager launchBarManager) { + static void stopActiveLaunches(ILaunchBarManager launchBarManager) { final ILaunch[] activeLaunches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); if (activeLaunches != null && activeLaunches.length > 0) { new Job(Messages.StopActiveCommandHandler_0) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 1c888382b89..9e32ba076a0 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -24,6 +24,8 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDi import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension; import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.dialogs.IPageChangingListener; +import org.eclipse.jface.dialogs.PageChangingEvent; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Activator; @@ -34,11 +36,13 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @SuppressWarnings("restriction") -public class NewLaunchConfigEditPage extends WizardPage { +public class NewLaunchConfigEditPage extends WizardPage implements IPageChangingListener { private ILaunchConfigurationWorkingCopy workingCopy; private LaunchConfigurationDialogExt launchConfigurationDialog = new LaunchConfigurationDialogExt(); private LaunchConfigurationTabGroupViewerExt tabViewer; - private ILaunchConfigurationType type; + + private ILaunchGroup launchGroup; + private ILaunchConfigurationType launchConfigType; public NewLaunchConfigEditPage() { super(Messages.NewLaunchConfigEditPage_0); @@ -55,7 +59,6 @@ public class NewLaunchConfigEditPage extends WizardPage { LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); tabViewer = new LaunchConfigurationTabGroupViewerExt(comp, launchConfigurationDialog); launchConfigurationDialog.setTabViewer(tabViewer); - changeLaunchConfigType(type); GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false); data.heightHint = 500; tabViewer.getControl().setLayoutData(data); @@ -63,6 +66,14 @@ public class NewLaunchConfigEditPage extends WizardPage { validateFields(); } + public void setLaunchGroup(ILaunchGroup launchGroup) { + this.launchGroup = launchGroup; + } + + public void setLaunchConfigType(ILaunchConfigurationType type) { + this.launchConfigType = type; + } + /** * @return the workingCopy */ @@ -70,26 +81,26 @@ public class NewLaunchConfigEditPage extends WizardPage { return workingCopy; } - void changeLaunchConfigType(ILaunchConfigurationType type) { - if (type == null) + @Override + public void handlePageChanging(PageChangingEvent event) { + if (launchConfigType == null) { return; - try { - this.type = type; - LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); - if (tabViewer != null) { + } + LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); + if (tabViewer != null) { + try { String name = launchConfigurationDialog.generateName("launchConfiguration"); //$NON-NLS-1$ - workingCopy = type.newInstance(null, name); + workingCopy = launchConfigType.newInstance(null, name); launchConfigurationDialog.doSetDefaults(workingCopy); tabViewer.setInput(workingCopy); - setTitle(String.format(Messages.NewLaunchConfigEditPage_7, type.getName())); + setTitle(String.format(Messages.NewLaunchConfigEditPage_7, launchConfigType.getName())); + } catch (CoreException e) { + Activator.log(e); } - } catch (CoreException e) { - Activator.log(e); - return; } } - boolean performFinish() { + public boolean performFinish() { if (workingCopy == null) return false; workingCopy.rename(tabViewer.getWorkingCopy().getName()); @@ -139,11 +150,6 @@ public class NewLaunchConfigEditPage extends WizardPage { return NewLaunchConfigEditPage.this.getLaunchGroup(); } - @Override - public String getMode() { - return NewLaunchConfigEditPage.this.getMode(); - } - @Override public void updateMessage() { validateFields(); @@ -193,24 +199,15 @@ public class NewLaunchConfigEditPage extends WizardPage { } }; - public String getMode() { - return ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode(); - } - public LaunchGroupExtension getLaunchGroup() { - try { - if (workingCopy == null) - return null; - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager() - .getLaunchGroup(workingCopy.getType(), getMode()); - if (group == null) { - return null; - } - LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() - .getLaunchGroup(group.getIdentifier()); - return groupExt; - } catch (CoreException e) { + if (workingCopy == null) + return null; + if (launchGroup == null) { return null; } + LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager() + .getLaunchGroup(launchGroup.getIdentifier()); + return groupExt; } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java index 30536c6ff2b..44b576a7e3d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -19,8 +19,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -30,7 +29,6 @@ import org.eclipse.swt.widgets.TableItem; public class NewLaunchConfigModePage extends WizardPage { private Table table; - ILaunchGroup selectedGroup; public NewLaunchConfigModePage() { super(Messages.NewLaunchConfigModePage_0); @@ -85,23 +83,8 @@ public class NewLaunchConfigModePage extends WizardPage { if (!hasDebug) { table.select(0); } - selectedGroup = (ILaunchGroup) table.getSelection()[0].getData(); } - table.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - selectedGroup = (ILaunchGroup) table.getSelection()[0].getData(); - ((NewLaunchConfigWizard) getWizard()).typePage.populateItems(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - getContainer().showPage(getNextPage()); - } - }); - setControl(comp); } @@ -118,4 +101,13 @@ public class NewLaunchConfigModePage extends WizardPage { item.setData(group); } + + public ILaunchGroup getSelectedGroup() { + return (ILaunchGroup) table.getSelection()[0].getData(); + } + + public void addGroupSelectionListener(SelectionListener listener) { + table.addSelectionListener(listener); + } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java index ad24719705f..4e42cf2c8e9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -15,12 +15,12 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -51,13 +51,11 @@ public class NewLaunchConfigTypePage extends WizardPage { getContainer().showPage(getNextPage()); } }); - populateItems(); setControl(comp); } - void populateItems() { - ILaunchGroup group = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup; + public void setLaunchGroup(ILaunchGroup group) { if (group == null) return; @@ -84,21 +82,12 @@ public class NewLaunchConfigTypePage extends WizardPage { setPageComplete(haveItems); } - @Override - public boolean canFlipToNextPage() { - return isPageComplete(); + public void addTypeSelectionListener(SelectionListener listener) { + table.addSelectionListener(listener); } - - @Override - public IWizardPage getNextPage() { - ILaunchConfigurationType type = (ILaunchConfigurationType) table.getSelection()[0].getData(); - NewLaunchConfigWizard wiz = (NewLaunchConfigWizard) getWizard(); - NewLaunchConfigEditPage editPage = wiz.editPage; - // lazy page creation - if (wiz.getPage(editPage.getName()) == null) { - wiz.addPage(editPage); - } - editPage.changeLaunchConfigType(type); - return editPage; + + public ILaunchConfigurationType getSelectedType() { + return (ILaunchConfigurationType) table.getSelection()[0].getData(); } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 0dcac33a4db..31942645c4c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -1,32 +1,15 @@ +################################################################################ +# Copyright (c) 2016 QNX Software Systems 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 +################################################################################ BuildActiveCommandHandler_0=Building Active Configuration BuildActiveCommandHandler_1=Building Active Configuration -ConfigSelector_0=No Launch Configurations -ConfigSelector_1=Launch Configuration -ConfigSelector_2=New Launch Configuration... -ConfigSelector_3=Create Launch Configuration -CSelector_0=Closing popup -CSelector_1=Updating launch bar selection -EditButton_0=Edit -FilterControl_0=type filter text -FilterControl_1={0} {1} matches. -LaunchBarControl_0=on -LaunchBarControl_Build=Build -LaunchBarControl_Launch=Launch -LaunchBarControl_Stop=Stop -LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane -LaunchBarPreferencePage_0=Preferences for the Launch Bar -LaunchBarPreferencePage_1=Enable the Launch Bar -LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector -LaunchBarPreferencePage_EnableBuildButton=Enable the Build button -LaunchConfigurationEditDialog_0=Delete -LaunchConfigurationEditDialog_1=Duplicate -LaunchConfigurationEditDialog_2=Launch -LaunchConfigurationEditDialog_3=Confirm Delete -LaunchConfigurationEditDialog_4=Are you sure you want to delete -LaunchConfigurationEditDialog_5=Deleting launch configuration -LaunchConfigurationEditDialog_6=Duplicating launch configuration -ModeSelector_0=Launch Mode -ModeSelector_ToolTip=Launch in ''{0}'' mode +StopActiveCommandHandler_0=Stopping launches +StopActiveCommandHandler_1=Stopping build + NewLaunchConfigEditPage_0=NewLaunchConfigEditPage NewLaunchConfigEditPage_1=Launch Configuration Properties NewLaunchConfigEditPage_2=Edit the new launch configuration properties @@ -42,10 +25,6 @@ NewLaunchConfigTypePage_0=Select Launch Configuration Type NewLaunchConfigTypePage_1=Launch Configuration Type NewLaunchConfigTypePage_2=Select the type of launch configuration to create. NewLaunchConfigWizard_0=Create Launch Configuration -StopActiveCommandHandler_0=Stopping launches -StopActiveCommandHandler_1=Stopping build -TargetSelector_ToolTipPrefix=Launch Target -TargetSelector_CreateNewTarget=New Launch Target... DescriptorMustNotBeNull=Descriptor must not be null DescriptorMustNotBeNullDesc=The launch descriptor must not be null. diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java index 7c4a10a4431..e32c6b4cfd4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java @@ -66,7 +66,7 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { @Override public String getText(Object element) { if (element instanceof ILaunchTarget) { - return ((ILaunchTarget) element).getName(); + return ((ILaunchTarget) element).getId(); } return super.getText(element); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java similarity index 97% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java rename to bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java index ec026074e81..dff15f08065 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardAction.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java @@ -8,11 +8,12 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.target; +package org.eclipse.launchbar.ui.target; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.launchbar.ui.internal.target.NewLaunchTargetWizard; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.IWorkbenchWindow; diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index b985d758bfe..ad98a06df76 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -33,4 +33,11 @@ version="0.0.0" unpack="false"/> + + diff --git a/pom.xml b/pom.xml index 4e1521bd7fd..cb4bf1ac8a9 100644 --- a/pom.xml +++ b/pom.xml @@ -38,14 +38,9 @@ - - eclipse - http://download.eclipse.org/releases/mars/ - p2 - platform - http://download.eclipse.org/eclipse/updates/4.5/ + http://download.eclipse.org/eclipse/updates/4.6milestones/ p2 @@ -55,12 +50,17 @@ orbit - http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/ + http://download.eclipse.org/tools/orbit/downloads/drops/S20160501200945/repository/ + p2 + + + cdt + http://download.eclipse.org/tools/cdt/builds/neon/milestones/ p2 remote - http://download.eclipse.org/tools/ptp/builds/remote/2.0.0/ + http://download.eclipse.org/tools/ptp/builds/remote/neon/milestones/ p2 @@ -68,6 +68,7 @@ bundles/org.eclipse.launchbar.core bundles/org.eclipse.launchbar.ui + bundles/org.eclipse.launchbar.ui.controls features/org.eclipse.launchbar tests/org.eclipse.launchbar.core.tests diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 2e000a0d190..92b71cbef91 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -31,7 +31,6 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -import java.util.List; import org.eclipse.core.internal.preferences.EclipsePreferences; import org.eclipse.core.internal.resources.Project; @@ -355,9 +354,9 @@ public class LaunchBarManager2Test { public void testGetLaunchTargets() throws CoreException { manager.launchObjectAdded(launchObject); manager.setActiveLaunchDescriptor(descriptor); - List launchTargets = manager.getLaunchTargets(descriptor); - assertEquals(1, launchTargets.size()); - assertEquals(otherTarget, launchTargets.get(0)); + ILaunchTarget[] launchTargets = manager.getLaunchTargets(descriptor); + assertEquals(1, launchTargets.length); + assertEquals(otherTarget, launchTargets[0]); } @Test @@ -369,8 +368,8 @@ public class LaunchBarManager2Test { init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); - List launchTargets = manager.getLaunchTargets(desc); - assertEquals(1, launchTargets.size()); + ILaunchTarget[] launchTargets = manager.getLaunchTargets(desc); + assertEquals(1, launchTargets.length); } @Test @@ -382,8 +381,8 @@ public class LaunchBarManager2Test { init(); manager.launchObjectAdded(launchObject); ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); - List launchTargets = manager.getLaunchTargets(desc); - assertEquals(1, launchTargets.size()); + ILaunchTarget[] launchTargets = manager.getLaunchTargets(desc); + assertEquals(1, launchTargets.length); } @Test From a91b8a801ad2aed7510871f3c705c7fb641cd34c Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 11 May 2016 15:54:59 -0400 Subject: [PATCH 104/198] launchbar: added tests, cleaned up API added some tests for LaunchTarget hide some API's for LaunchTarget added some asserts to prevent misuse Change-Id: I8b5b59ea8901133e79d03afe55e6c1fca2762bc1 --- .../core/internal/target/LaunchTarget.java | 26 +++---- .../launchbar/core/target/ILaunchTarget.java | 10 +-- .../{ => target}/LaunchTargetTest.java | 68 +++++++++++++++++-- 3 files changed, 82 insertions(+), 22 deletions(-) rename tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/{ => target}/LaunchTargetTest.java (51%) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index 987414558bc..5e1656d9c87 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -13,7 +13,12 @@ import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; import org.osgi.service.prefs.Preferences; public class LaunchTarget extends PlatformObject implements ILaunchTarget { - + public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---") { + @Override + public ILaunchTargetWorkingCopy getWorkingCopy() { + throw new UnsupportedOperationException("getWorkingCopy is not supported for NULL_TARGET"); + }; + }; private final String typeId; private final String id; final Preferences attributes; @@ -22,13 +27,15 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { * This should only be used to create the null target. There are no attributes supported on the * null target. */ - public LaunchTarget(String typeId, String id) { + private LaunchTarget(String typeId, String id) { this.typeId = typeId; this.id = id; this.attributes = null; } public LaunchTarget(String typeId, String id, Preferences attributes) { + if (typeId == null || id == null || attributes == null) + throw new NullPointerException(); this.typeId = typeId; this.id = id; this.attributes = attributes; @@ -62,8 +69,8 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((id == null) ? 0 : id.hashCode()); - result = prime * result + ((typeId == null) ? 0 : typeId.hashCode()); + result = prime * result + id.hashCode(); + result = prime * result + typeId.hashCode(); return result; } @@ -76,17 +83,10 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { if (getClass() != obj.getClass()) return false; LaunchTarget other = (LaunchTarget) obj; - if (id == null) { - if (other.id != null) - return false; - } else if (!id.equals(other.id)) + if (!id.equals(other.id)) return false; - if (typeId == null) { - if (other.typeId != null) - return false; - } else if (!typeId.equals(other.typeId)) + if (!typeId.equals(other.typeId)) return false; return true; } - } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 6cb14a1fb4d..4a4f32ff876 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -26,18 +26,18 @@ public interface ILaunchTarget extends IAdaptable { /** * The null target, which is the default when no other target is available. */ - public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---"); //$NON-NLS-1$ //$NON-NLS-2$ + public static final ILaunchTarget NULL_TARGET = LaunchTarget.NULL_TARGET; /** * The id for the target. It is unique for each type. - * + * * @return id for the target. */ String getId(); /** * The user consumable name of the target. - * + * * @deprecated this will be the same as the id * @return name of the target */ @@ -55,7 +55,7 @@ public interface ILaunchTarget extends IAdaptable { /** * Return a string attribute of this target - * + * * @param key * key * @param defValue @@ -67,7 +67,7 @@ public interface ILaunchTarget extends IAdaptable { /** * Create a working copy of this launch target to allow setting of attributes. It also allows * changing the id, which results in a new launch target when saved. - * + * * @return launch target working copy */ ILaunchTargetWorkingCopy getWorkingCopy(); diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java similarity index 51% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java rename to tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java index 65c7209fa65..f9fca4c1f6e 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchTargetTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java @@ -5,23 +5,31 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ -package org.eclipse.launchbar.core.internal; +package org.eclipse.launchbar.core.internal.target; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.eclipse.core.runtime.CoreException; +import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; +import org.osgi.service.prefs.Preferences; @SuppressWarnings("nls") public class LaunchTargetTest { + private org.osgi.service.prefs.Preferences pref; + + @Before + public void setUp() { + pref = Mockito.mock(Preferences.class); + } @Test public void testRemoveLaunchTarget() throws CoreException { @@ -46,4 +54,56 @@ public class LaunchTargetTest { assertFalse(targetSet.contains(target2)); } + @Test + public void testEquals() { + LaunchTarget t1 = new LaunchTarget("a", "b", pref); + LaunchTarget t2 = new LaunchTarget("a", "b", pref); + assertEquals(t1, t2); + LaunchTarget t3 = new LaunchTarget("a", "a", pref); + assertNotEquals(t1, t3); + LaunchTarget t4 = new LaunchTarget("b", "a", pref); + assertNotEquals(t4, t3); + assertNotEquals(t4, null); + } + + @Test + public void testEqualsHashode() { + LaunchTarget t1 = new LaunchTarget("a", "b", pref); + LaunchTarget t2 = new LaunchTarget("a", "b", pref); + assertEquals(t1.hashCode(), t2.hashCode()); + } + + @Test + public void testBasic() { + LaunchTarget t1 = new LaunchTarget("a", "b", pref); + ILaunchTarget save = t1.getWorkingCopy().save(); + assertEquals(t1, save); + } + + @Test + public void testNullTarget() { + ILaunchTarget nt = ILaunchTarget.NULL_TARGET; + assertEquals("b", nt.getAttribute("a", "b")); + } + + @Test(expected = NullPointerException.class) + public void testNPEInConstrPref() { + new LaunchTarget("a", "b", null); + } + + @Test(expected = NullPointerException.class) + public void testNPEInConstrType() { + new LaunchTarget(null, "b", pref); + } + + @Test(expected = NullPointerException.class) + public void testNPEInConstrId() { + new LaunchTarget("type", null, pref); + } + + @Test(expected = UnsupportedOperationException.class) + public void testWConNULL() { + ILaunchTarget nt = ILaunchTarget.NULL_TARGET; + nt.getWorkingCopy(); + } } From c4d7ecfc60ca714aefb1cc2331325d9fc6fe5884 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 24 May 2016 10:47:12 -0400 Subject: [PATCH 105/198] Bug 494427 - fix NPE in launch active. Change-Id: I97e150b2c457702208b714dd7870955dc9e70067 --- .../commands/LaunchActiveCommandHandler.java | 7 ++++++- pom.xml | 15 --------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java index 45ff856928e..f7aa548a5d5 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -29,9 +29,14 @@ public class LaunchActiveCommandHandler extends AbstractHandler { ILaunchBarManager launchBarManager = Activator.getService(ILaunchBarManager.class); StopActiveCommandHandler.stopActiveLaunches(launchBarManager); ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); - if (config == null) + if (config == null) { return Status.OK_STATUS; + } + ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); + if (launchMode == null) { + return Status.OK_STATUS; + } DebugUITools.launch(config, launchMode.getIdentifier()); return Status.OK_STATUS; diff --git a/pom.xml b/pom.xml index cb4bf1ac8a9..a2deaa55320 100644 --- a/pom.xml +++ b/pom.xml @@ -219,11 +219,6 @@ gtk x86_64 - - linux - gtk - ppc64 - win32 win32 @@ -239,16 +234,6 @@ cocoa x86_64 - - aix - gtk - ppc - - - solaris - gtk - sparc -
From 62545585be60b38bc087faf6767a0214b32714b7 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 3 Jun 2016 16:30:26 -0400 Subject: [PATCH 106/198] Make sure we can terminate a launch before we do it. DSF throws an exception when we try to terminate a launch that's already terminated. Change-Id: Ie836e1f3e182b009ba4649a27afda716e8876885 --- .../commands/StopActiveCommandHandler.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index 06276c71420..ab345d37f40 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -53,19 +53,21 @@ public class StopActiveCommandHandler extends AbstractHandler { return Status.OK_STATUS; } for (ILaunch launch : activeLaunches) { - ILaunchConfiguration launchConfig = launch.getLaunchConfiguration(); - if (activeConfig.equals(launchConfig)) { - launch.terminate(); - continue; - } - if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { - // There are evil delegates that use a working - // copy for scratch storage - if (activeConfig - .equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) { + if (launch.canTerminate()) { + ILaunchConfiguration launchConfig = launch.getLaunchConfiguration(); + if (activeConfig.equals(launchConfig)) { launch.terminate(); continue; } + if (launchConfig instanceof ILaunchConfigurationWorkingCopy) { + // There are evil delegates that use a + // working copy for scratch storage + if (activeConfig + .equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) { + launch.terminate(); + continue; + } + } } } return Status.OK_STATUS; From ebecae31679ebd256e31ab22a7fd1257bace3148 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 11 Jul 2016 14:15:36 -0400 Subject: [PATCH 107/198] Bug 497437 - Fix issues with null target. Avoid assert in enablement on null target. Fix order of initialization of null target in ILaunchTarget interface. Change-Id: I4c85433743bbb16c54514005b27e0414bb27c510 --- .../launchbar/core/internal/LaunchConfigProviderInfo.java | 6 +++++- .../launchbar/core/internal/target/LaunchTarget.java | 8 +------- .../org/eclipse/launchbar/core/target/ILaunchTarget.java | 7 ++++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 625b15eff8f..73c686f2f10 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -83,8 +83,12 @@ public class LaunchConfigProviderInfo { } public boolean enabled(Object element) { - if (expression == null) + if (expression == null) { return true; + } + if (element == null) { + return true; + } try { EvaluationResult result = expression.evaluate(new EvaluationContext(null, element)); return (result == EvaluationResult.TRUE); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index 5e1656d9c87..07c389b383e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -13,12 +13,6 @@ import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; import org.osgi.service.prefs.Preferences; public class LaunchTarget extends PlatformObject implements ILaunchTarget { - public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---") { - @Override - public ILaunchTargetWorkingCopy getWorkingCopy() { - throw new UnsupportedOperationException("getWorkingCopy is not supported for NULL_TARGET"); - }; - }; private final String typeId; private final String id; final Preferences attributes; @@ -27,7 +21,7 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { * This should only be used to create the null target. There are no attributes supported on the * null target. */ - private LaunchTarget(String typeId, String id) { + public LaunchTarget(String typeId, String id) { this.typeId = typeId; this.id = id; this.attributes = null; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 4a4f32ff876..13bb91f2adb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -26,7 +26,12 @@ public interface ILaunchTarget extends IAdaptable { /** * The null target, which is the default when no other target is available. */ - public static final ILaunchTarget NULL_TARGET = LaunchTarget.NULL_TARGET; + public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---") { //$NON-NLS-1$ //$NON-NLS-2$ + @Override + public ILaunchTargetWorkingCopy getWorkingCopy() { + throw new UnsupportedOperationException("getWorkingCopy is not supported for NULL_TARGET"); + }; + }; /** * The id for the target. It is unique for each type. From 40b483f43f10cba1a1c4dde30ac0dbb2f8dc2984 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 11 Jul 2016 14:43:50 -0400 Subject: [PATCH 108/198] 497437 - Fix composite icon for null target. Increment maint version. Change-Id: Ie4fc47e30cdcab149fde828db6138ab7b16026a8 --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.core/pom.xml | 2 +- .../eclipse/launchbar/ui/controls/internal/TargetSelector.java | 2 +- bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/pom.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index ede7d846f4b..5fb04cf0628 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.0.0.qualifier +Bundle-Version: 2.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml index 3cf8b86a839..54292889cf8 100644 --- a/bundles/org.eclipse.launchbar.core/pom.xml +++ b/bundles/org.eclipse.launchbar.core/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.core - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java index edc1313d3ca..d25f950702b 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java @@ -112,7 +112,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { String compId = target.getTypeId() + (status.getCode() == Code.ERROR ? ".error" : ".warning"); //$NON-NLS-1$ //$NON-NLS-2$ Image image = Activator.getDefault().getImageRegistry().get(compId); - if (image == null) { + if (image == null && baseImage != null) { ImageDescriptor desc = new CompositeImageDescriptor() { @Override protected Point getSize() { diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 9cb89b14495..7f4b7eb81aa 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.0.0.qualifier +Bundle-Version: 2.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml index 56c66dd7a01..919f0336c11 100644 --- a/bundles/org.eclipse.launchbar.ui/pom.xml +++ b/bundles/org.eclipse.launchbar.ui/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.ui - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT eclipse-plugin diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index ad98a06df76..8d3245f9840 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index cd2f48216b4..b59d46824d1 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT eclipse-feature From b43933ec2b7c461b359ca086b9e0f3c344c7a122 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Tue, 23 Aug 2016 23:20:36 +0300 Subject: [PATCH 109/198] Releng improvements. Move to Neon final p2 repos and update Tycho to 0.26 which did the same. Change-Id: I9342de800ce9e260d1baebed5253fa3ed17ff68c Signed-off-by: Alexander Kurtakov --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index a2deaa55320..b53efcd572d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ pom - 0.25.0 - 0.25.0 + 0.26.0 + 0.26.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -40,7 +40,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.6milestones/ + http://download.eclipse.org/eclipse/updates/4.6/ p2 @@ -50,17 +50,17 @@ orbit - http://download.eclipse.org/tools/orbit/downloads/drops/S20160501200945/repository/ + http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/ p2 cdt - http://download.eclipse.org/tools/cdt/builds/neon/milestones/ + http://download.eclipse.org/tools/cdt/releases/9.0 p2 remote - http://download.eclipse.org/tools/ptp/builds/remote/neon/milestones/ + http://download.eclipse.org/tools/ptp/updates/remote/neon/ p2 From c39d229f46868132c9ef25df29d95ea2777773c1 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 31 Aug 2016 12:29:30 -0400 Subject: [PATCH 110/198] Allow setting of target attributes for remote targets. This is used, for example, by ESP8266 to set the OS and ARCH attributes on new launch targets created by the remote launch target provider. Change-Id: If0e5f2c20debfa17dcab3608584b54638679bb63 --- .../META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.remote.core/pom.xml | 2 +- .../remote/core/RemoteLaunchTargetProvider.java | 11 +++++++---- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar.remote/pom.xml | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF index 6ad3819382f..9c14a8ee348 100644 --- a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Remote Core Bundle-SymbolicName: org.eclipse.launchbar.remote.core;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.remote.core.internal.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.remote.core/pom.xml b/bundles/org.eclipse.launchbar.remote.core/pom.xml index a02aca3e5f3..300eb79704d 100644 --- a/bundles/org.eclipse.launchbar.remote.core/pom.xml +++ b/bundles/org.eclipse.launchbar.remote.core/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.remote.core - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java index eb32493d936..2761670ce6d 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java @@ -29,6 +29,10 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide protected abstract String getTypeId(); + protected void initLaunchTarget(ILaunchTarget target) { + // default nothing + } + @Override public void init(ILaunchTargetManager targetManager) { this.targetManager = targetManager; @@ -49,7 +53,7 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide for (IRemoteConnection remote : remoteType.getConnections()) { String id = remote.getName(); if (targetManager.getLaunchTarget(typeId, id) == null) { - targetManager.addLaunchTarget(typeId, id); + initLaunchTarget(targetManager.addLaunchTarget(typeId, id)); } } @@ -75,7 +79,7 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide if (connection.getConnectionType().getId().equals(getTypeId())) { switch (event.getType()) { case RemoteConnectionChangeEvent.CONNECTION_ADDED: - targetManager.addLaunchTarget(getTypeId(), connection.getName()); + initLaunchTarget(targetManager.addLaunchTarget(getTypeId(), connection.getName())); break; case RemoteConnectionChangeEvent.CONNECTION_REMOVED: ILaunchTarget target = targetManager.getLaunchTarget(getTypeId(), connection.getName()); @@ -91,11 +95,10 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide if (target != null ) { targetManager.removeLaunchTarget(target); } - targetManager.addLaunchTarget(getTypeId(), wc.getName()); + initLaunchTarget(targetManager.addLaunchTarget(getTypeId(), wc.getName())); } break; } - } } diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index e22b58b1cca..9467061f58c 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar.remote/pom.xml b/features/org.eclipse.launchbar.remote/pom.xml index e2879f4a5fd..7d5a47c5c8a 100644 --- a/features/org.eclipse.launchbar.remote/pom.xml +++ b/features/org.eclipse.launchbar.remote/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar.remote - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT eclipse-feature From 1961357f1a7d66d621eec8497326455f5a3bc7e1 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 2 Sep 2016 14:38:03 -0400 Subject: [PATCH 111/198] Add source features and other general build fixes. Change-Id: I3853dcdf0b37aeb528f5a6db78b354bce94b9eca --- .../build.properties | 3 +- .../org.eclipse.launchbar.remote/feature.xml | 4 +-- features/org.eclipse.launchbar.remote/pom.xml | 34 ++++++++++++++++++- features/org.eclipse.launchbar/pom.xml | 34 ++++++++++++++++++- 4 files changed, 70 insertions(+), 5 deletions(-) diff --git a/features/org.eclipse.launchbar.remote/build.properties b/features/org.eclipse.launchbar.remote/build.properties index 64f93a9f0b7..b3a611b5c93 100644 --- a/features/org.eclipse.launchbar.remote/build.properties +++ b/features/org.eclipse.launchbar.remote/build.properties @@ -1 +1,2 @@ -bin.includes = feature.xml +bin.includes = feature.xml,\ + feature.properties diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 9467061f58c..b5d687e641d 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -1,9 +1,9 @@ diff --git a/features/org.eclipse.launchbar.remote/pom.xml b/features/org.eclipse.launchbar.remote/pom.xml index 7d5a47c5c8a..a2529b02841 100644 --- a/features/org.eclipse.launchbar.remote/pom.xml +++ b/features/org.eclipse.launchbar.remote/pom.xml @@ -14,6 +14,38 @@ org.eclipse.launchbar.features org.eclipse.launchbar.remote 1.0.1-SNAPSHOT - eclipse-feature + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + ${tycho-extras-version} + + + source-feature + package + + source-feature + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attach-p2-metadata + package + + p2-metadata + + + + + + diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index b59d46824d1..9d83cf6ea77 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -14,6 +14,38 @@ org.eclipse.launchbar.features org.eclipse.launchbar 2.0.1-SNAPSHOT - eclipse-feature + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + ${tycho-extras-version} + + + source-feature + package + + source-feature + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attach-p2-metadata + package + + p2-metadata + + + + + + From 54b3fd4a5bb895ef18b71a1f17d4bdafbb6ac035 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 2 Sep 2016 15:01:12 -0400 Subject: [PATCH 112/198] Add source to the repo. Change-Id: I1c40db04657448e940152224b974e878fa6f78e9 --- repo/category.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repo/category.xml b/repo/category.xml index 2407cc4dc13..7e3314d878e 100644 --- a/repo/category.xml +++ b/repo/category.xml @@ -3,8 +3,10 @@ + + From d16fcb8d49334d3812c042b53fb1408a6f97d265 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 10 Oct 2016 00:12:25 -0400 Subject: [PATCH 113/198] Changes to make the config dialog more specific to launch bar. It no longer brings up the traditional launch configuration dialog. Instead it has a new one that uses the tabs but without the other stuff. Change-Id: I89e2ac4e6a7575e0151c24632f26b5ee565a5449 --- .../META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.core/pom.xml | 2 +- .../launchbar/core/ILaunchDescriptorType.java | 11 + .../internal/DefaultLaunchDescriptorType.java | 6 + .../controls/internal/LaunchBarControl.java | 77 +++++-- .../META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/pom.xml | 2 +- .../ui/ILaunchBarLaunchConfigDialog.java | 29 +++ .../internal/LaunchBarLaunchConfigDialog.java | 213 ++++++++++++++++++ .../ui/internal/LaunchBarUIManager.java | 67 ++++-- 10 files changed, 367 insertions(+), 44 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 5fb04cf0628..6114714257c 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.0.1.qualifier +Bundle-Version: 2.1.0.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml index 54292889cf8..66f9d66550d 100644 --- a/bundles/org.eclipse.launchbar.core/pom.xml +++ b/bundles/org.eclipse.launchbar.core/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.core - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java index 6452c7d2efe..6710ee4a7e8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java @@ -33,4 +33,15 @@ public interface ILaunchDescriptorType { */ ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException; + /** + * Does this descriptor type support launching on targets other than Local? + * + * @return supports targets + * @throws CoreException + * @since 2.1 + */ + default boolean supportsTargets() throws CoreException { + return true; + } + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java index 840c0fda82d..d1297d6fdd6 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java @@ -30,6 +30,12 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { private Map descriptors = new HashMap<>(); + @Override + public boolean supportsTargets() throws CoreException { + // Old style launch configs do not support targets. + return false; + } + @Override public ILaunchDescriptor getDescriptor(Object launchObject) { if (launchObject instanceof ILaunchConfiguration) { diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 80668df5945..d89987ccee7 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -50,8 +50,10 @@ public class LaunchBarControl implements ILaunchBarListener { private ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); + private Composite container; private ConfigSelector configSelector; private ModeSelector modeSelector; + private Label onLabel; private TargetSelector targetSelector; private static final int SELECTION_DELAY = 200; @@ -60,7 +62,7 @@ public class LaunchBarControl implements ILaunchBarListener { public void createControl(Composite parent) { manager.addListener(this); - Composite container = new Composite(parent, SWT.NONE); + container = new Composite(parent, SWT.NONE); container.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); GridLayout layout = new GridLayout(5, false); layout.marginHeight = 2; @@ -94,20 +96,34 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); configSelector.setInput(manager); + // TODO remove boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR); - if (enabled) { - Label label = new Label(container, SWT.NONE); - label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); - label.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ - targetSelector = new TargetSelector(container, SWT.NONE); - targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); - targetSelector.setInput(manager); + boolean supportsTargets = true; + try { + ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); + supportsTargets = desc.getType().supportsTargets(); + } catch (CoreException e) { + Activator.log(e); + } + + if (supportsTargets) { + createTargetSelector(); } syncSelectors(); } + private void createTargetSelector() { + onLabel = new Label(container, SWT.NONE); + onLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + onLabel.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ + + targetSelector = new TargetSelector(container, SWT.NONE); + targetSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); + targetSelector.setInput(manager); + } + protected void syncSelectors() { try { if (configSelector != null) @@ -145,13 +161,13 @@ public class LaunchBarControl implements ILaunchBarListener { final Event trigger = new Event(); final IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class); ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, trigger); - try { - command.executeWithChecks(executionEvent); - } catch (OperationCanceledException ex) { - // abort - } catch (Exception ex) { - Activator.log(ex); - } + try { + command.executeWithChecks(executionEvent); + } catch (OperationCanceledException ex) { + // abort + } catch (Exception ex) { + Activator.log(ex); + } }; }); button.addDisposeListener(new DisposeListener() { @@ -165,9 +181,32 @@ public class LaunchBarControl implements ILaunchBarListener { @Override public void activeLaunchDescriptorChanged(ILaunchDescriptor descriptor) { - if (configSelector != null) { - configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); - } + container.getDisplay().syncExec(() -> { + if (configSelector != null) { + configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); + } + + boolean supportsTargets = true; + try { + supportsTargets = descriptor.getType().supportsTargets(); + } catch (CoreException e) { + Activator.log(e); + } + + if (supportsTargets) { + if (targetSelector == null || targetSelector.isDisposed()) { + createTargetSelector(); + syncSelectors(); + container.getParent().layout(true); + } + } else { + if (targetSelector != null && !targetSelector.isDisposed()) { + onLabel.dispose(); + targetSelector.dispose(); + container.getParent().layout(true); + } + } + }); } @Override @@ -194,5 +233,5 @@ public class LaunchBarControl implements ILaunchBarListener { public ConfigSelector getConfigSelector() { return configSelector; } - + } diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 7f4b7eb81aa..3ad1121a898 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.0.1.qualifier +Bundle-Version: 2.1.0.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml index 919f0336c11..0fe05f35edb 100644 --- a/bundles/org.eclipse.launchbar.ui/pom.xml +++ b/bundles/org.eclipse.launchbar.ui/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.ui - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java new file mode 100644 index 00000000000..b7e59c5d442 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2016 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui; + +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +/** + * The edit dialog for launch configurations created by the launch bar. Allows tabs to get the + * target associated with the edit session. + * + * @since 2.1 + */ +public interface ILaunchBarLaunchConfigDialog extends ILaunchConfigurationDialog { + + /** + * The target associated with the edit session, usually the active target when the session was + * started. + * + * @return launch target + */ + ILaunchTarget getLaunchTarget(); + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java new file mode 100644 index 00000000000..b5a677a49b8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -0,0 +1,213 @@ +package org.eclipse.launchbar.ui.internal; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; +import org.eclipse.debug.ui.ILaunchConfigurationTab; +import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; +import org.eclipse.jface.dialogs.TitleAreaDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.launchbar.core.ILaunchDescriptor; +import org.eclipse.launchbar.core.target.ILaunchTarget; +import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.custom.CTabItem; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILaunchBarLaunchConfigDialog { + + private final ILaunchConfigurationWorkingCopy workingCopy; + private final ILaunchDescriptor descriptor; + private final ILaunchMode mode; + private final ILaunchTarget target; + + private ILaunchConfigurationTabGroup group; + private CTabFolder tabFolder; + private CTabItem lastSelection; + + public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, + ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target) { + super(shell); + this.workingCopy = workingCopy; + this.descriptor = descriptor; + this.mode = mode; + this.target = target; + setShellStyle(getShellStyle() | SWT.RESIZE); + } + + @Override + protected int getDialogBoundsStrategy() { + // Don't persist the size since it'll be different for every config + return DIALOG_PERSISTLOCATION; + } + + @Override + protected Control createDialogArea(Composite parent) { + // create the top level composite for the dialog area + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.verticalSpacing = 0; + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + composite.setFont(parent.getFont()); + + getShell().setText("Edit Configuration"); + boolean supportsTargets = true; + try { + supportsTargets = descriptor.getType().supportsTargets(); + } catch (CoreException e) { + Activator.log(e); + } + if (supportsTargets) { + setTitle(String.format("Edit %s for %s on %s", descriptor.getName(), mode.getLabel(), target.getId())); + } else { + setTitle(String.format("Edit %s for %s", descriptor.getName(), mode.getLabel())); + } + setMessage("Set parameters for the configuration."); + + tabFolder = new CTabFolder(composite, SWT.NONE); + tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + tabFolder.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + CTabItem selItem = tabFolder.getSelection(); + if (selItem != null) { + selItem.getControl().setFocus(); + } + } + }); + tabFolder.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + ILaunchConfigurationTab oldTab = (ILaunchConfigurationTab) lastSelection.getData(); + oldTab.deactivated(workingCopy); + + CTabItem selItem = tabFolder.getSelection(); + ILaunchConfigurationTab newTab = (ILaunchConfigurationTab) selItem.getData(); + newTab.activated(workingCopy); + + selItem.getControl().setFocus(); + } + }); + + try { + group = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, mode.getIdentifier()); + group.createTabs(this, mode.getIdentifier()); + + for (ILaunchConfigurationTab configTab : group.getTabs()) { + configTab.setLaunchConfigurationDialog(this); + + CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); + tabItem.setData(configTab); + tabItem.setText(configTab.getName()); + + Composite tabComp = new Composite(tabFolder, SWT.NONE); + tabComp.setLayout(new GridLayout()); + tabItem.setControl(tabComp); + + configTab.createControl(tabComp); + Control configControl = configTab.getControl(); + configControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + if (lastSelection == null) { + // Assuming the first one ends up selected + lastSelection = tabItem; + } + } + + group.initializeFrom(workingCopy); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + + return composite; + } + + @Override + protected void okPressed() { + group.performApply(workingCopy); + super.okPressed(); + } + + @Override + public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) + throws InvocationTargetException, InterruptedException { + // TODO Auto-generated method stub + + } + + @Override + public void updateButtons() { + // TODO + } + + @Override + public void updateMessage() { + // TODO Auto-generated method stub + + } + + @Override + public void setName(String name) { + // Names aren't setable from this dialog + } + + @Override + public String generateName(String name) { + // Names aren't setable from this dialog + return null; + } + + @Override + public ILaunchConfigurationTab[] getTabs() { + return group.getTabs(); + } + + @Override + public ILaunchConfigurationTab getActiveTab() { + CTabItem selItem = tabFolder.getSelection(); + if (selItem != null) { + return (ILaunchConfigurationTab) selItem.getData(); + } else { + return null; + } + } + + @Override + public String getMode() { + return mode.getIdentifier(); + } + + @Override + public ILaunchTarget getLaunchTarget() { + return target; + } + + @Override + public void setActiveTab(ILaunchConfigurationTab tab) { + for (CTabItem item : tabFolder.getItems()) { + if (tab.equals(item.getData())) { + tabFolder.setSelection(item); + return; + } + } + } + + @Override + public void setActiveTab(int index) { + tabFolder.setSelection(index); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 907ad6234b3..c7e3a2cd1a9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -32,6 +32,7 @@ import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.Window; import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.internal.ExecutableExtension; @@ -48,14 +49,16 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { private void init() { if (descriptorLabelProviders == null) { descriptorLabelProviders = new HashMap<>(); - IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); //$NON-NLS-1$ + IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, + "launchBarUIContributions"); //$NON-NLS-1$ IExtension[] extensions = point.getExtensions(); for (IExtension extension : extensions) { for (IConfigurationElement element : extension.getConfigurationElements()) { String elementName = element.getName(); if (elementName.equals("descriptorUI")) { //$NON-NLS-1$ String descriptorTypeId = element.getAttribute("descriptorTypeId"); //$NON-NLS-1$ - ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); //$NON-NLS-1$ + ExecutableExtension labelProvider = new ExecutableExtension<>(element, + "labelProvider"); //$NON-NLS-1$ descriptorLabelProviders.put(descriptorTypeId, labelProvider); } } @@ -66,7 +69,8 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { @Override public ILabelProvider getLabelProvider(ILaunchDescriptor descriptor) throws CoreException { init(); - ExecutableExtension provider = descriptorLabelProviders.get(manager.getDescriptorTypeId(descriptor.getType())); + ExecutableExtension provider = descriptorLabelProviders + .get(manager.getDescriptorTypeId(descriptor.getType())); return provider != null ? provider.get() : null; } @@ -84,26 +88,47 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { return s; } - // At this point, no error handling should be needed. - try { - ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); - ILaunchMode mode = manager.getActiveLaunchMode(); - ILaunchTarget target = manager.getActiveLaunchTarget(); - ILaunchConfigurationType configType = manager.getLaunchConfigurationType(descriptor, target); - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, - mode.getIdentifier()); - ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); - if (config instanceof ILaunchConfigurationWorkingCopy - && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { - config = ((ILaunchConfigurationWorkingCopy) config).doSave(); + if (true) { + try { + ILaunchMode mode = manager.getActiveLaunchMode(); + ILaunchTarget target = manager.getActiveLaunchTarget(); + ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); + + ILaunchConfigurationWorkingCopy workingCopy = config.getWorkingCopy(); + LaunchBarLaunchConfigDialog dialog = new LaunchBarLaunchConfigDialog(shell, workingCopy, descriptor, + mode, target); + if (dialog.open() == Window.OK) { + if (!workingCopy.getOriginal().equals(workingCopy) + && !workingCopy.getOriginal().getAttributes().equals(workingCopy.getAttributes())) { + workingCopy.doSave(); + } + } + } catch (CoreException e) { + return e.getStatus(); + } + } else { + // At this point, no error handling should be needed. + try { + ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); + ILaunchMode mode = manager.getActiveLaunchMode(); + ILaunchTarget target = manager.getActiveLaunchTarget(); + ILaunchConfigurationType configType = manager.getLaunchConfigurationType(descriptor, target); + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup( + configType, + mode.getIdentifier()); + ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); + if (config instanceof ILaunchConfigurationWorkingCopy + && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { + config = ((ILaunchConfigurationWorkingCopy) config).doSave(); + } + // open real eclipse launch configurations dialog + DebugUIPlugin.openLaunchConfigurationsDialog(shell, new StructuredSelection(config), + group.getIdentifier(), false); + } catch (CoreException e2) { + return e2.getStatus(); } - // open real eclipse launch configurations dialog - DebugUIPlugin.openLaunchConfigurationsDialog(shell, new StructuredSelection(config), - group.getIdentifier(), false); - return Status.OK_STATUS; - } catch (CoreException e2) { - return e2.getStatus(); } + return Status.OK_STATUS; } private IStatus canOpenConfigurationEditor(ILaunchDescriptor desc) { From 0aa31108c48e7ed2257347f1412e8c1e023d2d97 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 17 Oct 2016 13:54:07 -0400 Subject: [PATCH 114/198] Make sure we apply when update buttons is called in new edit dialog. Change-Id: I8a31af7d0700ac285ecaa30d2a884b45d439f46f --- .../ui/internal/LaunchBarLaunchConfigDialog.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index b5a677a49b8..1dd932579a9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -36,6 +36,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private ILaunchConfigurationTabGroup group; private CTabFolder tabFolder; private CTabItem lastSelection; + private boolean initing; public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target) { @@ -55,6 +56,8 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override protected Control createDialogArea(Composite parent) { + initing = true; + // create the top level composite for the dialog area Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -132,6 +135,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau Activator.log(e.getStatus()); } + initing = false; return composite; } @@ -150,7 +154,16 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override public void updateButtons() { - // TODO + // Lots of tabs want to be applied when this is called + if (!initing) { + ILaunchConfigurationTab[] tabs = getTabs(); + if (tabFolder != null && tabs != null) { + int pageIndex = tabFolder.getSelectionIndex(); + if (pageIndex >= 0) { + tabs[pageIndex].performApply(workingCopy); + } + } + } } @Override From 6c4c3c936330dc1f71475e6ed0e46aeddbe5cc8a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 2 Nov 2016 11:14:27 -0400 Subject: [PATCH 115/198] Fix NPE in launch control when no descriptors. Also allows the enable preference to always disable. Change-Id: I991e26eb312d8bf0c9e32a4ce37119d4c38481a4 --- .../controls/internal/LaunchBarControl.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index d89987ccee7..a8c90aa7684 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -96,17 +96,23 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); configSelector.setInput(manager); - // TODO remove boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR); - - boolean supportsTargets = true; - try { - ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); - supportsTargets = desc.getType().supportsTargets(); - } catch (CoreException e) { - Activator.log(e); + boolean supportsTargets; + if (!enabled) { + supportsTargets = false; + } else { + try { + ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); + if (desc != null) { + supportsTargets = desc.getType().supportsTargets(); + } else { + supportsTargets = true; + } + } catch (CoreException e) { + Activator.log(e); + supportsTargets = true; + } } - if (supportsTargets) { createTargetSelector(); } From f5264933cf4ad7e6b63109777f5fd2f20d98d8ed Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 3 Nov 2016 13:31:12 -0400 Subject: [PATCH 116/198] Implement the launch config dialog run method. e.g. needed by JUnit. Change-Id: I4a6204248e26efc93cac2ce33b1367fbe072b05e --- .../internal/LaunchBarLaunchConfigDialog.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 1dd932579a9..c3c65d2f6ef 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -8,8 +8,11 @@ import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; import org.eclipse.debug.ui.ILaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.operation.ModalContext; +import org.eclipse.jface.wizard.ProgressMonitorPart; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog; @@ -36,6 +39,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private ILaunchConfigurationTabGroup group; private CTabFolder tabFolder; private CTabItem lastSelection; + private ProgressMonitorPart pmPart; private boolean initing; public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, @@ -135,6 +139,10 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau Activator.log(e.getStatus()); } + pmPart = new ProgressMonitorPart(composite, new GridLayout(), true); + pmPart.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + pmPart.setVisible(false); + initing = false; return composite; } @@ -148,8 +156,25 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { - // TODO Auto-generated method stub + Control lastControl = getShell().getDisplay().getFocusControl(); + if (lastControl != null && lastControl.getShell() != getShell()) { + lastControl = null; + } + getButton(IDialogConstants.OK_ID).setEnabled(false); + getButton(IDialogConstants.CANCEL_ID).setEnabled(false); + pmPart.attachToCancelComponent(null); + try { + ModalContext.run(runnable, fork, pmPart, getShell().getDisplay()); + } finally { + pmPart.removeFromCancelComponent(null); + getButton(IDialogConstants.OK_ID).setEnabled(true); + getButton(IDialogConstants.CANCEL_ID).setEnabled(true); + if (lastControl != null) { + lastControl.setFocus(); + } + updateButtons(); + } } @Override From 80c6a9694ea0fa81cca4fe8f705440c8287cfa7e Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 11 Nov 2016 12:36:48 -0500 Subject: [PATCH 117/198] Add method to ILaunchTarget to get all the attributes. This is used by CDT, for example, to be able to map targets to toolchains. Change-Id: I98d7463d512299c43c405fd474bb8e128a81663f --- .../launchbar/core/internal/Messages.java | 1 + .../core/internal/messages.properties | 6 +++--- .../core/internal/target/LaunchTarget.java | 21 +++++++++++++++++++ .../target/LaunchTargetWorkingCopy.java | 7 +++++++ .../launchbar/core/target/ILaunchTarget.java | 13 +++++++++++- 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java index aac564aa411..172f4e198c1 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java @@ -14,6 +14,7 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.launchbar.core.internal.messages"; //$NON-NLS-1$ + public static String ILaunchTarget_notSupported; public static String LaunchBarManager_0; public static String LaunchBarManager_1; public static String LaunchBarManager_2; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties index 9d627bf8d9c..6f2a6f0319b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties @@ -1,5 +1,3 @@ -LaunchBarManager_1=Active descriptor must be in the map of descriptors -LaunchBarManager_2=Mode is not supported by descriptor ################################################################################ # Copyright (c) 2014 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials @@ -10,7 +8,9 @@ LaunchBarManager_2=Mode is not supported by descriptor # Contributors: # Doug Schaefer ################################################################################ - +ILaunchTarget_notSupported=getWorkingCopy is not supported for NULL_TARGET LaunchBarManager_0=Launch Bar Initialization +LaunchBarManager_1=Active descriptor must be in the map of descriptors +LaunchBarManager_2=Mode is not supported by descriptor LocalTarget_name=Local OK=OK diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index 07c389b383e..ab54170a7a0 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -7,9 +7,14 @@ *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; +import java.util.HashMap; +import java.util.Map; + import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; +import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; public class LaunchTarget extends PlatformObject implements ILaunchTarget { @@ -59,6 +64,22 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { } } + @Override + public Map getAttributes() { + Map attrs = new HashMap<>(); + try { + for (String key : attributes.keys()) { + String value = attributes.get(key, null); + if (value != null) { + attrs.put(key, value); + } + } + } catch (BackingStoreException e) { + Activator.log(e); + } + return attrs; + } + @Override public int hashCode() { final int prime = 31; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java index b256188df89..f9089b8dc3d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java @@ -61,6 +61,13 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa } } + @Override + public Map getAttributes() { + Map attrs = original.getAttributes(); + attrs.putAll(changes); + return attrs; + } + @Override public void setAttribute(String key, String value) { changes.put(key, value); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 13bb91f2adb..21bdf2ac929 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -7,7 +7,10 @@ *******************************************************************************/ package org.eclipse.launchbar.core.target; +import java.util.Map; + import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.launchbar.core.internal.Messages; import org.eclipse.launchbar.core.internal.target.LaunchTarget; /** @@ -29,7 +32,7 @@ public interface ILaunchTarget extends IAdaptable { public static final ILaunchTarget NULL_TARGET = new LaunchTarget("null", "---") { //$NON-NLS-1$ //$NON-NLS-2$ @Override public ILaunchTargetWorkingCopy getWorkingCopy() { - throw new UnsupportedOperationException("getWorkingCopy is not supported for NULL_TARGET"); + throw new UnsupportedOperationException(Messages.ILaunchTarget_notSupported); }; }; @@ -69,6 +72,14 @@ public interface ILaunchTarget extends IAdaptable { */ String getAttribute(String key, String defValue); + /** + * Returns a read-only map of the attributes. + * + * @return the attributes for this target + * @since 2.1 + */ + Map getAttributes(); + /** * Create a working copy of this launch target to allow setting of attributes. It also allows * changing the id, which results in a new launch target when saved. From 151a99ad35c39d1ef27e785c94e5fa65eb344762 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 16 Nov 2016 11:12:58 -0500 Subject: [PATCH 118/198] Upversion launchbar feature to 2.1. Change-Id: I8863d985b2f8ca7e459d56676177e6958f3eefda --- features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 8d3245f9840..9d16c635164 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index 9d83cf6ea77..24c785f07f4 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT eclipse-feature From 4bada0e6ab5dd73bd651fdafa729b45e7c7a3196 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 21 Nov 2016 10:49:44 -0500 Subject: [PATCH 119/198] Preference to Always show Launch Target. Default is auto. Default behavior is to only show the launch target selector when the active launch descriptor supports multiple targets. Add a pref to always show the launch target selector. Change-Id: I2615ab605be8a6cb706baca7407b265f8b832cf1 --- .../ui/controls/internal/Activator.java | 2 +- .../controls/internal/LaunchBarControl.java | 21 ++++++++++++------- .../controls/internal/LaunchBarInjector.java | 3 ++- .../LaunchBarPreferenceInitializer.java | 2 +- .../internal/LaunchBarPreferencePage.java | 6 ++++-- .../ui/controls/internal/Messages.java | 2 +- .../ui/controls/internal/messages.properties | 2 +- 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java index 4e6169d8a52..363516acea0 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java @@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin { // Preference ids public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$ - public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$ + public static final String PREF_ALWAYS_TARGETSELECTOR = "alwaysTargetSelector"; //$NON-NLS-1$ public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$ public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index a8c90aa7684..c390314f399 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -96,10 +96,9 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); configSelector.setInput(manager); - boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR); boolean supportsTargets; - if (!enabled) { - supportsTargets = false; + if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) { + supportsTargets = true; } else { try { ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); @@ -192,11 +191,17 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); } - boolean supportsTargets = true; - try { - supportsTargets = descriptor.getType().supportsTargets(); - } catch (CoreException e) { - Activator.log(e); + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + boolean supportsTargets; + if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) { + supportsTargets = true; + } else { + try { + supportsTargets = descriptor.getType().supportsTargets(); + } catch (CoreException e) { + supportsTargets = true; + Activator.log(e); + } } if (supportsTargets) { diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java index b8161e898f7..4bf0c648bbb 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java @@ -72,7 +72,8 @@ public class LaunchBarInjector { boolean enabled = Boolean.parseBoolean(event.getNewValue().toString()); injectIntoAll(enabled); } - if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)|| event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) { + if (event.getProperty().equals(Activator.PREF_ALWAYS_TARGETSELECTOR) + || event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); if (enabled){ diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java index 077ecacf4b9..e951b5eeb63 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java @@ -22,7 +22,7 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true); store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true); - store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true); + store.setDefault(Activator.PREF_ALWAYS_TARGETSELECTOR, false); store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3); } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java index b1ab27fdd0a..33163482d31 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java @@ -33,8 +33,10 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement @Override protected void createFieldEditors() { addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent())); - addField(new BooleanFieldEditor(Activator.PREF_ENABLE_TARGETSELECTOR, Messages.LaunchBarPreferencePage_EnableTargetSelector, getFieldEditorParent())); - addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON, Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent())); + addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON, + Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent())); + addField(new BooleanFieldEditor(Activator.PREF_ALWAYS_TARGETSELECTOR, + Messages.LaunchBarPreferencePage_AlwaysTargetSelector, getFieldEditorParent())); } } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java index d39471e3a17..9eac59043d4 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java @@ -32,7 +32,7 @@ public class Messages extends NLS { public static String LaunchBarListViewer_0; public static String LaunchBarPreferencePage_0; public static String LaunchBarPreferencePage_1; - public static String LaunchBarPreferencePage_EnableTargetSelector; + public static String LaunchBarPreferencePage_AlwaysTargetSelector; public static String LaunchBarPreferencePage_EnableBuildButton; public static String LaunchConfigurationEditDialog_0; public static String LaunchConfigurationEditDialog_1; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties index 391f607abda..30e6ed1e228 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties @@ -21,7 +21,7 @@ LaunchBarControl_Stop=Stop LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane LaunchBarPreferencePage_0=Preferences for the Launch Bar LaunchBarPreferencePage_1=Enable the Launch Bar -LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector +LaunchBarPreferencePage_AlwaysTargetSelector=Always show the target selector LaunchBarPreferencePage_EnableBuildButton=Enable the Build button LaunchConfigurationEditDialog_0=Delete LaunchConfigurationEditDialog_1=Duplicate From 303bd3aaa7ae9da778ca14cd516edf8dcf21f86a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 21 Nov 2016 11:45:09 -0500 Subject: [PATCH 120/198] Fix NPE on last descriptor delete. Refactor supportsTarget code. Change-Id: I51ed0640a187428416e6d10785b0efc22af764be --- .../controls/internal/LaunchBarControl.java | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index c390314f399..d4ace4c2e3b 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -97,21 +97,13 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setInput(manager); boolean supportsTargets; - if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) { + try { + supportsTargets = supportsTargets(manager.getActiveLaunchDescriptor()); + } catch (CoreException e) { + Activator.log(e); supportsTargets = true; - } else { - try { - ILaunchDescriptor desc = manager.getActiveLaunchDescriptor(); - if (desc != null) { - supportsTargets = desc.getType().supportsTargets(); - } else { - supportsTargets = true; - } - } catch (CoreException e) { - Activator.log(e); - supportsTargets = true; - } } + if (supportsTargets) { createTargetSelector(); } @@ -191,20 +183,7 @@ public class LaunchBarControl implements ILaunchBarListener { configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); } - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - boolean supportsTargets; - if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) { - supportsTargets = true; - } else { - try { - supportsTargets = descriptor.getType().supportsTargets(); - } catch (CoreException e) { - supportsTargets = true; - Activator.log(e); - } - } - - if (supportsTargets) { + if (supportsTargets(descriptor)) { if (targetSelector == null || targetSelector.isDisposed()) { createTargetSelector(); syncSelectors(); @@ -220,6 +199,24 @@ public class LaunchBarControl implements ILaunchBarListener { }); } + private boolean supportsTargets(ILaunchDescriptor descriptor) { + if (descriptor == null) { + return true; + } + + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) { + return true; + } + + try { + return descriptor.getType().supportsTargets(); + } catch (CoreException e) { + Activator.log(e); + return true; + } + } + @Override public void activeLaunchModeChanged(ILaunchMode mode) { if (modeSelector != null) { From ecc24ace4da910e4735ecdf20dce88ff623f5e18 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 24 Nov 2016 14:52:09 -0500 Subject: [PATCH 121/198] Fix descriptor name on edit config dialog. Use the label provider if there is one. Also externalizes strings for the dialog. Change-Id: I3a1e5c7f2b2843cd014a033ee5859832f7e10f9e --- .../internal/LaunchBarLaunchConfigDialog.java | 23 ++++++++++++++----- .../launchbar/ui/internal/Messages.java | 8 +++++++ .../launchbar/ui/internal/messages.properties | 4 ++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index c3c65d2f6ef..11d22c2f5c4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -12,10 +12,12 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; +import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.wizard.ProgressMonitorPart; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog; +import org.eclipse.launchbar.ui.ILaunchBarUIManager; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; @@ -70,19 +72,28 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parent.getFont()); - getShell().setText("Edit Configuration"); + getShell().setText(Messages.LaunchBarLaunchConfigDialog_EditConfiguration); boolean supportsTargets = true; try { supportsTargets = descriptor.getType().supportsTargets(); } catch (CoreException e) { Activator.log(e); } - if (supportsTargets) { - setTitle(String.format("Edit %s for %s on %s", descriptor.getName(), mode.getLabel(), target.getId())); - } else { - setTitle(String.format("Edit %s for %s", descriptor.getName(), mode.getLabel())); + + try { + ILaunchBarUIManager uiManager = Activator.getService(ILaunchBarUIManager.class); + ILabelProvider labelProvider = uiManager.getLabelProvider(descriptor); + String descName = labelProvider != null ? labelProvider.getText(descriptor) : descriptor.getName(); + if (supportsTargets) { + setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit2, descName, mode.getLabel(), target.getId())); + } else { + setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit1, descName, mode.getLabel())); + } + } catch (CoreException e) { + Activator.log(e); } - setMessage("Set parameters for the configuration."); + + setMessage(Messages.LaunchBarLaunchConfigDialog_SetParameters); tabFolder = new CTabFolder(composite, SWT.NONE); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index ed4c60c346e..aa8c1687353 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -41,6 +41,14 @@ public class Messages extends NLS { public static String CannotEditLaunchConfiguration; public static String NoLaunchModeSelected; public static String NoLaunchGroupSelected; + public static String LaunchBarLaunchConfigDialog_Edit1; + + public static String LaunchBarLaunchConfigDialog_Edit2; + + public static String LaunchBarLaunchConfigDialog_EditConfiguration; + + public static String LaunchBarLaunchConfigDialog_SetParameters; + public static String LaunchConfigurationNotFound; public static String LaunchConfigurationNotFoundDesc; public static String NoLaunchTabsDefined; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 31942645c4c..bab31f6113c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -34,6 +34,10 @@ NoLaunchConfigType=No launch configuration type matches selected launch descript CannotEditLaunchConfiguration=Cannot edit this configuration. NoLaunchModeSelected=No launch mode selected. NoLaunchGroupSelected=No launch group found for the current selection. +LaunchBarLaunchConfigDialog_Edit1=Edit %s for %s +LaunchBarLaunchConfigDialog_Edit2=Edit %s for %s on %s +LaunchBarLaunchConfigDialog_EditConfiguration=Edit Configuration +LaunchBarLaunchConfigDialog_SetParameters=Set parameters for the configuration. LaunchConfigurationNotFound=Launch Configuration Not Found LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target. NoLaunchTabsDefined=No launch tabs defined. From 1f75afd0c7a67595c34581d9134c62acf317d74a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 5 Dec 2016 14:37:57 -0500 Subject: [PATCH 122/198] Put a border on the tab folder for the config edit dialog. Change-Id: I07dbcf079a94f71c66669c0cc9578b98fbbc996d --- .../launchbar/ui/internal/LaunchBarLaunchConfigDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 11d22c2f5c4..8473b934182 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -95,7 +95,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau setMessage(Messages.LaunchBarLaunchConfigDialog_SetParameters); - tabFolder = new CTabFolder(composite, SWT.NONE); + tabFolder = new CTabFolder(composite, SWT.BORDER); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); tabFolder.addFocusListener(new FocusAdapter() { @Override From b57aa9d3362bd46460d9c4d3ac64ac4e9ac893d9 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 5 Dec 2016 15:21:36 -0500 Subject: [PATCH 123/198] Add image to tabs for the config edit dialog. Change-Id: Ibe5a0ddb91989de8015b8511bb960addf608d7c0 --- .../launchbar/ui/internal/LaunchBarLaunchConfigDialog.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 8473b934182..576bc48dc44 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -130,6 +130,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); tabItem.setData(configTab); tabItem.setText(configTab.getName()); + tabItem.setImage(configTab.getImage()); Composite tabComp = new Composite(tabFolder, SWT.NONE); tabComp.setLayout(new GridLayout()); From 573a55c8ba99a91ab83aeceac715fa814d62f3b8 Mon Sep 17 00:00:00 2001 From: Jesper Eskilson Date: Mon, 23 Jan 2017 17:48:07 +0100 Subject: [PATCH 124/198] Bug 510892: Include the launch target's id in the overlay image id Otherwise, launch targets with same type, but different ids, will get the wrong icon, but only when the target status is != OK. Change-Id: I97e5713bec16eb3a08cae3ffe58bc4fab51b04df Signed-off-by: Jesper Eskilson --- .../launchbar/ui/controls/internal/TargetSelector.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java index d25f950702b..f084d21f7eb 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java @@ -100,7 +100,6 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { return null; } if (element instanceof ILaunchTarget) { - // TODO apply a status overlay ILaunchTarget target = (ILaunchTarget) element; ILabelProvider provider = targetUIManager.getLabelProvider(target); if (provider != null) { @@ -109,8 +108,8 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { if (status.getCode() == Code.OK) { return baseImage; } else { - String compId = target.getTypeId() - + (status.getCode() == Code.ERROR ? ".error" : ".warning"); //$NON-NLS-1$ //$NON-NLS-2$ + String compId = String.format("%s.%s.%s", target.getTypeId(), target.getId(), + status.getCode()); Image image = Activator.getDefault().getImageRegistry().get(compId); if (image == null && baseImage != null) { ImageDescriptor desc = new CompositeImageDescriptor() { From 3a921fdd8360b8b21edb1dca3451a37b7588bf4b Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 27 Jan 2017 16:31:23 -0500 Subject: [PATCH 125/198] Implement updateMessage for Launch Config Tab Also cleans up the description for the dialog to make it more clear it's editing a configuration. Change-Id: Ic871582d56cb1253383adfced238cf5ecedb416e --- .../internal/LaunchBarLaunchConfigDialog.java | 64 ++++++++++++++++++- .../launchbar/ui/internal/messages.properties | 4 +- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 576bc48dc44..bd7a71dd666 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -9,6 +9,7 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPre import org.eclipse.debug.ui.ILaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; @@ -27,6 +28,7 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; @@ -203,10 +205,70 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau } } + private String getTabsErrorMessage() { + ILaunchConfigurationTab activeTab = getActiveTab(); + if (activeTab != null) { + String message = activeTab.getErrorMessage(); + if (message != null) { + return message; + } + } + + for (ILaunchConfigurationTab tab : getTabs()) { + if (tab != activeTab) { + String message = tab.getErrorMessage(); + if (message != null) { + return message; + } + } + } + + return null; + } + + private String getTabsMessage() { + ILaunchConfigurationTab activeTab = getActiveTab(); + if (activeTab != null) { + String message = activeTab.getMessage(); + if (message != null) { + return message; + } + } + + for (ILaunchConfigurationTab tab : getTabs()) { + if (tab != activeTab) { + String message = tab.getMessage(); + if (message != null) { + return message; + } + } + } + + return null; + } + @Override public void updateMessage() { - // TODO Auto-generated method stub + if (initing) { + return; + } + for (ILaunchConfigurationTab tab : getTabs()) { + tab.isValid(workingCopy); + } + + Button okButton = getButton(IDialogConstants.OK_ID); + + String message = getTabsErrorMessage(); + if (message != null) { + setMessage(message, IMessageProvider.ERROR); + okButton.setEnabled(false); + return; + } + + message = getTabsMessage(); + setMessage(message); + okButton.setEnabled(true); } @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index bab31f6113c..7e55a143a6e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -34,8 +34,8 @@ NoLaunchConfigType=No launch configuration type matches selected launch descript CannotEditLaunchConfiguration=Cannot edit this configuration. NoLaunchModeSelected=No launch mode selected. NoLaunchGroupSelected=No launch group found for the current selection. -LaunchBarLaunchConfigDialog_Edit1=Edit %s for %s -LaunchBarLaunchConfigDialog_Edit2=Edit %s for %s on %s +LaunchBarLaunchConfigDialog_Edit1=Edit configuration %s for %s +LaunchBarLaunchConfigDialog_Edit2=Edit configuration %s for %s on %s LaunchBarLaunchConfigDialog_EditConfiguration=Edit Configuration LaunchBarLaunchConfigDialog_SetParameters=Set parameters for the configuration. LaunchConfigurationNotFound=Launch Configuration Not Found From 313b437b36d179def67aa66b032b8ca717e100c7 Mon Sep 17 00:00:00 2001 From: Matthew Bastien Date: Fri, 3 Feb 2017 09:47:03 -0500 Subject: [PATCH 126/198] NewLaunchConfig* notify listeners when table entries are selected The NewLaunchConfig*Page classes don't notify their listeners when they automatically select a type or mode with table.select(). This causes the NewLaunchConfigEditPage to have a "null" type if the user doesn't explicitly click on one and thus opens the default page. Added in calls to table.notifyListeners() in order to fix this. Verified that the launch config edit page opens appropriately even if there is no explicit selection by the user Change-Id: I5fbafd2f43d7c0951e929f5dcbfc57fcccd18db6 Signed-off-by: Matthew Bastien --- .../ui/internal/dialogs/NewLaunchConfigModePage.java | 4 +++- .../ui/internal/dialogs/NewLaunchConfigTypePage.java | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java index 44b576a7e3d..be8d68053c8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -83,6 +83,9 @@ public class NewLaunchConfigModePage extends WizardPage { if (!hasDebug) { table.select(0); } + + // We're guaranteed to have made a selection here + table.notifyListeners(SWT.Selection, null); } setControl(comp); @@ -101,7 +104,6 @@ public class NewLaunchConfigModePage extends WizardPage { item.setData(group); } - public ILaunchGroup getSelectedGroup() { return (ILaunchGroup) table.getSelection()[0].getData(); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java index 4e42cf2c8e9..bb6fda8a8c5 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -78,6 +78,7 @@ public class NewLaunchConfigTypePage extends WizardPage { if (haveItems) { table.select(0); + table.notifyListeners(SWT.Selection, null); } setPageComplete(haveItems); } @@ -85,9 +86,9 @@ public class NewLaunchConfigTypePage extends WizardPage { public void addTypeSelectionListener(SelectionListener listener) { table.addSelectionListener(listener); } - + public ILaunchConfigurationType getSelectedType() { return (ILaunchConfigurationType) table.getSelection()[0].getData(); } - + } From 98b34f15de7356710659b423310d0bd3d62ac15b Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 9 Feb 2017 11:27:06 -0500 Subject: [PATCH 127/198] Enable plug-in activation in the launch descriptor context. Property testers for the launch descriptor type enablement aren't getting called even if they are set to plug-in activation true. The evaluation context needs to enable it as well. Change-Id: I309af38e37870220fa6bf3eb2781c85d4f73e7ec --- .../launchbar/core/internal/LaunchDescriptorTypeInfo.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java index 5978e49243a..13e5e37e5ee 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -88,7 +88,9 @@ public class LaunchDescriptorTypeInfo { public boolean enabled(Object launchObject) throws CoreException { if (expression == null) return true; - EvaluationResult result = expression.evaluate(new EvaluationContext(null, launchObject)); + EvaluationContext context = new EvaluationContext(null, launchObject); + context.setAllowPluginActivation(true); + EvaluationResult result = expression.evaluate(context); return (result == EvaluationResult.TRUE); } } \ No newline at end of file From 231758acfc0446d1a27711ecef12d993b89edece Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Tue, 14 Feb 2017 10:59:34 +0200 Subject: [PATCH 128/198] Update maven build machinery * Tycho 0.26.0 -> 1.0.0 * Resources plugin 2.7 -> 3.0.2 * Findbugs 3.0.4 -> 3.0.4 * PMD 3.6 -> 3.7 Change-Id: I016f27f86aca14bfc8af74fe4cb6d05b23f586eb Signed-off-by: Alexander Kurtakov --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b53efcd572d..f3bdced65dd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 - 3.0.5 + 3.1.1 org.eclipse.launchbar @@ -14,8 +14,8 @@ pom - 0.26.0 - 0.26.0 + 1.0.0 + 1.0.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -281,7 +281,7 @@ org.apache.maven.plugins maven-resources-plugin - 2.7 + 3.0.2 ISO-8859-1 @@ -294,7 +294,7 @@ org.codehaus.mojo findbugs-maven-plugin - 3.0.3 + 3.0.4 true false @@ -310,7 +310,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.6 + 3.7 utf-8 100 From fd7e8fcde02567ca402de900ee6e776430bb46e7 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 22 Feb 2017 15:54:08 +0200 Subject: [PATCH 129/198] Do not add closed projects. We can not have launch configuration on closed projects so better to not add these projects at all. This prevents filling LaunchBar filling the Error Log with "Project /NAME is closed." Change-Id: I2f7d81e23aa4d76a1ba1894ae786b7b403124abf Signed-off-by: Alexander Kurtakov --- .../core/internal/ProjectLaunchObjectProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java index 8d494062154..c9c352dafd5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2017 QNX Software Systems 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 @@ -35,7 +35,9 @@ public class ProjectLaunchObjectProvider implements ILaunchObjectProvider, IReso public void init(ILaunchBarManager manager) throws CoreException { this.manager = manager; for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { - manager.launchObjectAdded(project); + if (project.isOpen()) { + manager.launchObjectAdded(project); + } } ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); } From de43afb5b886f1c762161b1bae0b12aec07c8495 Mon Sep 17 00:00:00 2001 From: Matthew Bastien Date: Tue, 4 Apr 2017 12:41:10 -0400 Subject: [PATCH 130/198] Avoid setting active target to ILaunchTarget.NULL_TARGET Sometimes the active target would be set to a null "---" target when switching between launch descriptors even though a valid non-null launch target could be selected. Added a check to syncActiveTarget() in order to prevent this scenario from happening. Change-Id: Ife75701e8753123e6b1c5202b7bda339c6bfafd4 Signed-off-by: Matthew Bastien --- .../org/eclipse/launchbar/core/internal/LaunchBarManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 99aa6346ac2..9e78d132972 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -525,7 +525,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } else { // current active target, check if it is supported - if (activeLaunchTarget != null && supportsTarget(activeLaunchDesc, activeLaunchTarget)) { + if (activeLaunchTarget != null && activeLaunchTarget != ILaunchTarget.NULL_TARGET + && supportsTarget(activeLaunchDesc, activeLaunchTarget)) { setActiveLaunchTarget(activeLaunchTarget); return; } From c5a2c150ae2d9396c1973783a5e55a2c9a9627c6 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 25 May 2017 11:19:35 -0400 Subject: [PATCH 131/198] Check for disposed. Upversion for Launch Bar 2.1.1. Change-Id: I3ee0317023ecf9ca730743eb33650c4ec4c04b92 --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.core/pom.xml | 2 +- .../org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui.controls/pom.xml | 2 +- .../launchbar/ui/controls/internal/LaunchBarControl.java | 4 ++++ bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/pom.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 6114714257c..17cfb7b85e1 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.1.0.qualifier +Bundle-Version: 2.1.1.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml index 66f9d66550d..c91c8db4b1d 100644 --- a/bundles/org.eclipse.launchbar.core/pom.xml +++ b/bundles/org.eclipse.launchbar.core/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.core - 2.1.0-SNAPSHOT + 2.1.1-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index a872488efe2..77965c7a60d 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Launch Bar UI Controls Bundle-SymbolicName: org.eclipse.launchbar.ui.controls;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.ui.controls.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", diff --git a/bundles/org.eclipse.launchbar.ui.controls/pom.xml b/bundles/org.eclipse.launchbar.ui.controls/pom.xml index 5d02eb5e7c8..ef9c1ef3410 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/pom.xml +++ b/bundles/org.eclipse.launchbar.ui.controls/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.ui.controls - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index d4ace4c2e3b..f096bfd15c9 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -112,6 +112,10 @@ public class LaunchBarControl implements ILaunchBarListener { } private void createTargetSelector() { + if (container.isDisposed()) { + return; + } + onLabel = new Label(container, SWT.NONE); onLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); onLabel.setText(Messages.LaunchBarControl_0 + ":"); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 3ad1121a898..d29431beb28 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.1.0.qualifier +Bundle-Version: 2.1.1.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml index 0fe05f35edb..552f28d2140 100644 --- a/bundles/org.eclipse.launchbar.ui/pom.xml +++ b/bundles/org.eclipse.launchbar.ui/pom.xml @@ -12,7 +12,7 @@ org.eclipse.launchbar.ui - 2.1.0-SNAPSHOT + 2.1.1-SNAPSHOT eclipse-plugin diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 9d16c635164..40177a125da 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index 24c785f07f4..39533d10ad8 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 2.1.0-SNAPSHOT + 2.1.1-SNAPSHOT eclipse-feature From accbe9abc4fb1dda0bfb4a7abe08308c6b0f25ba Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 12 Jun 2017 14:53:43 -0400 Subject: [PATCH 132/198] Fix concurrent mod exception with listeners. Change-Id: If5088b530606421b573359b7755a01e45e32f0a7 --- .../core/internal/LaunchBarManager.java | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 9e78d132972..2749824e3b5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -610,11 +610,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchDescriptorChanged() { if (!initialized) return; - for (ILaunchBarListener listener : listeners) { - try { - listener.activeLaunchDescriptorChanged(activeLaunchDesc); - } catch (Exception e) { - Activator.log(e); + synchronized (listeners) { + for (ILaunchBarListener listener : listeners) { + try { + listener.activeLaunchDescriptorChanged(activeLaunchDesc); + } catch (Exception e) { + Activator.log(e); + } } } } @@ -673,11 +675,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchModeChanged() { if (!initialized) return; - for (ILaunchBarListener listener : listeners) { - try { - listener.activeLaunchModeChanged(activeLaunchMode); - } catch (Exception e) { - Activator.log(e); + synchronized (listeners) { + for (ILaunchBarListener listener : listeners) { + try { + listener.activeLaunchModeChanged(activeLaunchMode); + } catch (Exception e) { + Activator.log(e); + } } } } @@ -764,11 +768,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchTargetChanged() { if (!initialized) return; - for (ILaunchBarListener listener : listeners) { - try { - listener.activeLaunchTargetChanged(activeLaunchTarget); - } catch (Exception e) { - Activator.log(e); + synchronized (listeners) { + for (ILaunchBarListener listener : listeners) { + try { + listener.activeLaunchTargetChanged(activeLaunchTarget); + } catch (Exception e) { + Activator.log(e); + } } } } @@ -823,15 +829,19 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene public void addListener(ILaunchBarListener listener) { if (listener == null) return; - if (!listeners.contains(listener)) // cannot add duplicates - listeners.add(listener); + synchronized (listeners) { + if (!listeners.contains(listener)) // cannot add duplicates + listeners.add(listener); + } } @Override public void removeListener(ILaunchBarListener listener) { if (listener == null) return; - listeners.remove(listener); + synchronized (listener) { + listeners.remove(listener); + } } @Override @@ -912,11 +922,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireLaunchTargetsChanged() { if (!initialized) return; - for (ILaunchBarListener listener : listeners) { - try { - listener.launchTargetsChanged(); - } catch (Exception e) { - Activator.log(e); + synchronized (listeners) { + for (ILaunchBarListener listener : listeners) { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); + } } } } From 64f1d0b5d96d245272e1fd5f42803dabe614d1a1 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 15 Jun 2017 10:54:50 -0400 Subject: [PATCH 133/198] Fix deadlock on startup. Never use syncExec. Change-Id: I841045d56dc4a7446854282db6d74809629952a6 --- .../launchbar/ui/controls/internal/LaunchBarControl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index f096bfd15c9..960ae5fdf4d 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -182,7 +182,7 @@ public class LaunchBarControl implements ILaunchBarListener { @Override public void activeLaunchDescriptorChanged(ILaunchDescriptor descriptor) { - container.getDisplay().syncExec(() -> { + container.getDisplay().asyncExec(() -> { if (configSelector != null) { configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); } From ff9289d396ec9b3a65b6ba864d5daf41972a179d Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 15 Jun 2017 11:15:40 -0400 Subject: [PATCH 134/198] Even better solution for the deadlock on startup. Make sure we aren't locked when calling the listeners. Change-Id: Id67f52013646733347c3ac0e45ef0a32953c9e89 --- .../core/internal/LaunchBarManager.java | 72 ++++++++++--------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 2749824e3b5..283b53a1f5d 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -11,6 +11,7 @@ package org.eclipse.launchbar.core.internal; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -607,18 +608,31 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); } + private interface FireAction { + void run(ILaunchBarListener listener); + } + + private void fireEvent(FireAction action) { + Collection l; + synchronized (listeners) { + l = new ArrayList<>(listeners); + } + + for (ILaunchBarListener listener : l) { + action.run(listener); + } + } + private void fireActiveLaunchDescriptorChanged() { if (!initialized) return; - synchronized (listeners) { - for (ILaunchBarListener listener : listeners) { - try { - listener.activeLaunchDescriptorChanged(activeLaunchDesc); - } catch (Exception e) { - Activator.log(e); - } + fireEvent(listener -> { + try { + listener.activeLaunchDescriptorChanged(activeLaunchDesc); + } catch (Exception e) { + Activator.log(e); } - } + }); } @Override @@ -675,15 +689,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchModeChanged() { if (!initialized) return; - synchronized (listeners) { - for (ILaunchBarListener listener : listeners) { - try { - listener.activeLaunchModeChanged(activeLaunchMode); - } catch (Exception e) { - Activator.log(e); - } + fireEvent(listener -> { + try { + listener.activeLaunchModeChanged(activeLaunchMode); + } catch (Exception e) { + Activator.log(e); } - } + }); } private void storeLaunchMode(ILaunchDescriptor desc, ILaunchMode mode) { @@ -768,15 +780,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireActiveLaunchTargetChanged() { if (!initialized) return; - synchronized (listeners) { - for (ILaunchBarListener listener : listeners) { - try { - listener.activeLaunchTargetChanged(activeLaunchTarget); - } catch (Exception e) { - Activator.log(e); - } + fireEvent(listener -> { + try { + listener.activeLaunchTargetChanged(activeLaunchTarget); + } catch (Exception e) { + Activator.log(e); } - } + }); } private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) { @@ -922,15 +932,13 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene private void fireLaunchTargetsChanged() { if (!initialized) return; - synchronized (listeners) { - for (ILaunchBarListener listener : listeners) { - try { - listener.launchTargetsChanged(); - } catch (Exception e) { - Activator.log(e); - } + fireEvent(listener -> { + try { + listener.launchTargetsChanged(); + } catch (Exception e) { + Activator.log(e); } - } + }); } @Override From bb7cbf8429293a5e620a9408981f6b999d9b732e Mon Sep 17 00:00:00 2001 From: Matthew Bastien Date: Mon, 26 Jun 2017 11:21:55 -0400 Subject: [PATCH 135/198] Bug 518837: Launch Config Dialog select first tab by default Under certain circumstances the launch config dialog wouldn't have a tab selected when it opened. Changed the selection logic to explicitly select the first tab rather than assume that it would be selected. Change-Id: If2b3e2e933b12feb7e28a74270b34279ec891e54 Signed-off-by: Matthew Bastien --- .../launchbar/ui/internal/LaunchBarLaunchConfigDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index bd7a71dd666..a3c4cbec941 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -143,7 +143,8 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau configControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); if (lastSelection == null) { - // Assuming the first one ends up selected + // Select the first tab by default + tabFolder.setSelection(tabItem); lastSelection = tabItem; } } From 12514becfbed8a1f39082751e7266285d8ca6488 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Wed, 5 Jul 2017 11:39:53 -0400 Subject: [PATCH 136/198] Bug 519249 - [LaunchBar] popup disposed when typing Focus is lost and popup disposed after filter control is activated Probably in Oxygen sometime changes as focus now totally lost (focus control is null) after selection in our custom tree. Just resetting focus for now, need more investigation later why it was lost Change-Id: I0ab671ba97d8ecfe5586688812a9ea728d8f9619 --- .../eclipse/launchbar/ui/controls/internal/FilterControl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java index 491d03ebe68..b8b73034d9b 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java @@ -206,6 +206,8 @@ public class FilterControl extends Composite { listViewer.setHistorySupported(patternText == null || patternText.isEmpty()); listViewer.refresh(true); updateListSelection(false); + // re-focus filterText in case it lost the focus + filterText.setFocus(); } finally { redrawControl.setRedraw(true); } From ac5c884286fac6d55f5b8a42007335c2d1e4c438 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 11 Jul 2017 12:12:56 -0400 Subject: [PATCH 137/198] Add some logging to debug test failures we're seeing on Linux. Change-Id: I570733a2d3c81937a59cfa2aa93dfc98f6b6d325 --- .../eclipse/launchbar/ui/controls/internal/Activator.java | 3 +++ .../eclipse/launchbar/ui/controls/internal/CSelector.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java index 363516acea0..651bac3e78b 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java @@ -80,4 +80,7 @@ public class Activator extends AbstractUIPlugin { plugin.getLog().log(status); } + public static void log(String msg) { + plugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, msg)); + } } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index 55948f7745c..0b24dad0993 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -295,6 +295,7 @@ public abstract class CSelector extends Composite { } protected void openPopup() { + Activator.log(CSelector.this.getClass().getName() + " opening"); Object[] elements = contentProvider.getElements(input); if (elements.length == 0 && !hasActionArea()) return; @@ -342,6 +343,7 @@ public abstract class CSelector extends Composite { saveShellSize(); } }); + Activator.log(CSelector.this.getClass().getName() + " openned"); } protected String getDialogPreferencePrefix() { @@ -382,14 +384,18 @@ public abstract class CSelector extends Composite { } private void closePopup() { + Activator.log(new Throwable(CSelector.this.getClass().getName() + " close requested")); getDisplay().asyncExec(new Runnable() { @Override public void run() { - if (popup == null || popup.isDisposed()) + if (popup == null || popup.isDisposed()) { + Activator.log(CSelector.this.getClass().getName() + " close aborted"); return; + } arrowTransition.to(arrowMax); popup.setVisible(false); popup.dispose(); + Activator.log(CSelector.this.getClass().getName() + " closed"); } }); } From ede3252c712b9a1c99fa72b593ee0e64ef9d5b81 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 11 Jul 2017 14:23:53 -0400 Subject: [PATCH 138/198] More logs. Change-Id: I906f43975c2c4c3f4b81f38fcee4cb82227423eb --- .../org/eclipse/launchbar/ui/controls/internal/CSelector.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index 0b24dad0993..80b6564a08f 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -137,6 +137,7 @@ public abstract class CSelector extends Composite { public CSelector(Composite parent, int style) { super(parent, style); + Activator.log(new Throwable(getClass().getName() + " created")); setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); GridLayout mainButtonLayout = new GridLayout(); From f6809dae38589f14cd7b2cc8272c51f88f51e435 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 11 Jul 2017 15:22:21 -0400 Subject: [PATCH 139/198] Yes more logs, tricky bug. Change-Id: I716d388ccb21070d02722ae958cfcf6ddf9e2a3e --- .../eclipse/launchbar/ui/controls/internal/CSelector.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index 80b6564a08f..249a4b6e55b 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -69,6 +69,7 @@ public abstract class CSelector extends Composite { private MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(MouseEvent event) { + Activator.log(new Throwable(getClass().getName() + " mouse up")); if (popup == null || popup.isDisposed()) { setFocus(); openPopup(); @@ -76,6 +77,10 @@ public abstract class CSelector extends Composite { closePopup(); } } + + public void mouseDown(MouseEvent e) { + Activator.log(new Throwable(getClass().getName() + " mouse down")); + } }; protected boolean myIsFocusAncestor(Control control) { @@ -137,7 +142,7 @@ public abstract class CSelector extends Composite { public CSelector(Composite parent, int style) { super(parent, style); - Activator.log(new Throwable(getClass().getName() + " created")); + Activator.log(new Throwable(getClass().getName() + ':' + Integer.toHexString(hashCode()) + " created")); setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); GridLayout mainButtonLayout = new GridLayout(); @@ -170,6 +175,7 @@ public abstract class CSelector extends Composite { super.dispose(); if (popup != null) popup.dispose(); + Activator.log(new Throwable(getClass().getName() + ':' + Integer.toHexString(hashCode()) + " disposed")); } public void setDelayedSelection(final Object element, long millis) { From 0a0ff7b964c4bcd38fe4f86cae019112323c27a5 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 12 Jul 2017 10:48:18 -0400 Subject: [PATCH 140/198] Remove logging. Change-Id: Ie44ef7f1201ba73b752fb9fface2e654fb14e67c --- .../launchbar/ui/controls/internal/CSelector.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index 249a4b6e55b..cf18ca56d22 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -69,7 +69,6 @@ public abstract class CSelector extends Composite { private MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(MouseEvent event) { - Activator.log(new Throwable(getClass().getName() + " mouse up")); if (popup == null || popup.isDisposed()) { setFocus(); openPopup(); @@ -77,10 +76,6 @@ public abstract class CSelector extends Composite { closePopup(); } } - - public void mouseDown(MouseEvent e) { - Activator.log(new Throwable(getClass().getName() + " mouse down")); - } }; protected boolean myIsFocusAncestor(Control control) { @@ -142,7 +137,6 @@ public abstract class CSelector extends Composite { public CSelector(Composite parent, int style) { super(parent, style); - Activator.log(new Throwable(getClass().getName() + ':' + Integer.toHexString(hashCode()) + " created")); setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); GridLayout mainButtonLayout = new GridLayout(); @@ -175,7 +169,6 @@ public abstract class CSelector extends Composite { super.dispose(); if (popup != null) popup.dispose(); - Activator.log(new Throwable(getClass().getName() + ':' + Integer.toHexString(hashCode()) + " disposed")); } public void setDelayedSelection(final Object element, long millis) { @@ -302,7 +295,6 @@ public abstract class CSelector extends Composite { } protected void openPopup() { - Activator.log(CSelector.this.getClass().getName() + " opening"); Object[] elements = contentProvider.getElements(input); if (elements.length == 0 && !hasActionArea()) return; @@ -350,7 +342,6 @@ public abstract class CSelector extends Composite { saveShellSize(); } }); - Activator.log(CSelector.this.getClass().getName() + " openned"); } protected String getDialogPreferencePrefix() { @@ -391,18 +382,15 @@ public abstract class CSelector extends Composite { } private void closePopup() { - Activator.log(new Throwable(CSelector.this.getClass().getName() + " close requested")); getDisplay().asyncExec(new Runnable() { @Override public void run() { if (popup == null || popup.isDisposed()) { - Activator.log(CSelector.this.getClass().getName() + " close aborted"); return; } arrowTransition.to(arrowMax); popup.setVisible(false); popup.dispose(); - Activator.log(CSelector.this.getClass().getName() + " closed"); } }); } From 4e6e053c6ce4a29e6ee2bdf607d862a2b404a0f4 Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Thu, 20 Jul 2017 14:47:14 -0400 Subject: [PATCH 141/198] Bug 520029 - Synchronize access to listeners in LaunchTargetManager. Change-Id: I339fe158341890caa95537b332da29717f7bc5a1 Signed-off-by: Roland Grunberg --- .../internal/target/LaunchTargetManager.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 2ad11c32936..66df11523bb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -8,6 +8,7 @@ package org.eclipse.launchbar.core.internal.target; import java.util.ArrayList; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -35,7 +36,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { private Map> targets; private Map typeElements; private Map typeProviders = new LinkedHashMap<>(); - private List listeners = new LinkedList<>(); + private List listeners = Collections.synchronizedList(new LinkedList<>()); private static final String DELIMETER1 = ","; //$NON-NLS-1$ private static final String DELIMETER2 = ":"; //$NON-NLS-1$ @@ -201,8 +202,10 @@ public class LaunchTargetManager implements ILaunchTargetManager { Activator.log(e); } - for (ILaunchTargetListener listener : listeners) { - listener.launchTargetAdded(target); + synchronized (listeners) { + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetAdded(target); + } } return target; @@ -226,16 +229,20 @@ public class LaunchTargetManager implements ILaunchTargetManager { Activator.log(e); } - for (ILaunchTargetListener listener : listeners) { - listener.launchTargetRemoved(target); + synchronized (listeners) { + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetRemoved(target); + } } } } @Override public void targetStatusChanged(ILaunchTarget target) { - for (ILaunchTargetListener listener : listeners) { - listener.launchTargetStatusChanged(target); + synchronized (listeners) { + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetStatusChanged(target); + } } } From 3d9e23860398e2847775e78055cb102b843a1e81 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 23 Aug 2017 10:24:49 -0600 Subject: [PATCH 142/198] Upversion LaunchBar for Oxygen.1 (2.1.2) Change-Id: Ib2c4658c3997224c5204003eea2ee4177d423bdd --- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar.remote/pom.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index b5d687e641d..6cc7ca86b82 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar.remote/pom.xml b/features/org.eclipse.launchbar.remote/pom.xml index a2529b02841..ec494d8c0e7 100644 --- a/features/org.eclipse.launchbar.remote/pom.xml +++ b/features/org.eclipse.launchbar.remote/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar.remote - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT eclipse-feature diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 40177a125da..22b8bb8259b 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml index 39533d10ad8..758ac14dffa 100644 --- a/features/org.eclipse.launchbar/pom.xml +++ b/features/org.eclipse.launchbar/pom.xml @@ -13,7 +13,7 @@ org.eclipse.launchbar.features org.eclipse.launchbar - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT eclipse-feature From 374059131bc64435291cee3967a7517d2821b84d Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 31 Aug 2017 11:34:17 -0400 Subject: [PATCH 143/198] Bug 521703 Add name attribute to new targets This ensure they have at least one attribute to that the child node persists (empty ones don't). Change-Id: I3bdc64a07a097882acfcc4995e1d09a0a862b197 --- .../launchbar/core/ILaunchBarListener.java | 17 +++------ .../internal/target/LaunchTargetManager.java | 35 ++++++++++++------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java index 2db287409a0..c3d2c8fafe8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java @@ -1,16 +1,9 @@ /******************************************************************************* - * Copyright (c) Jan 29, 2016 QNX Software Systems. All Rights Reserved. - * - * You must obtain a written license from and pay applicable license fees to QNX - * Software Systems before you may reproduce, modify or distribute this software, - * or any work that includes all or part of this software. Free development - * licenses are available for evaluation and non-commercial purposes. For more - * information visit [http://licensing.qnx.com] or email licensing@qnx.com. - * - * This file may contain contributions from others. Please review this entire - * file for other proprietary rights or license notices, as well as the QNX - * Development Suite License Guide at [http://licensing.qnx.com/license-guide/] - * for other information. + * Copyright (c) 2016 QNX Software Systems 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 *******************************************************************************/ package org.eclipse.launchbar.core; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 66df11523bb..e6ce687f956 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -192,23 +192,32 @@ public class LaunchTargetManager implements ILaunchTargetManager { targets.put(typeId, type); } - Preferences prefs = getTargetsPref(); - String childName = typeId + DELIMETER1 + id; - ILaunchTarget target = new LaunchTarget(typeId, id, prefs.node(childName)); - type.put(id, target); try { - prefs.flush(); + Preferences prefs = getTargetsPref(); + String childName = typeId + DELIMETER1 + id; + Preferences child; + if (prefs.nodeExists(childName)) { + child = prefs.node(childName); + } else { + child = prefs.node(childName); + // set the id so we have at least one attribute to save + child.put("name", id); //$NON-NLS-1$ + } + ILaunchTarget target = new LaunchTarget(typeId, id, child); + type.put(id, target); + child.flush(); + + synchronized (listeners) { + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetAdded(target); + } + } + + return target; } catch (BackingStoreException e) { Activator.log(e); + return null; } - - synchronized (listeners) { - for (ILaunchTargetListener listener : listeners) { - listener.launchTargetAdded(target); - } - } - - return target; } @Override From 4a25d3cf1da03480c2a7c074cfe43622c3a2c6c7 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 6 Sep 2017 13:28:47 -0400 Subject: [PATCH 144/198] Add build settings tabs for descriptor/config editor. Add a mechanism to allow extenders to provide tabs for build settings in the descriptor config editor. Also move to pom-less builds. Change-Id: I850898aba94c38d69717c9b8366de3b9a7031ff6 --- .mvn/extensions.xml | 8 ++ .../META-INF/MANIFEST.MF | 4 +- bundles/org.eclipse.launchbar.core/pom.xml | 18 ----- .../internal/DefaultLaunchDescriptor.java | 8 +- .../org.eclipse.launchbar.remote.core/pom.xml | 18 ----- .../org.eclipse.launchbar.remote.ui/pom.xml | 18 ----- .../org.eclipse.launchbar.ui.controls/pom.xml | 18 ----- bundles/org.eclipse.launchbar.ui/pom.xml | 18 ----- .../schema/launchBarUIContributions.exsd | 46 +++++++++++ .../internal/LaunchBarLaunchConfigDialog.java | 66 +++++++++++---- .../ui/internal/LaunchBarUIManager.java | 80 ++++++++++--------- bundles/pom.xml | 15 ++++ features/org.eclipse.launchbar/feature.xml | 2 +- features/org.eclipse.launchbar/pom.xml | 51 ------------ features/pom.xml | 15 ++++ pom.xml | 28 +++++++ 16 files changed, 215 insertions(+), 198 deletions(-) create mode 100644 .mvn/extensions.xml delete mode 100644 bundles/org.eclipse.launchbar.core/pom.xml delete mode 100644 bundles/org.eclipse.launchbar.remote.core/pom.xml delete mode 100644 bundles/org.eclipse.launchbar.remote.ui/pom.xml delete mode 100644 bundles/org.eclipse.launchbar.ui.controls/pom.xml delete mode 100644 bundles/org.eclipse.launchbar.ui/pom.xml create mode 100644 bundles/pom.xml delete mode 100644 features/org.eclipse.launchbar/pom.xml create mode 100644 features/pom.xml diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 00000000000..9d93c39fd93 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,8 @@ + + + + org.eclipse.tycho.extras + tycho-pomless + 1.0.0 + + diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 17cfb7b85e1..e773efc6109 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.1.1.qualifier +Bundle-Version: 2.2.0.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, @@ -11,6 +11,6 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.core, - org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests", + org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui", org.eclipse.launchbar.core.target, org.eclipse.launchbar.core.target.launch diff --git a/bundles/org.eclipse.launchbar.core/pom.xml b/bundles/org.eclipse.launchbar.core/pom.xml deleted file mode 100644 index c91c8db4b1d..00000000000 --- a/bundles/org.eclipse.launchbar.core/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.core - 2.1.1-SNAPSHOT - - eclipse-plugin - diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java index 50cc5cbb689..28af5ce2d2b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2017 QNX Software Systems 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 @@ -34,6 +34,12 @@ public class DefaultLaunchDescriptor extends PlatformObject implements ILaunchDe if (ILaunchConfiguration.class.equals(adapter)) { return adapter.cast(configuration); } + + T obj = configuration.getAdapter(adapter); + if (obj != null) { + return obj; + } + return super.getAdapter(adapter); } diff --git a/bundles/org.eclipse.launchbar.remote.core/pom.xml b/bundles/org.eclipse.launchbar.remote.core/pom.xml deleted file mode 100644 index 300eb79704d..00000000000 --- a/bundles/org.eclipse.launchbar.remote.core/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.remote.core - 1.0.1-SNAPSHOT - - eclipse-plugin - diff --git a/bundles/org.eclipse.launchbar.remote.ui/pom.xml b/bundles/org.eclipse.launchbar.remote.ui/pom.xml deleted file mode 100644 index d10b2c206c4..00000000000 --- a/bundles/org.eclipse.launchbar.remote.ui/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.remote.ui - 1.0.0-SNAPSHOT - - eclipse-plugin - diff --git a/bundles/org.eclipse.launchbar.ui.controls/pom.xml b/bundles/org.eclipse.launchbar.ui.controls/pom.xml deleted file mode 100644 index ef9c1ef3410..00000000000 --- a/bundles/org.eclipse.launchbar.ui.controls/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.ui.controls - 1.0.1-SNAPSHOT - - eclipse-plugin - diff --git a/bundles/org.eclipse.launchbar.ui/pom.xml b/bundles/org.eclipse.launchbar.ui/pom.xml deleted file mode 100644 index 552f28d2140..00000000000 --- a/bundles/org.eclipse.launchbar.ui/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.ui - 2.1.1-SNAPSHOT - - eclipse-plugin - diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd index e13cca0bb24..c052bede12d 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd @@ -19,6 +19,7 @@ + @@ -48,6 +49,11 @@
+ + + Provides a label provider to visualize launch descriptors in the descriptor selector. + + @@ -72,6 +78,46 @@ + + + + Allows launch config providers to add build settings tabs to existing launch configuration tab groups when edited from the launch bar. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index a3c4cbec941..188d13765fe 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -39,6 +39,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private final ILaunchDescriptor descriptor; private final ILaunchMode mode; private final ILaunchTarget target; + private final ILaunchConfigurationTabGroup buildTabGroup; private ILaunchConfigurationTabGroup group; private CTabFolder tabFolder; @@ -47,12 +48,16 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private boolean initing; public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, - ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target) { + ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target, + ILaunchConfigurationTabGroup buildTabGroup) { super(shell); + this.workingCopy = workingCopy; this.descriptor = descriptor; this.mode = mode; this.target = target; + this.buildTabGroup = buildTabGroup; + setShellStyle(getShellStyle() | SWT.RESIZE); } @@ -123,25 +128,21 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau }); try { + if (buildTabGroup != null) { + buildTabGroup.createTabs(this, mode.getIdentifier()); + + for (ILaunchConfigurationTab configTab : buildTabGroup.getTabs()) { + installTab(configTab, tabFolder); + } + + buildTabGroup.initializeFrom(workingCopy); + } + group = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, mode.getIdentifier()); group.createTabs(this, mode.getIdentifier()); for (ILaunchConfigurationTab configTab : group.getTabs()) { - configTab.setLaunchConfigurationDialog(this); - - CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); - tabItem.setData(configTab); - tabItem.setText(configTab.getName()); - tabItem.setImage(configTab.getImage()); - - Composite tabComp = new Composite(tabFolder, SWT.NONE); - tabComp.setLayout(new GridLayout()); - tabItem.setControl(tabComp); - - configTab.createControl(tabComp); - Control configControl = configTab.getControl(); - configControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - + CTabItem tabItem = installTab(configTab, tabFolder); if (lastSelection == null) { // Select the first tab by default tabFolder.setSelection(tabItem); @@ -162,8 +163,30 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau return composite; } + private CTabItem installTab(ILaunchConfigurationTab tab, CTabFolder tabFolder) { + tab.setLaunchConfigurationDialog(this); + + CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); + tabItem.setData(tab); + tabItem.setText(tab.getName()); + tabItem.setImage(tab.getImage()); + + Composite tabComp = new Composite(tabFolder, SWT.NONE); + tabComp.setLayout(new GridLayout()); + tabItem.setControl(tabComp); + + tab.createControl(tabComp); + Control configControl = tab.getControl(); + configControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + return tabItem; + } + @Override protected void okPressed() { + if (buildTabGroup != null) { + buildTabGroup.performApply(workingCopy); + } group.performApply(workingCopy); super.okPressed(); } @@ -285,7 +308,16 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override public ILaunchConfigurationTab[] getTabs() { - return group.getTabs(); + if (buildTabGroup != null) { + ILaunchConfigurationTab[] buildTabs = buildTabGroup.getTabs(); + ILaunchConfigurationTab[] mainTabs = group.getTabs(); + ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[buildTabs.length + mainTabs.length]; + System.arraycopy(buildTabs, 0, tabs, 0, buildTabs.length); + System.arraycopy(mainTabs, 0, tabs, buildTabs.length, mainTabs.length); + return tabs; + } else { + return group.getTabs(); + } } @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index c7e3a2cd1a9..67473189279 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -31,7 +31,6 @@ import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.window.Window; import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchDescriptor; @@ -43,12 +42,18 @@ import org.eclipse.ui.PlatformUI; public class LaunchBarUIManager implements ILaunchBarUIManager { - private Map> descriptorLabelProviders = null; + private Map> descriptorLabelProviders; + + // Map + private Map>> buildTabGroups; + private ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); private void init() { if (descriptorLabelProviders == null) { descriptorLabelProviders = new HashMap<>(); + buildTabGroups = new HashMap<>(); + IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "launchBarUIContributions"); //$NON-NLS-1$ IExtension[] extensions = point.getExtensions(); @@ -60,6 +65,19 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { ExecutableExtension labelProvider = new ExecutableExtension<>(element, "labelProvider"); //$NON-NLS-1$ descriptorLabelProviders.put(descriptorTypeId, labelProvider); + } else if (elementName.equals("buildTabGroup")) { //$NON-NLS-1$ + String launchConfigTypeId = element.getAttribute("launchConfigType"); //$NON-NLS-1$ + String descriptorTypeId = element.getAttribute("launchDescriptorType"); //$NON-NLS-1$ + ExecutableExtension tabGroup = new ExecutableExtension<>(element, + "tabGroup"); //$NON-NLS-1$ + + Map> descGroup = buildTabGroups.get(launchConfigTypeId); + if (descGroup == null) { + descGroup = new HashMap<>(); + buildTabGroups.put(launchConfigTypeId, descGroup); + } + + descGroup.put(descriptorTypeId, tabGroup); } } } @@ -88,46 +106,36 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { return s; } - if (true) { - try { - ILaunchMode mode = manager.getActiveLaunchMode(); - ILaunchTarget target = manager.getActiveLaunchTarget(); - ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); + try { + ILaunchMode mode = manager.getActiveLaunchMode(); + ILaunchTarget target = manager.getActiveLaunchTarget(); + ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); - ILaunchConfigurationWorkingCopy workingCopy = config.getWorkingCopy(); - LaunchBarLaunchConfigDialog dialog = new LaunchBarLaunchConfigDialog(shell, workingCopy, descriptor, - mode, target); - if (dialog.open() == Window.OK) { - if (!workingCopy.getOriginal().equals(workingCopy) - && !workingCopy.getOriginal().getAttributes().equals(workingCopy.getAttributes())) { - workingCopy.doSave(); - } + ILaunchConfigurationWorkingCopy workingCopy = config.getWorkingCopy(); + + ILaunchConfigurationTabGroup buildTabGroup = null; + Map> descGroups = buildTabGroups + .get(config.getType().getIdentifier()); + if (descGroups != null) { + ExecutableExtension tabGroup = descGroups + .get(manager.getDescriptorTypeId(descriptor.getType())); + if (tabGroup != null) { + buildTabGroup = tabGroup.create(); } - } catch (CoreException e) { - return e.getStatus(); } - } else { - // At this point, no error handling should be needed. - try { - ILaunchBarManager manager = Activator.getService(ILaunchBarManager.class); - ILaunchMode mode = manager.getActiveLaunchMode(); - ILaunchTarget target = manager.getActiveLaunchTarget(); - ILaunchConfigurationType configType = manager.getLaunchConfigurationType(descriptor, target); - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup( - configType, - mode.getIdentifier()); - ILaunchConfiguration config = manager.getLaunchConfiguration(descriptor, target); - if (config instanceof ILaunchConfigurationWorkingCopy - && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { - config = ((ILaunchConfigurationWorkingCopy) config).doSave(); + + LaunchBarLaunchConfigDialog dialog = new LaunchBarLaunchConfigDialog(shell, workingCopy, descriptor, mode, + target, buildTabGroup); + if (dialog.open() == Window.OK) { + if (!workingCopy.getOriginal().equals(workingCopy) + && !workingCopy.getOriginal().getAttributes().equals(workingCopy.getAttributes())) { + workingCopy.doSave(); } - // open real eclipse launch configurations dialog - DebugUIPlugin.openLaunchConfigurationsDialog(shell, new StructuredSelection(config), - group.getIdentifier(), false); - } catch (CoreException e2) { - return e2.getStatus(); } + } catch (CoreException e) { + return e.getStatus(); } + return Status.OK_STATUS; } diff --git a/bundles/pom.xml b/bundles/pom.xml new file mode 100644 index 00000000000..9d8949028b5 --- /dev/null +++ b/bundles/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + + + bundles-parent + pom + diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 22b8bb8259b..63ddc75cbc6 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/pom.xml b/features/org.eclipse.launchbar/pom.xml deleted file mode 100644 index 758ac14dffa..00000000000 --- a/features/org.eclipse.launchbar/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.features - org.eclipse.launchbar - 2.1.2-SNAPSHOT - eclipse-feature - - - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - ${tycho-extras-version} - - - source-feature - package - - source-feature - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - - - - - - - diff --git a/features/pom.xml b/features/pom.xml new file mode 100644 index 00000000000..94a900d2074 --- /dev/null +++ b/features/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + + org.eclipse.launchbar + parent + 1.0.0-SNAPSHOT + + + features-parent + pom + diff --git a/pom.xml b/pom.xml index f3bdced65dd..24172d34e3d 100644 --- a/pom.xml +++ b/pom.xml @@ -253,6 +253,34 @@ + + org.eclipse.tycho.extras + tycho-source-feature-plugin + ${tycho-extras-version} + + + source-feature + package + + source-feature + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attach-p2-metadata + package + + p2-metadata + + + + From ccc816a4427235c67c285fdb721b496d1b95d150 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 27 Sep 2017 13:57:57 -0400 Subject: [PATCH 145/198] New Target Management wizard and allow editing of LC names. Add a new launch target wizard that manages creating and editing of launch targets (similar to the new CDT toolchain wizard). Allow editing of launch configuration names in the descriptor edit dialog. Change-Id: I1c690a5c5d8a8a6d4e4698b47cd35e6cc40944c5 --- .../core/AbstractLaunchConfigProvider.java | 16 +- .../core/internal/LaunchBarManager.java | 2 +- .../internal/target/LaunchTargetManager.java | 2 +- .../target/LaunchTargetWorkingCopy.java | 10 +- .../ui/controls/internal/TargetSelector.java | 35 +- .../META-INF/MANIFEST.MF | 2 +- .../schema/launchTargetTypeUI.exsd | 50 +- .../launchbar/ui/internal/Activator.java | 1 + .../internal/LaunchBarLaunchConfigDialog.java | 79 ++- .../ui/internal/LaunchBarUIManager.java | 3 +- .../launchbar/ui/internal/Messages.java | 12 + .../launchbar/ui/internal/messages.properties | 6 + .../target/LaunchTargetUIManager.java | 100 +++- .../target/LaunchTargetWizardDialog.java | 44 ++ .../target/NewLaunchTargetWizard.java | 91 +-- .../target/NewLaunchTargetWizardNewPage.java | 518 ------------------ .../NewLaunchTargetWizardSelectionPage.java | 225 +++++--- .../ui/target/ILaunchTargetUIManager.java | 14 + .../ui/target/LaunchTargetWizard.java | 33 ++ .../target/NewLaunchTargetWizardAction.java | 125 +---- .../PerTargetLaunchConfigProviderTest.java | 31 +- 21 files changed, 491 insertions(+), 908 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java delete mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index 19cef3b7bb5..b7d7a3a3016 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -61,12 +61,16 @@ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurati return false; } - // Check for our class name but also that the config name - // matches what we originally set it to. - // This covers the case when the config was duplicated. - // We can own only one, the original one. - return configuration.getAttribute(ATTR_PROVIDER_CLASS, "").equals(getClass().getName()) //$NON-NLS-1$ - && configuration.getAttribute(ATTR_ORIGINAL_NAME, "").equals(configuration.getName()); //$NON-NLS-1$ + if (configuration.getAttribute(ATTR_PROVIDER_CLASS, "").equals(getClass().getName())) { //$NON-NLS-1$ + // We provided the configuration but we need to check if this is a duplicate and + // not own it. Check the original name and if there is still a config with that + // name, this is the duplicate. Otherwise it's simply a rename + String origName = configuration.getAttribute(ATTR_ORIGINAL_NAME, ""); //$NON-NLS-1$ + return origName.equals(configuration.getName()) + || !DebugPlugin.getDefault().getLaunchManager().isExistingLaunchConfigurationName(origName); + } else { + return false; + } } } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 283b53a1f5d..468c6bc0eae 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -947,7 +947,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return; fireLaunchTargetsChanged(); // if we added new target we probably want to use it - if (activeLaunchDesc == null || supportsTarget(activeLaunchDesc, target)) { + if (activeLaunchDesc != null && supportsTarget(activeLaunchDesc, target)) { try { setActiveLaunchTarget(target); } catch (CoreException e) { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index e6ce687f956..fe6631c46bc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -205,7 +205,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } ILaunchTarget target = new LaunchTarget(typeId, id, child); type.put(id, target); - child.flush(); + prefs.flush(); synchronized (listeners) { for (ILaunchTargetListener listener : listeners) { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java index f9089b8dc3d..714b1ef29d4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java @@ -77,7 +77,7 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa public ILaunchTarget save() { try { LaunchTarget target; - if (newId == null) { + if (newId == null || newId.equals(original.getId())) { target = original; } else { // make a new one and remove the old one @@ -91,7 +91,13 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa // set the changed attributes for (Map.Entry entry : changes.entrySet()) { - target.attributes.put(entry.getKey(), entry.getValue()); + String key = entry.getKey(); + String value = entry.getValue(); + if (value != null) { + target.attributes.put(key, value); + } else { + target.attributes.remove(key); + } } target.attributes.flush(); return target; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java index f084d21f7eb..cbd53e74198 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java @@ -18,14 +18,9 @@ import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.window.SameShellProvider; import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetListener; @@ -48,7 +43,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.PropertyDialogAction; public class TargetSelector extends CSelector implements ILaunchTargetListener { @@ -108,7 +102,7 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { if (status.getCode() == Code.OK) { return baseImage; } else { - String compId = String.format("%s.%s.%s", target.getTypeId(), target.getId(), + String compId = String.format("%s.%s.%s", target.getTypeId(), target.getId(), //$NON-NLS-1$ status.getCode()); Image image = Activator.getDefault().getImageRegistry().get(compId); if (image == null && baseImage != null) { @@ -157,34 +151,9 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { return true; } - private ISelectionProvider getSelectionProvider() { - return new ISelectionProvider() { - @Override - public void setSelection(ISelection selection) { - // ignore - } - - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - // ignore - } - - @Override - public ISelection getSelection() { - return new StructuredSelection(TargetSelector.this.getSelection()); - } - - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - // ignore - } - }; - } - @Override public void handleEdit(Object element) { - // opens property dialog on a selected target - new PropertyDialogAction(new SameShellProvider(getShell()), getSelectionProvider()).run(); + targetUIManager.editLaunchTarget((ILaunchTarget) getSelection()); } @Override diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index d29431beb28..a252075c446 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.1.1.qualifier +Bundle-Version: 2.2.0.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd index cb66eccd31b..5d964f9875c 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd @@ -21,6 +21,7 @@ and target creation wizard. + @@ -173,6 +174,53 @@ Since 3.0
+ + + + Wizard that supports creation and editing of targets. These wizards are per target type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -187,7 +235,7 @@ Since 3.0 - <extension + <extension point="org.eclipse.launchbar.ui.launchTargetTypeUI"> <launchTargetTypeUI id="com.qnx.tools.ide.target.qconn" diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index 85b8303cf52..e07cf4a1257 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -103,4 +103,5 @@ public class Activator extends AbstractUIPlugin { ServiceReference ref = context.getServiceReference(cls); return ref != null ? context.getService(ref) : null; } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 188d13765fe..7b8b9afd306 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -3,7 +3,9 @@ package org.eclipse.launchbar.ui.internal; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; import org.eclipse.debug.ui.ILaunchConfigurationTab; @@ -24,6 +26,8 @@ import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; @@ -31,7 +35,9 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; 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.Text; public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILaunchBarLaunchConfigDialog { @@ -40,8 +46,10 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private final ILaunchMode mode; private final ILaunchTarget target; private final ILaunchConfigurationTabGroup buildTabGroup; + private final String originalName; private ILaunchConfigurationTabGroup group; + private Text nameText; private CTabFolder tabFolder; private CTabItem lastSelection; private ProgressMonitorPart pmPart; @@ -57,6 +65,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau this.mode = mode; this.target = target; this.buildTabGroup = buildTabGroup; + this.originalName = workingCopy.getName(); setShellStyle(getShellStyle() | SWT.RESIZE); } @@ -71,14 +80,6 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau protected Control createDialogArea(Composite parent) { initing = true; - // create the top level composite for the dialog area - Composite composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.verticalSpacing = 0; - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - composite.setFont(parent.getFont()); - getShell().setText(Messages.LaunchBarLaunchConfigDialog_EditConfiguration); boolean supportsTargets = true; try { @@ -102,6 +103,31 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau setMessage(Messages.LaunchBarLaunchConfigDialog_SetParameters); + // create the top level composite for the dialog area + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.verticalSpacing = 0; + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + composite.setFont(parent.getFont()); + + Composite nameComp = new Composite(composite, SWT.NONE); + nameComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + nameComp.setLayout(new GridLayout(2, false)); + + Label nameLabel = new Label(nameComp, SWT.NONE); + nameLabel.setText(Messages.LaunchBarLaunchConfigDialog_LaunchConfigName); + + nameText = new Text(nameComp, SWT.BORDER); + nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + nameText.setText(workingCopy.getName()); + nameText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + updateMessage(); + } + }); + tabFolder = new CTabFolder(composite, SWT.BORDER); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); tabFolder.addFocusListener(new FocusAdapter() { @@ -184,6 +210,11 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override protected void okPressed() { + String newName = nameText.getText().trim(); + if (!newName.equals(originalName)) { + workingCopy.rename(newName); + } + if (buildTabGroup != null) { buildTabGroup.performApply(workingCopy); } @@ -277,6 +308,31 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau return; } + String newName = nameText.getText().trim(); + if (newName.isEmpty()) { + setMessage(Messages.LaunchBarLaunchConfigDialog_LCMustHaveName, IMessageProvider.ERROR); + return; + } + + if (!newName.equals(originalName)) { + // make sure it's not taken + try { + ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); + + if (manager.isExistingLaunchConfigurationName(newName)) { + setMessage(Messages.LaunchBarLaunchConfigDialog_LCNameExists, IMessageProvider.ERROR); + return; + } + + if (!manager.isValidLaunchConfigurationName(newName)) { + setMessage(Messages.LaunchBarLaunchConfigDialog_LCNameNotValid, IMessageProvider.ERROR); + return; + } + } catch (CoreException e1) { + Activator.log(e1.getStatus()); + } + } + for (ILaunchConfigurationTab tab : getTabs()) { tab.isValid(workingCopy); } @@ -297,13 +353,14 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override public void setName(String name) { - // Names aren't setable from this dialog + if (nameText != null && !nameText.isDisposed()) { + nameText.setText(name); + } } @Override public String generateName(String name) { - // Names aren't setable from this dialog - return null; + return DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(name); } @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 67473189279..16e62a40677 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -128,7 +128,8 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { target, buildTabGroup); if (dialog.open() == Window.OK) { if (!workingCopy.getOriginal().equals(workingCopy) - && !workingCopy.getOriginal().getAttributes().equals(workingCopy.getAttributes())) { + && (!workingCopy.getOriginal().getAttributes().equals(workingCopy.getAttributes()) + || !workingCopy.getOriginal().getName().equals(workingCopy.getName()))) { workingCopy.doSave(); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index aa8c1687353..e220d9b1e10 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -33,6 +33,8 @@ public class Messages extends NLS { public static String NewLaunchConfigTypePage_2; public static String NewLaunchConfigWizard_0; + public static String NewLaunchTargetWizard_Title; + public static String DescriptorMustNotBeNull; public static String DescriptorMustNotBeNullDesc; public static String NoActiveTarget; @@ -47,10 +49,20 @@ public class Messages extends NLS { public static String LaunchBarLaunchConfigDialog_EditConfiguration; + public static String LaunchBarLaunchConfigDialog_LaunchConfigName; + + public static String LaunchBarLaunchConfigDialog_LCMustHaveName; + + public static String LaunchBarLaunchConfigDialog_LCNameExists; + + public static String LaunchBarLaunchConfigDialog_LCNameNotValid; + public static String LaunchBarLaunchConfigDialog_SetParameters; public static String LaunchConfigurationNotFound; public static String LaunchConfigurationNotFoundDesc; + + public static String LaunchTargetWizardDialog_Delete; public static String NoLaunchTabsDefined; public static String NoLaunchTabsDefinedDesc; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 7e55a143a6e..8f0cabb106c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -25,6 +25,7 @@ NewLaunchConfigTypePage_0=Select Launch Configuration Type NewLaunchConfigTypePage_1=Launch Configuration Type NewLaunchConfigTypePage_2=Select the type of launch configuration to create. NewLaunchConfigWizard_0=Create Launch Configuration +NewLaunchTargetWizard_Title=New Launch Target DescriptorMustNotBeNull=Descriptor must not be null DescriptorMustNotBeNullDesc=The launch descriptor must not be null. @@ -37,8 +38,13 @@ NoLaunchGroupSelected=No launch group found for the current selection. LaunchBarLaunchConfigDialog_Edit1=Edit configuration %s for %s LaunchBarLaunchConfigDialog_Edit2=Edit configuration %s for %s on %s LaunchBarLaunchConfigDialog_EditConfiguration=Edit Configuration +LaunchBarLaunchConfigDialog_LaunchConfigName=Launch Configuration Name: +LaunchBarLaunchConfigDialog_LCMustHaveName=Launch configuration must have a name +LaunchBarLaunchConfigDialog_LCNameExists=A launch configuration with that name already exists. +LaunchBarLaunchConfigDialog_LCNameNotValid=The launch configuration name is not valid. LaunchBarLaunchConfigDialog_SetParameters=Set parameters for the configuration. LaunchConfigurationNotFound=Launch Configuration Not Found LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target. +LaunchTargetWizardDialog_Delete=Delete NoLaunchTabsDefined=No launch tabs defined. NoLaunchTabsDefinedDesc=No launch tabs have been defined for this launch configuration type. diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java index e32c6b4cfd4..5faf1d91737 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java @@ -7,9 +7,7 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.eclipse.core.runtime.CoreException; @@ -19,19 +17,27 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.SameShellProvider; +import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; +import org.eclipse.launchbar.ui.target.LaunchTargetWizard; import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.internal.dialogs.WizardCollectionElement; -import org.eclipse.ui.internal.registry.WizardsRegistryReader; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.PropertyDialogAction; import org.eclipse.ui.wizards.IWizardDescriptor; public class LaunchTargetUIManager implements ILaunchTargetUIManager { private Map typeElements; private Map labelProviders = new HashMap<>(); - private IWizardDescriptor[] wizards; + private Map editElements; @Override public synchronized ILabelProvider getLabelProvider(ILaunchTarget target) { @@ -43,13 +49,16 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { .getExtensionPoint(Activator.getDefault().getBundle().getSymbolicName() + ".launchTargetTypeUI"); //$NON-NLS-1$ for (IExtension extension : point.getExtensions()) { for (IConfigurationElement element : extension.getConfigurationElements()) { - String id = element.getAttribute("id"); //$NON-NLS-1$ - if (id != null) { - typeElements.put(id, element); + if ("launchTargetTypeUI".equals(element.getName())) { //$NON-NLS-1$ + String id = element.getAttribute("id"); //$NON-NLS-1$ + if (id != null) { + typeElements.put(id, element); + } } } } } + String typeId = target.getTypeId(); ILabelProvider labelProvider = labelProviders.get(typeId); if (labelProvider == null) { @@ -85,27 +94,66 @@ public class LaunchTargetUIManager implements ILaunchTargetUIManager { } @Override - public synchronized IWizardDescriptor[] getLaunchTargetWizards() { - if (wizards != null) - return wizards; - WizardsRegistryReader reader = new WizardsRegistryReader(Activator.PLUGIN_ID, "launchTargetTypeUI"); //$NON-NLS-1$ - WizardCollectionElement wizardElements = reader.getWizardElements(); - List result = collectWizards(wizardElements, new ArrayList<>()); - wizards = result.toArray(new IWizardDescriptor[result.size()]); - return wizards; + public IWizardDescriptor[] getLaunchTargetWizards() { + // No one one should be using this. The new target wizard is internal. + return null; } - /* we don't show categories we have to flatten the wizards */ - private List collectWizards(WizardCollectionElement element, List result) { - Object[] children = element.getChildren(null); // children are categories - IWizardDescriptor[] wizards = element.getWizards(); - for (IWizardDescriptor desc : wizards) { - result.add(desc); + @Override + public void editLaunchTarget(ILaunchTarget target) { + if (editElements == null) { + // Load them up + editElements = new HashMap<>(); + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint point = registry + .getExtensionPoint(Activator.getDefault().getBundle().getSymbolicName() + ".launchTargetTypeUI"); //$NON-NLS-1$ + for (IExtension extension : point.getExtensions()) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + if ("wizard2".equals(element.getName())) { //$NON-NLS-1$ + String id = element.getAttribute("id"); //$NON-NLS-1$ + if (id != null) { + editElements.put(id, element); + } + } + } + } } - for (Object cat : children) { - WizardCollectionElement category = (WizardCollectionElement) cat; - collectWizards(category, result); + + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + IConfigurationElement element = editElements.get(target.getTypeId()); + if (element != null) { + try { + LaunchTargetWizard wizard = (LaunchTargetWizard) element.createExecutableExtension("class"); //$NON-NLS-1$ + wizard.setLaunchTarget(target); + WizardDialog dialog = wizard.canDelete() ? new LaunchTargetWizardDialog(shell, wizard) + : new WizardDialog(shell, wizard); + dialog.open(); + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + } else { + new PropertyDialogAction(new SameShellProvider(shell), new ISelectionProvider() { + @Override + public void setSelection(ISelection selection) { + // ignore + } + + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + // ignore + } + + @Override + public ISelection getSelection() { + return new StructuredSelection(target); + } + + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + // ignore + } + }).run(); } - return result; } + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java new file mode 100644 index 00000000000..24fdf5aca7a --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.wizard.IWizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.launchbar.ui.target.LaunchTargetWizard; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; + +public class LaunchTargetWizardDialog extends WizardDialog { + + public static final int ID_DELETE = IDialogConstants.CLIENT_ID + 0; + + public LaunchTargetWizardDialog(Shell parentShell, IWizard newWizard) { + super(parentShell, newWizard); + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, ID_DELETE, Messages.LaunchTargetWizardDialog_Delete, false); + + super.createButtonsForButtonBar(parent); + } + + @Override + protected void buttonPressed(int buttonId) { + if (buttonId == ID_DELETE) { + ((LaunchTargetWizard) getWizard()).performDelete(); + setReturnCode(CANCEL); + close(); + } else { + super.buttonPressed(buttonId); + } + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java index 7fb746f169e..45a0d66b47e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java @@ -10,104 +10,33 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.Wizard; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.target.ILaunchTargetUIManager; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWizard; -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.wizards.IWizardDescriptor; +import org.eclipse.launchbar.ui.internal.Messages; /** * The new wizard is responsible for allowing the user to choose which new * (nested) wizard to run. The set of available new wizards comes from the new * extension point. */ -public class NewLaunchTargetWizard extends Wizard implements IWorkbenchWizard { - private NewLaunchTargetWizardSelectionPage mainPage; - private IWorkbench workbench; - private final ILaunchTargetUIManager targetUIManager = Activator.getService(ILaunchTargetUIManager.class); +public class NewLaunchTargetWizard extends Wizard { + + public NewLaunchTargetWizard() { + setForcePreviousAndNextButtons(true); + } /** * Create the wizard pages */ @Override public void addPages() { - mainPage = new NewLaunchTargetWizardSelectionPage(workbench, getWizardDescriptors()); - addPage(mainPage); + addPage(new NewLaunchTargetWizardSelectionPage()); + setWindowTitle(Messages.NewLaunchTargetWizard_Title); } - public IWizardDescriptor[] getWizardDescriptors() { - return targetUIManager.getLaunchTargetWizards(); - } - - /** - * Lazily create the wizards pages - * @param aWorkbench the workbench - * @param currentSelection the current selection - */ - @Override - public void init(IWorkbench aWorkbench, - IStructuredSelection currentSelection) { - this.workbench = aWorkbench; - if (getWindowTitle() == null) { - setWindowTitle(WorkbenchMessages.NewWizard_title); - } - setDefaultPageImageDescriptor(WorkbenchImages - .getImageDescriptor(IWorkbenchGraphicConstants.IMG_WIZBAN_NEW_WIZ)); - setNeedsProgressMonitor(true); - } - - /** - * The user has pressed Finish. Instruct self's pages to finish, and answer - * a boolean indicating success. - * - * @return boolean - */ @Override public boolean performFinish() { - //save our selection state - mainPage.saveWidgetValues(); - // if we're finishing from the main page then perform finish on the selected wizard. - if (getContainer().getCurrentPage() == mainPage) { - if (mainPage.canFinishEarly()) { - IWizard wizard = mainPage.getSelectedNode().getWizard(); - wizard.setContainer(getContainer()); - return wizard.performFinish(); - } - } - return true; + // Downstream wizards do finish + return false; } - @Override - public IDialogSettings getDialogSettings() { - IDialogSettings wizardSettings = super.getDialogSettings(); - if (wizardSettings == null) { - IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings(); - String settingsSection = getClass().getSimpleName(); - wizardSettings = workbenchSettings.getSection(settingsSection); - if (wizardSettings == null) { - wizardSettings = workbenchSettings.addNewSection(settingsSection); - } - setDialogSettings(wizardSettings); - } - return wizardSettings; - } - - @Override - public boolean canFinish() { - // we can finish if the first page is current and the the page can finish early. - if (getContainer().getCurrentPage() == mainPage) { - if (mainPage.canFinishEarly()) { - return true; - } - } - return super.canFinish(); - } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java deleted file mode 100644 index 8cdb42b1811..00000000000 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardNewPage.java +++ /dev/null @@ -1,518 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.target; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.wizard.IWizardContainer; -import org.eclipse.jface.wizard.IWizardContainer2; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbenchWizard; -import org.eclipse.ui.activities.WorkbenchActivityHelper; -import org.eclipse.ui.dialogs.FilteredTree; -import org.eclipse.ui.internal.WorkbenchMessages; -import org.eclipse.ui.internal.dialogs.DialogUtil; -import org.eclipse.ui.internal.dialogs.WizardActivityFilter; -import org.eclipse.ui.internal.dialogs.WizardContentProvider; -import org.eclipse.ui.internal.dialogs.WizardPatternFilter; -import org.eclipse.ui.internal.dialogs.WorkbenchWizardElement; -import org.eclipse.ui.internal.dialogs.WorkbenchWizardNode; -import org.eclipse.ui.model.AdaptableList; -import org.eclipse.ui.model.WorkbenchLabelProvider; -import org.eclipse.ui.wizards.IWizardCategory; -import org.eclipse.ui.wizards.IWizardDescriptor; - -/** - * New wizard selection tab that allows the user to select a registered 'New' - * wizard to be launched. - */ -class NewLaunchTargetWizardNewPage implements ISelectionChangedListener { - // id constants - private static final String DIALOG_SETTING_SECTION_NAME = "NewWizardSelectionPage."; //$NON-NLS-1$ - private final static int SIZING_LISTS_HEIGHT = 200; - private final static int SIZING_VIEWER_WIDTH = 300; - private final static String STORE_EXPANDED_CATEGORIES_ID = DIALOG_SETTING_SECTION_NAME - + "STORE_EXPANDED_CATEGORIES_ID"; //$NON-NLS-1$ - private final static String STORE_SELECTED_ID = DIALOG_SETTING_SECTION_NAME - + "STORE_SELECTED_ID"; //$NON-NLS-1$ - private NewLaunchTargetWizardSelectionPage page; - private FilteredTree filteredTree; - private WizardPatternFilter filteredTreeFilter; - //Keep track of the wizards we have previously selected - private Hashtable selectedWizards = new Hashtable(); - private IDialogSettings settings; - private Button showAllCheck; - private IWizardDescriptor[] primaryWizards; - private CLabel descImageCanvas; - private Map imageTable = new HashMap(); - private IWizardDescriptor selectedElement; - private WizardActivityFilter filter = new WizardActivityFilter(); - private boolean needShowAll; - - /** - * Create an instance of this class - * @param mainPage - * @param wizardCategories - * @param primaryWizards - * @param projectsOnly - */ - public NewLaunchTargetWizardNewPage(NewLaunchTargetWizardSelectionPage mainPage, - IWizardCategory wizardCategories, - IWizardDescriptor[] primaryWizards) { - this.page = mainPage; - this.primaryWizards = primaryWizards; - needShowAll = !allActivityEnabled(primaryWizards); - } - - /** - * @param category the wizard category - * @return whether all of the wizards in the category are enabled via activity filtering - */ - private boolean allActivityEnabled(IWizardDescriptor[] wizards) { - for (int i = 0; i < wizards.length; i++) { - IWizardDescriptor wizard = wizards[i]; - if (WorkbenchActivityHelper.filterItem(wizard)) { - return false; - } - } - return true; - } - - /** - * @since 3.0 - */ - public void activate() { - page.setDescription(WorkbenchMessages.NewWizardNewPage_description); - } - - /** - * Create this tab's visual components - * - * @param parent Composite - * @return Control - */ - protected Control createControl(Composite parent) { - Font wizardFont = parent.getFont(); - // top level group - Composite outerContainer = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - outerContainer.setLayout(layout); - Label wizardLabel = new Label(outerContainer, SWT.NONE); - GridData data = new GridData(SWT.BEGINNING, SWT.FILL, false, true); - outerContainer.setLayoutData(data); - wizardLabel.setFont(wizardFont); - wizardLabel.setText(WorkbenchMessages.NewWizardNewPage_wizardsLabel); - Composite innerContainer = new Composite(outerContainer, SWT.NONE); - layout = new GridLayout(2, false); - layout.marginHeight = 0; - layout.marginWidth = 0; - innerContainer.setLayout(layout); - innerContainer.setFont(wizardFont); - data = new GridData(SWT.FILL, SWT.FILL, true, true); - innerContainer.setLayoutData(data); - filteredTree = createFilteredTree(innerContainer); - createOptionsButtons(innerContainer); - createImage(innerContainer); - updateDescription(null); - // wizard actions pane...create SWT table directly to - // get single selection mode instead of multi selection. - restoreWidgetValues(); - return outerContainer; - } - - /** - * Create a new FilteredTree in the parent. - * - * @param parent the parent Composite. - * @since 3.0 - */ - protected FilteredTree createFilteredTree(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout(layout); - GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); - data.widthHint = SIZING_VIEWER_WIDTH; - data.horizontalSpan = 2; - data.grabExcessHorizontalSpace = true; - data.grabExcessVerticalSpace = true; - boolean needsHint = DialogUtil.inRegularFontMode(parent); - //Only give a height hint if the dialog is going to be too small - if (needsHint) { - data.heightHint = SIZING_LISTS_HEIGHT; - } - composite.setLayoutData(data); - filteredTreeFilter = new WizardPatternFilter(); - FilteredTree filterTree = new FilteredTree(composite, - SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, filteredTreeFilter, true); - filterTree.setQuickSelectionMode(true); - final TreeViewer treeViewer = filterTree.getViewer(); - treeViewer.setContentProvider(new WizardContentProvider()); - treeViewer.setLabelProvider(new WorkbenchLabelProvider()); - //treeViewer.setComparator(NewWizardCollectionComparator.INSTANCE); - treeViewer.addSelectionChangedListener(this); - ArrayList inputArray = new ArrayList(); - for (int i = 0; i < primaryWizards.length; i++) { - inputArray.add(primaryWizards[i]); - } - boolean expandTop = false; - // ensure the category is expanded. If there is a remembered expansion it will be set later. - if (expandTop) { - treeViewer.setAutoExpandLevel(2); - } - AdaptableList input = new AdaptableList(inputArray); - treeViewer.setInput(input); - filterTree.setBackground(parent.getDisplay().getSystemColor( - SWT.COLOR_WIDGET_BACKGROUND)); - treeViewer.getTree().setFont(parent.getFont()); - treeViewer.addDoubleClickListener(new IDoubleClickListener() { - @Override - public void doubleClick(DoubleClickEvent event) { - IStructuredSelection s = (IStructuredSelection) event - .getSelection(); - selectionChanged(new SelectionChangedEvent(event.getViewer(), s)); - Object element = s.getFirstElement(); - if (treeViewer.isExpandable(element)) { - treeViewer.setExpandedState(element, !treeViewer - .getExpandedState(element)); - } else if (element instanceof WorkbenchWizardElement) { - page.advanceToNextPageOrFinish(); - } - } - }); - treeViewer.addFilter(filter); - Dialog.applyDialogFont(filterTree); - return filterTree; - } - - /** - * Create the Show All and help buttons at the bottom of the page. - * - * @param parent the parent composite on which to create the widgets - */ - private void createOptionsButtons(Composite parent) { - if (needShowAll) { - showAllCheck = new Button(parent, SWT.CHECK); - GridData data = new GridData(); - showAllCheck.setLayoutData(data); - showAllCheck.setFont(parent.getFont()); - showAllCheck.setText(WorkbenchMessages.NewWizardNewPage_showAll); - showAllCheck.setSelection(false); - // flipping tabs updates the selected node - showAllCheck.addSelectionListener(new SelectionAdapter() { - // the delta of expanded elements between the last 'show all' - // and the current 'no show all' - private Object[] delta = new Object[0]; - - @Override - public void widgetSelected(SelectionEvent e) { - boolean showAll = showAllCheck.getSelection(); - if (showAll) { - filteredTree.getViewer().getControl().setRedraw(false); - } else { - // get the inital expanded elements when going from show - // all-> no show all. - // this isnt really the delta yet, we're just reusing - // the variable. - delta = filteredTree.getViewer().getExpandedElements(); - } - try { - if (showAll) { - filteredTree.getViewer().resetFilters(); - filteredTree.getViewer().addFilter(filteredTreeFilter); - // restore the expanded elements that were present - // in the last show all state but not in the 'no - // show all' state. - Object[] currentExpanded = filteredTree.getViewer() - .getExpandedElements(); - Object[] expanded = new Object[delta.length - + currentExpanded.length]; - System.arraycopy(currentExpanded, 0, expanded, 0, - currentExpanded.length); - System.arraycopy(delta, 0, expanded, - currentExpanded.length, delta.length); - filteredTree.getViewer().setExpandedElements(expanded); - } else { - filteredTree.getViewer().addFilter(filter); - } - filteredTree.getViewer().refresh(false); - if (!showAll) { - // if we're going from show all -> no show all - // record the elements that were expanded in the - // 'show all' state but not the 'no show all' state - // (because they didnt exist). - Object[] newExpanded = filteredTree.getViewer().getExpandedElements(); - List deltaList = new ArrayList(Arrays.asList(delta)); - deltaList.removeAll(Arrays.asList(newExpanded)); - } - } finally { - if (showAll) { - filteredTree.getViewer().getControl().setRedraw(true); - } - } - } - }); - } - } - - /** - * Create the image controls. - * - * @param parent the parent Composite. - * @since 3.0 - */ - private void createImage(Composite parent) { - descImageCanvas = new CLabel(parent, SWT.NONE); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING - | GridData.VERTICAL_ALIGN_BEGINNING); - data.widthHint = 0; - data.heightHint = 0; - descImageCanvas.setLayoutData(data); - // hook a listener to get rid of cached images. - descImageCanvas.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - for (Iterator i = imageTable.values().iterator(); i.hasNext();) { - ((Image) i.next()).dispose(); - } - imageTable.clear(); - } - }); - } - - /** - * Returns the single selected object contained in the passed - * selectionEvent, or null if the selectionEvent contains - * either 0 or 2+ selected objects. - */ - protected Object getSingleSelection(IStructuredSelection selection) { - return selection.size() == 1 ? selection.getFirstElement() : null; - } - - /** - * Set self's widgets to the values that they held last time this page was - * open - * - */ - protected void restoreWidgetValues() { - //expandPreviouslyExpandedCategories(); - selectPreviouslySelected(); - } - - /** - * Store the current values of self's widgets so that they can be restored - * in the next instance of self - * - */ - public void saveWidgetValues() { - storeSelectedCategoryAndWizard(); - } - - /** - * The user selected either new wizard category(s) or wizard element(s). - * Proceed accordingly. - * - * @param selectionEvent ISelection - */ - @Override - public void selectionChanged(SelectionChangedEvent selectionEvent) { - page.setErrorMessage(null); - page.setMessage(null); - Object selectedObject = getSingleSelection((IStructuredSelection) selectionEvent - .getSelection()); - if (selectedObject instanceof IWizardDescriptor) { - if (selectedObject == selectedElement) { - return; - } - updateWizardSelection((IWizardDescriptor) selectedObject); - } else { - selectedElement = null; - page.setHasPages(false); - page.setCanFinishEarly(false); - page.selectWizardNode(null); - updateDescription(null); - } - } - - /** - * Selects the wizard category and wizard in this page that were selected - * last time this page was used. If a category or wizard that was - * previously selected no longer exists then it is ignored. - */ - protected void selectPreviouslySelected() { - String selectedId = settings.get(STORE_SELECTED_ID); - if (selectedId == null) { - return; - } - Object selected = null; - for (int i = 0; i < primaryWizards.length; i++) { - IWizardDescriptor wizard = primaryWizards[i]; - if (wizard.getId().equals(selectedId)) { - selected = wizard; - break; - } - } - if (selected == null) { - // if we cant find either a category or a wizard, abort. - return; - } - //work around for 62039 - final StructuredSelection selection = new StructuredSelection(selected); - filteredTree.getViewer().getControl().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - filteredTree.getViewer().setSelection(selection, true); - } - }); - } - - /** - * Set the dialog store to use for widget value storage and retrieval - * - * @param settings IDialogSettings - */ - public void setDialogSettings(IDialogSettings settings) { - this.settings = settings; - } - - - /** - * Stores the currently-selected element in this page's dialog store, in - * order to recreate this page's state in the next instance of this page. - */ - protected void storeSelectedCategoryAndWizard() { - Object selected = getSingleSelection((IStructuredSelection) filteredTree - .getViewer().getSelection()); - if (selected != null) { - if (selected instanceof IWizardCategory) { - settings.put(STORE_SELECTED_ID, - ((IWizardCategory) selected).getPath() - .toString()); - } else { - // else its a wizard - settings.put(STORE_SELECTED_ID, - ((IWizardDescriptor) selected).getId()); - } - } - } - - /** - * Update the current description controls. - * - * @param selectedObject the new wizard - * @since 3.0 - */ - private void updateDescription(IWizardDescriptor selectedObject) { - String string = ""; //$NON-NLS-1$ - if (selectedObject != null) { - string = selectedObject.getDescription(); - } - page.setDescription(string); - if (hasImage(selectedObject)) { - ImageDescriptor descriptor = null; - if (selectedObject != null) { - descriptor = selectedObject.getDescriptionImage(); - } - if (descriptor != null) { - GridData data = (GridData) descImageCanvas.getLayoutData(); - data.widthHint = SWT.DEFAULT; - data.heightHint = SWT.DEFAULT; - Image image = (Image) imageTable.get(descriptor); - if (image == null) { - image = descriptor.createImage(false); - imageTable.put(descriptor, image); - } - descImageCanvas.setImage(image); - } - } else { - GridData data = (GridData) descImageCanvas.getLayoutData(); - data.widthHint = 0; - data.heightHint = 0; - descImageCanvas.setImage(null); - } - descImageCanvas.getParent().layout(true); - filteredTree.getViewer().getTree().showSelection(); - IWizardContainer container = page.getWizard().getContainer(); - if (container instanceof IWizardContainer2) { - ((IWizardContainer2) container).updateSize(); - } - } - - /** - * Tests whether the given wizard has an associated image. - * - * @param selectedObject the wizard to test - * @return whether the given wizard has an associated image - */ - private boolean hasImage(IWizardDescriptor selectedObject) { - if (selectedObject == null) { - return false; - } - if (selectedObject.getDescriptionImage() != null) { - return true; - } - return false; - } - - /** - * @param selectedObject - */ - private void updateWizardSelection(IWizardDescriptor selectedObject) { - selectedElement = selectedObject; - WorkbenchWizardNode selectedNode; - if (selectedWizards.containsKey(selectedObject)) { - selectedNode = (WorkbenchWizardNode) selectedWizards - .get(selectedObject); - } else { - selectedNode = new WorkbenchWizardNode(page, selectedObject) { - @Override - public IWorkbenchWizard createWizard() throws CoreException { - return wizardElement.createWizard(); - } - }; - selectedWizards.put(selectedObject, selectedNode); - } - page.setCanFinishEarly(selectedObject.canFinishEarly()); - page.setHasPages(selectedObject.hasPages()); - page.selectWizardNode(selectedNode); - updateDescription(selectedObject); - } -} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java index 4e13b15d821..ae11b1a9738 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -10,111 +10,156 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.wizard.WizardDialog; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.target.LaunchTargetWizard; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.internal.IWorkbenchHelpContextIds; -import org.eclipse.ui.internal.WorkbenchMessages; -import org.eclipse.ui.internal.activities.ws.WorkbenchTriggerPoints; -import org.eclipse.ui.internal.dialogs.WorkbenchWizardSelectionPage; -import org.eclipse.ui.wizards.IWizardDescriptor; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.ui.IWorkbenchWizard; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.plugin.AbstractUIPlugin; -/** - * New wizard selection tab that allows the user to either select a - * registered 'New' wizard to be launched, or to select a solution or - * projects to be retrieved from an available server. This page - * contains two visual tabs that allow the user to perform these tasks. - * - * Temporarily has two inner pages. The new format page is used if the system - * is currently aware of activity categories. - */ -class NewLaunchTargetWizardSelectionPage extends WorkbenchWizardSelectionPage { - // widgets - private NewLaunchTargetWizardNewPage newResourcePage; - private IWizardDescriptor[] wizards; - private boolean canFinishEarly = false, hasPages = true; +class NewLaunchTargetWizardSelectionPage extends WizardPage { - /** - * Create an instance of this class. - * - * @param workbench the workbench - * @param wizards the primary wizard elements - */ - public NewLaunchTargetWizardSelectionPage(IWorkbench workbench, - IWizardDescriptor[] wizards) { - super("newWizardSelectionPage", workbench, null, null, WorkbenchTriggerPoints.NEW_WIZARDS);//$NON-NLS-1$ - setTitle(WorkbenchMessages.NewWizardSelectionPage_description); - this.wizards = wizards; - } + private Table table; - /** - * Makes the next page visible. - */ - public void advanceToNextPageOrFinish() { - if (canFlipToNextPage()) { - getContainer().showPage(getNextPage()); - } else if (canFinishEarly()) { - if (getWizard().performFinish()) { - ((WizardDialog) getContainer()).close(); - } - } + public NewLaunchTargetWizardSelectionPage() { + super(NewLaunchTargetWizardSelectionPage.class.getName()); } @Override public void createControl(Composite parent) { - IDialogSettings settings = getDialogSettings(); - newResourcePage = new NewLaunchTargetWizardNewPage(this, null, wizards); - newResourcePage.setDialogSettings(settings); - Control control = newResourcePage.createControl(parent); - getWorkbench().getHelpSystem().setHelp(control, - IWorkbenchHelpContextIds.NEW_WIZARD_SELECTION_WIZARD_PAGE); - setControl(control); + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout()); + + table = new Table(comp, SWT.BORDER | SWT.SINGLE); + table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + List elements = new ArrayList<>(); + IExtensionPoint point = Platform.getExtensionRegistry() + .getExtensionPoint(Activator.PLUGIN_ID + ".launchTargetTypeUI"); //$NON-NLS-1$ + for (IExtension extension : point.getExtensions()) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String elementName = element.getName(); + if ("wizard2".equals(elementName) || "wizard".equals(elementName)) { //$NON-NLS-1$ //$NON-NLS-2$ + elements.add(element); + } + } + } + + elements.sort(new Comparator() { + @Override + public int compare(IConfigurationElement o1, IConfigurationElement o2) { + String name1 = o1.getAttribute("name"); //$NON-NLS-1$ + String name2 = o2.getAttribute("name"); //$NON-NLS-1$ + return name1.compareTo(name2); + } + }); + + for (IConfigurationElement element : elements) { + String name = element.getAttribute("name"); //$NON-NLS-1$ + TableItem item = new TableItem(table, SWT.NONE); + item.setText(name); + + String iconFile = element.getAttribute("icon"); //$NON-NLS-1$ + if (iconFile != null) { + ImageDescriptor desc = Activator.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), iconFile); + if (desc != null) { + item.setImage(desc.createImage()); + } + } + + item.setData(element); + } + + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + getContainer().updateButtons(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + if (canFlipToNextPage()) { + getContainer().showPage(getNextPage()); + } + } + }); + + setControl(comp); } - /** - * Since Finish was pressed, write widget values to the dialog store so that they - *will persist into the next invocation of this wizard page - */ - protected void saveWidgetValues() { - newResourcePage.saveWidgetValues(); + @Override + public void dispose() { + for (TableItem item : table.getItems()) { + Object obj = item.getData(); + if (obj instanceof Wizard) { + ((Wizard) obj).dispose(); + } + } + super.dispose(); + } + + public ImageDescriptor getDescriptionImage(IConfigurationElement element) { + String descImage = element.getAttribute("icon"); //$NON-NLS-1$ + if (descImage == null) { + return null; + } + return AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), descImage); } @Override public boolean canFlipToNextPage() { - // if the current page advertises that it does have pages then ask it via the super call - if (hasPages) { - return super.canFlipToNextPage(); + return table.getSelectionIndex() >= 0; + } + + @Override + public IWizardPage getNextPage() { + int i = table.getSelectionIndex(); + if (i >= 0) { + TableItem item = table.getItem(i); + Object obj = item.getData(); + Wizard nextWizard; + if (obj instanceof IConfigurationElement) { + IConfigurationElement element = (IConfigurationElement) obj; + try { + nextWizard = (Wizard) element.createExecutableExtension("class"); //$NON-NLS-1$ + nextWizard.addPages(); + if (nextWizard instanceof IWorkbenchWizard) { + ((IWorkbenchWizard) nextWizard).init(PlatformUI.getWorkbench(), new StructuredSelection()); + } + item.setData(nextWizard); + } catch (CoreException e) { + Activator.log(e); + return null; + } + } else { + nextWizard = (LaunchTargetWizard) obj; + } + + return nextWizard.getStartingPage(); } - return false; + return super.getNextPage(); } - /** - * Sets whether the selected wizard advertises that it does provide pages. - * - * @param newValue whether the selected wizard has pages - * @since 3.1 - */ - public void setHasPages(boolean newValue) { - hasPages = newValue; - } - - /** - * Sets whether the selected wizard advertises that it can finish early. - * - * @param newValue whether the selected wizard can finish early - */ - public void setCanFinishEarly(boolean newValue) { - canFinishEarly = newValue; - } - - /** - * Answers whether the currently selected page, if any, advertises that it may finish early. - * - * @return whether the page can finish early - */ - public boolean canFinishEarly() { - return canFinishEarly; - } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java index f29dde373d9..4e2a99c1998 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java @@ -25,5 +25,19 @@ public interface ILaunchTargetUIManager { */ ILabelProvider getLabelProvider(ILaunchTarget target); + /** + * @deprecated this should never have been in the interface, now returns null + * @return null + */ + @Deprecated public IWizardDescriptor[] getLaunchTargetWizards(); + + /** + * Open a dialog to edit the specified launch target. + * + * @param target + * launch target to edit + */ + void editLaunchTarget(ILaunchTarget target); + } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java new file mode 100644 index 00000000000..a2100b70fa8 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.target; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.launchbar.core.target.ILaunchTarget; + +public abstract class LaunchTargetWizard extends Wizard { + + protected ILaunchTarget launchTarget; + + public void setLaunchTarget(ILaunchTarget launchTarget) { + this.launchTarget = launchTarget; + } + + public ILaunchTarget getLaunchTarget() { + return launchTarget; + } + + public boolean canDelete() { + return false; + } + + public void performDelete() { + // do nothing by default + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java index dff15f08065..83a65250ff4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java @@ -1,140 +1,27 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2017 QNX Software Systems 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: - * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.launchbar.ui.target; import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.ui.internal.target.NewLaunchTargetWizard; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.*; -import org.eclipse.ui.internal.IWorkbenchHelpContextIds; -import org.eclipse.ui.internal.WorkbenchMessages; -import org.eclipse.ui.internal.WorkbenchPlugin; /** - * Invoke the resource creation wizard selection Wizard. - *

- * This class may be instantiated; it is not intended to be subclassed. - *

- *

- * This method automatically registers listeners so that it can keep its - * enablement state up to date. Ordinarily, the window's references to these - * listeners will be dropped automatically when the window closes. However, - * if the client needs to get rid of an action while the window is still open, - * the client must call #dispose() to give the - * action an opportunity to deregister its listeners and to perform any other - * cleanup. - *

- * @noextend This class is not intended to be subclassed by clients. + * Open the new launch target wizard. */ -public class NewLaunchTargetWizardAction extends Action implements - ActionFactory.IWorkbenchAction { - /** - * The wizard dialog width - */ - private static final int SIZING_WIZARD_WIDTH = 500; - /** - * The wizard dialog height - */ - private static final int SIZING_WIZARD_HEIGHT = 500; - /** - * The title of the wizard window or null to use the default - * wizard window title. - */ - private String windowTitle = null; - /** - * The workbench window; or null if this - * action has been disposed. - */ - private IWorkbenchWindow workbenchWindow; - - /** - * Create a new instance of this class. - */ - public NewLaunchTargetWizardAction() { - super(WorkbenchMessages.NewWizardAction_text); - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window == null) { - throw new IllegalArgumentException(); - } - this.workbenchWindow = window; - // @issues should be IDE-specific images - ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); - setImageDescriptor(images - .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); - setDisabledImageDescriptor(images - .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED)); - setToolTipText(WorkbenchMessages.NewWizardAction_toolTip); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, - IWorkbenchHelpContextIds.NEW_ACTION); - } - - /** - *

- * Sets the title of the wizard window - *

- * - *

- * If the title of the wizard window is null, the default - * wizard window title will be used. - *

- * - * @param windowTitle - * The title of the wizard window, otherwise null - * (default wizard window title). - * - * @since 3.6 - */ - public void setWizardWindowTitle(String windowTitle) { - this.windowTitle = windowTitle; - } +public class NewLaunchTargetWizardAction extends Action { @Override public void run() { - if (workbenchWindow == null) { - // action has been disposed - return; - } - NewLaunchTargetWizard wizard = new NewLaunchTargetWizard(); - wizard.setWindowTitle(windowTitle); - wizard.init(workbenchWindow.getWorkbench(), null); - IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings(); - String settingsSection = getClass().getSimpleName(); - IDialogSettings wizardSettings = workbenchSettings.getSection(settingsSection); - if (wizardSettings == null) { - wizardSettings = workbenchSettings.addNewSection(settingsSection); - } - wizard.setDialogSettings(wizardSettings); - wizard.setForcePreviousAndNextButtons(true); - Shell parent = workbenchWindow.getShell(); - WizardDialog dialog = new WizardDialog(parent, wizard); - dialog.create(); - dialog.getShell().setSize( - Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), - SIZING_WIZARD_HEIGHT); - PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), - IWorkbenchHelpContextIds.NEW_WIZARD); - dialog.open(); + Wizard wizard = new NewLaunchTargetWizard(); + new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard).open(); } - @Override - public void dispose() { - if (workbenchWindow == null) { - // action has already been disposed - return; - } - workbenchWindow = null; - } } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index f1211ff6627..f898541b011 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -18,7 +18,6 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; @@ -27,7 +26,6 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.launchbar.core.internal.Activator; -import org.eclipse.launchbar.core.internal.LaunchBarManager2Test; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.junit.After; @@ -54,7 +52,7 @@ public class PerTargetLaunchConfigProviderTest { null); localTarget = mock(ILaunchTarget.class); - doReturn("Local").when(localTarget).getName(); + doReturn("Local").when(localTarget).getId(); doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); doReturn(localTarget).when(targetManager).getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, "Local"); @@ -62,7 +60,7 @@ public class PerTargetLaunchConfigProviderTest { // other mocked remote connections otherTarget = mock(ILaunchTarget.class); doReturn("otherTargetType").when(otherTarget).getTypeId(); - doReturn("otherTarget").when(otherTarget).getName(); + doReturn("otherTarget").when(otherTarget).getId(); doReturn(otherTarget).when(targetManager).getLaunchTarget("otherTargetType", "otherTarget"); doReturn(new ILaunchTarget[] { localTarget, otherTarget }).when(targetManager).getLaunchTargets(); @@ -94,7 +92,7 @@ public class PerTargetLaunchConfigProviderTest { public class PerTargetLaunchConfigProvider1 extends PerTargetLaunchConfigProvider { public static final String CONNECTION_NAME_ATTR = "connectionName"; - private ILaunchBarManager manager; + private ILaunchBarManager manager = mock(ILaunchBarManager.class); @Override public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { @@ -111,7 +109,7 @@ public class PerTargetLaunchConfigProviderTest { protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { super.populateLaunchConfiguration(descriptor, target, workingCopy); - workingCopy.setAttribute(CONNECTION_NAME_ATTR, target.getName()); + workingCopy.setAttribute(CONNECTION_NAME_ATTR, target.getId()); } @Override @@ -122,9 +120,9 @@ public class PerTargetLaunchConfigProviderTest { @Override protected ILaunchTarget getLaunchTarget(ILaunchConfiguration configuration) throws CoreException { String name = configuration.getAttribute(CONNECTION_NAME_ATTR, ""); - if (localTarget.getName().equals(name)) { + if (localTarget.getId().equals(name)) { return localTarget; - } else if (otherTarget.getName().equals(name)) { + } else if (otherTarget.getId().equals(name)) { return otherTarget; } else { return null; @@ -133,9 +131,6 @@ public class PerTargetLaunchConfigProviderTest { @Override protected ILaunchBarManager getManager() { - if (manager == null) { - manager = mock(ILaunchBarManager.class); - } return manager; } @@ -230,7 +225,7 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration1); ILaunchConfigurationWorkingCopy wc = launchConfiguration1.getWorkingCopy(); - wc.setAttribute(PerTargetLaunchConfigProvider1.CONNECTION_NAME_ATTR, otherTarget.getName()); + wc.setAttribute(PerTargetLaunchConfigProvider1.CONNECTION_NAME_ATTR, otherTarget.getId()); wc.doSave(); provider.launchConfigurationChanged(launchConfiguration1); // provider.launchConfigurationChanged(lc3); @@ -244,13 +239,15 @@ public class PerTargetLaunchConfigProviderTest { ILaunchConfiguration launchConfiguration1 = provider.getLaunchConfiguration(descriptor, localTarget); assertNotNull(launchConfiguration1); ILaunchConfigurationWorkingCopy wc = launchConfiguration1.getWorkingCopy(); - wc.setAttribute(LaunchBarManager2Test.ATTR_ORIGINAL_NAME, "bla"); + wc.rename("blah"); launchConfiguration1 = wc.doSave(); provider.launchConfigurationChanged(launchConfiguration1); - // we should have lost ownership - assertFalse(provider.ownsLaunchConfiguration(launchConfiguration1)); - verify(provider.manager).launchConfigurationRemoved(launchConfiguration1); - verify(provider.manager).launchConfigurationAdded(launchConfiguration1); + // we should still maintain ownership on a rename + assertTrue(provider.ownsLaunchConfiguration(launchConfiguration1)); + // provider not hooked up properly to verify these. + // TODO not sure this test is valid as a result + // verify(provider.manager).launchConfigurationAdded(launchConfiguration1); + // verify(provider.manager).launchConfigurationRemoved(launchConfiguration1); // have to fake out the remove provider.launchConfigurationRemoved(launchConfiguration1); ILaunchConfiguration launchConfiguration2 = provider.getLaunchConfiguration(descriptor, localTarget); From 36555cd219d98ad6b4cdce2f6698969b273ea863 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 3 Oct 2017 13:58:17 -0400 Subject: [PATCH 146/198] Fix up the description in launch object provider init. Change-Id: I52d440721e4e2be948ea18814a0eeb6b31eb8217 --- .../org/eclipse/launchbar/core/ILaunchObjectProvider.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java index 59525dd87ac..663a0cb660e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java @@ -19,10 +19,11 @@ import org.eclipse.core.runtime.CoreException; public interface ILaunchObjectProvider { /** - * Add initial launch descriptors and set up for new ones. + * Add initial launch objects and set up listeners for new ones. * - * @param launchbar manager - * @throws CoreException + * @param launchbar + * manager + * @throws CoreException */ void init(ILaunchBarManager manager) throws CoreException; From bc661996aa1be1bfd9c52c613f0abdb28e782140 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 13 Oct 2017 12:07:33 -0400 Subject: [PATCH 147/198] Combine Mode and Type into a single page for new configs. Change-Id: Ic8c6a4580ecd7dcb4435b204c10f37703ad1443a --- .../launchbar/ui/NewLaunchConfigWizard.java | 61 +----- .../launchbar/ui/internal/Messages.java | 4 + .../dialogs/NewLaunchConfigTypePage2.java | 200 ++++++++++++++++++ .../launchbar/ui/internal/messages.properties | 4 +- 4 files changed, 216 insertions(+), 53 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java index b6adf46ac13..66cac5a4b21 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java @@ -19,28 +19,25 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationListener; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchMode; -import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.wizard.IWizardContainer; import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigEditPage; -import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigModePage; -import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigTypePage; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Composite; +import org.eclipse.launchbar.ui.internal.dialogs.NewLaunchConfigTypePage2; public class NewLaunchConfigWizard extends Wizard implements ILaunchConfigurationListener { - private NewLaunchConfigModePage modePage = new NewLaunchConfigModePage(); - private NewLaunchConfigTypePage typePage = new NewLaunchConfigTypePage(); - private NewLaunchConfigEditPage editPage = new NewLaunchConfigEditPage(); + private NewLaunchConfigTypePage2 typePage; + private NewLaunchConfigEditPage editPage; private List configsToDelete = new ArrayList<>(); public NewLaunchConfigWizard() { + editPage = new NewLaunchConfigEditPage(); + typePage = new NewLaunchConfigTypePage2(editPage); + setWindowTitle(Messages.NewLaunchConfigWizard_0); // while the wizard is open, some ill behaved launch config tabs save the working copy. @@ -50,46 +47,6 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this); } - @Override - public void createPageControls(Composite pageContainer) { - super.createPageControls(pageContainer); - - // Link the pages - SelectionListener modePageListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - ILaunchGroup selectedGroup = modePage.getSelectedGroup(); - typePage.setLaunchGroup(selectedGroup); - editPage.setLaunchGroup(selectedGroup); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - getContainer().showPage(modePage.getNextPage()); - } - }; - modePage.addGroupSelectionListener(modePageListener); - modePageListener.widgetSelected(null); - - SelectionListener typePageListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - editPage.setLaunchConfigType(typePage.getSelectedType()); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - getContainer().showPage(typePage.getNextPage()); - } - }; - typePage.addTypeSelectionListener(typePageListener); - typePageListener.widgetSelected(null); - - editPage.setLaunchConfigType(typePage.getSelectedType()); - } - @Override public void setContainer(IWizardContainer wizardContainer) { super.setContainer(wizardContainer); @@ -102,7 +59,6 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio @Override public void addPages() { - addPage(modePage); addPage(typePage); addPage(editPage); } @@ -120,8 +76,9 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio } public ILaunchMode getLaunchMode() { - String initMode = modePage.getSelectedGroup().getMode(); - return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(initMode); + // TODO we want to make sure the newly created config has the right mode + // selected in the launch bar + return null; } @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index e220d9b1e10..105892d1fff 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -31,6 +31,10 @@ public class Messages extends NLS { public static String NewLaunchConfigTypePage_0; public static String NewLaunchConfigTypePage_1; public static String NewLaunchConfigTypePage_2; + + public static String NewLaunchConfigTypePage2_Mode; + + public static String NewLaunchConfigTypePage2_Type; public static String NewLaunchConfigWizard_0; public static String NewLaunchTargetWizard_Title; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java new file mode 100644 index 00000000000..b33a13278df --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java @@ -0,0 +1,200 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.dialogs; + +import java.util.Arrays; +import java.util.Comparator; + +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; + +public class NewLaunchConfigTypePage2 extends WizardPage { + + private final NewLaunchConfigEditPage editPage; + + private Table modeTable; + private Table typeTable; + + public NewLaunchConfigTypePage2(NewLaunchConfigEditPage editPage) { + super(NewLaunchConfigTypePage2.class.getName()); + this.editPage = editPage; + setTitle(Messages.NewLaunchConfigTypePage_1); + setDescription(Messages.NewLaunchConfigTypePage_2); + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout()); + + Group modeGroup = new Group(comp, SWT.NONE); + modeGroup.setText(Messages.NewLaunchConfigTypePage2_Mode); + modeGroup.setLayout(new GridLayout()); + modeGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + modeTable = new Table(modeGroup, SWT.SINGLE | SWT.BORDER); + GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); + data.heightHint = 100; + modeTable.setLayoutData(data); + modeTable.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + modeChanged(); + } + }); + + Group typeGroup = new Group(comp, SWT.NONE); + typeGroup.setText(Messages.NewLaunchConfigTypePage2_Type); + typeGroup.setLayout(new GridLayout()); + typeGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + typeTable = new Table(typeGroup, SWT.SINGLE | SWT.BORDER); + typeTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + typeTable.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + typeChanged(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + getContainer().showPage(getNextPage()); + } + }); + + populateMode(); + + setControl(comp); + } + + private void populateMode() { + int select = -1; + + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { + if (group.getMode().equals("run")) { //$NON-NLS-1$ + if (createModeItem(modeTable, group)) { + select++; + } + } + } + + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { + if (group.getMode().equals("debug")) { //$NON-NLS-1$ + if (createModeItem(modeTable, group)) { + select++; + } + } + } + + for (ILaunchGroup group : DebugUITools.getLaunchGroups()) { + if (!group.getMode().equals("run") && !group.getMode().equals("debug")) { //$NON-NLS-1$ //$NON-NLS-2$ + createModeItem(modeTable, group); + } + } + + if (select >= 0) { + modeTable.select(select); + modeChanged(); + } else if (modeTable.getItemCount() > 0) { + modeTable.select(0); + modeChanged(); + } else { + setPageComplete(false); + } + } + + private boolean createModeItem(Table table, ILaunchGroup group) { + if (group.getCategory() != null || !group.isPublic()) + return false; + + TableItem item = new TableItem(table, SWT.NONE); + item.setText(group.getLabel().replace("&", "")); //$NON-NLS-1$ //$NON-NLS-2$ + ImageDescriptor imageDesc = group.getImageDescriptor(); + if (imageDesc != null) { + item.setImage(imageDesc.createImage()); + } + item.setData(group); + + return true; + } + + private void modeChanged() { + TableItem[] selection = modeTable.getSelection(); + if (selection.length == 0) { + editPage.setLaunchGroup(null); + setPageComplete(false); + return; + } + + ILaunchGroup group = (ILaunchGroup) selection[0].getData(); + editPage.setLaunchGroup(group); + + ILaunchConfigurationType[] types = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); + Arrays.sort(types, new Comparator() { + @Override + public int compare(ILaunchConfigurationType type0, ILaunchConfigurationType type1) { + int comp = type0.getPluginIdentifier().compareTo(type1.getPluginIdentifier()); + if (comp != 0) { + return comp; + } else { + return type0.getName().compareTo(type1.getName()); + } + } + }); + + typeTable.removeAll(); + for (ILaunchConfigurationType type : types) { + if (!type.isPublic() || type.getCategory() != null || !type.supportsMode(group.getMode())) + continue; + + TableItem item = new TableItem(typeTable, SWT.NONE); + item.setText(type.getName()); + ImageDescriptor imageDesc = DebugUITools.getDefaultImageDescriptor(type); + if (imageDesc != null) + item.setImage(imageDesc.createImage()); + item.setData(type); + } + + if (typeTable.getItemCount() > 0) { + typeTable.select(0); + typeChanged(); + } else { + setPageComplete(false); + } + } + + private void typeChanged() { + TableItem[] selection = typeTable.getSelection(); + if (selection.length == 0) { + editPage.setLaunchConfigType(null); + setPageComplete(false); + return; + } + + ILaunchConfigurationType type = (ILaunchConfigurationType) selection[0].getData(); + editPage.setLaunchConfigType(type); + setPageComplete(true); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 8f0cabb106c..4e66d904734 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -23,7 +23,9 @@ NewLaunchConfigModePage_1=Initial Launch Mode NewLaunchConfigModePage_2=Select initial launch mode. NewLaunchConfigTypePage_0=Select Launch Configuration Type NewLaunchConfigTypePage_1=Launch Configuration Type -NewLaunchConfigTypePage_2=Select the type of launch configuration to create. +NewLaunchConfigTypePage_2=Select the mode and type of the launch configuration to create. +NewLaunchConfigTypePage2_Mode=Launch Mode +NewLaunchConfigTypePage2_Type=Launch Configuration Type NewLaunchConfigWizard_0=Create Launch Configuration NewLaunchTargetWizard_Title=New Launch Target From 82279154738dce7a6bb1cb6c7a61888789a6e47a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Sat, 14 Oct 2017 15:40:27 -0400 Subject: [PATCH 148/198] Add SWTBot tests including one to test creating launch configs. Change-Id: Ia5032df7094be215ebefd9c2fb7caa35a9cb7f43 --- .../META-INF/MANIFEST.MF | 2 +- .../ui/controls/internal/CSelector.java | 2 + .../ui/controls/internal/ConfigSelector.java | 7 +- .../controls/internal/LaunchBarWidgetIds.java | 20 ++++ pom.xml | 16 +++- .../org.eclipse.launchbar.ui.tests/.classpath | 7 ++ tests/org.eclipse.launchbar.ui.tests/.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../META-INF/MANIFEST.MF | 15 +++ .../build.properties | 4 + tests/org.eclipse.launchbar.ui.tests/pom.xml | 44 +++++++++ .../launchbar/ui/tests/SWTBotCSelector.java | 65 +++++++++++++ .../ui/tests/SWTBotConfigSelector.java | 93 +++++++++++++++++++ .../ui/tests/internal/Activator.java | 29 ++++++ .../internal/AutomatedIntegrationSuite.java | 17 ++++ .../internal/CreateLaunchConfigTests.java | 83 +++++++++++++++++ 16 files changed, 428 insertions(+), 11 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java create mode 100644 tests/org.eclipse.launchbar.ui.tests/.classpath create mode 100644 tests/org.eclipse.launchbar.ui.tests/.project create mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF create mode 100644 tests/org.eclipse.launchbar.ui.tests/build.properties create mode 100644 tests/org.eclipse.launchbar.ui.tests/pom.xml create mode 100644 tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java create mode 100644 tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java create mode 100644 tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java create mode 100644 tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java create mode 100644 tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index 77965c7a60d..393397e6fcb 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -19,4 +19,4 @@ Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.eclipse.launchbar.ui.controls.internal;x-internal:=true +Export-Package: org.eclipse.launchbar.ui.controls.internal;x-friends:="org.eclipse.launchbar.ui.tests" diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index cf18ca56d22..1b11aa03ea1 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -264,6 +264,7 @@ public abstract class CSelector extends Composite { arrow.addMouseListener(mouseListener); if (editable) { final EditButton editButton = new EditButton(buttonComposite, SWT.NONE); + editButton.setData(LaunchBarWidgetIds.ID, LaunchBarWidgetIds.EDIT); editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); editButton.setBackground(getBackground()); editButton.addSelectionListener(new SelectionAdapter() { @@ -303,6 +304,7 @@ public abstract class CSelector extends Composite { popup.dispose(); } popup = new Shell(getShell(), SWT.TOOL | SWT.ON_TOP | SWT.RESIZE); + popup.setData(LaunchBarWidgetIds.ID, LaunchBarWidgetIds.POPUP); popup.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); popup.setBackground(getBackground()); listViewer = new LaunchBarListViewer(popup); diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java index a0107cdc858..41aa4ed4638 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java @@ -51,6 +51,7 @@ public class ConfigSelector extends CSelector { public ConfigSelector(Composite parent, int style) { super(parent, style); + setData(LaunchBarWidgetIds.ID, LaunchBarWidgetIds.CONFIG_SELECTOR); setToolTipText(Messages.ConfigSelector_1); defaultProvider = new DefaultDescriptorLabelProvider(); @@ -166,6 +167,7 @@ public class ConfigSelector extends CSelector { @Override public void createActionArea(Composite parent) { final Composite createButton = new Composite(parent, SWT.BORDER); + createButton.setData(LaunchBarWidgetIds.ID, LaunchBarWidgetIds.NEW); GridDataFactory.fillDefaults().grab(true, false).applyTo(createButton); GridLayoutFactory.fillDefaults().margins(7, 7).applyTo(createButton); createButton.setBackground(getBackground()); @@ -230,9 +232,4 @@ public class ConfigSelector extends CSelector { super.setSelection(element); } - @Override - public void openPopup() { - super.openPopup(); - } - } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java new file mode 100644 index 00000000000..e749c29bddb --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.controls.internal; + +public interface LaunchBarWidgetIds { + + public static final String ID = "org.eclipse.swtbot.widget.key"; //$NON-NLS-1$ + + public static final String CONFIG_SELECTOR = "org.eclipse.launchbar.selector.config"; //$NON-NLS-1$ + + public static final String POPUP = "org.eclipse.launchbar.popup"; //$NON-NLS-1$ + public static final String EDIT = "org.eclipse.launchbar.edit"; //$NON-NLS-1$ + public static final String NEW = "org.eclipse.launchbar.new"; //$NON-NLS-1$ + +} diff --git a/pom.xml b/pom.xml index 24172d34e3d..ae9f6fbf8d5 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.6/ + http://download.eclipse.org/eclipse/updates/4.7/ p2 @@ -48,19 +48,24 @@ http://download.eclipse.org/cbi/updates/license/ p2 - + cdt - http://download.eclipse.org/tools/cdt/releases/9.0 + http://download.eclipse.org/tools/cdt/releases/9.2/ p2 remote - http://download.eclipse.org/tools/ptp/updates/remote/neon/ + http://download.eclipse.org/tools/ptp/builds/remote/oxygen/milestones/ + p2 + + + swtbot + http://download.eclipse.org/technology/swtbot/snapshots/ p2 @@ -71,6 +76,7 @@ bundles/org.eclipse.launchbar.ui.controls features/org.eclipse.launchbar tests/org.eclipse.launchbar.core.tests + tests/org.eclipse.launchbar.ui.tests bundles/org.eclipse.launchbar.remote.core bundles/org.eclipse.launchbar.remote.ui diff --git a/tests/org.eclipse.launchbar.ui.tests/.classpath b/tests/org.eclipse.launchbar.ui.tests/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/org.eclipse.launchbar.ui.tests/.project b/tests/org.eclipse.launchbar.ui.tests/.project new file mode 100644 index 00000000000..4883f55ece3 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.launchbar.ui.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..16c10fa07a4 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Launch Bar UI Tests +Bundle-SymbolicName: org.eclipse.launchbar.ui.tests +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Eclipse CDT +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.junit;bundle-version="4.12.0", + org.eclipse.swtbot.go;bundle-version="2.7.0", + org.eclipse.debug.core;bundle-version="3.11.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.launchbar.ui.controls.internal +Bundle-Activator: org.eclipse.launchbar.ui.tests.internal.Activator diff --git a/tests/org.eclipse.launchbar.ui.tests/build.properties b/tests/org.eclipse.launchbar.ui.tests/build.properties new file mode 100644 index 00000000000..34d2e4d2dad --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml new file mode 100644 index 00000000000..7442a5a8558 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + + org.eclipse.launchbar + 1.0.0-SNAPSHOT + ../../pom.xml + parent + + + org.eclipse.launchbar.ui.tests + 1.0.0-SNAPSHOT + eclipse-test-plugin + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + + true + false + + **/AutomatedIntegrationSuite.* + + true + + + p2-installable-unit + org.eclipse.sdk.feature.group + + + org.eclipse.sdk.ide + + + + + + \ No newline at end of file diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java new file mode 100644 index 00000000000..25b74498220 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.tests; + +import org.eclipse.launchbar.ui.controls.internal.CSelector; +import org.eclipse.launchbar.ui.controls.internal.LaunchBarWidgetIds; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swtbot.swt.finder.SWTBot; +import org.eclipse.swtbot.swt.finder.SWTBotWidget; +import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; +import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory; +import org.eclipse.swtbot.swt.finder.results.Result; +import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl; + +@SWTBotWidget(clasz = CSelector.class, preferredName = "cselector") +public class SWTBotCSelector extends AbstractSWTBotControl { + + public static SWTBotCSelector withId(String id) throws WidgetNotFoundException { + return new SWTBotCSelector(new SWTBot().widget(WidgetMatcherFactory.withId(id))); + } + + public SWTBotCSelector(CSelector w) throws WidgetNotFoundException { + super(w); + } + + public SWTBot bot() { + return new SWTBot(widget); + } + + public void click(int x, int y) { + notify(SWT.MouseEnter); + notify(SWT.MouseMove); + notify(SWT.Activate); + notify(SWT.FocusIn); + notify(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); + notify(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); + } + + @Override + public SWTBotCSelector click() { + Point size = syncExec(new Result() { + @Override + public Point run() { + return widget.getSize(); + } + }); + click(size.x / 2, size.y / 2); + return this; + } + + public void clickEdit() { + bot().buttonWithId(LaunchBarWidgetIds.EDIT).click(); // $NON-NLS-1$ + } + + public void select(String text) { + click(); + } + +} diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java new file mode 100644 index 00000000000..dfd28ad7bfe --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.tests; + +import org.eclipse.launchbar.ui.controls.internal.ConfigSelector; +import org.eclipse.launchbar.ui.controls.internal.LaunchBarWidgetIds; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swtbot.swt.finder.SWTBot; +import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; +import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory; +import org.eclipse.swtbot.swt.finder.results.Result; +import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; + +@SuppressWarnings("nls") +public class SWTBotConfigSelector extends SWTBotCSelector { + + private class ActionArea extends AbstractSWTBotControl { + public ActionArea(SWTBotShell shell) throws WidgetNotFoundException { + super(shell.bot().widget(WidgetMatcherFactory.withId(LaunchBarWidgetIds.NEW))); + } + + public void click(int x, int y) { + notify(SWT.MouseEnter); + notify(SWT.MouseMove); + notify(SWT.Activate); + notify(SWT.FocusIn); + notify(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); + notify(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); + } + + @Override + public ActionArea click() { + Point size = syncExec(new Result() { + @Override + public Point run() { + return widget.getSize(); + } + }); + click(size.x / 2, size.y / 2); + return this; + } + } + + public static class NewConfigDialog extends SWTBotShell { + public NewConfigDialog(Shell shell) { + super(shell); + } + + public NewConfigDialog setMode(String mode) { + bot().tableInGroup("Launch Mode").select(mode); + return this; + } + + public NewConfigDialog setType(String type) { + bot().tableInGroup("Launch Configuration Type").select(type); + return this; + } + + public NewConfigDialog next() { + bot().button("Next >").click(); + return this; + } + + public NewConfigDialog finish() { + bot().button("Finish").click(); + return this; + } + } + + public SWTBotConfigSelector(ConfigSelector configSelector) { + super(configSelector); + } + + public SWTBotConfigSelector(SWTBot bot) { + this(bot.widget(WidgetMatcherFactory.withId(LaunchBarWidgetIds.CONFIG_SELECTOR))); + } + + public NewConfigDialog newConfigDialog() { + click(); + new ActionArea(bot().shellWithId(LaunchBarWidgetIds.POPUP)).click(); + return new NewConfigDialog(bot().shell("Create Launch Configuration").widget); + } + +} diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java new file mode 100644 index 00000000000..7b887ec433b --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.tests.internal; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +public class Activator extends AbstractUIPlugin { + + private static BundleContext bundleContext; + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + bundleContext = context; + } + + public static T getService(Class service) { + ServiceReference ref = bundleContext.getServiceReference(service); + return ref != null ? bundleContext.getService(ref) : null; + } + +} diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java new file mode 100644 index 00000000000..26f656fcc2b --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.tests.internal; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ CreateLaunchConfigTests.class }) +public class AutomatedIntegrationSuite { + +} diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java new file mode 100644 index 00000000000..7a952a28229 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2017 QNX Software Systems 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 + *******************************************************************************/ +package org.eclipse.launchbar.ui.tests.internal; + +import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName; + +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.launchbar.ui.tests.SWTBotConfigSelector; +import org.eclipse.launchbar.ui.tests.SWTBotConfigSelector.NewConfigDialog; +import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; +import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView; +import org.eclipse.swtbot.swt.finder.SWTBot; +import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences; +import org.eclipse.swtbot.swt.finder.waits.ICondition; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@SuppressWarnings("nls") +public class CreateLaunchConfigTests { + + private static SWTWorkbenchBot bot; + + @BeforeClass + public static void beforeClass() { + SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; + SWTBotPreferences.TIMEOUT = 10000; + bot = new SWTWorkbenchBot(); + } + + @Before + public void before() { + bot.resetWorkbench(); + + for (SWTBotView view : bot.views(withPartName("Welcome"))) { + view.close(); + } + } + + @Test + public void createEclipseApplication() throws Exception { + String configName = "Test Config"; + ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); + for (ILaunchConfiguration config : launchManager.getLaunchConfigurations()) { + if (config.getName().equals(configName)) { + config.delete(); + } + } + + bot.waitUntil(new ICondition() { + @Override + public void init(SWTBot bot) { + NewConfigDialog dialog = new SWTBotConfigSelector(bot).newConfigDialog(); + dialog.setMode("Debug").setType("Eclipse Application").next(); + dialog.bot().textWithLabel("Name:").setText(configName); + dialog.finish(); + } + + @Override + public boolean test() throws Exception { + for (ILaunchConfiguration config : launchManager.getLaunchConfigurations()) { + if (config.getName().equals(configName)) { + return true; + } + } + return false; + } + + @Override + public String getFailureMessage() { + return "Test config not found"; + } + }); + } + +} From 9419e2213f5535f64b448b2c5e472a4174e1a312 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 14 Nov 2017 12:14:09 -0500 Subject: [PATCH 149/198] Fix up the version for the remote feature. Change-Id: Id1e3e59ade989bc1b7dfcb1c98df116eb9ef2b1b --- .../org.eclipse.launchbar.remote/feature.xml | 72 +++++++++---------- features/org.eclipse.launchbar.remote/pom.xml | 51 ------------- 2 files changed, 36 insertions(+), 87 deletions(-) delete mode 100644 features/org.eclipse.launchbar.remote/pom.xml diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 6cc7ca86b82..518945d422a 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -1,36 +1,36 @@ - - - - - %description - - - - %copyright - - - - %license - - - - - - - + + + + + %description + + + + %copyright + + + + %license + + + + + + + diff --git a/features/org.eclipse.launchbar.remote/pom.xml b/features/org.eclipse.launchbar.remote/pom.xml deleted file mode 100644 index ec494d8c0e7..00000000000 --- a/features/org.eclipse.launchbar.remote/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 1.0.0-SNAPSHOT - ../../pom.xml - - - org.eclipse.launchbar.features - org.eclipse.launchbar.remote - 1.0.2-SNAPSHOT - eclipse-feature - - - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - ${tycho-extras-version} - - - source-feature - package - - source-feature - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - - - - - - - From eb93740aba09ab2e365b9b6cdb6cf8204e0451f9 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 16 Nov 2017 13:36:20 -0500 Subject: [PATCH 150/198] Set title and description for new target wizard selection page. Change-Id: I15ade69533ef0227864c0723678d9df672db39c4 --- .../launchbar/ui/internal/Messages.java | 4 + .../launchbar/ui/internal/messages.properties | 2 + .../NewLaunchTargetWizardSelectionPage.java | 333 +++++++++--------- 3 files changed, 174 insertions(+), 165 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 105892d1fff..969bd40d01d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -39,6 +39,10 @@ public class Messages extends NLS { public static String NewLaunchTargetWizard_Title; + public static String NewLaunchTargetWizardSelectionPage_Description; + + public static String NewLaunchTargetWizardSelectionPage_Title; + public static String DescriptorMustNotBeNull; public static String DescriptorMustNotBeNullDesc; public static String NoActiveTarget; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 4e66d904734..7d1827330b8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -28,6 +28,8 @@ NewLaunchConfigTypePage2_Mode=Launch Mode NewLaunchConfigTypePage2_Type=Launch Configuration Type NewLaunchConfigWizard_0=Create Launch Configuration NewLaunchTargetWizard_Title=New Launch Target +NewLaunchTargetWizardSelectionPage_Description=Select the type of target to create. +NewLaunchTargetWizardSelectionPage_Title=New Launch Target DescriptorMustNotBeNull=Descriptor must not be null DescriptorMustNotBeNullDesc=The launch descriptor must not be null. diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java index ae11b1a9738..436c4323881 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -1,165 +1,168 @@ -/******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.target; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.target.LaunchTargetWizard; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.IWorkbenchWizard; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -class NewLaunchTargetWizardSelectionPage extends WizardPage { - - private Table table; - - public NewLaunchTargetWizardSelectionPage() { - super(NewLaunchTargetWizardSelectionPage.class.getName()); - } - - @Override - public void createControl(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - comp.setLayout(new GridLayout()); - - table = new Table(comp, SWT.BORDER | SWT.SINGLE); - table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - - List elements = new ArrayList<>(); - IExtensionPoint point = Platform.getExtensionRegistry() - .getExtensionPoint(Activator.PLUGIN_ID + ".launchTargetTypeUI"); //$NON-NLS-1$ - for (IExtension extension : point.getExtensions()) { - for (IConfigurationElement element : extension.getConfigurationElements()) { - String elementName = element.getName(); - if ("wizard2".equals(elementName) || "wizard".equals(elementName)) { //$NON-NLS-1$ //$NON-NLS-2$ - elements.add(element); - } - } - } - - elements.sort(new Comparator() { - @Override - public int compare(IConfigurationElement o1, IConfigurationElement o2) { - String name1 = o1.getAttribute("name"); //$NON-NLS-1$ - String name2 = o2.getAttribute("name"); //$NON-NLS-1$ - return name1.compareTo(name2); - } - }); - - for (IConfigurationElement element : elements) { - String name = element.getAttribute("name"); //$NON-NLS-1$ - TableItem item = new TableItem(table, SWT.NONE); - item.setText(name); - - String iconFile = element.getAttribute("icon"); //$NON-NLS-1$ - if (iconFile != null) { - ImageDescriptor desc = Activator.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), iconFile); - if (desc != null) { - item.setImage(desc.createImage()); - } - } - - item.setData(element); - } - - table.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - getContainer().updateButtons(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - if (canFlipToNextPage()) { - getContainer().showPage(getNextPage()); - } - } - }); - - setControl(comp); - } - - @Override - public void dispose() { - for (TableItem item : table.getItems()) { - Object obj = item.getData(); - if (obj instanceof Wizard) { - ((Wizard) obj).dispose(); - } - } - super.dispose(); - } - - public ImageDescriptor getDescriptionImage(IConfigurationElement element) { - String descImage = element.getAttribute("icon"); //$NON-NLS-1$ - if (descImage == null) { - return null; - } - return AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), descImage); - } - - @Override - public boolean canFlipToNextPage() { - return table.getSelectionIndex() >= 0; - } - - @Override - public IWizardPage getNextPage() { - int i = table.getSelectionIndex(); - if (i >= 0) { - TableItem item = table.getItem(i); - Object obj = item.getData(); - Wizard nextWizard; - if (obj instanceof IConfigurationElement) { - IConfigurationElement element = (IConfigurationElement) obj; - try { - nextWizard = (Wizard) element.createExecutableExtension("class"); //$NON-NLS-1$ - nextWizard.addPages(); - if (nextWizard instanceof IWorkbenchWizard) { - ((IWorkbenchWizard) nextWizard).init(PlatformUI.getWorkbench(), new StructuredSelection()); - } - item.setData(nextWizard); - } catch (CoreException e) { - Activator.log(e); - return null; - } - } else { - nextWizard = (LaunchTargetWizard) obj; - } - - return nextWizard.getStartingPage(); - } - return super.getNextPage(); - } - -} +/******************************************************************************* + * Copyright (c) 2000, 2015 IBM Corporation 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.launchbar.ui.target.LaunchTargetWizard; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.ui.IWorkbenchWizard; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +class NewLaunchTargetWizardSelectionPage extends WizardPage { + + private Table table; + + public NewLaunchTargetWizardSelectionPage() { + super(NewLaunchTargetWizardSelectionPage.class.getName()); + setTitle(Messages.NewLaunchTargetWizardSelectionPage_Title); + setDescription(Messages.NewLaunchTargetWizardSelectionPage_Description); + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout()); + + table = new Table(comp, SWT.BORDER | SWT.SINGLE); + table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + List elements = new ArrayList<>(); + IExtensionPoint point = Platform.getExtensionRegistry() + .getExtensionPoint(Activator.PLUGIN_ID + ".launchTargetTypeUI"); //$NON-NLS-1$ + for (IExtension extension : point.getExtensions()) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String elementName = element.getName(); + if ("wizard2".equals(elementName) || "wizard".equals(elementName)) { //$NON-NLS-1$ //$NON-NLS-2$ + elements.add(element); + } + } + } + + elements.sort(new Comparator() { + @Override + public int compare(IConfigurationElement o1, IConfigurationElement o2) { + String name1 = o1.getAttribute("name"); //$NON-NLS-1$ + String name2 = o2.getAttribute("name"); //$NON-NLS-1$ + return name1.compareTo(name2); + } + }); + + for (IConfigurationElement element : elements) { + String name = element.getAttribute("name"); //$NON-NLS-1$ + TableItem item = new TableItem(table, SWT.NONE); + item.setText(name); + + String iconFile = element.getAttribute("icon"); //$NON-NLS-1$ + if (iconFile != null) { + ImageDescriptor desc = Activator.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), iconFile); + if (desc != null) { + item.setImage(desc.createImage()); + } + } + + item.setData(element); + } + + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + getContainer().updateButtons(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + if (canFlipToNextPage()) { + getContainer().showPage(getNextPage()); + } + } + }); + + setControl(comp); + } + + @Override + public void dispose() { + for (TableItem item : table.getItems()) { + Object obj = item.getData(); + if (obj instanceof Wizard) { + ((Wizard) obj).dispose(); + } + } + super.dispose(); + } + + public ImageDescriptor getDescriptionImage(IConfigurationElement element) { + String descImage = element.getAttribute("icon"); //$NON-NLS-1$ + if (descImage == null) { + return null; + } + return AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), descImage); + } + + @Override + public boolean canFlipToNextPage() { + return table.getSelectionIndex() >= 0; + } + + @Override + public IWizardPage getNextPage() { + int i = table.getSelectionIndex(); + if (i >= 0) { + TableItem item = table.getItem(i); + Object obj = item.getData(); + Wizard nextWizard; + if (obj instanceof IConfigurationElement) { + IConfigurationElement element = (IConfigurationElement) obj; + try { + nextWizard = (Wizard) element.createExecutableExtension("class"); //$NON-NLS-1$ + nextWizard.addPages(); + if (nextWizard instanceof IWorkbenchWizard) { + ((IWorkbenchWizard) nextWizard).init(PlatformUI.getWorkbench(), new StructuredSelection()); + } + item.setData(nextWizard); + } catch (CoreException e) { + Activator.log(e); + return null; + } + } else { + nextWizard = (LaunchTargetWizard) obj; + } + + return nextWizard.getStartingPage(); + } + return super.getNextPage(); + } + +} From 494fbe48cbb01fc37239b46b02edc366cc67862f Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 16 Nov 2017 14:56:08 -0500 Subject: [PATCH 151/198] Fix class cast exception when going to wizard second time. When going to a wizard, but hitting back, we reuse the wizard object when we hit next again. The cast was incorrect for that object. Change-Id: I1210f17d57d26b76a47eaedd0f92bb9c63496bf8 --- .../ui/internal/target/NewLaunchTargetWizardSelectionPage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java index 436c4323881..d9b9d1b03db 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -26,7 +26,6 @@ import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.launchbar.ui.internal.Activator; import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.launchbar.ui.target.LaunchTargetWizard; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@ -157,7 +156,7 @@ class NewLaunchTargetWizardSelectionPage extends WizardPage { return null; } } else { - nextWizard = (LaunchTargetWizard) obj; + nextWizard = (Wizard) obj; } return nextWizard.getStartingPage(); From b56b76df66510f965d07b6c801df1847f24811bc Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Wed, 17 Jan 2018 11:37:56 +0000 Subject: [PATCH 152/198] Bug 529762 - [launchbar] "widget is disposed" sometimes at startup Additional isDisposed checks added to prevent unhandled event loop exceptions at platform startup on new workspaces. Change-Id: Ib2e33def766c23719e483496d110644a2cd8a712 Signed-off-by: Mat Booth --- .../ui/controls/internal/LaunchBarControl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 960ae5fdf4d..7b6e5b7ca61 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -182,6 +182,10 @@ public class LaunchBarControl implements ILaunchBarListener { @Override public void activeLaunchDescriptorChanged(ILaunchDescriptor descriptor) { + if (container == null || container.isDisposed()) { + return; + } + container.getDisplay().asyncExec(() -> { if (configSelector != null) { configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); @@ -191,13 +195,19 @@ public class LaunchBarControl implements ILaunchBarListener { if (targetSelector == null || targetSelector.isDisposed()) { createTargetSelector(); syncSelectors(); - container.getParent().layout(true); + if (!container.isDisposed()) { + Composite parent = container.getParent(); + parent.layout(true); + } } } else { if (targetSelector != null && !targetSelector.isDisposed()) { onLabel.dispose(); targetSelector.dispose(); - container.getParent().layout(true); + if (!container.isDisposed()) { + Composite parent = container.getParent(); + parent.layout(true); + } } } }); From a3a38550267b4c5407529cc729ce9e509742dbf5 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 8 Feb 2018 18:04:47 +0200 Subject: [PATCH 153/198] Build with Tycho 1.1 and CBI 1.1.4 Tycho 1.1.0 is a prereq for building against Photon. Change-Id: I2854741cf5e5763b9481399de4adb6c6eb4316b7 Signed-off-by: Alexander Kurtakov --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ae9f6fbf8d5..22fc5a81fc8 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ pom - 1.0.0 - 1.0.0 + 1.1.0 + 1.1.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -153,7 +153,7 @@ org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin - 1.1.3 + 1.1.4 sign From f92ccfca722fea0e5175e7aaa559333ca53097a3 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 8 Feb 2018 20:45:59 +0200 Subject: [PATCH 154/198] Set Maven prereq to 3.3.1 for CBI 1.1.4. Change-Id: I147ffc8b840698774ea8c1243c7e0ca923b1f74e Signed-off-by: Alexander Kurtakov --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 22fc5a81fc8..679c6cf62fc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 - 3.1.1 + 3.3.1 org.eclipse.launchbar From 2801712233cd6957c2eb00884058461fe37e28e0 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 8 Feb 2018 20:52:20 +0200 Subject: [PATCH 155/198] Build against CDT 9.4 and Oxygen everywhere. Change-Id: I419f7a353e0d6fc1e0e0b2d8d16c24886f5d38ee Signed-off-by: Alexander Kurtakov --- pom.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 679c6cf62fc..8e5ef8b6a05 100644 --- a/pom.xml +++ b/pom.xml @@ -19,8 +19,7 @@ jacoco reuseReports ${project.basedir}/../../target/jacoco.exec - cdt-e4.4 - http://download.eclipse.org/eclipse/updates/4.4 + http://download.eclipse.org/eclipse/updates/4.7 @@ -48,14 +47,9 @@ http://download.eclipse.org/cbi/updates/license/ p2 - cdt - http://download.eclipse.org/tools/cdt/releases/9.2/ + http://download.eclipse.org/tools/cdt/releases/9.4/ p2 From a62d2ae89bd3db4f8cfc8aa07aaf1fc57459b075 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 10 Jul 2018 22:05:15 -0400 Subject: [PATCH 156/198] Bug 536889 - Launchbar needs to replace slashes for launch target names - fix LaunchTargetManager addLaunchTarget to change any slashes in the target name to semi-colons when forming the preference node name to use - fix LaunchTargetManager initTargets method to restore slashes when reading the targets from preference nodes - fix LaunchTargetManager removeLaunchTarget to change any slashes in the target name to semi-colons when removing a preference node corresponding to the launch target id Signed-off-by: Jeff Johnston --- .../core/internal/target/LaunchTargetManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index fe6631c46bc..d2e27ea2887 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -40,6 +40,8 @@ public class LaunchTargetManager implements ILaunchTargetManager { private static final String DELIMETER1 = ","; //$NON-NLS-1$ private static final String DELIMETER2 = ":"; //$NON-NLS-1$ + private static final String SLASH = "/"; //$NON-NLS-1$ + private static final String SLASH_REPLACER = ";"; //$NON-NLS-1$ private Preferences getTargetsPref() { return InstanceScope.INSTANCE.getNode(Activator.getDefault().getBundle().getSymbolicName()) @@ -70,7 +72,9 @@ public class LaunchTargetManager implements ILaunchTargetManager { String[] segments = childName.split(DELIMETER1); if (segments.length == 2) { String typeId = segments[0]; - String name = segments[1]; + // Bug 536889 - we need to restore any slashes we changed when creating + // the target node so the name will appear correct to the end-user + String name = segments[1].replaceAll(SLASH_REPLACER, SLASH); Map type = targets.get(typeId); if (type == null) { @@ -194,7 +198,9 @@ public class LaunchTargetManager implements ILaunchTargetManager { try { Preferences prefs = getTargetsPref(); - String childName = typeId + DELIMETER1 + id; + // Bug 536889 - replace any slashes in the id with a replacement character + // for the child node name but still leave the id intact for the launch target + String childName = typeId + DELIMETER1 + id.replaceAll(SLASH, SLASH_REPLACER); Preferences child; if (prefs.nodeExists(childName)) { child = prefs.node(childName); @@ -233,7 +239,8 @@ public class LaunchTargetManager implements ILaunchTargetManager { // Remove the attribute node try { - getTargetsPref().node(typeId + DELIMETER1 + target.getId()).removeNode(); + // Bug 536889 - calculate the node name to remove, replacing slashes with a replacement character + getTargetsPref().node(typeId + DELIMETER1 + target.getId().replaceAll(SLASH, SLASH_REPLACER)).removeNode(); } catch (BackingStoreException e) { Activator.log(e); } From 1a1cbf62b823fc83f68e43e027580a07f56cdf22 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 23 Jul 2018 19:46:27 +0100 Subject: [PATCH 157/198] [releng] Update to Photon (4.8) as target platform Includes upgrading Tycho version Change-Id: I773b64a839580bb755413ef8eede4e831f4d0f8a --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 8e5ef8b6a05..b78727ec999 100644 --- a/pom.xml +++ b/pom.xml @@ -14,12 +14,12 @@ pom - 1.1.0 - 1.1.0 + 1.2.0 + 1.2.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec - http://download.eclipse.org/eclipse/updates/4.7 + http://download.eclipse.org/eclipse/updates/4.8 @@ -39,7 +39,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.7/ + http://download.eclipse.org/eclipse/updates/4.8/ p2 @@ -49,12 +49,12 @@ cdt - http://download.eclipse.org/tools/cdt/releases/9.4/ + http://download.eclipse.org/tools/cdt/releases/9.5/ p2 remote - http://download.eclipse.org/tools/ptp/builds/remote/oxygen/milestones/ + http://download.eclipse.org/tools/ptp/builds/remote/photon/milestones/ p2 From 2982dc100fc1f18ef9f30b1535382efd9d889ba6 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 23 Jul 2018 19:46:58 +0100 Subject: [PATCH 158/198] [releng] Set name of repo to be consitent with naming in CDT and tools.templates This makes handling of releng easier across projects. Change-Id: I91f532e95ec45dad4cf758f2226e51e53a797ffb --- repo/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repo/pom.xml b/repo/pom.xml index f0d452be228..48ad94849c5 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -11,4 +11,8 @@ repo eclipse-repository + + + org.eclipse.launchbar.repo + From 44cf2dac1c23587ada579a3880f79f52201f88da Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 23 Jul 2018 19:54:54 +0100 Subject: [PATCH 159/198] [releng] Bump version to 2.2.1 And bump bundle patch versions too Change-Id: I006948f6a39c798cf5603583d115ebfab1e6c368 --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/pom.xml | 2 +- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- repo/pom.xml | 2 +- tests/org.eclipse.launchbar.core.tests/pom.xml | 2 +- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index e773efc6109..564e0903d06 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.2.0.qualifier +Bundle-Version: 2.2.1.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF index 9c14a8ee348..adb96a0bffe 100644 --- a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Remote Core Bundle-SymbolicName: org.eclipse.launchbar.remote.core;singleton:=true -Bundle-Version: 1.0.1.qualifier +Bundle-Version: 1.0.2.qualifier Bundle-Activator: org.eclipse.launchbar.remote.core.internal.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF index 99c55974a49..37af2dfa88d 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Remote Launch Target UI Bundle-SymbolicName: org.eclipse.launchbar.remote.ui;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Activator: org.eclipse.launchbar.remote.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.ui, diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index 393397e6fcb..42115ce4d5a 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Launch Bar UI Controls Bundle-SymbolicName: org.eclipse.launchbar.ui.controls;singleton:=true -Bundle-Version: 1.0.1.qualifier +Bundle-Version: 1.0.2.qualifier Bundle-Activator: org.eclipse.launchbar.ui.controls.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index a252075c446..b4414dee0f4 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.2.0.qualifier +Bundle-Version: 2.2.1.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/pom.xml b/bundles/pom.xml index 9d8949028b5..7df0e6f0257 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 1.0.0-SNAPSHOT + 2.2.1-SNAPSHOT bundles-parent diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 518945d422a..0cf9ed6e244 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 63ddc75cbc6..fe2b04cde2d 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/pom.xml b/features/pom.xml index 94a900d2074..ebbd3eb6085 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 1.0.0-SNAPSHOT + 2.2.1-SNAPSHOT features-parent diff --git a/pom.xml b/pom.xml index b78727ec999..a45038860d2 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.launchbar parent - 1.0.0-SNAPSHOT + 2.2.1-SNAPSHOT pom diff --git a/repo/pom.xml b/repo/pom.xml index 48ad94849c5..b23e44aeb2a 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -5,7 +5,7 @@ org.eclipse.launchbar parent - 1.0.0-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index b9830dc3ba6..22f928117b4 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 1.0.0-SNAPSHOT + 2.2.1-SNAPSHOT ../../pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index 7442a5a8558..761f4fa5cf7 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -6,7 +6,7 @@ org.eclipse.launchbar - 1.0.0-SNAPSHOT + 2.2.1-SNAPSHOT ../../pom.xml parent From 2ab45c194ec72798ed22e4106d31260eb2e044e2 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 23 Jul 2018 21:02:35 +0100 Subject: [PATCH 160/198] [releng] Bump version to 2.2.2 Change-Id: I9a8c59dcef2bac369f183b301d995d4deb0bf023 --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/pom.xml | 2 +- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- repo/pom.xml | 2 +- tests/org.eclipse.launchbar.core.tests/pom.xml | 2 +- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 564e0903d06..ccaa542041c 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index b4414dee0f4..680e552a09f 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/pom.xml b/bundles/pom.xml index 7df0e6f0257..dd17ff250e2 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.1-SNAPSHOT + 2.2.2-SNAPSHOT bundles-parent diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 0cf9ed6e244..7a9c72531f5 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index fe2b04cde2d..1f9e5d0e883 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/pom.xml b/features/pom.xml index ebbd3eb6085..78fc4b82d04 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.1-SNAPSHOT + 2.2.2-SNAPSHOT features-parent diff --git a/pom.xml b/pom.xml index a45038860d2..24453171e3d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.launchbar parent - 2.2.1-SNAPSHOT + 2.2.2-SNAPSHOT pom diff --git a/repo/pom.xml b/repo/pom.xml index b23e44aeb2a..5fd830311e2 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -5,7 +5,7 @@ org.eclipse.launchbar parent - 2.2.1-SNAPSHOT + 2.2.2-SNAPSHOT ../pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index 22f928117b4..66b01ebcd0c 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.1-SNAPSHOT + 2.2.2-SNAPSHOT ../../pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index 761f4fa5cf7..7e274d24ac0 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -6,7 +6,7 @@ org.eclipse.launchbar - 2.2.1-SNAPSHOT + 2.2.2-SNAPSHOT ../../pom.xml parent From c1e3974e1b94511c7970faa41ac0c70882e67b35 Mon Sep 17 00:00:00 2001 From: Umair Sair Date: Wed, 12 Sep 2018 00:00:29 +0500 Subject: [PATCH 161/198] Bug 538942 - Moving backward and forward in "Create Launch Configuration" dialog of launchbar causes NPEs Change-Id: Ibd11b43d4348abfa74509ce715c8d5e741f1582f Signed-off-by: Umair Sair --- .../ui/internal/dialogs/NewLaunchConfigEditPage.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 9e32ba076a0..2c6f50cc5a7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -83,7 +83,9 @@ public class NewLaunchConfigEditPage extends WizardPage implements IPageChanging @Override public void handlePageChanging(PageChangingEvent event) { - if (launchConfigType == null) { + if (launchConfigType == null || event.getTargetPage() != this) { + if (tabViewer != null) + tabViewer.setInput(null); return; } LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog); @@ -186,6 +188,11 @@ public class NewLaunchConfigEditPage extends WizardPage implements IPageChanging public void setTabViewer(LaunchConfigurationTabGroupViewer viewer) { super.setTabViewer(viewer); } + + @Override + public boolean isTreeSelectionEmpty() { + return false; + } } private class LaunchConfigurationTabGroupViewerExt extends LaunchConfigurationTabGroupViewer { From df0fc91d7f2173ead4b4299338491379377c90ca Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 7 Nov 2018 15:07:33 +0200 Subject: [PATCH 162/198] Launchbar not visible on Java 11 o.e.launchbar.ui.controls uses annotations and thus imports javax.annotations package. This package is removed in Java 11 and equinox doesn't put javax.annotation bundle on the classpath resulting in launchbar not functioning at all. The fix is to Import-Package: javax.annotation like eclipse platform bundles do and letting equinox resolve it either from the jvm or the bundle shipped with platform. Change-Id: Id5702919b233b3fea424fa2f1db15505eee8ecb7 Signed-off-by: Alexander Kurtakov --- bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index 42115ce4d5a..5564e489c2a 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -16,6 +16,7 @@ Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", org.eclipse.debug.ui;bundle-version="3.11.200", org.eclipse.launchbar.core;bundle-version="2.0.0", org.eclipse.launchbar.ui;bundle-version="2.0.0" +Import-Package: javax.annotation Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin From 453055e0ed4cfdf47d55db23a6027978dc7c98ab Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 7 Nov 2018 15:22:33 +0200 Subject: [PATCH 163/198] Update Maven build plugins jarsigner - 1.1.4 -> 1.1.5 resources - 3.0.2 -> 3.1.0 findbugs - 3.0.4 -> 3.0.5 pmd - 3.7 -> 3.10.0 Change-Id: I8fd5d6639a46d86e5452e85dcdce1635016207a3 Signed-off-by: Alexander Kurtakov --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 24453171e3d..4d36b29fa9b 100644 --- a/pom.xml +++ b/pom.xml @@ -147,7 +147,7 @@ org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin - 1.1.4 + 1.1.5 sign @@ -309,7 +309,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.0.2 + 3.1.0 ISO-8859-1 @@ -322,7 +322,7 @@ org.codehaus.mojo findbugs-maven-plugin - 3.0.4 + 3.0.5 true false @@ -338,7 +338,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.7 + 3.10.0 utf-8 100 From 5c6c2c63802926ac8d3dec65b38b96d0fbcb233a Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 7 Nov 2018 15:40:47 +0200 Subject: [PATCH 164/198] Add autmatic-module-name for Java 9+ compatibility. Change-Id: Id5ecc850d6e3ca8a70cdf33905d446a382061118 --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 1 + bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF | 1 + bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 1 + 3 files changed, 3 insertions(+) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index ccaa542041c..7f4c39992ae 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -14,3 +14,4 @@ Export-Package: org.eclipse.launchbar.core, org.eclipse.launchbar.core.internal;x-friends:="org.eclipse.launchbar.core.tests,org.eclipse.launchbar.ui", org.eclipse.launchbar.core.target, org.eclipse.launchbar.core.target.launch +Automatic-Module-Name: org.eclipse.launchbar.core diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index 5564e489c2a..5a987f2d75a 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -21,3 +21,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Export-Package: org.eclipse.launchbar.ui.controls.internal;x-friends:="org.eclipse.launchbar.ui.tests" +Automatic-Module-Name: org.eclipse.launchbar.ui.controls diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 680e552a09f..293c6396664 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -18,3 +18,4 @@ Export-Package: org.eclipse.launchbar.ui, org.eclipse.launchbar.ui.internal.commands;x-internal:=true, org.eclipse.launchbar.ui.internal.dialogs;x-internal:=true, org.eclipse.launchbar.ui.target +Automatic-Module-Name: org.eclipse.launchbar.ui From 3bae6cbcd96f627b43c5c50fe7b64a168e49d8ef Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 20:08:42 +0200 Subject: [PATCH 165/198] Update Maven plugins. Tycho to 1.3.0 PMD to 3.11 Change-Id: I6d82ad8d72d6c003b440f474eed66273221655be Signed-off-by: Alexander Kurtakov --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4d36b29fa9b..326824c6366 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ pom - 1.2.0 - 1.2.0 + 1.3.0 + 1.3.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -338,7 +338,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.10.0 + 3.11.0 utf-8 100 From f617a5f6fe49df4d3c6731a00b0263cb60c45be1 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 20:22:32 +0200 Subject: [PATCH 166/198] Build against 2018-12 stream. Change-Id: I02ce424eaeb0ed95b0a42c1792b8d90845a45b35 Signed-off-by: Alexander Kurtakov --- pom.xml | 16 +++----------- .../META-INF/MANIFEST.MF | 4 ++-- .../org.eclipse.launchbar.core.tests/pom.xml | 21 ------------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index 326824c6366..bf29ed0ea76 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ jacoco reuseReports ${project.basedir}/../../target/jacoco.exec - http://download.eclipse.org/eclipse/updates/4.8 + http://download.eclipse.org/eclipse/updates/4.10 @@ -39,7 +39,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.8/ + http://download.eclipse.org/eclipse/updates/4.10/ p2 @@ -49,7 +49,7 @@ cdt - http://download.eclipse.org/tools/cdt/releases/9.5/ + http://download.eclipse.org/tools/cdt/releases/9.6/ p2 @@ -209,21 +209,11 @@ p2 consider - - linux - gtk - x86 - linux gtk x86_64 - - win32 - win32 - x86 - win32 win32 diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF index 7cedb534a9e..41b41e5ab51 100644 --- a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF @@ -5,5 +5,5 @@ Bundle-SymbolicName: org.eclipse.launchbar.core.tests;singleton:=true Bundle-Version: 1.0.0.qualifier Fragment-Host: org.eclipse.launchbar.core;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.junit;bundle-version="4.11.0", - org.mockito;bundle-version="1.9.5" +Require-Bundle: org.junit;bundle-version="4.12.0", + org.mockito;bundle-version="2.23.0" diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index 66b01ebcd0c..5f5c5b24e71 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -15,25 +15,4 @@ 1.0.0-SNAPSHOT eclipse-test-plugin - - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - - - - eclipse-plugin - org.hamcrest - 0.0.0 - - - - - - - From 43f040db9eb8fc473466f14d72d323dd522327a0 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 20:37:13 +0200 Subject: [PATCH 167/198] Modernize o.e.launchbar.core.tests * Bump BREE to Java 1.8. * More warnings and fixes for them. * Deprecation fixes. Change-Id: I632ff2954021f1c2ff9a443b23f95985fb8040ee Signed-off-by: Alexander Kurtakov --- .../.classpath | 8 +- .../.settings/org.eclipse.jdt.core.prefs | 112 +++++++++++++++++- .../META-INF/MANIFEST.MF | 3 +- .../PerTargetLaunchConfigProviderTest.java | 4 +- .../core/internal/LaunchBarManager2Test.java | 20 ++-- .../core/internal/LaunchBarManagerTest.java | 10 +- .../internal/target/LaunchTargetTest.java | 10 +- 7 files changed, 140 insertions(+), 27 deletions(-) diff --git a/tests/org.eclipse.launchbar.core.tests/.classpath b/tests/org.eclipse.launchbar.core.tests/.classpath index 098194ca4b7..3e5654f17eb 100644 --- a/tests/org.eclipse.launchbar.core.tests/.classpath +++ b/tests/org.eclipse.launchbar.core.tests/.classpath @@ -1,7 +1,11 @@ - + - + + + + + diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs index f42de363afa..97541062df6 100644 --- a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,113 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF index 41b41e5ab51..7f04cfbdaaf 100644 --- a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF @@ -4,6 +4,7 @@ Bundle-Name: Launch Bar Core Tests Bundle-SymbolicName: org.eclipse.launchbar.core.tests;singleton:=true Bundle-Version: 1.0.0.qualifier Fragment-Host: org.eclipse.launchbar.core;bundle-version="1.0.0" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit;bundle-version="4.12.0", org.mockito;bundle-version="2.23.0" +Automatic-Module-Name: org.eclipse.launchbar.core.tests diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index f898541b011..13e60a7e498 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 QNX Software Systems and others. + * Copyright (c) 2015, 2018 QNX Software Systems 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 @@ -46,7 +46,7 @@ public class PerTargetLaunchConfigProviderTest { private PerTargetLaunchConfigProvider1 provider; @Before - public void basicSetupOnly() throws CoreException { + public void basicSetupOnly() { ILaunchTargetManager targetManager = mock(ILaunchTargetManager.class); Activator.getDefault().getBundle().getBundleContext().registerService(ILaunchTargetManager.class, targetManager, null); diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 92b71cbef91..6d3870e759a 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -86,7 +86,7 @@ public class LaunchBarManager2Test { private ILaunchTarget[] targets; public class FixedLaunchBarManager extends LaunchBarManager { - public FixedLaunchBarManager() throws CoreException { + public FixedLaunchBarManager() { super(false); } @@ -218,7 +218,7 @@ public class LaunchBarManager2Test { private ILaunchTarget mockRemoteConnection(String t2) { ILaunchTarget target = mock(ILaunchTarget.class); doReturn(t2).when(target).getTypeId(); - doReturn(t2 + ".target").when(target).getName(); + doReturn(t2 + ".target").when(target).getId(); return target; } @@ -267,13 +267,13 @@ public class LaunchBarManager2Test { manager = new FixedLaunchBarManager(); localTarget = mock(ILaunchTarget.class); doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); - doReturn("Local").when(localTarget).getName(); + doReturn("Local").when(localTarget).getId(); // mock launchObject = "test"; // remote connections otherTarget = mock(ILaunchTarget.class); doReturn("otherTargetType").when(otherTarget).getTypeId(); - doReturn("otherTarget").when(otherTarget).getName(); + doReturn("otherTarget").when(otherTarget).getId(); targets = new ILaunchTarget[] { otherTarget, localTarget }; // lc String launchConfigTypeId = "lctype1"; @@ -399,7 +399,7 @@ public class LaunchBarManager2Test { } @Test - public void testGetLaunchDescriptors() throws CoreException { + public void testGetLaunchDescriptors() { manager.launchObjectAdded(launchObject); manager.launchConfigurationAdded(launchConfig); ILaunchDescriptor[] launchDescriptors = manager.getLaunchDescriptors(); @@ -668,7 +668,7 @@ public class LaunchBarManager2Test { } @Test - public void testGetActiveLaunchDescriptor() throws CoreException { + public void testGetActiveLaunchDescriptor() { ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); manager.launchObjectAdded(launchObject); @@ -678,7 +678,7 @@ public class LaunchBarManager2Test { } @Test - public void testSetActiveLaunchDescriptorUnkn() throws CoreException { + public void testSetActiveLaunchDescriptorUnkn() { try { manager.setActiveLaunchDescriptor(descriptor); fail(); @@ -695,7 +695,7 @@ public class LaunchBarManager2Test { } @Test - public void testSetActiveLaunchDescriptorLisBad() throws CoreException { + public void testSetActiveLaunchDescriptorLisBad() { ILaunchBarListener lis = mock(ILaunchBarListener.class); manager.addListener(lis); doThrow(new NullPointerException()).when(lis).activeLaunchDescriptorChanged(any(ILaunchDescriptor.class)); @@ -754,7 +754,7 @@ public class LaunchBarManager2Test { } @Test - public void testSetActiveLaunchModeUnsupported() throws CoreException { + public void testSetActiveLaunchModeUnsupported() { ILaunchConfigurationType lctype2 = mockLCType("lctype2"); ILaunchMode mode = mockLaunchModes(lctype2, "modex")[0]; mockLaunchModes(launchConfigType, "run", "debug", "foo"); diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index af557564acf..22a69d6e038 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -75,7 +75,7 @@ public class LaunchBarManagerTest { final ILaunchTargetManager targetManager = mock(ILaunchTargetManager.class); ILaunchTarget localTarget = mock(ILaunchTarget.class); doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); - doReturn("Local").when(localTarget).getName(); + doReturn("Local").when(localTarget).getId(); doReturn(new ILaunchTarget[] { localTarget }).when(targetManager).getLaunchTargets(); // Inject the launch config @@ -94,7 +94,7 @@ public class LaunchBarManagerTest { assertNotNull(manager.getActiveLaunchTarget()); assertEquals(ILaunchTargetManager.localLaunchTargetTypeId, manager.getActiveLaunchTarget().getTypeId()); - assertEquals("Local", manager.getActiveLaunchTarget().getName()); + assertEquals("Local", manager.getActiveLaunchTarget().getId()); assertNotNull(manager.getActiveLaunchMode()); assertEquals("run", manager.getActiveLaunchMode().getIdentifier()); @@ -166,7 +166,7 @@ public class LaunchBarManagerTest { final ILaunchTargetManager targetManager = mock(ILaunchTargetManager.class); ILaunchTarget localTarget = mock(ILaunchTarget.class); doReturn(ILaunchTargetManager.localLaunchTargetTypeId).when(localTarget).getTypeId(); - doReturn("Local").when(localTarget).getName(); + doReturn("Local").when(localTarget).getId(); doReturn(new ILaunchTarget[] { localTarget }).when(targetManager).getLaunchTargets(); ILaunchConfiguration launchConfig = mock(ILaunchConfiguration.class); @@ -207,7 +207,7 @@ public class LaunchBarManagerTest { assertEquals(descriptor, manager.getActiveLaunchDescriptor()); assertEquals(runMode, manager.getActiveLaunchMode()); assertEquals(ILaunchTargetManager.localLaunchTargetTypeId, manager.getActiveLaunchTarget().getTypeId()); - assertEquals("Local", manager.getActiveLaunchTarget().getName()); + assertEquals("Local", manager.getActiveLaunchTarget().getId()); assertEquals(launchConfig, manager.getActiveLaunchConfiguration()); } diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java index f9fca4c1f6e..094a4314f1a 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016 QNX Software Systems and others. + * Copyright (c) 2016, 2018 QNX Software Systems 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 @@ -7,13 +7,15 @@ *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.HashSet; import java.util.Set; -import org.eclipse.core.runtime.CoreException; import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetManager; @@ -32,7 +34,7 @@ public class LaunchTargetTest { } @Test - public void testRemoveLaunchTarget() throws CoreException { + public void testRemoveLaunchTarget() { ILaunchTargetManager manager = Activator.getLaunchTargetManager(); // Account for pre-populated targets int baseSize = manager.getLaunchTargets().length; From e4f9a90fb959198bf7d5d29de0926fde3143dc58 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 20:42:54 +0200 Subject: [PATCH 168/198] Remove unneeded nls suppress warnings. Change-Id: Ic23ff80620cc2a012bbcf77f395e803f019e1bed Signed-off-by: Alexander Kurtakov --- .../launchbar/core/PerTargetLaunchConfigProviderTest.java | 1 - .../eclipse/launchbar/core/internal/LaunchBarManager2Test.java | 2 +- .../eclipse/launchbar/core/internal/LaunchBarManagerTest.java | 1 - .../launchbar/core/internal/target/LaunchTargetTest.java | 1 - .../org/eclipse/launchbar/core/tests/TargetAttributesTest.java | 1 - .../org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java | 1 - .../launchbar/ui/tests/internal/CreateLaunchConfigTests.java | 1 - 7 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index 13e60a7e498..e8a4f13ccb4 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -34,7 +34,6 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -@SuppressWarnings("nls") @FixMethodOrder(MethodSorters.JVM) public class PerTargetLaunchConfigProviderTest { private ILaunchTarget localTarget; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 6d3870e759a..f8eca5b4a8a 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -62,7 +62,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -@SuppressWarnings({ "restriction", "nls" }) +@SuppressWarnings({ "restriction" }) @FixMethodOrder(MethodSorters.JVM) public class LaunchBarManager2Test { private LaunchBarManager manager; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 22a69d6e038..22ca2aab850 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -40,7 +40,6 @@ import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -@SuppressWarnings("nls") public class LaunchBarManagerTest { @Test public void startupTest() throws Exception { diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java index 094a4314f1a..78dca20d69d 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java @@ -24,7 +24,6 @@ import org.junit.Test; import org.mockito.Mockito; import org.osgi.service.prefs.Preferences; -@SuppressWarnings("nls") public class LaunchTargetTest { private org.osgi.service.prefs.Preferences pref; diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java index 4a393b9ebc2..d29dfbe2086 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java @@ -9,7 +9,6 @@ import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.eclipse.launchbar.core.target.ILaunchTargetWorkingCopy; import org.junit.Test; -@SuppressWarnings("nls") public class TargetAttributesTest { @Test diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java index dfd28ad7bfe..f303c88219d 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java @@ -20,7 +20,6 @@ import org.eclipse.swtbot.swt.finder.results.Result; import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; -@SuppressWarnings("nls") public class SWTBotConfigSelector extends SWTBotCSelector { private class ActionArea extends AbstractSWTBotControl { diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java index 7a952a28229..3a7b26e8e13 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java @@ -23,7 +23,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -@SuppressWarnings("nls") public class CreateLaunchConfigTests { private static SWTWorkbenchBot bot; From 861a8430ed5779405af84b86ce7c574fdb40f314 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 20:48:02 +0200 Subject: [PATCH 169/198] Add missing automatic-module-name. Change-Id: Ic81274c97b26df1299b9d806a9f326441a0fab24 Signed-off-by: Alexander Kurtakov --- bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF | 1 + bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF | 1 + tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF | 1 + 3 files changed, 3 insertions(+) diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF index adb96a0bffe..82adb292f6b 100644 --- a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF @@ -12,3 +12,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.remote.core, org.eclipse.launchbar.remote.core.internal;x-friends:="org.eclipse.launchbar.remote.ui" +Automatic-Module-Name: org.eclipse.launchbar.remote.core diff --git a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF index 37af2dfa88d..8d3bd235f0b 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF @@ -15,3 +15,4 @@ Require-Bundle: org.eclipse.ui, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.launchbar.remote.ui +Automatic-Module-Name: org.eclipse.launchbar.remote.ui diff --git a/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF index 16c10fa07a4..64775252740 100644 --- a/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Import-Package: org.eclipse.launchbar.ui.controls.internal Bundle-Activator: org.eclipse.launchbar.ui.tests.internal.Activator +Automatic-Module-Name: org.eclipse.launchbar.ui.tests From 041a7a6560bc6ffb2c90e2688b4a4d876faf1b02 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 21:08:16 +0200 Subject: [PATCH 170/198] Lambda conversions. Change-Id: I500febcaad04a654ece7cc4cc6d918a7f3a9f05a Signed-off-by: Alexander Kurtakov --- .../core/internal/LaunchBarManager.java | 35 ++--- .../internal/ProjectLaunchObjectProvider.java | 42 +++-- .../ui/controls/internal/CButton.java | 31 ++-- .../ui/controls/internal/CSelector.java | 145 +++++++----------- .../ui/controls/internal/ConfigSelector.java | 11 +- .../ui/controls/internal/FilterControl.java | 58 +++---- .../controls/internal/LaunchBarControl.java | 18 +-- .../controls/internal/LaunchBarInjector.java | 56 +++---- .../internal/LaunchBarListViewer.java | 114 ++++++-------- .../ui/controls/internal/ModeSelector.java | 46 +++--- .../ui/controls/internal/TargetSelector.java | 17 +- .../internal/LaunchBarLaunchConfigDialog.java | 9 +- .../commands/BuildActiveCommandHandler.java | 33 ++-- .../dialogs/NewLaunchConfigTypePage2.java | 18 +-- .../NewLaunchTargetWizardSelectionPage.java | 14 +- .../core/internal/LaunchBarManagerTest.java | 11 +- .../launchbar/ui/tests/SWTBotCSelector.java | 9 +- .../ui/tests/SWTBotConfigSelector.java | 9 +- 18 files changed, 257 insertions(+), 419 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 468c6bc0eae..e7957ecf35f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -13,7 +13,6 @@ package org.eclipse.launchbar.core.internal; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedList; @@ -231,9 +230,19 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } // Sort things orderedDescriptorTypes = new ArrayList<>(descriptorTypes.values()); - Collections.sort(orderedDescriptorTypes, new Comparator() { - @Override - public int compare(LaunchDescriptorTypeInfo o1, LaunchDescriptorTypeInfo o2) { + Collections.sort(orderedDescriptorTypes, (o1, o2) -> { + int p1 = o1.getPriority(); + int p2 = o2.getPriority(); + if (p1 < p2) { + return 1; + } else if (p1 > p2) { + return -1; + } else { + return 0; + } + }); + for (List providers : configProviders.values()) { + Collections.sort(providers, (o1, o2) -> { int p1 = o1.getPriority(); int p2 = o2.getPriority(); if (p1 < p2) { @@ -243,22 +252,6 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } else { return 0; } - } - }); - for (List providers : configProviders.values()) { - Collections.sort(providers, new Comparator() { - @Override - public int compare(LaunchConfigProviderInfo o1, LaunchConfigProviderInfo o2) { - int p1 = o1.getPriority(); - int p2 = o2.getPriority(); - if (p1 < p2) { - return 1; - } else if (p1 > p2) { - return -1; - } else { - return 0; - } - } }); } // Now that all the types are loaded, the object providers which now diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java index c9c352dafd5..d64de8c1b0a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2017 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -18,7 +18,6 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.launchbar.core.ILaunchBarManager; @@ -50,30 +49,27 @@ public class ProjectLaunchObjectProvider implements ILaunchObjectProvider, IReso @Override public void resourceChanged(IResourceChangeEvent event) { try { - event.getDelta().accept(new IResourceDeltaVisitor() { - @Override - public boolean visit(IResourceDelta delta) throws CoreException { - IResource res = delta.getResource(); - if (res instanceof IProject) { - IProject project = (IProject) res; - int kind = delta.getKind(); - if ((kind & IResourceDelta.ADDED) != 0) { - manager.launchObjectAdded(project); - } else if ((kind & IResourceDelta.REMOVED) != 0) { - manager.launchObjectRemoved(project); - } else if ((kind & IResourceDelta.CHANGED) != 0) { - int flags = delta.getFlags(); - // Right now, only care about nature changes - if ((flags & IResourceDelta.DESCRIPTION) != 0) { - manager.launchObjectChanged(project); - } + event.getDelta().accept(delta -> { + IResource res = delta.getResource(); + if (res instanceof IProject) { + IProject project = (IProject) res; + int kind = delta.getKind(); + if ((kind & IResourceDelta.ADDED) != 0) { + manager.launchObjectAdded(project); + } else if ((kind & IResourceDelta.REMOVED) != 0) { + manager.launchObjectRemoved(project); + } else if ((kind & IResourceDelta.CHANGED) != 0) { + int flags = delta.getFlags(); + // Right now, only care about nature changes + if ((flags & IResourceDelta.DESCRIPTION) != 0) { + manager.launchObjectChanged(project); } - return false; - } else if (res instanceof IFile || res instanceof IFolder) { - return false; } - return true; + return false; + } else if (res instanceof IFile || res instanceof IFolder) { + return false; } + return true; }); } catch (CoreException e) { Activator.log(e.getStatus()); diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java index 24d53787c51..341aa59cdcc 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -14,8 +14,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseTrackAdapter; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; @@ -31,21 +29,18 @@ public class CButton extends Canvas { public CButton(Composite parent, int style) { super(parent, style); - addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - if (inButton) { - if (hotImage != null) { - e.gc.drawImage(hotImage, 0, 0); - } else if (coldImage != null) { - e.gc.drawImage(coldImage, 0, 0); - } - } else { - if (coldImage != null) { - e.gc.drawImage(coldImage, 0, 0); - } else if (hotImage != null) { - e.gc.drawImage(hotImage, 0, 0); - } + addPaintListener(e -> { + if (inButton) { + if (hotImage != null) { + e.gc.drawImage(hotImage, 0, 0); + } else if (coldImage != null) { + e.gc.drawImage(coldImage, 0, 0); + } + } else { + if (coldImage != null) { + e.gc.drawImage(coldImage, 0, 0); + } else if (hotImage != null) { + e.gc.drawImage(hotImage, 0, 0); } } }); diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index 1b11aa03ea1..cd0287dd07f 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -19,18 +19,12 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Color; @@ -141,17 +135,14 @@ public abstract class CSelector extends Composite { GridLayout mainButtonLayout = new GridLayout(); setLayout(mainButtonLayout); - addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - GC gc = e.gc; - gc.setBackground(getBackground()); - gc.setForeground(getOutlineColor()); - Point size = getSize(); - final int arc = 3; - gc.fillRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); - gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); - } + addPaintListener(e -> { + GC gc = e.gc; + gc.setBackground(getBackground()); + gc.setForeground(getOutlineColor()); + Point size = getSize(); + final int arc = 3; + gc.fillRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); + gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, arc, arc); }); addMouseListener(mouseListener); } @@ -181,13 +172,10 @@ public abstract class CSelector extends Composite { return Status.CANCEL_STATUS; if (isDisposed()) return Status.CANCEL_STATUS; - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (monitor.isCanceled()) - return; - setSelection(element); - } + getDisplay().asyncExec(() -> { + if (monitor.isCanceled()) + return; + setSelection(element); }); return Status.OK_STATUS; } @@ -245,21 +233,18 @@ public abstract class CSelector extends Composite { arrow.setBackground(getBackground()); arrow.setForeground(getForeground()); arrowTransition = new Transition(arrow, arrowMax, 80); - arrow.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - final int hPadding = 2; - GC gc = e.gc; - LineAttributes attributes = new LineAttributes(2); - attributes.cap = SWT.CAP_ROUND; - gc.setLineAttributes(attributes); - gc.setAlpha(mouseOver ? 255 : 100); - Rectangle bounds = arrow.getBounds(); - int arrowWidth = bounds.width - hPadding * 2; - int current = arrowTransition.getCurrent(); - gc.drawPolyline(new int[] { hPadding, bounds.height / 2 - current, hPadding + (arrowWidth / 2), - bounds.height / 2 + current, hPadding + arrowWidth, bounds.height / 2 - current }); - } + arrow.addPaintListener(e -> { + final int hPadding = 2; + GC gc = e.gc; + LineAttributes attributes = new LineAttributes(2); + attributes.cap = SWT.CAP_ROUND; + gc.setLineAttributes(attributes); + gc.setAlpha(mouseOver ? 255 : 100); + Rectangle bounds = arrow.getBounds(); + int arrowWidth = bounds.width - hPadding * 2; + int current = arrowTransition.getCurrent(); + gc.drawPolyline(new int[] { hPadding, bounds.height / 2 - current, hPadding + (arrowWidth / 2), + bounds.height / 2 + current, hPadding + arrowWidth, bounds.height / 2 - current }); }); arrow.addMouseListener(mouseListener); if (editable) { @@ -272,12 +257,9 @@ public abstract class CSelector extends Composite { public void widgetSelected(SelectionEvent e) { // Need to run this after the current event storm // Or we get a disposed error. - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (CSelector.this.selection != null) - handleEdit(selection); - } + getDisplay().asyncExec(() -> { + if (CSelector.this.selection != null) + handleEdit(selection); }); } }); @@ -311,18 +293,15 @@ public abstract class CSelector extends Composite { initializeListViewer(listViewer); listViewer.setFilterVisible(elements.length > 7); listViewer.setInput(input); - listViewer.addSelectionChangedListener(new ISelectionChangedListener() { - @Override - public void selectionChanged(SelectionChangedEvent event) { - if (!listViewer.isFinalSelection()) - return; - StructuredSelection ss = (StructuredSelection) event.getSelection(); - if (!ss.isEmpty()) { - setSelection(ss.getFirstElement()); - fireSelectionChanged(); - } - closePopup(); + listViewer.addSelectionChangedListener(event -> { + if (!listViewer.isFinalSelection()) + return; + StructuredSelection ss = (StructuredSelection) event.getSelection(); + if (!ss.isEmpty()) { + setSelection(ss.getFirstElement()); + fireSelectionChanged(); } + closePopup(); }); if (hasActionArea()) createActionArea(popup); @@ -335,14 +314,11 @@ public abstract class CSelector extends Composite { getDisplay().addFilter(SWT.FocusIn, focusOutListener); getDisplay().addFilter(SWT.FocusOut, focusOutListener); getDisplay().addFilter(SWT.MouseUp, focusOutListener); - popup.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - getDisplay().removeFilter(SWT.FocusIn, focusOutListener); - getDisplay().removeFilter(SWT.FocusOut, focusOutListener); - getDisplay().removeFilter(SWT.MouseUp, focusOutListener); - saveShellSize(); - } + popup.addDisposeListener(e -> { + getDisplay().removeFilter(SWT.FocusIn, focusOutListener); + getDisplay().removeFilter(SWT.FocusOut, focusOutListener); + getDisplay().removeFilter(SWT.MouseUp, focusOutListener); + saveShellSize(); }); } @@ -384,16 +360,13 @@ public abstract class CSelector extends Composite { } private void closePopup() { - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (popup == null || popup.isDisposed()) { - return; - } - arrowTransition.to(arrowMax); - popup.setVisible(false); - popup.dispose(); + getDisplay().asyncExec(() -> { + if (popup == null || popup.isDisposed()) { + return; } + arrowTransition.to(arrowMax); + popup.setVisible(false); + popup.dispose(); }); } @@ -415,12 +388,7 @@ public abstract class CSelector extends Composite { icon.setImage(image); if (disposeImage) { final Image disposableImage = image; - icon.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - disposableImage.dispose(); - } - }); + icon.addDisposeListener(e -> disposableImage.dispose()); } return icon; } @@ -490,16 +458,13 @@ public abstract class CSelector extends Composite { } public void refresh() { - PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (isDisposed()) - return; - update(selection); // update current selection - name or icon - // may have changed - if (popup != null && !popup.isDisposed()) { - listViewer.refresh(true); // update all labels in the popup - } + PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { + if (isDisposed()) + return; + update(selection); // update current selection - name or icon + // may have changed + if (popup != null && !popup.isDisposed()) { + listViewer.refresh(true); // update all labels in the popup } }); } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java index 41aa4ed4638..cc22d905699 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.controls.internal; -import java.util.Comparator; - import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; @@ -120,12 +118,7 @@ public class ConfigSelector extends CSelector { // no sorter for top, data is sorted by provider in historical order setHistorySortComparator(null); // alphabetic sorter - setSorter(new Comparator() { - @Override - public int compare(ILaunchDescriptor o1, ILaunchDescriptor o2) { - return o1.getName().compareTo(o2.getName()); - } - }); + setSorter((ILaunchDescriptor o1, ILaunchDescriptor o2) -> o1.getName().compareTo(o2.getName())); } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java index b8b73034d9b..341de480908 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -24,18 +24,12 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.AccessibleAdapter; import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.TraverseEvent; -import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -145,12 +139,7 @@ public class FilterControl extends Composite { public Control attachListViewer(LaunchBarListViewer listViewer) { this.listViewer = listViewer; // listViewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); - listViewer.getControl().addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - refreshJob.cancel(); - } - }); + listViewer.getControl().addDisposeListener(e -> refreshJob.cancel()); listViewer.addFilter(patternFilter); return listViewer.getControl(); } @@ -272,28 +261,20 @@ public class FilterControl extends Composite { } }); // enter key set focus to tree - filterText.addTraverseListener(new TraverseListener() { - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - e.doit = false; - listViewer.setFocus(); - updateListSelection(true); - } else if (e.detail == SWT.TRAVERSE_ARROW_NEXT) { - listViewer.setFocus(); - updateListSelection(false); - } else if (e.detail == SWT.TRAVERSE_ESCAPE) { - listViewer.setDefaultSelection(new StructuredSelection()); - e.doit = false; - } - } - }); - filterText.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - textChanged(); + filterText.addTraverseListener(e -> { + if (e.detail == SWT.TRAVERSE_RETURN) { + e.doit = false; + listViewer.setFocus(); + updateListSelection(true); + } else if (e.detail == SWT.TRAVERSE_ARROW_NEXT) { + listViewer.setFocus(); + updateListSelection(false); + } else if (e.detail == SWT.TRAVERSE_ESCAPE) { + listViewer.setDefaultSelection(new StructuredSelection()); + e.doit = false; } }); + filterText.addModifyListener(e -> textChanged()); // if we're using a field with built in cancel we need to listen for // default selection changes (which tell us the cancel button has been // pressed) @@ -438,13 +419,10 @@ public class FilterControl extends Composite { setFilterText(initialText); textChanged(); } else { - getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (!filterText.isDisposed() && filterText.isFocusControl()) { - setFilterText(initialText); - textChanged(); - } + getDisplay().asyncExec(() -> { + if (!filterText.isDisposed() && filterText.isFocusControl()) { + setFilterText(initialText); + textChanged(); } }); } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 7b6e5b7ca61..44f6d3e06c4 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -28,8 +28,6 @@ import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.ILaunchBarUIConstants; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; @@ -68,12 +66,7 @@ public class LaunchBarControl implements ILaunchBarListener { layout.marginHeight = 2; layout.marginWidth = 2; container.setLayout(layout); - container.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - LaunchBarControl.this.dispose(); - } - }); + container.addDisposeListener(e -> LaunchBarControl.this.dispose()); ToolBar toolBar = new ToolBar(container, SWT.FLAT); IPreferenceStore store = Activator.getDefault().getPreferenceStore(); @@ -171,12 +164,7 @@ public class LaunchBarControl implements ILaunchBarListener { } }; }); - button.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - image.dispose(); - } - }); + button.addDisposeListener(e -> image.dispose()); return button; } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java index 4bf0c648bbb..125c7d6267a 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -26,11 +26,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; import org.eclipse.e4.ui.model.application.ui.menu.MToolControl; import org.eclipse.e4.ui.workbench.UIEvents; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.widgets.Widget; -import org.osgi.service.event.Event; -import org.osgi.service.event.EventHandler; public class LaunchBarInjector { @@ -47,39 +43,33 @@ public class LaunchBarInjector { injectIntoAll(enabled); // Watch for new trimmed windows and inject there too. - eventBroker.subscribe(UIEvents.TrimmedWindow.TOPIC_TRIMBARS, new EventHandler() { - @Override - public void handleEvent(Event event) { - if (!UIEvents.isADD(event)) - return; - Object newValue = event.getProperty(UIEvents.EventTags.NEW_VALUE); - if (newValue instanceof MTrimBar) { - MTrimBar trimBar = (MTrimBar) newValue; - if (trimBar.getSide() == SideValue.TOP) { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); - injectLaunchBar(trimBar, enabled); - } + eventBroker.subscribe(UIEvents.TrimmedWindow.TOPIC_TRIMBARS, event -> { + if (!UIEvents.isADD(event)) + return; + Object newValue = event.getProperty(UIEvents.EventTags.NEW_VALUE); + if (newValue instanceof MTrimBar) { + MTrimBar trimBar = (MTrimBar) newValue; + if (trimBar.getSide() == SideValue.TOP) { + IPreferenceStore store1 = Activator.getDefault().getPreferenceStore(); + boolean enabled1 = store1.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); + injectLaunchBar(trimBar, enabled1); } } }); // Watch for preference changes - Activator.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty().equals(Activator.PREF_ENABLE_LAUNCHBAR)) { - boolean enabled = Boolean.parseBoolean(event.getNewValue().toString()); - injectIntoAll(enabled); - } - if (event.getProperty().equals(Activator.PREF_ALWAYS_TARGETSELECTOR) - || event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); - if (enabled){ - injectIntoAll(false); - injectIntoAll(true); - } + Activator.getDefault().getPreferenceStore().addPropertyChangeListener(event -> { + if (event.getProperty().equals(Activator.PREF_ENABLE_LAUNCHBAR)) { + boolean enabled1 = Boolean.parseBoolean(event.getNewValue().toString()); + injectIntoAll(enabled1); + } + if (event.getProperty().equals(Activator.PREF_ALWAYS_TARGETSELECTOR) + || event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) { + IPreferenceStore store1 = Activator.getDefault().getPreferenceStore(); + boolean enabled2 = store1.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); + if (enabled2){ + injectIntoAll(false); + injectIntoAll(true); } } }); diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java index 3bd71a4cb2c..d1398005f87 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -28,8 +28,6 @@ import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.MouseAdapter; @@ -39,7 +37,6 @@ import org.eclipse.swt.events.MouseTrackAdapter; import org.eclipse.swt.events.MouseTrackListener; 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.GC; @@ -50,9 +47,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Sash; import org.eclipse.swt.widgets.Widget; @@ -85,57 +80,54 @@ public class LaunchBarListViewer extends StructuredViewer { } } - private TraverseListener listItemTraverseListener = new TraverseListener() { - @Override - public void keyTraversed(TraverseEvent e) { - final ListItem currItem = selIndex >= 0 ? listItems[selIndex] : null; - if (currItem == null && e.keyCode != SWT.ARROW_DOWN) { - return; - } - if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_TAB_NEXT) { - if (e.keyCode == SWT.ARROW_DOWN) { - int maxIdx = listItems.length - 1; - if (selIndex < maxIdx) { - // move to next item - listItems[selIndex + 1].setSelected(true); - if (scrollBucket < maxScrollBucket) { - scrollBucket++; - } else { - // need to scroll the list up 1 item - int sY = listScrolled.getOrigin().y; - listScrolled.setOrigin(0, sY + itemH); - } - } else if (selIndex == maxIdx && maxIdx > maxScrollBucket) { - // level the scroll for any offset at the bottom of the list - listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket + 1)); + private TraverseListener listItemTraverseListener = e -> { + final ListItem currItem = selIndex >= 0 ? listItems[selIndex] : null; + if (currItem == null && e.keyCode != SWT.ARROW_DOWN) { + return; + } + if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_TAB_NEXT) { + if (e.keyCode == SWT.ARROW_DOWN) { + int maxIdx = listItems.length - 1; + if (selIndex < maxIdx) { + // move to next item + listItems[selIndex + 1].setSelected(true); + if (scrollBucket < maxScrollBucket) { + scrollBucket++; + } else { + // need to scroll the list up 1 item + int sY1 = listScrolled.getOrigin().y; + listScrolled.setOrigin(0, sY1 + itemH); } + } else if (selIndex == maxIdx && maxIdx > maxScrollBucket) { + // level the scroll for any offset at the bottom of the list + listScrolled.setOrigin(0, itemH * (maxIdx - maxScrollBucket + 1)); } - } else if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { - if (e.keyCode == SWT.ARROW_UP) { - if (selIndex > 0) { - // move to previous item - if (scrollBucket > 0) { - scrollBucket--; - } else { - // need to scroll the list down 1 item - int sY = listScrolled.getOrigin().y; - listScrolled.setOrigin(0, sY - itemH); - } - listItems[selIndex - 1].setSelected(true); - } else if (selIndex == 0) { - // level any offset @ beginning - listScrolled.setOrigin(0, 0); - } - } else if (currItem.editButton != null) { - // remove focus from edit button - currItem.editButton.setSelected(false); - currItem.editButton.redraw(); - } - } else if (e.detail == SWT.TRAVERSE_RETURN) { - setDefaultSelection(new StructuredSelection(currItem.element)); - } else if (e.detail == SWT.TRAVERSE_ESCAPE) { - setDefaultSelection(new StructuredSelection()); } + } else if (e.detail == SWT.TRAVERSE_ARROW_PREVIOUS || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { + if (e.keyCode == SWT.ARROW_UP) { + if (selIndex > 0) { + // move to previous item + if (scrollBucket > 0) { + scrollBucket--; + } else { + // need to scroll the list down 1 item + int sY2 = listScrolled.getOrigin().y; + listScrolled.setOrigin(0, sY2 - itemH); + } + listItems[selIndex - 1].setSelected(true); + } else if (selIndex == 0) { + // level any offset @ beginning + listScrolled.setOrigin(0, 0); + } + } else if (currItem.editButton != null) { + // remove focus from edit button + currItem.editButton.setSelected(false); + currItem.editButton.redraw(); + } + } else if (e.detail == SWT.TRAVERSE_RETURN) { + setDefaultSelection(new StructuredSelection(currItem.element)); + } else if (e.detail == SWT.TRAVERSE_ESCAPE) { + setDefaultSelection(new StructuredSelection()); } }; @@ -308,12 +300,7 @@ public class LaunchBarListViewer extends StructuredViewer { icon.setImage(image); if (disposeImage) { final Image disposableImage = image; - icon.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - disposableImage.dispose(); - } - }); + icon.addDisposeListener(e -> disposableImage.dispose()); } icon.setBackground(parent.getBackground()); return icon; @@ -361,12 +348,7 @@ public class LaunchBarListViewer extends StructuredViewer { sash.moveBelow(null); sash.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION)); - sash.addListener(SWT.Selection, new Listener() { - @Override - public void handleEvent(Event e) { - separatorIndex = (e.y + itemH / 2) / itemH; - } - }); + sash.addListener(SWT.Selection, e -> separatorIndex = (e.y + itemH / 2) / itemH); sash.addMouseListener(new MouseListener() { @Override public void mouseUp(MouseEvent e) { diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java index 04f93de342a..75dfdfa5438 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.controls.internal; -import java.util.Comparator; import java.util.HashMap; import java.util.Map; @@ -107,32 +106,29 @@ public class ModeSelector extends CSelector { return super.getText(element); } }); - setSorter(new Comparator() { - @Override - public int compare(Object o1, Object o2) { - if (o1 instanceof ILaunchMode && o2 instanceof ILaunchMode) { - String mode1 = ((ILaunchMode) o1).getIdentifier(); - String mode2 = ((ILaunchMode) o2).getIdentifier(); - // run comes first, then debug, then the rest - if (mode1.equals("run")) { //$NON-NLS-1$ - if (mode2.equals("run")) //$NON-NLS-1$ - return 0; - else - return -1; - } + setSorter((o1, o2) -> { + if (o1 instanceof ILaunchMode && o2 instanceof ILaunchMode) { + String mode1 = ((ILaunchMode) o1).getIdentifier(); + String mode2 = ((ILaunchMode) o2).getIdentifier(); + // run comes first, then debug, then the rest + if (mode1.equals("run")) { //$NON-NLS-1$ if (mode2.equals("run")) //$NON-NLS-1$ - return 1; - if (mode1.equals("debug")) { //$NON-NLS-1$ - if (mode2.equals("debug")) //$NON-NLS-1$ - return 0; - else - return -1; - } - if (mode2.equals("debug")) //$NON-NLS-1$ - return 1; + return 0; + else + return -1; } - return 0; + if (mode2.equals("run")) //$NON-NLS-1$ + return 1; + if (mode1.equals("debug")) { //$NON-NLS-1$ + if (mode2.equals("debug")) //$NON-NLS-1$ + return 0; + else + return -1; + } + if (mode2.equals("debug")) //$NON-NLS-1$ + return 1; } + return 0; }); } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java index cbd53e74198..f56300878f9 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.launchbar.ui.controls.internal; -import java.util.Comparator; - import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -135,14 +133,11 @@ public class TargetSelector extends CSelector implements ILaunchTargetListener { } }); - setSorter(new Comparator() { - @Override - public int compare(Object o1, Object o2) { - // Sort by name - String s1 = String.valueOf(o1); - String s2 = String.valueOf(o2); - return s1.compareTo(s2); - } + setSorter((o1, o2) -> { + // Sort by name + String s1 = String.valueOf(o1); + String s2 = String.valueOf(o2); + return s1.compareTo(s2); }); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 7b8b9afd306..9ccb2fb23ae 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -26,8 +26,6 @@ import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; @@ -121,12 +119,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau nameText = new Text(nameComp, SWT.BORDER); nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); nameText.setText(workingCopy.getName()); - nameText.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - updateMessage(); - } - }); + nameText.addModifyListener(e -> updateMessage()); tabFolder = new CTabFolder(composite, SWT.BORDER); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index b1f18f4968e..592099acba2 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 QNX Software Systems and others. + * Copyright (c) 2014, 2018 QNX Software Systems 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 @@ -191,23 +191,20 @@ public class BuildActiveCommandHandler extends AbstractHandler { } protected void saveEditors(final Collection projects) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); - for (IWorkbenchWindow window : windows) { - IWorkbenchPage[] pages = window.getPages(); - for (IWorkbenchPage page : pages) { - if (projects.isEmpty()) { - page.saveAllEditors(false); - } else { - IEditorPart[] editors = page.getDirtyEditors(); - for (IEditorPart editor : editors) { - IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); - if (inputFile != null) { - if (projects.contains(inputFile.getProject())) { - page.saveEditor(editor, false); - } + Display.getDefault().syncExec(() -> { + IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + for (IWorkbenchWindow window : windows) { + IWorkbenchPage[] pages = window.getPages(); + for (IWorkbenchPage page : pages) { + if (projects.isEmpty()) { + page.saveAllEditors(false); + } else { + IEditorPart[] editors = page.getDirtyEditors(); + for (IEditorPart editor : editors) { + IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); + if (inputFile != null) { + if (projects.contains(inputFile.getProject())) { + page.saveEditor(editor, false); } } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java index b33a13278df..fe0d3db7eb5 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017 QNX Software Systems and others. + * Copyright (c) 2017, 2018 QNX Software Systems 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 @@ -8,7 +8,6 @@ package org.eclipse.launchbar.ui.internal.dialogs; import java.util.Arrays; -import java.util.Comparator; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfigurationType; @@ -151,15 +150,12 @@ public class NewLaunchConfigTypePage2 extends WizardPage { editPage.setLaunchGroup(group); ILaunchConfigurationType[] types = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); - Arrays.sort(types, new Comparator() { - @Override - public int compare(ILaunchConfigurationType type0, ILaunchConfigurationType type1) { - int comp = type0.getPluginIdentifier().compareTo(type1.getPluginIdentifier()); - if (comp != 0) { - return comp; - } else { - return type0.getName().compareTo(type1.getName()); - } + Arrays.sort(types, (type0, type1) -> { + int comp = type0.getPluginIdentifier().compareTo(type1.getPluginIdentifier()); + if (comp != 0) { + return comp; + } else { + return type0.getName().compareTo(type1.getName()); } }); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java index d9b9d1b03db..34ac9cd4648 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation 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 @@ -11,7 +11,6 @@ package org.eclipse.launchbar.ui.internal.target; import java.util.ArrayList; -import java.util.Comparator; import java.util.List; import org.eclipse.core.runtime.CoreException; @@ -68,13 +67,10 @@ class NewLaunchTargetWizardSelectionPage extends WizardPage { } } - elements.sort(new Comparator() { - @Override - public int compare(IConfigurationElement o1, IConfigurationElement o2) { - String name1 = o1.getAttribute("name"); //$NON-NLS-1$ - String name2 = o2.getAttribute("name"); //$NON-NLS-1$ - return name1.compareTo(name2); - } + elements.sort((o1, o2) -> { + String name1 = o1.getAttribute("name"); //$NON-NLS-1$ + String name2 = o2.getAttribute("name"); //$NON-NLS-1$ + return name1.compareTo(name2); }); for (IConfigurationElement element : elements) { diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 22ca2aab850..218067444f0 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -37,8 +37,6 @@ import org.eclipse.launchbar.core.ILaunchDescriptorType; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; public class LaunchBarManagerTest { @Test @@ -172,12 +170,9 @@ public class LaunchBarManagerTest { doReturn(launchConfig).when(configProvider).getLaunchConfiguration(eq(descriptor), any(ILaunchTarget.class)); doReturn(launchConfigType).when(configProvider).getLaunchConfigurationType(any(ILaunchDescriptor.class), any(ILaunchTarget.class)); - doAnswer(new Answer() { - @Override - public Boolean answer(InvocationOnMock invocation) throws Throwable { - ILaunchTarget target = (ILaunchTarget) invocation.getArguments()[1]; - return target.getTypeId().equals(ILaunchTargetManager.localLaunchTargetTypeId); - } + doAnswer(invocation -> { + ILaunchTarget target = (ILaunchTarget) invocation.getArguments()[1]; + return target.getTypeId().equals(ILaunchTargetManager.localLaunchTargetTypeId); }).when(configProvider).supports(eq(descriptor), any(ILaunchTarget.class)); doReturn(elements.toArray(new IConfigurationElement[0])).when(extension).getConfigurationElements(); diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java index 25b74498220..230fd1c18fa 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017 QNX Software Systems and others. + * Copyright (c) 2017, 2018 QNX Software Systems 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 @@ -44,12 +44,7 @@ public class SWTBotCSelector extends AbstractSWTBotControl { @Override public SWTBotCSelector click() { - Point size = syncExec(new Result() { - @Override - public Point run() { - return widget.getSize(); - } - }); + Point size = syncExec((Result) () -> widget.getSize()); click(size.x / 2, size.y / 2); return this; } diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java index f303c88219d..915f7235897 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017 QNX Software Systems and others. + * Copyright (c) 2017, 2018 QNX Software Systems 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 @@ -38,12 +38,7 @@ public class SWTBotConfigSelector extends SWTBotCSelector { @Override public ActionArea click() { - Point size = syncExec(new Result() { - @Override - public Point run() { - return widget.getSize(); - } - }); + Point size = syncExec((Result) () -> widget.getSize()); click(size.x / 2, size.y / 2); return this; } From e795c3441db3ee9fbffbe9164a686fdb3cb77885 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 21 Dec 2018 21:13:27 +0200 Subject: [PATCH 171/198] Remove unneeded empty plugin.xml file. Change-Id: Id958a97ab5fe51433907bed539ee2037c308ec89 Signed-off-by: Alexander Kurtakov --- bundles/org.eclipse.launchbar.remote.ui/build.properties | 3 +-- bundles/org.eclipse.launchbar.remote.ui/plugin.xml | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 bundles/org.eclipse.launchbar.remote.ui/plugin.xml diff --git a/bundles/org.eclipse.launchbar.remote.ui/build.properties b/bundles/org.eclipse.launchbar.remote.ui/build.properties index e9863e281ea..34d2e4d2dad 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/build.properties +++ b/bundles/org.eclipse.launchbar.remote.ui/build.properties @@ -1,5 +1,4 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - .,\ - plugin.xml + . diff --git a/bundles/org.eclipse.launchbar.remote.ui/plugin.xml b/bundles/org.eclipse.launchbar.remote.ui/plugin.xml deleted file mode 100644 index 5535690d377..00000000000 --- a/bundles/org.eclipse.launchbar.remote.ui/plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - From 32b3dc7d9467d82b8e04a6b805d41e930e2fa199 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 24 Jan 2019 12:12:19 +0200 Subject: [PATCH 172/198] Update tycho pomless to 1.3.0. Change-Id: Ia3e73c4c57ad6af91d874944692f29297334e1e0 Signed-off-by: Alexander Kurtakov --- .mvn/extensions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 9d93c39fd93..c81e8ae5004 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -3,6 +3,6 @@ org.eclipse.tycho.extras tycho-pomless - 1.0.0 + 1.3.0 From a0cc4a412814559aabeca5b8d0c112d633c2b9b2 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 24 Jan 2019 12:13:25 +0200 Subject: [PATCH 173/198] Run ui tests with pde.feature instead of sdk.feature. Prevents downloading all the *source bundles which are not really needed. Change-Id: I91690309b5deb9a48273743406a03ad842a32a29 Signed-off-by: Alexander Kurtakov --- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index 7e274d24ac0..998aed5d3f7 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -32,7 +32,7 @@ p2-installable-unit - org.eclipse.sdk.feature.group + org.eclipse.pde.feature.group org.eclipse.sdk.ide From bb02738761eca59d5147f75445bb31d675b22fbc Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 24 Jan 2019 12:26:56 +0200 Subject: [PATCH 174/198] Switch to spotbugs instead of findbugs. It's the comunity project now. Change-Id: I8597b05f7f1f0e16bd34d0d115fe735c19ede5fa Signed-off-by: Alexander Kurtakov --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index bf29ed0ea76..0a6418368a2 100644 --- a/pom.xml +++ b/pom.xml @@ -310,9 +310,9 @@ 1.8 - org.codehaus.mojo - findbugs-maven-plugin - 3.0.5 + com.github.spotbugs + spotbugs-maven-plugin + 3.1.10 true false From 04ad3ec06fccab42c23d59bf29ac13213553a565 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 24 Jan 2019 13:03:09 +0200 Subject: [PATCH 175/198] Do not use internal E4Workbench class. Rather fetch the context from the factory. Change-Id: I12e1b94d070feeebcee9298f544ab2fc9c5cb3ec Signed-off-by: Alexander Kurtakov --- .../ui/controls/internal/OpenLaunchSelector.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java index e24f46084f7..7d6c80f3b56 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 QNX Software Systems and others. + * Copyright (c) 2015, 2019 QNX Software Systems 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 @@ -16,21 +16,22 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Status; +import org.eclipse.e4.core.contexts.EclipseContextFactory; import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.ui.internal.workbench.E4Workbench; import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.e4.ui.model.application.ui.menu.MToolControl; import org.eclipse.e4.ui.workbench.modeling.EModelService; +import org.osgi.framework.FrameworkUtil; public class OpenLaunchSelector extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { - IEclipseContext serviceContext = E4Workbench.getServiceContext(); + IEclipseContext serviceContext = EclipseContextFactory.getServiceContext( + FrameworkUtil.getBundle(org.eclipse.e4.ui.workbench.IWorkbench.class).getBundleContext()); MApplication application = serviceContext.get(MApplication.class); EModelService service = application.getContext().get(EModelService.class); - List findElements = service.findElements(application, LaunchBarControl.ID, - null, null); - if (findElements.size() > 0) { + List findElements = service.findElements(application, LaunchBarControl.ID, null, null); + if (!findElements.isEmpty()) { MToolControl mpart = (MToolControl) findElements.get(0); Object bar = mpart.getObject(); if (bar instanceof LaunchBarControl) { From 46b125139a2f19c77782de8ca26d61eeb7c004ff Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Thu, 24 Jan 2019 13:24:02 +0200 Subject: [PATCH 176/198] Fix compile when using Java 11 Tycho 1.4.0-SNAPSHOT is needed due to a fix in tycho for Java 11 compatibility. Change-Id: I3db48b8396b54c8fd8b6b5afd69730809d2ef761 Signed-off-by: Alexander Kurtakov --- pom.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0a6418368a2..e61eaeef138 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ pom - 1.3.0 - 1.3.0 + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -84,6 +84,10 @@ cbi https://repo.eclipse.org/content/repositories/cbi-releases/ + + tycho-snapshots + https://repo.eclipse.org/content/repositories/tycho-snapshots/ + From fe09ae9bae9780adc8b43a8eb020c4f3fd4aab2e Mon Sep 17 00:00:00 2001 From: William Riley Date: Mon, 4 Feb 2019 11:18:41 +0000 Subject: [PATCH 177/198] [releng] Bump version to 2.2.3 Change-Id: I5cccc2d9ef78915803a4029f75717d972fb5973e --- bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF | 2 +- bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/pom.xml | 2 +- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- repo/pom.xml | 2 +- tests/org.eclipse.launchbar.core.tests/pom.xml | 2 +- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 7f4c39992ae..8b18d87df34 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.2.2.qualifier +Bundle-Version: 2.2.3.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index 293c6396664..d0bc725fbd1 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.2.2.qualifier +Bundle-Version: 2.2.3.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/pom.xml b/bundles/pom.xml index dd17ff250e2..fa2387bfb9d 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.2-SNAPSHOT + 2.2.3-SNAPSHOT bundles-parent diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 7a9c72531f5..12d31babc91 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index 1f9e5d0e883..a2e18bea702 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/pom.xml b/features/pom.xml index 78fc4b82d04..900e0581f67 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.2-SNAPSHOT + 2.2.3-SNAPSHOT features-parent diff --git a/pom.xml b/pom.xml index e61eaeef138..dc85e84102f 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.launchbar parent - 2.2.2-SNAPSHOT + 2.2.3-SNAPSHOT pom diff --git a/repo/pom.xml b/repo/pom.xml index 5fd830311e2..c5a92306545 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -5,7 +5,7 @@ org.eclipse.launchbar parent - 2.2.2-SNAPSHOT + 2.2.3-SNAPSHOT ../pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index 5f5c5b24e71..afce610a4bf 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.2-SNAPSHOT + 2.2.3-SNAPSHOT ../../pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index 998aed5d3f7..4a6614bde79 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -6,7 +6,7 @@ org.eclipse.launchbar - 2.2.2-SNAPSHOT + 2.2.3-SNAPSHOT ../../pom.xml parent From 653bd51fa83344fba42329bf9867dc636d509227 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 10 Apr 2019 19:35:42 +0300 Subject: [PATCH 178/198] Releng changes. * Use tycho 1.4.0 final * Use 2019-03 dependencies repos Change-Id: I75c91b0085da43a6c95cc673cd74b6290fa43b0d Signed-off-by: Alexander Kurtakov --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index dc85e84102f..e35d6ec4048 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ pom - 1.4.0-SNAPSHOT - 1.4.0-SNAPSHOT + 1.4.0 + 1.4.0 jacoco reuseReports ${project.basedir}/../../target/jacoco.exec @@ -39,7 +39,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.10/ + http://download.eclipse.org/eclipse/updates/4.11/ p2 @@ -49,7 +49,7 @@ cdt - http://download.eclipse.org/tools/cdt/releases/9.6/ + http://download.eclipse.org/tools/cdt/releases/9.7 p2 From 16c7075763a6ccd530b11ca641c8ebf34ae0f4d8 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 21 May 2019 16:19:38 -0400 Subject: [PATCH 179/198] Bug 547442 - Launchbar shouldn't set active target for added Container target - add new ILaunchTargetManager2 interface which specifies new addLaunchTargetNoNotify() method - change LaunchTargetManager to also implement ILaunchTargetManager2 interface - bump to next minor release 2.3.0 Change-Id: I263c44b586a60428971c401d982da2dacd8cd1f0 Signed-off-by: Jeff Johnston --- .../META-INF/MANIFEST.MF | 2 +- .../internal/target/LaunchTargetManager.java | 25 ++++++++++------ .../core/target/ILaunchTargetManager2.java | 29 +++++++++++++++++++ features/org.eclipse.launchbar/feature.xml | 2 +- 4 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF index 8b18d87df34..e3465955719 100644 --- a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar Core Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true -Bundle-Version: 2.2.3.qualifier +Bundle-Version: 2.3.0.qualifier Bundle-Activator: org.eclipse.launchbar.core.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index d2e27ea2887..a4c4ab7a043 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -26,12 +26,13 @@ import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTargetListener; import org.eclipse.launchbar.core.target.ILaunchTargetManager; +import org.eclipse.launchbar.core.target.ILaunchTargetManager2; import org.eclipse.launchbar.core.target.ILaunchTargetProvider; import org.eclipse.launchbar.core.target.TargetStatus; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; -public class LaunchTargetManager implements ILaunchTargetManager { +public class LaunchTargetManager implements ILaunchTargetManager, ILaunchTargetManager2 { private Map> targets; private Map typeElements; @@ -188,7 +189,7 @@ public class LaunchTargetManager implements ILaunchTargetManager { } @Override - public ILaunchTarget addLaunchTarget(String typeId, String id) { + public ILaunchTarget addLaunchTargetNoNotify(String typeId, String id) { initTargets(); Map type = targets.get(typeId); if (type == null) { @@ -212,19 +213,25 @@ public class LaunchTargetManager implements ILaunchTargetManager { ILaunchTarget target = new LaunchTarget(typeId, id, child); type.put(id, target); prefs.flush(); - - synchronized (listeners) { - for (ILaunchTargetListener listener : listeners) { - listener.launchTargetAdded(target); - } - } - return target; } catch (BackingStoreException e) { Activator.log(e); return null; } } + + @Override + public ILaunchTarget addLaunchTarget(String typeId, String id) { + ILaunchTarget target = addLaunchTargetNoNotify(typeId, id); + if (target != null) { + synchronized (listeners) { + for (ILaunchTargetListener listener : listeners) { + listener.launchTargetAdded(target); + } + } + } + return target; + } @Override public void removeLaunchTarget(ILaunchTarget target) { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java new file mode 100644 index 00000000000..d95daf3c890 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2019 Red Hat Inc. 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 + *******************************************************************************/ +package org.eclipse.launchbar.core.target; + +/** + * Launch target manager extensions. + * + * @noimplement not to be implemented by clients + */ +public interface ILaunchTargetManager2 { + + /** + * Add a launch target with the given typeId, id, and name but no notification. + * + * @param typeId + * type id of the launch target + * @param id + * id for the target. + * @return the created launch target + */ + ILaunchTarget addLaunchTargetNoNotify(String typeId, String id); + + +} diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index a2e18bea702..b61f15d85ee 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ From a18f0a85f2a8ed496a9bb7ecab40fce81cb44cff Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Wed, 22 May 2019 10:46:06 -0400 Subject: [PATCH 180/198] [releng] Bump version to 2.3.0 Change-Id: Ic515e87ff34d1750d7a3c585e036ae020469b578 --- bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF | 2 +- bundles/pom.xml | 2 +- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- repo/pom.xml | 2 +- tests/org.eclipse.launchbar.core.tests/pom.xml | 2 +- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF index d0bc725fbd1..ae2d05593ee 100644 --- a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: LaunchBar UI Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true -Bundle-Version: 2.2.3.qualifier +Bundle-Version: 2.3.0.qualifier Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.core.runtime, diff --git a/bundles/pom.xml b/bundles/pom.xml index fa2387bfb9d..c8f557a6886 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT bundles-parent diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 12d31babc91..7b58ab6b421 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/pom.xml b/features/pom.xml index 900e0581f67..54a77f2fc0b 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT features-parent diff --git a/pom.xml b/pom.xml index e35d6ec4048..c75d2692ca6 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.launchbar parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT pom diff --git a/repo/pom.xml b/repo/pom.xml index c5a92306545..dade6cbb1b3 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -5,7 +5,7 @@ org.eclipse.launchbar parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index afce610a4bf..850399203ca 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../../pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index 4a6614bde79..ce7aa7a6f7a 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -6,7 +6,7 @@ org.eclipse.launchbar - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../../pom.xml parent From d2c9b975a5a3d30536d56bd3b2df3e28b8f146a8 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Wed, 22 May 2019 10:51:30 -0400 Subject: [PATCH 181/198] [releng] update platform version Change-Id: I3c9fcbd4f16ec8913c3ad4946627c9baef95215c --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c75d2692ca6..722b6ee23a9 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ jacoco reuseReports ${project.basedir}/../../target/jacoco.exec - http://download.eclipse.org/eclipse/updates/4.10 + http://download.eclipse.org/eclipse/updates/4.11 @@ -39,7 +39,7 @@ platform - http://download.eclipse.org/eclipse/updates/4.11/ + https://download.eclipse.org/eclipse/updates/4.12-I-builds/I20190521-1800/ p2 From fb389bae6f69c79fa2da9710c94b0fe1508a8b42 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 27 May 2019 16:28:01 -0400 Subject: [PATCH 182/198] Bug 547705 Implement Dup and Del of Configs. Make Default public. Adds Duplicate and Delete buttons to our config editor. Default descriptors, which map directly to launch configs,\ differently from the others. As a result, we make the Default configs public so others can take advantage of this behavior. Change-Id: Idbe9449556e214001ac0a9e615ce684e5e5579b3 --- bundles/org.eclipse.launchbar.core/plugin.xml | 2 +- .../DefaultLaunchDescriptor.java | 12 +-- .../DefaultLaunchDescriptorType.java | 38 +++++--- .../internal/LaunchBarLaunchConfigDialog.java | 90 +++++++++++++++++++ .../ui/internal/LaunchBarUIManager.java | 17 +++- .../launchbar/ui/internal/Messages.java | 16 ++-- .../launchbar/ui/internal/messages.properties | 9 ++ .../core/internal/LaunchBarManager2Test.java | 1 + 8 files changed, 156 insertions(+), 29 deletions(-) rename bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/{internal => }/DefaultLaunchDescriptor.java (80%) rename bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/{internal => }/DefaultLaunchDescriptorType.java (71%) diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/bundles/org.eclipse.launchbar.core/plugin.xml index 13b7ef1dfd0..207ec12cd0a 100644 --- a/bundles/org.eclipse.launchbar.core/plugin.xml +++ b/bundles/org.eclipse.launchbar.core/plugin.xml @@ -10,7 +10,7 @@ id="org.eclipse.launchbar.core.objectProvider.project"> diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java similarity index 80% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java rename to bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java index 28af5ce2d2b..fc7156d6df9 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java @@ -8,23 +8,23 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.core.internal; +package org.eclipse.launchbar.core; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchDescriptorType; /** * A special launch descriptor that managed configurations that aren't owned by other - * descriptors. + * descriptors. + * + * @since 2.3 */ public class DefaultLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { - private final DefaultLaunchDescriptorType type; + private final ILaunchDescriptorType type; private final ILaunchConfiguration configuration; - public DefaultLaunchDescriptor(DefaultLaunchDescriptorType type, ILaunchConfiguration configuration) { + public DefaultLaunchDescriptor(ILaunchDescriptorType type, ILaunchConfiguration configuration) { this.type = type; this.configuration = configuration; } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java similarity index 71% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java rename to bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java index d1297d6fdd6..fab847e1fdb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer *******************************************************************************/ -package org.eclipse.launchbar.core.internal; +package org.eclipse.launchbar.core; import java.util.HashMap; import java.util.Map; @@ -17,12 +17,13 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.launchbar.core.ILaunchDescriptor; -import org.eclipse.launchbar.core.ILaunchDescriptorType; +import org.eclipse.launchbar.core.internal.Activator; /** * A special descriptor type that managed configurations that aren't owned by * other descriptor types. + * + * @since 2.3 */ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { @@ -33,24 +34,35 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { @Override public boolean supportsTargets() throws CoreException { // Old style launch configs do not support targets. + // Though if yours does, you can always subclass and override this. return false; } + /** + * Used to filter out private and external tools builders + * + * @param config + * @return + * @throws CoreException + */ + public static boolean isPublic(ILaunchConfiguration config) throws CoreException { + ILaunchConfigurationType type = config.getType(); + if (type == null) { + return false; + } + + String category = type.getCategory(); + + return type.isPublic() && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false)) + && !("org.eclipse.ui.externaltools.builder".equals(category)); // $NON-NLS-1$ + } + @Override public ILaunchDescriptor getDescriptor(Object launchObject) { if (launchObject instanceof ILaunchConfiguration) { ILaunchConfiguration config = (ILaunchConfiguration) launchObject; try { - ILaunchConfigurationType type = config.getType(); - if (type == null) { - return null; - } - - // Filter out private and external tools builders - String category = type.getCategory(); - if (type.isPublic() && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false)) - && !("org.eclipse.ui.externaltools.builder".equals(category))) { //$NON-NLS-1$ - + if (isPublic(config)) { DefaultLaunchDescriptor descriptor = descriptors.get(config); if (descriptor == null) { descriptor = new DefaultLaunchDescriptor(this, config); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index 9ccb2fb23ae..b0bfcd881f1 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -12,11 +12,14 @@ import org.eclipse.debug.ui.ILaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IMessageProvider; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.wizard.ProgressMonitorPart; +import org.eclipse.launchbar.core.DefaultLaunchDescriptor; +import org.eclipse.launchbar.core.DefaultLaunchDescriptorType; import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog; @@ -53,6 +56,9 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private ProgressMonitorPart pmPart; private boolean initing; + public static final int ID_DUPLICATE = IDialogConstants.CLIENT_ID + 1; + public static final int ID_DELETE = IDialogConstants.CLIENT_ID + 2; + public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target, ILaunchConfigurationTabGroup buildTabGroup) { @@ -201,6 +207,90 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau return tabItem; } + @Override + protected Control createButtonBar(Composite parent) { + Composite buttonBar = (Composite) super.createButtonBar(parent); + Control[] children = buttonBar.getChildren(); + Control okCancelButtons = children[children.length - 1]; + Control configButtons = createConfigButtons(buttonBar); + + // insert our buttons ahead of the OK/Cancel buttons + configButtons.moveAbove(okCancelButtons); + + return buttonBar; + } + + protected Control createConfigButtons(Composite parent) { + ((GridLayout) parent.getLayout()).numColumns++; + Composite composite = new Composite(parent, SWT.NONE); + // create a layout with spacing and margins appropriate for the font size. + GridLayout layout = new GridLayout(); + layout.numColumns = 0; // this is incremented by createButton + layout.makeColumnsEqualWidth = true; + layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); + layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); + layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); + layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); + composite.setLayout(layout); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER + | GridData.VERTICAL_ALIGN_CENTER); + composite.setLayoutData(data); + composite.setFont(parent.getFont()); + + // Allow Duplicate only if the resulting configuration is public + try { + if (DefaultLaunchDescriptorType.isPublic(workingCopy.getOriginal())) { + createButton(composite, ID_DUPLICATE, Messages.LaunchBarLaunchConfigDialog_Duplicate, false); + } + } catch (CoreException e) { + Activator.log(e.getStatus()); + } + + String deleteText; + if (descriptor instanceof DefaultLaunchDescriptor) { + deleteText = Messages.LaunchBarLaunchConfigDialog_Delete; + } else { + deleteText = Messages.LaunchBarLaunchConfigDialog_Reset; + } + + // TODO if the descriptor is not a launch config, this should really say Reset + createButton(composite, ID_DELETE, deleteText, false); + + return composite; + } + + @Override + protected void buttonPressed(int buttonId) { + if (buttonId == ID_DUPLICATE) { + duplicatePressed(); + } else if (buttonId == ID_DELETE) { + deletePressed(); + } else { + super.buttonPressed(buttonId); + } + } + + protected void deletePressed() { + String title, message; + if (descriptor instanceof DefaultLaunchDescriptor) { + title = Messages.LaunchBarLaunchConfigDialog_DeleteTitle; + message = Messages.LaunchBarLaunchConfigDialog_DeleteConfirm; + } else { + title = Messages.LaunchBarLaunchConfigDialog_ResetTitle; + message = Messages.LaunchBarLaunchConfigDialog_ResetConfirm; + } + + if (MessageDialog.openConfirm(getShell(), title, String.format(message, workingCopy.getName()))) { + setReturnCode(ID_DELETE); + close(); + } + } + + protected void duplicatePressed() { + setReturnCode(ID_DUPLICATE); + close(); + } + @Override protected void okPressed() { String newName = nameText.getText().trim(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 16e62a40677..1f60b6b8b51 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; @@ -126,12 +127,26 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { LaunchBarLaunchConfigDialog dialog = new LaunchBarLaunchConfigDialog(shell, workingCopy, descriptor, mode, target, buildTabGroup); - if (dialog.open() == Window.OK) { + switch (dialog.open()) { + case Window.OK: if (!workingCopy.getOriginal().equals(workingCopy) && (!workingCopy.getOriginal().getAttributes().equals(workingCopy.getAttributes()) || !workingCopy.getOriginal().getName().equals(workingCopy.getName()))) { workingCopy.doSave(); } + break; + case LaunchBarLaunchConfigDialog.ID_DUPLICATE: + { + String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(workingCopy.getName()); + ILaunchConfigurationWorkingCopy newWorkingCopy = workingCopy.copy(newName); + newWorkingCopy.doSave(); + } + break; + case LaunchBarLaunchConfigDialog.ID_DELETE: + config.delete(); + break; + default: + break; } } catch (CoreException e) { return e.getStatus(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 969bd40d01d..01a9b11775d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -52,21 +52,21 @@ public class Messages extends NLS { public static String NoLaunchModeSelected; public static String NoLaunchGroupSelected; public static String LaunchBarLaunchConfigDialog_Edit1; - public static String LaunchBarLaunchConfigDialog_Edit2; - public static String LaunchBarLaunchConfigDialog_EditConfiguration; - public static String LaunchBarLaunchConfigDialog_LaunchConfigName; - public static String LaunchBarLaunchConfigDialog_LCMustHaveName; - public static String LaunchBarLaunchConfigDialog_LCNameExists; - public static String LaunchBarLaunchConfigDialog_LCNameNotValid; - public static String LaunchBarLaunchConfigDialog_SetParameters; - + public static String LaunchBarLaunchConfigDialog_Duplicate; + public static String LaunchBarLaunchConfigDialog_Delete; + public static String LaunchBarLaunchConfigDialog_Reset; + public static String LaunchBarLaunchConfigDialog_DeleteTitle; + public static String LaunchBarLaunchConfigDialog_ResetTitle; + public static String LaunchBarLaunchConfigDialog_DeleteConfirm; + public static String LaunchBarLaunchConfigDialog_ResetConfirm; + public static String LaunchConfigurationNotFound; public static String LaunchConfigurationNotFoundDesc; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 7d1827330b8..7e52a79713a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -39,6 +39,7 @@ NoLaunchConfigType=No launch configuration type matches selected launch descript CannotEditLaunchConfiguration=Cannot edit this configuration. NoLaunchModeSelected=No launch mode selected. NoLaunchGroupSelected=No launch group found for the current selection. + LaunchBarLaunchConfigDialog_Edit1=Edit configuration %s for %s LaunchBarLaunchConfigDialog_Edit2=Edit configuration %s for %s on %s LaunchBarLaunchConfigDialog_EditConfiguration=Edit Configuration @@ -47,6 +48,14 @@ LaunchBarLaunchConfigDialog_LCMustHaveName=Launch configuration must have a name LaunchBarLaunchConfigDialog_LCNameExists=A launch configuration with that name already exists. LaunchBarLaunchConfigDialog_LCNameNotValid=The launch configuration name is not valid. LaunchBarLaunchConfigDialog_SetParameters=Set parameters for the configuration. +LaunchBarLaunchConfigDialog_Duplicate=Duplicate +LaunchBarLaunchConfigDialog_Delete=Delete +LaunchBarLaunchConfigDialog_Reset=Restore Defaults +LaunchBarLaunchConfigDialog_DeleteTitle=Delete Launch Configuration +LaunchBarLaunchConfigDialog_ResetTitle=Restore Launch Configuration Defaults +LaunchBarLaunchConfigDialog_DeleteConfirm=Are you sure you would like to delete %s +LaunchBarLaunchConfigDialog_ResetConfirm=Are you sure you want to restore defaults on %s + LaunchConfigurationNotFound=Launch Configuration Not Found LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target. LaunchTargetWizardDialog_Delete=Delete diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index f8eca5b4a8a..8b4cffd5a0e 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -49,6 +49,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; import org.eclipse.launchbar.core.DefaultLaunchConfigProvider; +import org.eclipse.launchbar.core.DefaultLaunchDescriptorType; import org.eclipse.launchbar.core.ILaunchBarListener; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; import org.eclipse.launchbar.core.ILaunchDescriptor; From 890bca3466b3d7be07a5b21d1bed771e6b40e97b Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 31 May 2019 16:24:07 -0400 Subject: [PATCH 183/198] Bug 547831 Allow LC Providers to use the Null Target The Null Target is half way to becoming a first class citizen. However we don't provide it in the list of targets available for a launch descriptor. This adds support for that by adding a boolean flag to the launch configuration provider launch bar contribution extension. To help with that, changed the handling of get launch config for the default launch descriptors to grab the config directly from the descriptor without going through the providers. It would be very weird for the providers to return a different config, but that door is now shut. Also add some documentation to ILaunchBarManager. Was going to add the support there but went for the extension instead. Might as well check in the docs I wrote doing that. Change-Id: Ia03002a661a3971df68f74b2c338fe538b8b376a --- .../schema/launchBarContributions.exsd | 7 ++ .../launchbar/core/ILaunchBarManager.java | 119 +++++++++++++++--- .../core/internal/LaunchBarManager.java | 34 ++++- .../internal/LaunchConfigProviderInfo.java | 12 ++ 4 files changed, 150 insertions(+), 22 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd index 91f7c5152aa..6fa1fe86532 100644 --- a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd +++ b/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd @@ -131,6 +131,13 @@ provider with priority 5. Priority 0 is reserved for default provider. + + + + Does the descriptor managed by this config provider support the null target. + + + diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index b80b6ef1734..72d415653bc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -25,20 +25,20 @@ import org.eclipse.launchbar.core.target.ILaunchTarget; public interface ILaunchBarManager extends ILaunchConfigurationListener { /** - * A launch object has been added. Create a matching launch descriptor if available. + * A launch object has been added. Create a matching launch descriptor if + * available. * - * @param element - * launch object + * @param element launch object * @return the launch descriptor that got created, null of none was * @throws CoreException */ ILaunchDescriptor launchObjectAdded(Object launchObject) throws CoreException; /** - * A launch object has been removed. Remove the associated launch descriptor if there is one. + * A launch object has been removed. Remove the associated launch descriptor if + * there is one. * - * @param element - * launch object + * @param element launch object * @throws CoreException */ void launchObjectRemoved(Object launchObject) throws CoreException; @@ -66,37 +66,118 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { void removeListener(ILaunchBarListener listener); /** - * Return the type id for the given launch descriptor type. This is defined in the extension - * point that defines the type. + * Return the type id for the given launch descriptor type. This is defined in + * the extension point that defines the type. * - * @param descType - * descriptor type + * @param descType descriptor type * @return the type id for the descriptor type */ String getDescriptorTypeId(ILaunchDescriptorType descType) throws CoreException; + /** + * Returns the active launch descriptor. + * + * @return active launch descriptor + * @throws CoreException + */ ILaunchDescriptor getActiveLaunchDescriptor() throws CoreException; - + + /** + * Returns the active launch mode. + * + * @return active launch mode + * @throws CoreException + */ ILaunchMode getActiveLaunchMode() throws CoreException; + /** + * Returns the active launch target. + * + * @return active launch target + * @throws CoreException + */ ILaunchTarget getActiveLaunchTarget() throws CoreException; - + + /** + * Returns the active launch configuration as derived from the active descriptor + * and target. + * + * @return active launch configuration + * @throws CoreException + */ ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException; + /** + * Returns the launch configuration derived from the given launch descriptor and + * target. + * + * @param desc launch descriptor + * @param target launch target + * @return launch configuration + * @throws CoreException + */ ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor desc, ILaunchTarget target) throws CoreException; - - ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor desc, ILaunchTarget target) throws CoreException; - + + /** + * Returns the launch configuration type used for configurations that are + * derived from the given launch descriptor and launch target without creating a + * launch configuration. + * + * @param desc launch descriptor + * @param target launch target + * @return launch configuration type + * @throws CoreException + */ + ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor desc, ILaunchTarget target) + throws CoreException; + + /** + * Returns all know launch descriptors. + * + * @return launch descriptors + * @throws CoreException + */ ILaunchDescriptor[] getLaunchDescriptors() throws CoreException; - + + /** + * Set the active launch descriptor. + * + * @param desc launch descriptor + * @throws CoreException + */ void setActiveLaunchDescriptor(ILaunchDescriptor desc) throws CoreException; + /** + * Return all launch modes for the active launch descriptor and active launch target. + * + * @return launch modes + * @throws CoreException + */ ILaunchMode[] getLaunchModes() throws CoreException; - + + /** + * Set the active launch mode. + * + * @param mode launch mode + * @throws CoreException + */ void setActiveLaunchMode(ILaunchMode mode) throws CoreException; + /** + * Return all launch targets supported by the given launch descriptor. + * + * @param desc launch descriptor + * @return launch targets + * @throws CoreException + */ ILaunchTarget[] getLaunchTargets(ILaunchDescriptor desc) throws CoreException; - + + /** + * Set the active launch target. + * + * @param target launch target + * @throws CoreException + */ void setActiveLaunchTarget(ILaunchTarget target) throws CoreException; - + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index e7957ecf35f..f496b4e0ef0 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -37,6 +37,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchListener; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.launchbar.core.DefaultLaunchDescriptor; import org.eclipse.launchbar.core.ILaunchBarListener; import org.eclipse.launchbar.core.ILaunchBarManager; import org.eclipse.launchbar.core.ILaunchConfigurationProvider; @@ -310,6 +311,14 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene throws CoreException { if (descriptor == null) return null; + + if (descriptor instanceof DefaultLaunchDescriptor) { + // With the default descriptor, we already have the config, just return the type + // Doesn't matter what the target is, that's dealt with at launch time + ILaunchConfiguration config = descriptor.getAdapter(ILaunchConfiguration.class); + return config.getType(); + } + for (LaunchConfigProviderInfo providerInfo : configProviders.get(getDescriptorTypeId(descriptor.getType()))) { if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) { ILaunchConfigurationProvider provider = providerInfo.getProvider(); @@ -321,6 +330,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } } + + // not found return null; } @@ -708,6 +719,9 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene targets.add(target); } } + if (supportsNullTarget(descriptor)) { + targets.add(ILaunchTarget.NULL_TARGET); + } return targets.toArray(new ILaunchTarget[targets.size()]); } @@ -727,6 +741,16 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene return false; } + boolean supportsNullTarget(ILaunchDescriptor descriptor) { + String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); + for (LaunchConfigProviderInfo providerInfo : configProviders.get(descriptorTypeId)) { + if (providerInfo.enabled(descriptor) && providerInfo.supportsNullTarget()) { + return true; + } + } + return false; + } + @Override public ILaunchTarget getActiveLaunchTarget() { return activeLaunchTarget; @@ -761,9 +785,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } private void storeLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target) { - if (target == null || target == ILaunchTarget.NULL_TARGET) { - // no point storing null, if stored id is invalid it won't be used - // anyway + if (target == null) { + // Don't store if it's null. Not sure we're null any more anyway. return; } // per desc store, desc can be null means it store globally @@ -807,6 +830,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (descriptor == null) { return null; } + + if (descriptor instanceof DefaultLaunchDescriptor) { + return descriptor.getAdapter(ILaunchConfiguration.class); + } + String descTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeId)) { try { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 73c686f2f10..9ee32ead2de 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -22,6 +22,7 @@ import org.eclipse.launchbar.core.ILaunchConfigurationProvider; public class LaunchConfigProviderInfo { private final String descriptorTypeId; private final int priority; + private final boolean supportsNullTarget; private IConfigurationElement element; private ILaunchConfigurationProvider provider; private Expression expression; @@ -38,6 +39,13 @@ public class LaunchConfigProviderInfo { } priority = priorityNum; + String nullTargetString = element.getAttribute("supportsNullTarget"); //$NON-NLS-1$ + if (nullTargetString != null) { + supportsNullTarget = Boolean.parseBoolean(nullTargetString); + } else { + supportsNullTarget = false; + } + this.element = element; IConfigurationElement[] enabledExpressions = element.getChildren("enablement");//$NON-NLS-1$ @@ -70,6 +78,10 @@ public class LaunchConfigProviderInfo { return priority; } + public boolean supportsNullTarget() { + return supportsNullTarget; + } + public ILaunchConfigurationProvider getProvider() { if (provider == null) { try { From 65fdbea4c0f867a80489f821b005ff9f52e24055 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 4 Jun 2019 10:46:06 -0400 Subject: [PATCH 184/198] Bug 547916 - Manage the size of the New Launch Config Wizard Dialog. Replicates the size management code of the regular launch config dialog and sets the default size to be 800x720. Change-Id: I00e5028383e3a04e8b81d3adfa8487f9fb7fbcaf --- .../ui/controls/internal/ConfigSelector.java | 3 +- .../launchbar/ui/NewLaunchConfigWizard.java | 2 +- .../ui/NewLaunchConfigWizardDialog.java | 66 +++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java index cc22d905699..dd79efa4601 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java @@ -28,6 +28,7 @@ import org.eclipse.launchbar.core.ILaunchDescriptor; import org.eclipse.launchbar.ui.DefaultDescriptorLabelProvider; import org.eclipse.launchbar.ui.ILaunchBarUIManager; import org.eclipse.launchbar.ui.NewLaunchConfigWizard; +import org.eclipse.launchbar.ui.NewLaunchConfigWizardDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; @@ -174,7 +175,7 @@ public class ConfigSelector extends CSelector { @Override public void mouseUp(org.eclipse.swt.events.MouseEvent e) { final NewLaunchConfigWizard wizard = new NewLaunchConfigWizard(); - WizardDialog dialog = new WizardDialog(getShell(), wizard); + WizardDialog dialog = new NewLaunchConfigWizardDialog(getShell(), wizard); if (dialog.open() == Window.OK) { new Job(Messages.ConfigSelector_3) { @Override diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java index 66cac5a4b21..3445cbf9406 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java @@ -50,7 +50,7 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio @Override public void setContainer(IWizardContainer wizardContainer) { super.setContainer(wizardContainer); - + if (wizardContainer != null) { // Edit page wants to know when it's about to change to itself ((WizardDialog) wizardContainer).addPageChangingListener(editPage); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java new file mode 100644 index 00000000000..869bcef2d44 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2014, 2018 QNX Software Systems 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 + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.launchbar.ui; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.IWizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Shell; + +/** + * Wizard Dialog for Launch Bar's new Launch Configuration Wizard. + * + * @since 2.3 + */ +public class NewLaunchConfigWizardDialog extends WizardDialog { + + /** + * Size of this dialog if there is no preference specifying a size. + */ + protected static final Point DEFAULT_INITIAL_DIALOG_SIZE = new Point(800, 720); + + public NewLaunchConfigWizardDialog(Shell parentShell, IWizard newWizard) { + super(parentShell, newWizard); + } + + /** + * Returns the name of the section that this dialog stores its settings in + * + * @return String + */ + protected String getDialogSettingsSectionName() { + return Activator.PLUGIN_ID + ".LAUNCH_CONFIGURATIONS_DIALOG_SECTION"; //$NON-NLS-1$ + } + + @Override + protected IDialogSettings getDialogBoundsSettings() { + IDialogSettings settings = Activator.getDefault().getDialogSettings(); + IDialogSettings section = settings.getSection(getDialogSettingsSectionName()); + if (section == null) { + section = settings.addNewSection(getDialogSettingsSectionName()); + } + return section; + } + + @Override + protected Point getInitialSize() { + try { + // Check if we've saved the height before + getDialogBoundsSettings().getInt("DIALOG_HEIGHT"); //$NON-NLS-1$ + return super.getInitialSize(); + } catch(NumberFormatException nfe) { + // Nope, return the default size + return DEFAULT_INITIAL_DIALOG_SIZE; + } + } + +} From 3d3a8074b7652dd92c74beebeb7010c7938b41a6 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 4 Jun 2019 13:47:52 -0400 Subject: [PATCH 185/198] Bug 547918 - Show launch config type in edit page title. Allows users to understand better what launch configuration type they are looking at. Change-Id: Ib6239fa6ec14d955ed0ed850af5e3c7697ce9519 --- .../core/internal/target/LaunchTarget.java | 16 +++++++++------- .../ui/internal/LaunchBarLaunchConfigDialog.java | 5 +++-- .../launchbar/ui/internal/messages.properties | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index ab54170a7a0..917e53ba015 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -67,15 +67,17 @@ public class LaunchTarget extends PlatformObject implements ILaunchTarget { @Override public Map getAttributes() { Map attrs = new HashMap<>(); - try { - for (String key : attributes.keys()) { - String value = attributes.get(key, null); - if (value != null) { - attrs.put(key, value); + if (attributes != null) { + try { + for (String key : attributes.keys()) { + String value = attributes.get(key, null); + if (value != null) { + attrs.put(key, value); + } } + } catch (BackingStoreException e) { + Activator.log(e); } - } catch (BackingStoreException e) { - Activator.log(e); } return attrs; } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index b0bfcd881f1..d71aa55088b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -96,10 +96,11 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau ILaunchBarUIManager uiManager = Activator.getService(ILaunchBarUIManager.class); ILabelProvider labelProvider = uiManager.getLabelProvider(descriptor); String descName = labelProvider != null ? labelProvider.getText(descriptor) : descriptor.getName(); + String typeName = workingCopy.getType().getName(); if (supportsTargets) { - setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit2, descName, mode.getLabel(), target.getId())); + setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit2, typeName, descName, mode.getLabel(), target.getId())); } else { - setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit1, descName, mode.getLabel())); + setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit1, typeName, descName, mode.getLabel())); } } catch (CoreException e) { Activator.log(e); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 7e52a79713a..58b4e7f7bd9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -40,8 +40,8 @@ CannotEditLaunchConfiguration=Cannot edit this configuration. NoLaunchModeSelected=No launch mode selected. NoLaunchGroupSelected=No launch group found for the current selection. -LaunchBarLaunchConfigDialog_Edit1=Edit configuration %s for %s -LaunchBarLaunchConfigDialog_Edit2=Edit configuration %s for %s on %s +LaunchBarLaunchConfigDialog_Edit1=Edit %s configuration %s for %s +LaunchBarLaunchConfigDialog_Edit2=Edit %s configuration %s for %s on %s LaunchBarLaunchConfigDialog_EditConfiguration=Edit Configuration LaunchBarLaunchConfigDialog_LaunchConfigName=Launch Configuration Name: LaunchBarLaunchConfigDialog_LCMustHaveName=Launch configuration must have a name From 578bfc472df53972f70fd1716c9d9225ca1df1a1 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Thu, 4 Jul 2019 09:36:36 -0400 Subject: [PATCH 186/198] [releng] Update target platform to latest dependencies Change-Id: I3f37027e3a7006d9ddddddb16a0671c615fe041d --- .../org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF | 3 ++- pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index 5a987f2d75a..9d635cf72f3 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", org.eclipse.debug.ui;bundle-version="3.11.200", org.eclipse.launchbar.core;bundle-version="2.0.0", org.eclipse.launchbar.ui;bundle-version="2.0.0" -Import-Package: javax.annotation +Import-Package: javax.annotation, + javax.inject Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin diff --git a/pom.xml b/pom.xml index 722b6ee23a9..2de320b29d8 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ platform - https://download.eclipse.org/eclipse/updates/4.12-I-builds/I20190521-1800/ + https://download.eclipse.org/eclipse/updates/4.13-I-builds/I20190707-1800/ p2 @@ -49,7 +49,7 @@ cdt - http://download.eclipse.org/tools/cdt/releases/9.7 + http://download.eclipse.org/tools/cdt/releases/9.8 p2 From 236be726c46c7fb47c08b1ea42f60433ca5aa8c1 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 15 Jul 2019 10:09:06 -0400 Subject: [PATCH 187/198] Bug 549066 - NPE in Launch Bar injection when running headless. Adds a check that we actually got an application before doing the injection. Change-Id: Ie3670f1c35d107f8147799a449498e03b950ac00 --- .../launchbar/ui/controls/internal/LaunchBarInjector.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java index 125c7d6267a..ed4e6f2f724 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java @@ -38,6 +38,11 @@ public class LaunchBarInjector { @Execute void execute() { + if (application == null) { + // We are running headless, don't need the launch bar here. + return; + } + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); injectIntoAll(enabled); From 5c7dbff43fd7ca8fcdbcb081b5af3895eff06918 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Fri, 19 Jul 2019 16:05:36 -0400 Subject: [PATCH 188/198] [releng] Bump version to 2.4.0 Change-Id: I8d003bb0c98093bf9f9b108076b10b00f920af6a --- bundles/pom.xml | 2 +- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- repo/pom.xml | 2 +- tests/org.eclipse.launchbar.core.tests/pom.xml | 2 +- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bundles/pom.xml b/bundles/pom.xml index c8f557a6886..d01947db9bf 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.3.0-SNAPSHOT + 2.4.0-SNAPSHOT bundles-parent diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 7b58ab6b421..230f5634b86 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index b61f15d85ee..c5e82f2e9f5 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/pom.xml b/features/pom.xml index 54a77f2fc0b..abb3bd8ae7e 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.3.0-SNAPSHOT + 2.4.0-SNAPSHOT features-parent diff --git a/pom.xml b/pom.xml index 2de320b29d8..0323ff73098 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.launchbar parent - 2.3.0-SNAPSHOT + 2.4.0-SNAPSHOT pom diff --git a/repo/pom.xml b/repo/pom.xml index dade6cbb1b3..ad04fdcb7a5 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -5,7 +5,7 @@ org.eclipse.launchbar parent - 2.3.0-SNAPSHOT + 2.4.0-SNAPSHOT ../pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index 850399203ca..3f658c3db26 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.3.0-SNAPSHOT + 2.4.0-SNAPSHOT ../../pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index ce7aa7a6f7a..ad3efb4ef17 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -6,7 +6,7 @@ org.eclipse.launchbar - 2.3.0-SNAPSHOT + 2.4.0-SNAPSHOT ../../pom.xml parent From fb05ee51d84f0e2d9f3558378c7febf8172f07a5 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Fri, 19 Jul 2019 16:07:23 -0400 Subject: [PATCH 189/198] [releng] Bump plug-in version number for bug fix in Bug 549066 See commit 236be726c46c7fb47c08b1ea42f60433ca5aa8c1 Change-Id: I6d401f46380c5821537184b0d55b2ac748f9986d --- bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF index 9d635cf72f3..ba08d341bd9 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Launch Bar UI Controls Bundle-SymbolicName: org.eclipse.launchbar.ui.controls;singleton:=true -Bundle-Version: 1.0.2.qualifier +Bundle-Version: 1.0.100.qualifier Bundle-Activator: org.eclipse.launchbar.ui.controls.internal.Activator Bundle-Vendor: Eclipse CDT Require-Bundle: org.eclipse.osgi.services;bundle-version="3.5.0", From 24cff824aeb1dc47d4938cedd00de1fe5d14aa3a Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 13:34:49 -0500 Subject: [PATCH 190/198] [releng] Update to stable platform repo URL Change-Id: I4ec7fad40814214b30cd41794a7dd67b488009ec --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0323ff73098..24db6ff6f7c 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ platform - https://download.eclipse.org/eclipse/updates/4.13-I-builds/I20190707-1800/ + https://download.eclipse.org/eclipse/updates/4.13/ p2 From 15b278c7ddf117ef77449a4fe4cf25a2e4e7d0c1 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 13:38:03 -0500 Subject: [PATCH 191/198] Bug 553230: Update to EPLv2 Change-Id: Ie5eddc150b09aa3993b35dd4c4c8d1105dd0dcb7 --- bundles/org.eclipse.launchbar.core/about.html | 52 ++++++++++++------- .../core/AbstractLaunchConfigProvider.java | 9 ++-- .../core/DefaultLaunchConfigProvider.java | 9 ++-- .../core/DefaultLaunchDescriptor.java | 9 ++-- .../core/DefaultLaunchDescriptorType.java | 9 ++-- .../launchbar/core/ILaunchBarListener.java | 9 ++-- .../launchbar/core/ILaunchBarManager.java | 9 ++-- .../core/ILaunchConfigurationProvider.java | 9 ++-- .../launchbar/core/ILaunchDescriptor.java | 9 ++-- .../launchbar/core/ILaunchDescriptorType.java | 9 ++-- .../launchbar/core/ILaunchObjectProvider.java | 9 ++-- .../core/PerTargetLaunchConfigProvider.java | 9 ++-- .../core/ProjectLaunchConfigProvider.java | 9 ++-- .../core/ProjectLaunchDescriptor.java | 9 ++-- .../ProjectPerTargetLaunchConfigProvider.java | 9 ++-- .../launchbar/core/internal/Activator.java | 9 ++-- .../core/internal/ExecutableExtension.java | 9 ++-- .../core/internal/LaunchBarManager.java | 9 ++-- .../internal/LaunchConfigProviderInfo.java | 9 ++-- .../internal/LaunchDescriptorTypeInfo.java | 9 ++-- .../launchbar/core/internal/Messages.java | 9 ++-- .../eclipse/launchbar/core/internal/Pair.java | 9 ++-- .../internal/ProjectLaunchObjectProvider.java | 9 ++-- .../core/internal/messages.properties | 9 ++-- .../core/internal/target/LaunchTarget.java | 9 ++-- .../internal/target/LaunchTargetManager.java | 9 ++-- .../target/LaunchTargetPropertyTester.java | 9 ++-- .../target/LaunchTargetWorkingCopy.java | 9 ++-- .../target/LocalLaunchTargetProvider.java | 9 ++-- .../launchbar/core/target/ILaunchTarget.java | 9 ++-- .../core/target/ILaunchTargetListener.java | 9 ++-- .../core/target/ILaunchTargetManager.java | 9 ++-- .../core/target/ILaunchTargetManager2.java | 9 ++-- .../core/target/ILaunchTargetWorkingCopy.java | 9 ++-- .../ILaunchConfigurationTargetedDelegate.java | 9 ++-- .../core/target/launch/ITargetedLaunch.java | 9 ++-- .../LaunchConfigurationTargetedDelegate.java | 9 ++-- .../core/target/launch/TargetedLaunch.java | 9 ++-- .../about.html | 52 ++++++++++++------- .../core/RemoteLaunchTargetProvider.java | 9 ++-- .../remote/core/internal/Activator.java | 9 ++-- .../remote/core/internal/Messages.java | 9 ++-- .../internal/RemoteTargetAdapterFactory.java | 9 ++-- .../remote/core/internal/messages.properties | 9 ++-- .../ui/RemoteLaunchTargetLabelProvider.java | 9 ++-- .../remote/ui/internal/Activator.java | 9 ++-- .../about.html | 52 ++++++++++++------- .../ui/controls/internal/Activator.java | 9 ++-- .../ui/controls/internal/CButton.java | 9 ++-- .../ui/controls/internal/CSelector.java | 9 ++-- .../ui/controls/internal/ConfigSelector.java | 9 ++-- .../ui/controls/internal/EditButton.java | 9 ++-- .../ui/controls/internal/FilterControl.java | 9 ++-- .../LaunchBarButtonImageDescriptor.java | 9 ++-- .../controls/internal/LaunchBarControl.java | 9 ++-- .../controls/internal/LaunchBarInjector.java | 9 ++-- .../internal/LaunchBarListViewer.java | 9 ++-- .../LaunchBarPreferenceInitializer.java | 9 ++-- .../internal/LaunchBarPreferencePage.java | 9 ++-- .../controls/internal/LaunchBarWidgetIds.java | 9 ++-- .../ui/controls/internal/Messages.java | 9 ++-- .../ui/controls/internal/ModeSelector.java | 9 ++-- .../controls/internal/OpenLaunchSelector.java | 9 ++-- .../ui/controls/internal/TargetSelector.java | 9 ++-- .../ui/controls/internal/Transition.java | 9 ++-- .../ui/controls/internal/messages.properties | 9 ++-- bundles/org.eclipse.launchbar.ui/about.html | 52 ++++++++++++------- .../schema/launchBarUIContributions.exsd | 9 ++-- .../ui/DefaultDescriptorLabelProvider.java | 9 ++-- .../ui/ILaunchBarLaunchConfigDialog.java | 9 ++-- .../launchbar/ui/ILaunchBarUIConstants.java | 9 ++-- .../launchbar/ui/ILaunchBarUIManager.java | 9 ++-- .../launchbar/ui/NewLaunchConfigWizard.java | 9 ++-- .../ui/NewLaunchConfigWizardDialog.java | 9 ++-- .../launchbar/ui/internal/Activator.java | 9 ++-- .../ui/internal/LaunchBarUIManager.java | 9 ++-- .../launchbar/ui/internal/Messages.java | 9 ++-- .../commands/BuildActiveCommandHandler.java | 9 ++-- .../ConfigureActiveLaunchHandler.java | 9 ++-- .../commands/LaunchActiveCommandHandler.java | 9 ++-- .../commands/StopActiveCommandHandler.java | 9 ++-- .../dialogs/NewLaunchConfigEditPage.java | 9 ++-- .../dialogs/NewLaunchConfigModePage.java | 9 ++-- .../dialogs/NewLaunchConfigTypePage.java | 9 ++-- .../dialogs/NewLaunchConfigTypePage2.java | 9 ++-- .../launchbar/ui/internal/messages.properties | 9 ++-- .../target/LaunchTargetUIManager.java | 9 ++-- .../target/LaunchTargetWizardDialog.java | 9 ++-- .../target/NewLaunchTargetWizard.java | 9 ++-- .../NewLaunchTargetWizardSelectionPage.java | 9 ++-- .../ui/target/ILaunchTargetUIManager.java | 9 ++-- .../ui/target/LaunchTargetWizard.java | 9 ++-- .../target/NewLaunchTargetWizardAction.java | 9 ++-- .../feature.properties | 15 +++--- .../org.eclipse.launchbar/build.properties | 9 ++-- .../org.eclipse.launchbar/feature.properties | 15 +++--- pom.xml | 6 +-- .../about.html | 52 ++++++++++++------- .../PerTargetLaunchConfigProviderTest.java | 9 ++-- .../core/internal/LaunchBarManager2Test.java | 9 ++-- .../core/internal/LaunchBarManagerTest.java | 9 ++-- .../internal/target/LaunchTargetTest.java | 9 ++-- .../launchbar/ui/tests/SWTBotCSelector.java | 9 ++-- .../ui/tests/SWTBotConfigSelector.java | 9 ++-- .../ui/tests/internal/Activator.java | 9 ++-- .../internal/AutomatedIntegrationSuite.java | 9 ++-- .../internal/CreateLaunchConfigTests.java | 9 ++-- 107 files changed, 775 insertions(+), 412 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/about.html b/bundles/org.eclipse.launchbar.core/about.html index d7c511887d6..164f781a8fd 100644 --- a/bundles/org.eclipse.launchbar.core/about.html +++ b/bundles/org.eclipse.launchbar.core/about.html @@ -1,24 +1,36 @@ - - -About - + + + + +About + -

About This Content

- -

June 22, 2007

-

License

+

About This Content

-

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

+

November 30, 2017

+

License

-

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

+

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

- \ No newline at end of file +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index b7d7a3a3016..8e04e004963 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index faafd04690b..8e8b035d96b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java index fc7156d6df9..ef835fbc886 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java index fab847e1fdb..1c17890058f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java index c3d2c8fafe8..a7800174345 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index 72d415653bc..587e5c48b3b 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index ba918e550f8..b8517f0172e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * QNX Software Systems - initial diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java index f0806988d50..47657c9e5c8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java index 6710ee4a7e8..5773f9e5aea 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java index 663a0cb660e..3e217166d92 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java index 314a17591ee..eeb4a317c1e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java index 7d3dae8bb00..03b66ee9ada 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java index bf4a2c63908..de161cc97e4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java index d85961f426a..47306ef5fb6 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * QNX Software Systems - Initial API and implementation diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index 5fbca406d0b..b001f86abbf 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java index b8ad5a63b0c..c509b2d91dc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index f496b4e0ef0..03ef0911f5c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 9ee32ead2de..150f985d980 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java index 13e5e37e5ee..aea72201687 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java index 172f4e198c1..3e0163cb8f4 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java index 27491501d0b..243f309d665 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java index d64de8c1b0a..12981d68d1e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer - Initial API and implementation diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties index 6f2a6f0319b..52f961bd86f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties @@ -1,9 +1,12 @@ ################################################################################ # Copyright (c) 2014 QNX Software Systems and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java index 917e53ba015..cfdece3f9bc 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index a4c4ab7a043..225e1d68c55 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java index 82269f5abf5..88c02ec505a 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java index 714b1ef29d4..88a681cddba 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java index 2e3b600b488..59819a20fe5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index 21bdf2ac929..a908eb8fc52 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015, 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java index c692370a5fe..26883be474e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java index 68e90cbc7c5..78c653f76ff 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java index d95daf3c890..93ba2f21938 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2019 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java index 25823e2a15e..75ecb311764 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java index 7707d8a349c..e2f78ba4df8 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target.launch; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java index cd8c7f92ef6..488d09b0406 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target.launch; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java index 53976bbfd47..e2ed482cddb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target.launch; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java index e022e7b9c37..6ac911185a3 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.target.launch; diff --git a/bundles/org.eclipse.launchbar.remote.core/about.html b/bundles/org.eclipse.launchbar.remote.core/about.html index d7c511887d6..164f781a8fd 100644 --- a/bundles/org.eclipse.launchbar.remote.core/about.html +++ b/bundles/org.eclipse.launchbar.remote.core/about.html @@ -1,24 +1,36 @@ - - -About - + + + + +About + -

About This Content

- -

June 22, 2007

-

License

+

About This Content

-

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

+

November 30, 2017

+

License

-

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

+

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

- \ No newline at end of file +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java index 2761670ce6d..5e270d3110a 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.remote.core; diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java index 7948c01f4a7..1583f34c241 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.remote.core.internal; diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java index 9ef2e4f98a3..6a27294d7b4 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.remote.core.internal; diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java index 050e631fec5..9fd2a658efd 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.remote.core.internal; diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties index 1cd2d0574f1..fcc2297dd0f 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties @@ -1,9 +1,12 @@ #****************************************************************************** # Copyright (c) 2015 QNX Software Systems and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 #****************************************************************************** RemoteLaunchTargetProvider_Closed=Closed RemoteLaunchTargetProvider_Missing=Connection missing diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java index 0b412bc4f0b..c6d76cf7872 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java +++ b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.remote.ui; diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java index 5db112b94ee..16e1fcb7fcd 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.remote.ui.internal; diff --git a/bundles/org.eclipse.launchbar.ui.controls/about.html b/bundles/org.eclipse.launchbar.ui.controls/about.html index d7c511887d6..164f781a8fd 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/about.html +++ b/bundles/org.eclipse.launchbar.ui.controls/about.html @@ -1,24 +1,36 @@ - - -About - + + + + +About + -

About This Content

- -

June 22, 2007

-

License

+

About This Content

-

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

+

November 30, 2017

+

License

-

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

+

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

- \ No newline at end of file +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java index 651bac3e78b..03871fd13c4 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.controls.internal; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java index 341aa59cdcc..4b33fbfbb58 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java index cd0287dd07f..ce1ccc4cbb6 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java index dd79efa4601..881b5e5384e 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java index 287188b5a36..c05a31a4781 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Alena Laskavaia diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java index 341de480908..248a658c4c2 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Alena Laskavaia diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java index 6fc5dca1c31..80047ba9a0d 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer - initial API and implementation diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 44f6d3e06c4..6014bef2fae 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java index ed4e6f2f724..879f42aacd6 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java index d1398005f87..84d61778cab 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Alena Laskavaia diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java index e951b5eeb63..13ae9196f8d 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java index 33163482d31..39470b74a6b 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java index e749c29bddb..f1ae03ff455 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.controls.internal; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java index 9eac59043d4..f2bf8fa27b5 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java index 75dfdfa5438..d885b581456 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java index 7d6c80f3b56..f2ee5997b3a 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015, 2019 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Alena Laskavaia diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java index f56300878f9..66a51a26aa9 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java index 1fa7b023ff8..7a0f7c5a024 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties index 30e6ed1e228..a6b1af4cd02 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties @@ -1,9 +1,12 @@ ################################################################################ # Copyright (c) 2016 QNX Software Systems and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 ################################################################################ ConfigSelector_0=No Launch Configurations ConfigSelector_1=Launch Configuration diff --git a/bundles/org.eclipse.launchbar.ui/about.html b/bundles/org.eclipse.launchbar.ui/about.html index d7c511887d6..164f781a8fd 100644 --- a/bundles/org.eclipse.launchbar.ui/about.html +++ b/bundles/org.eclipse.launchbar.ui/about.html @@ -1,24 +1,36 @@ - - -About - + + + + +About + -

About This Content

- -

June 22, 2007

-

License

+

About This Content

-

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

+

November 30, 2017

+

License

-

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

+

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

- \ No newline at end of file +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd index c052bede12d..facbd8234f1 100644 --- a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd +++ b/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd @@ -161,10 +161,13 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java index 284c698b5ee..de69fb334f5 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java index b7e59c5d442..350b3bdab1d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java index 8a204e10696..9aefe2e4740 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java index f677a1deb8d..4527c267b6d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java index 3445cbf9406..5944e82b5f9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java index 869bcef2d44..f81b435bc2b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index e07cf4a1257..e7ecb8b73d3 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index 1f60b6b8b51..d18d264a8c4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 01a9b11775d..1e8715cd0dd 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.internal; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index 592099acba2..b2a48988b8a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java index a7b3c593f0f..43e7c9ee97d 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014,2016 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.internal.commands; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java index f7aa548a5d5..799a0c8a383 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index ab345d37f40..1607c245353 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index 2c6f50cc5a7..b77735f0015 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java index be8d68053c8..c6e10f0446e 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java index bb6fda8a8c5..4bafe25a2b9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java index fe0d3db7eb5..67a7122be7b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.internal.dialogs; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties index 58b4e7f7bd9..3c8291f53d6 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties @@ -1,9 +1,12 @@ ################################################################################ # Copyright (c) 2016 QNX Software Systems and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 ################################################################################ BuildActiveCommandHandler_0=Building Active Configuration BuildActiveCommandHandler_1=Building Active Configuration diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java index 5faf1d91737..9b1acdbe237 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java index 24fdf5aca7a..0dd5c6841a8 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.internal.target; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java index 45a0d66b47e..eaf04caefcb 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java index 34ac9cd4648..329a5637ba7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2018 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java index 4e2a99c1998..d6977adc0b4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.target; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java index a2100b70fa8..18aa90d7fce 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.target; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java index 83a65250ff4..49ff4025ab7 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.target; diff --git a/features/org.eclipse.launchbar.remote/feature.properties b/features/org.eclipse.launchbar.remote/feature.properties index 8ec49e9a8a8..8a419623710 100644 --- a/features/org.eclipse.launchbar.remote/feature.properties +++ b/features/org.eclipse.launchbar.remote/feature.properties @@ -1,9 +1,12 @@ ############################################################################### # Copyright (c) 2005, 2010 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # IBM Corporation - initial API and implementation @@ -26,8 +29,8 @@ description=Support for IRemoteConnections as ILaunchTargets # copyright copyright=\ Copyright (c) 2015 QNX Software Systems and others\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ +This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License 2.0\n\ which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html +https://www.eclipse.org/legal/epl-2.0/ diff --git a/features/org.eclipse.launchbar/build.properties b/features/org.eclipse.launchbar/build.properties index 6c8e6da2e2e..4cf1a1fa3f8 100644 --- a/features/org.eclipse.launchbar/build.properties +++ b/features/org.eclipse.launchbar/build.properties @@ -1,9 +1,12 @@ ############################################################################### # Copyright (c) 2014 QNX and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # QNX - initial API and implementation diff --git a/features/org.eclipse.launchbar/feature.properties b/features/org.eclipse.launchbar/feature.properties index 414020faabc..8660d6ae80e 100644 --- a/features/org.eclipse.launchbar/feature.properties +++ b/features/org.eclipse.launchbar/feature.properties @@ -1,9 +1,12 @@ ############################################################################### # Copyright (c) 2005, 2010 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# 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 -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # IBM Corporation - initial API and implementation @@ -26,8 +29,8 @@ description=A Tool Control that sits in the TOP trim bar that controls build and # copyright copyright=\ Copyright (c) 2014 QNX Software Systems and others\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ +This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License 2.0\n\ which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html +https://www.eclipse.org/legal/epl-2.0/ diff --git a/pom.xml b/pom.xml index 24db6ff6f7c..cdccf5f32a2 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ - Eclipse Public License v1.0 + Eclipse Public License 2.0 - All rights reserved. + This program and the accompanying materials are made - available under the terms of the Eclipse Public License v1.0 + available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.htm diff --git a/tests/org.eclipse.launchbar.core.tests/about.html b/tests/org.eclipse.launchbar.core.tests/about.html index d7c511887d6..164f781a8fd 100644 --- a/tests/org.eclipse.launchbar.core.tests/about.html +++ b/tests/org.eclipse.launchbar.core.tests/about.html @@ -1,24 +1,36 @@ - - -About - + + + + +About + -

About This Content

- -

June 22, 2007

-

License

+

About This Content

-

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

+

November 30, 2017

+

License

-

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

+

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

- \ No newline at end of file +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index e8a4f13ccb4..1ea6eedbae8 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Elena Laskavaia diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 8b4cffd5a0e..f6aa42f4d40 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Elena Laskavaia diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 218067444f0..0742b1711e9 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Doug Schaefer diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java index 78dca20d69d..3afd94b95c0 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.core.internal.target; diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java index 230fd1c18fa..15f64f45481 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.tests; diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java index 915f7235897..585ae41c9a9 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017, 2018 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.tests; diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java index 7b887ec433b..fc8dede9838 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.tests.internal; diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java index 26f656fcc2b..5b5e4fe225f 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.tests.internal; diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java index 3a7b26e8e13..be70b33b98d 100644 --- a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java +++ b/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.launchbar.ui.tests.internal; From 30b947522809d349d48e8a512ad4000af1762e5f Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 13:43:05 -0500 Subject: [PATCH 192/198] Bug 553231: Apply check_code_cleanliness.sh from CDT Change-Id: I50ff4b6d95a08bd63eecde3a0321af28db6e0dae --- .gitattributes | 150 ++++++ .gitignore | 13 +- .../.settings/org.eclipse.jdt.core.prefs | 457 +++++++++++++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ .../core/AbstractLaunchConfigProvider.java | 3 +- .../core/DefaultLaunchConfigProvider.java | 3 +- .../core/DefaultLaunchDescriptor.java | 2 +- .../core/DefaultLaunchDescriptorType.java | 4 +- .../launchbar/core/ILaunchBarManager.java | 32 +- .../core/ILaunchConfigurationProvider.java | 4 +- .../launchbar/core/ILaunchDescriptor.java | 4 +- .../launchbar/core/ILaunchDescriptorType.java | 8 +- .../launchbar/core/ILaunchObjectProvider.java | 6 +- .../launchbar/core/internal/Activator.java | 2 +- .../core/internal/LaunchBarManager.java | 8 +- .../internal/LaunchConfigProviderInfo.java | 4 +- .../eclipse/launchbar/core/internal/Pair.java | 3 +- .../internal/target/LaunchTargetManager.java | 11 +- .../target/LaunchTargetWorkingCopy.java | 2 +- .../target/LocalLaunchTargetProvider.java | 3 +- .../launchbar/core/target/ILaunchTarget.java | 2 +- .../core/target/ILaunchTargetListener.java | 6 +- .../core/target/ILaunchTargetManager.java | 24 +- .../core/target/ILaunchTargetManager2.java | 7 +- .../core/target/ILaunchTargetProvider.java | 2 +- .../core/target/ILaunchTargetWorkingCopy.java | 8 +- .../ILaunchConfigurationTargetedDelegate.java | 8 +- .../core/target/launch/ITargetedLaunch.java | 2 +- .../LaunchConfigurationTargetedDelegate.java | 4 +- .../.settings/org.eclipse.jdt.core.prefs | 457 +++++++++++++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ .../core/RemoteLaunchTargetProvider.java | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 457 +++++++++++++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ .../.settings/org.eclipse.jdt.core.prefs | 457 +++++++++++++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ .../ui/controls/internal/Activator.java | 4 +- .../ui/controls/internal/FilterControl.java | 85 ++-- .../controls/internal/LaunchBarInjector.java | 6 +- .../internal/LaunchBarListViewer.java | 9 +- .../internal/LaunchBarPreferencePage.java | 10 +- .../ui/controls/internal/Transition.java | 4 +- .../.settings/org.eclipse.jdt.core.prefs | 404 ++++++++++++++- .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ .../ui/DefaultDescriptorLabelProvider.java | 4 +- .../ui/ILaunchBarLaunchConfigDialog.java | 2 +- .../launchbar/ui/NewLaunchConfigWizard.java | 2 +- .../ui/NewLaunchConfigWizardDialog.java | 8 +- .../launchbar/ui/internal/Activator.java | 2 +- .../internal/LaunchBarLaunchConfigDialog.java | 29 +- .../ui/internal/LaunchBarUIManager.java | 19 +- .../launchbar/ui/internal/Messages.java | 2 +- .../dialogs/NewLaunchConfigTypePage2.java | 2 +- .../NewLaunchTargetWizardSelectionPage.java | 326 ++++++------ .../ui/target/ILaunchTargetUIManager.java | 2 +- .../feature.properties | 2 +- .../org.eclipse.launchbar/build.properties | 2 +- .../org.eclipse.launchbar/feature.properties | 2 +- repo/.settings/org.eclipse.jdt.core.prefs | 464 ++++++++++++++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + repo/.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ repo/.settings/org.eclipse.pde.prefs | 35 ++ .../.settings/org.eclipse.jdt.core.prefs | 395 ++++++++++++++- .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ .../core/internal/LaunchBarManager2Test.java | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 457 +++++++++++++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 133 +++++ .../.settings/org.eclipse.pde.api.tools.prefs | 184 +++++++ .../.settings/org.eclipse.pde.prefs | 35 ++ 89 files changed, 6847 insertions(+), 392 deletions(-) create mode 100644 .gitattributes create mode 100644 bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs create mode 100644 bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs create mode 100644 bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs create mode 100644 bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs create mode 100644 bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs create mode 100644 bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs create mode 100644 repo/.settings/org.eclipse.jdt.core.prefs create mode 100644 repo/.settings/org.eclipse.jdt.launching.prefs create mode 100644 repo/.settings/org.eclipse.jdt.ui.prefs create mode 100644 repo/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 repo/.settings/org.eclipse.pde.prefs create mode 100644 tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs create mode 100644 tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs create mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs create mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..ad8bb8f989a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,150 @@ +* text=auto + +# Generic files +AUTHORS text +ChangeLog text +COPYING text +NEWS text +README text +*.txt text +*.md text +*.zip binary + +# C-like Sources +*.asm text +*.c text +*.cc text +*.cpp text +*.h text +*.s text +*.S text + +# C-like configuration/scripts +*.ac text +*.am text +*.bat text +*.build text +*.incl text +makefile text +Makefile text +*.mk text +*.sh text + +# Qt +*.pro text +*.qml text +*.qrc text + +# Visual Studio +*.dsp text eol=crlf +*.dsw text eol=crlf +*.filters text eol=crlf +*.sln text eol=crlf +*.vcxproj text eol=crlf + +# C output files +# (These should not normally be checked in, exceptions for pre-compiled libraries and tests) +*.o binary +*.d text +*.dll binary diff=dll +*.a binary +*.exe binary +*.out binary +*.app binary +*.jnilib binary diff=hex +*.so binary + +# Web/Javascript/Node +*.css text +*.htm text +*.html text +*.js text +*.json text +.npmignore text +package-list text +*.xml text +*.xsd text +*.xsl text +yarn.lock text +*.lock text + +# Images +*.gif binary +*.icns binary +*.ico binary +*.jpg binary +*.jpeg binary +*.png binary +*.PNG binary +*.xpm binary + +# Java/Eclipse +# remove trailing whitespace +*.java text +# remove trailing whitespace +*.properties text +.api_filters text +.classpath text +*.exsd text +*.g text +*.inf text +*.ini text +*.launch text +*.mappings text +# remove trailing whitespace +*.MF text +.options text +*.options text +*.prefs text +*.product text +.project text +*.setup text +*.target text + +# Java output files +# (These should not normally be checked in, exceptions for pre-compiled libraries and tests) +*.class binary +*.jar binary + +# Files used in tests +*.awts text +be32 binary +be32lib binary +be64 binary +be64lib binary +exe binary +exebig_g binary +exe_g binary +*.expected text +*.F90 text +*.init text +launchConfigTestGdbinit text +le32 binary +le32lib binary +le64 binary +le64lib binary +*.main text +output-1 text +*.pda text +*.rts text +test_commands text + +# Other special files +cdtOptions text +.contentsettings text +*.csv text +*.dia binary +*.dictionary text +.eclipseproduct text +.euml2 text +.gitattributes text +.gitignore text +*.patch text +*.src text +*.tmLanguage text +*.top text +*.ucd text +.umlproject text +*.upc text +# remove trailing whitespace +*.py text diff --git a/.gitignore b/.gitignore index c214eb32f59..a2267a1d9bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ -*/*/target/ -*/*/bin/ +/*/*/bin +/*/*/index +/*/*/target +/workspace/ +.DS_Store +.nfs* +.polyglot.build.properties +check_code_cleanliness_workspace/ +.META-INF_MANIFEST.MF +.polyglot..META-INF_MANIFEST.MF +*.takari_issue_192 diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..2b6ecff8a01 100644 --- a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,464 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..d2dc703ba9e --- /dev/null +++ b/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=1 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java index 8e04e004963..c6eb02e0978 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java @@ -51,7 +51,8 @@ public abstract class AbstractLaunchConfigProvider implements ILaunchConfigurati } @Override - public boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, ILaunchTarget target) throws CoreException { + public boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, + ILaunchTarget target) throws CoreException { ILaunchConfiguration lc = descriptor.getAdapter(ILaunchConfiguration.class); if (lc == null) return false; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java index 8e8b035d96b..73ec61eb8f9 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java @@ -72,7 +72,8 @@ public class DefaultLaunchConfigProvider implements ILaunchConfigurationProvider } @Override - public boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, ILaunchTarget target) throws CoreException { + public boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, + ILaunchTarget target) throws CoreException { ILaunchConfiguration lc = descriptor.getAdapter(ILaunchConfiguration.class); if (lc == null) return false; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java index ef835fbc886..4dba61e0916 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java @@ -19,7 +19,7 @@ import org.eclipse.debug.core.ILaunchConfiguration; /** * A special launch descriptor that managed configurations that aren't owned by other * descriptors. - * + * * @since 2.3 */ public class DefaultLaunchDescriptor extends PlatformObject implements ILaunchDescriptor { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java index 1c17890058f..0d1bcfaef9e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java @@ -25,7 +25,7 @@ import org.eclipse.launchbar.core.internal.Activator; /** * A special descriptor type that managed configurations that aren't owned by * other descriptor types. - * + * * @since 2.3 */ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { @@ -43,7 +43,7 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { /** * Used to filter out private and external tools builders - * + * * @param config * @return * @throws CoreException diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java index 587e5c48b3b..44121189c75 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java @@ -56,14 +56,14 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Add a listener that can react to launch bar changes - * + * * @param listener */ void addListener(ILaunchBarListener listener); /** * Remove a listener - * + * * @param listener */ void removeListener(ILaunchBarListener listener); @@ -71,7 +71,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Return the type id for the given launch descriptor type. This is defined in * the extension point that defines the type. - * + * * @param descType descriptor type * @return the type id for the descriptor type */ @@ -79,7 +79,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Returns the active launch descriptor. - * + * * @return active launch descriptor * @throws CoreException */ @@ -87,7 +87,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Returns the active launch mode. - * + * * @return active launch mode * @throws CoreException */ @@ -95,7 +95,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Returns the active launch target. - * + * * @return active launch target * @throws CoreException */ @@ -104,7 +104,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Returns the active launch configuration as derived from the active descriptor * and target. - * + * * @return active launch configuration * @throws CoreException */ @@ -113,7 +113,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Returns the launch configuration derived from the given launch descriptor and * target. - * + * * @param desc launch descriptor * @param target launch target * @return launch configuration @@ -125,7 +125,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { * Returns the launch configuration type used for configurations that are * derived from the given launch descriptor and launch target without creating a * launch configuration. - * + * * @param desc launch descriptor * @param target launch target * @return launch configuration type @@ -136,7 +136,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Returns all know launch descriptors. - * + * * @return launch descriptors * @throws CoreException */ @@ -144,7 +144,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Set the active launch descriptor. - * + * * @param desc launch descriptor * @throws CoreException */ @@ -152,7 +152,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Return all launch modes for the active launch descriptor and active launch target. - * + * * @return launch modes * @throws CoreException */ @@ -160,7 +160,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Set the active launch mode. - * + * * @param mode launch mode * @throws CoreException */ @@ -168,8 +168,8 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Return all launch targets supported by the given launch descriptor. - * - * @param desc launch descriptor + * + * @param desc launch descriptor * @return launch targets * @throws CoreException */ @@ -177,7 +177,7 @@ public interface ILaunchBarManager extends ILaunchConfigurationListener { /** * Set the active launch target. - * + * * @param target launch target * @throws CoreException */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java index b8517f0172e..5cabc260af5 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java @@ -79,8 +79,8 @@ public interface ILaunchConfigurationProvider { * @return launch configuration * @throws CoreException */ - boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, ILaunchTarget target) - throws CoreException; + boolean launchDescriptorMatches(ILaunchDescriptor descriptor, ILaunchConfiguration configuration, + ILaunchTarget target) throws CoreException; /** * A launch configuration has been added. Provider can inspect it and diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java index 47657c9e5c8..3aa0753f496 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java @@ -24,14 +24,14 @@ public interface ILaunchDescriptor extends IAdaptable { /** * Name to show in the launch descriptor selector. Names must be unique for * all descriptors of a given type. - * + * * @return name of the launch descriptor */ String getName(); /** * The type of launch descriptor. - * + * * @return provider */ ILaunchDescriptorType getType(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java index 5773f9e5aea..2167f83bfd2 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java @@ -22,13 +22,13 @@ public interface ILaunchDescriptorType { /** * Return a descriptor for the given launch object. - * + * * May return null to essentially eat the element so no other types create a * descriptor for it. - * + * * The enablement expression for a given launch object must pass for this * clause to be executed. - * + * * @param descriptor * launch object for descriptor * @return the best descriptor @@ -38,7 +38,7 @@ public interface ILaunchDescriptorType { /** * Does this descriptor type support launching on targets other than Local? - * + * * @return supports targets * @throws CoreException * @since 2.1 diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java index 3e217166d92..3dd7cf02b43 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java @@ -17,13 +17,13 @@ import org.eclipse.core.runtime.CoreException; /** * An extension that serves up objects to feed launch descriptors. - * + * */ public interface ILaunchObjectProvider { /** * Add initial launch objects and set up listeners for new ones. - * + * * @param launchbar * manager * @throws CoreException @@ -34,5 +34,5 @@ public interface ILaunchObjectProvider { * Shutting down, remove any listeners. */ void dispose(); - + } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index b001f86abbf..ad239646431 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -64,7 +64,7 @@ public class Activator extends Plugin { /** * Return the OSGi service with the given service interface. - * + * * @param service * service interface * @return the specified service or null if it's not registered diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java index 03ef0911f5c..e118cd89417 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java @@ -333,7 +333,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } } } - + // not found return null; } @@ -753,7 +753,7 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene } return false; } - + @Override public ILaunchTarget getActiveLaunchTarget() { return activeLaunchTarget; @@ -833,11 +833,11 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene if (descriptor == null) { return null; } - + if (descriptor instanceof DefaultLaunchDescriptor) { return descriptor.getAdapter(ILaunchConfiguration.class); } - + String descTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo providerInfo : configProviders.get(descTypeId)) { try { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java index 150f985d980..f0172116fe6 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java @@ -48,7 +48,7 @@ public class LaunchConfigProviderInfo { } else { supportsNullTarget = false; } - + this.element = element; IConfigurationElement[] enabledExpressions = element.getChildren("enablement");//$NON-NLS-1$ @@ -84,7 +84,7 @@ public class LaunchConfigProviderInfo { public boolean supportsNullTarget() { return supportsNullTarget; } - + public ILaunchConfigurationProvider getProvider() { if (provider == null) { try { diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java index 243f309d665..35a27314605 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java @@ -56,7 +56,8 @@ public class Pair { return false; if (getClass() != obj.getClass()) return false; - @SuppressWarnings("unchecked") Pair other = (Pair) obj; + @SuppressWarnings("unchecked") + Pair other = (Pair) obj; if (first == null) { if (other.first != null) return false; diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java index 225e1d68c55..474ff44dad1 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java @@ -44,7 +44,7 @@ public class LaunchTargetManager implements ILaunchTargetManager, ILaunchTargetM private static final String DELIMETER1 = ","; //$NON-NLS-1$ private static final String DELIMETER2 = ":"; //$NON-NLS-1$ - private static final String SLASH = "/"; //$NON-NLS-1$ + private static final String SLASH = "/"; //$NON-NLS-1$ private static final String SLASH_REPLACER = ";"; //$NON-NLS-1$ private Preferences getTargetsPref() { @@ -108,7 +108,7 @@ public class LaunchTargetManager implements ILaunchTargetManager, ILaunchTargetM // Use children going forward prefs.remove(typeId); } - + prefs.flush(); } } catch (BackingStoreException e) { @@ -222,7 +222,7 @@ public class LaunchTargetManager implements ILaunchTargetManager, ILaunchTargetM return null; } } - + @Override public ILaunchTarget addLaunchTarget(String typeId, String id) { ILaunchTarget target = addLaunchTargetNoNotify(typeId, id); @@ -250,11 +250,12 @@ public class LaunchTargetManager implements ILaunchTargetManager, ILaunchTargetM // Remove the attribute node try { // Bug 536889 - calculate the node name to remove, replacing slashes with a replacement character - getTargetsPref().node(typeId + DELIMETER1 + target.getId().replaceAll(SLASH, SLASH_REPLACER)).removeNode(); + getTargetsPref().node(typeId + DELIMETER1 + target.getId().replaceAll(SLASH, SLASH_REPLACER)) + .removeNode(); } catch (BackingStoreException e) { Activator.log(e); } - + synchronized (listeners) { for (ILaunchTargetListener listener : listeners) { listener.launchTargetRemoved(target); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java index 88a681cddba..dd68cb73a03 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java @@ -91,7 +91,7 @@ public class LaunchTargetWorkingCopy extends PlatformObject implements ILaunchTa } manager.removeLaunchTarget(original); } - + // set the changed attributes for (Map.Entry entry : changes.entrySet()) { String key = entry.getKey(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java index 59819a20fe5..b010d43881f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java @@ -24,7 +24,8 @@ public class LocalLaunchTargetProvider implements ILaunchTargetProvider { public void init(ILaunchTargetManager targetManager) { if (targetManager.getLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name) == null) { - ILaunchTarget target = targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, Messages.LocalTarget_name); + ILaunchTarget target = targetManager.addLaunchTarget(ILaunchTargetManager.localLaunchTargetTypeId, + Messages.LocalTarget_name); ILaunchTargetWorkingCopy wc = target.getWorkingCopy(); wc.setAttribute(ILaunchTarget.ATTR_OS, Platform.getOS()); wc.setAttribute(ILaunchTarget.ATTR_ARCH, Platform.getOSArch()); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index a908eb8fc52..e05b0763a03 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -77,7 +77,7 @@ public interface ILaunchTarget extends IAdaptable { /** * Returns a read-only map of the attributes. - * + * * @return the attributes for this target * @since 2.1 */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java index 26883be474e..29b16a4c68c 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java @@ -17,7 +17,7 @@ public interface ILaunchTargetListener { /** * A launch target was added. - * + * * @param target * the new launch target */ @@ -26,7 +26,7 @@ public interface ILaunchTargetListener { /** * A launch target was removed. - * + * * @param target * the target about to be removed. */ @@ -36,7 +36,7 @@ public interface ILaunchTargetListener { /** * The status of a target has changed. Query the target to find out what the * new status is. - * + * * @param target * the target whose status has changed */ diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java index 78c653f76ff..ebb83bef2eb 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java @@ -14,7 +14,7 @@ import org.eclipse.debug.core.ILaunchConfiguration; /** * The manager for the launch targets. It is registered as an OSGi service. - * + * * @noimplement not to be implemented by clients */ public interface ILaunchTargetManager { @@ -29,14 +29,14 @@ public interface ILaunchTargetManager { /** * The list of all launch targets. - * + * * @return list of launch targets */ ILaunchTarget[] getLaunchTargets(); /** * The list of launch targets with a given type id. - * + * * @param typeId * the launch target type id * @return list of launch targets @@ -45,7 +45,7 @@ public interface ILaunchTargetManager { /** * Return the launch target with the given typeId and name - * + * * @param typeId * type of the launch target * @param id @@ -56,7 +56,7 @@ public interface ILaunchTargetManager { /** * Return the status of the launch target. - * + * * @param target * the launch target * @return status @@ -65,7 +65,7 @@ public interface ILaunchTargetManager { /** * Add a launch target with the given typeId, id, and name. - * + * * @param typeId * type id of the launch target * @param id @@ -76,7 +76,7 @@ public interface ILaunchTargetManager { /** * Removes a launch target. - * + * * @param target * the launch target to remove */ @@ -84,14 +84,14 @@ public interface ILaunchTargetManager { /** * The status of the launch target has changed. - * + * * @param target */ void targetStatusChanged(ILaunchTarget target); /** * What is the default target to use for this launch configuration. - * + * * @param configuration * launch configuration or null if not set * @return default target for this launch configuration @@ -100,7 +100,7 @@ public interface ILaunchTargetManager { /** * Set the default target for the given launch configuration. - * + * * @param configuration * launch configuration * @param target @@ -110,14 +110,14 @@ public interface ILaunchTargetManager { /** * Add a listener. - * + * * @param listener */ void addListener(ILaunchTargetListener listener); /** * Remove a listener. - * + * * @param listener */ void removeListener(ILaunchTargetListener listener); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java index 93ba2f21938..f22867ee2ee 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java @@ -12,14 +12,14 @@ package org.eclipse.launchbar.core.target; /** * Launch target manager extensions. - * + * * @noimplement not to be implemented by clients */ public interface ILaunchTargetManager2 { - + /** * Add a launch target with the given typeId, id, and name but no notification. - * + * * @param typeId * type id of the launch target * @param id @@ -28,5 +28,4 @@ public interface ILaunchTargetManager2 { */ ILaunchTarget addLaunchTargetNoNotify(String typeId, String id); - } diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java index 62e571766a1..15f660447ec 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java @@ -19,7 +19,7 @@ public interface ILaunchTargetProvider { /** * Fetch the status for the launch target. - * + * * @param target * the launch target * @return status of the launch target diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java index 75ecb311764..9eb27ff736f 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java @@ -17,14 +17,14 @@ public interface ILaunchTargetWorkingCopy extends ILaunchTarget { /** * Get the original launch target. - * + * * @return the original launch target */ ILaunchTarget getOriginal(); /** * Gives the target a new ID. The save method will return a new target with the given name.e - * + * * @param id * new target ID */ @@ -32,7 +32,7 @@ public interface ILaunchTargetWorkingCopy extends ILaunchTarget { /** * Set an attribute. - * + * * @param key * key * @param value @@ -42,7 +42,7 @@ public interface ILaunchTargetWorkingCopy extends ILaunchTarget { /** * Save the changes to the original working copy. - * + * * @return original launch target unless the id was changed in which case returns a new target */ ILaunchTarget save(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java index e2f78ba4df8..c9005707cd9 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java @@ -28,7 +28,7 @@ public interface ILaunchConfigurationTargetedDelegate extends ILaunchConfigurati * launch object should be created by the debug platform. If a launch object * is returned, its launch mode must match that of the mode specified in * this method call. - * + * * @param configuration * the configuration being launched * @param mode @@ -53,7 +53,7 @@ public interface ILaunchConfigurationTargetedDelegate extends ILaunchConfigurati * ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build) * . *

- * + * * @param configuration * the configuration being launched * @param mode @@ -82,7 +82,7 @@ public interface ILaunchConfigurationTargetedDelegate extends ILaunchConfigurati * a final chance for this launch delegate to abort a launch if required. * For example, a delegate could cancel a launch if it discovered * compilation errors that would prevent the launch from succeeding. - * + * * @param configuration * the configuration being launched * @param mode @@ -108,7 +108,7 @@ public interface ILaunchConfigurationTargetedDelegate extends ILaunchConfigurati * Returns whether a launch should proceed. This method is called first in * the launch sequence providing an opportunity for this launch delegate to * abort the launch. - * + * * @param configuration * configuration being launched * @param mode diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java index 488d09b0406..31da57d676e 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java @@ -20,7 +20,7 @@ public interface ITargetedLaunch extends ILaunch { /** * The target this launch will or is running on. - * + * * @return launch target */ ILaunchTarget getLaunchTarget(); diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java index e2ed482cddb..00d621e78bd 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java @@ -20,10 +20,10 @@ import org.eclipse.launchbar.core.target.ILaunchTarget; /** * An implementation of the ILaunchConfigurationTargetedDelegate. - * + * * Implements the ILaunchConfigurationDelegate2 interfaces to pick out the * default target and pass it the targeted delegate methods. - * + * * The default for the targeted delegate methods is to call the non targeted * methods in the super class. * diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..2b6ecff8a01 100644 --- a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,464 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..d2dc703ba9e --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=1 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java index 5e270d3110a..ee2cbbf34f3 100644 --- a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java +++ b/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java @@ -95,7 +95,7 @@ public abstract class RemoteLaunchTargetProvider implements ILaunchTargetProvide IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) connection; IRemoteConnection original = ((IRemoteConnectionWorkingCopy) connection).getOriginal(); target = targetManager.getLaunchTarget(getTypeId(), original.getName()); - if (target != null ) { + if (target != null) { targetManager.removeLaunchTarget(target); } initLaunchTarget(targetManager.addLaunchTarget(getTypeId(), wc.getName())); diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..2b6ecff8a01 100644 --- a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,464 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..d2dc703ba9e --- /dev/null +++ b/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=1 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..2b6ecff8a01 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,464 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..d2dc703ba9e --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=1 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java index 03871fd13c4..382b137a1bc 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java @@ -42,12 +42,12 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - + @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; - + ImageRegistry imageRegistry = getImageRegistry(); imageRegistry.put(IMG_BUTTON_BACKGROUND, imageDescriptorFromPlugin(PLUGIN_ID, "icons/bgButton.png")); //$NON-NLS-1$ imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build_16.png")); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java index 248a658c4c2..140a9b9ce67 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java @@ -74,7 +74,7 @@ public class FilterControl extends Composite { /** * Creates a filter control, to be fully function attachListViewer must be called shortly after - * + * * @param parent */ public FilterControl(Composite parent) { @@ -113,7 +113,7 @@ public class FilterControl extends Composite { /** * Create the filtered tree's controls. Subclasses should override. - * + * * @param parent * @param treeStyle */ @@ -129,7 +129,7 @@ public class FilterControl extends Composite { /** * Create the filter controls. By default, a text and corresponding tool bar button that clears the contents of the text is * created. Subclasses may override. - * + * * @param parent * parent Composite of the filter controls * @return the Composite that contains the filter controls @@ -149,7 +149,7 @@ public class FilterControl extends Composite { /** * Create the refresh job for the receiver. - * + * */ private void createRefreshJob() { refreshJob = doCreateRefreshJob(); @@ -170,9 +170,9 @@ public class FilterControl extends Composite { /** * Creates a workbench job that will refresh the tree based on the current filter text. Subclasses may override. - * + * * @return a workbench job that can be scheduled to refresh the tree - * + * * @since 3.4 */ protected WorkbenchJob doCreateRefreshJob() { @@ -211,38 +211,33 @@ public class FilterControl extends Composite { /** * Creates the filter text and adds listeners. This method calls {@link #doCreateFilterText(Composite)} to create the text * control. Subclasses should override {@link #doCreateFilterText(Composite)} instead of overriding this method. - * + * * @param parent * Composite of the filter text */ protected void createFilterText(Composite parent) { filterText = doCreateFilterText(parent); - filterText.getAccessible().addAccessibleListener( - new AccessibleAdapter() { - @Override - public void getName(AccessibleEvent e) { - String filterTextString = filterText.getText(); - if (filterTextString.length() == 0 - || filterTextString.equals(initialText)) { - e.result = initialText; - } else { - e.result = NLS.bind( - Messages.FilterControl_1, - new String[] { - filterTextString, - String.valueOf(getFilteredItemsCount()) }); - } - } + filterText.getAccessible().addAccessibleListener(new AccessibleAdapter() { + @Override + public void getName(AccessibleEvent e) { + String filterTextString = filterText.getText(); + if (filterTextString.length() == 0 || filterTextString.equals(initialText)) { + e.result = initialText; + } else { + e.result = NLS.bind(Messages.FilterControl_1, + new String[] { filterTextString, String.valueOf(getFilteredItemsCount()) }); + } + } - /** - * Return the number of filtered items - * - * @return int - */ - private int getFilteredItemsCount() { - return listViewer.getItemCount(); - } - }); + /** + * Return the number of filtered items + * + * @return int + */ + private int getFilteredItemsCount() { + return listViewer.getItemCount(); + } + }); filterText.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { @@ -314,8 +309,7 @@ public class FilterControl extends Composite { } protected Text doCreateFilterText(Composite parent) { - return new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.SEARCH - | SWT.ICON_CANCEL); + return new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL); } /** @@ -335,9 +329,9 @@ public class FilterControl extends Composite { /** * Return the time delay that should be used when scheduling the filter refresh job. Subclasses may override. - * + * * @return a time delay in milliseconds before the job should run - * + * */ protected long getRefreshJobDelay() { return 200; @@ -345,7 +339,7 @@ public class FilterControl extends Composite { /** * Set the background for the widgets that support the filter text area. - * + * * @param background * background Color to set */ @@ -366,7 +360,7 @@ public class FilterControl extends Composite { /** * Set the text in the filter control. - * + * * @param string */ protected void setFilterText(String string) { @@ -382,7 +376,7 @@ public class FilterControl extends Composite { /** * Get the tree viewer of the receiver. - * + * * @return the tree viewer */ public LaunchBarListViewer getViewer() { @@ -391,7 +385,7 @@ public class FilterControl extends Composite { /** * Get the filter text for the receiver, if it was created. Otherwise return null. - * + * * @return the filter Text, or null if it was not created */ public Text getFilterControl() { @@ -400,7 +394,7 @@ public class FilterControl extends Composite { /** * Convenience method to return the text of the filter control. If the text widget is not created, then null is returned. - * + * * @return String in the text, or null if the text does not exist */ protected String getFilterString() { @@ -410,7 +404,7 @@ public class FilterControl extends Composite { /** * Set the text that will be shown until the first focus. A default value is provided, so this method only need be called if * overriding the default initial text is desired. - * + * * @param text * initial text to appear in text field */ @@ -437,7 +431,7 @@ public class FilterControl extends Composite { /** * Select all text in the filter text field. - * + * */ protected void selectAll() { if (filterText != null) { @@ -447,7 +441,7 @@ public class FilterControl extends Composite { /** * Get the initial text for the receiver. - * + * * @return String */ protected String getInitialText() { @@ -456,8 +450,7 @@ public class FilterControl extends Composite { private void updatePatternText() { String text = getFilterString(); - boolean initial = initialText != null - && initialText.equals(text); + boolean initial = initialText != null && initialText.equals(text); if (initial) { patternText = null; } else if (text != null) { diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java index 879f42aacd6..a2a1d278578 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java @@ -75,7 +75,7 @@ public class LaunchBarInjector { || event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) { IPreferenceStore store1 = Activator.getDefault().getPreferenceStore(); boolean enabled2 = store1.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR); - if (enabled2){ + if (enabled2) { injectIntoAll(false); injectIntoAll(true); } @@ -114,12 +114,12 @@ public class LaunchBarInjector { if (!LaunchBarControl.CLASS_URI.equals(launchBarElement.getContributionURI())) { launchBarElement.setContributionURI(LaunchBarControl.CLASS_URI); } - + // remove it if we're disabled if (!enabled) { trimBar.getChildren().remove(launchBarElement); // This seems to be a bug in the platform but for now, dispose of the widget - Widget widget = (Widget)launchBarElement.getWidget(); + Widget widget = (Widget) launchBarElement.getWidget(); widget.dispose(); } // either way, we're done diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java index 84d61778cab..e73b76d516c 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java @@ -79,7 +79,7 @@ public class LaunchBarListViewer extends StructuredViewer { @SuppressWarnings("unchecked") @Override public int compare(Viewer viewer, Object e1, Object e2) { - return ((Comparator)getComparator()).compare(e1, e2); + return ((Comparator) getComparator()).compare(e1, e2); } } @@ -157,7 +157,6 @@ public class LaunchBarListViewer extends StructuredViewer { } }; - private class ListItem extends Composite { protected final Object element; private Label icon; @@ -170,6 +169,7 @@ public class LaunchBarListViewer extends StructuredViewer { public String toString() { return "[" + index + "] " + labelProvider.getText(element); //$NON-NLS-1$ //$NON-NLS-2$ } + public ListItem(Composite parent, int style, Object element, int index, ILabelProvider labelProvider) { super(parent, style); this.element = element; @@ -227,7 +227,6 @@ public class LaunchBarListViewer extends StructuredViewer { addTraverseListener(listItemTraverseListener); addKeyListener(lisItemKeyListener); - layout(true); } @@ -292,8 +291,7 @@ public class LaunchBarListViewer extends StructuredViewer { gc.setAntialias(SWT.ON); gc.setInterpolation(SWT.HIGH); // resize to 16 pixels - gc.drawImage(image, 0, 0, image.getBounds().width, - image.getBounds().height, 0, 0, 16, 16); + gc.drawImage(image, 0, 0, image.getBounds().width, image.getBounds().height, 0, 0, 16, 16); gc.dispose(); image = buttonImage; disposeImage = true; @@ -377,7 +375,6 @@ public class LaunchBarListViewer extends StructuredViewer { // ignore } - }); sash.setToolTipText(Messages.LaunchBarListViewer_0); } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java index 39470b74a6b..629aa3047de 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java @@ -20,8 +20,7 @@ import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; -public class LaunchBarPreferencePage extends FieldEditorPreferencePage implements - IWorkbenchPreferencePage { +public class LaunchBarPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public LaunchBarPreferencePage() { super(GRID); @@ -29,13 +28,14 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement @Override public void init(IWorkbench workbench) { - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription(Messages.LaunchBarPreferencePage_0); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription(Messages.LaunchBarPreferencePage_0); } @Override protected void createFieldEditors() { - addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent())); + addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, + getFieldEditorParent())); addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON, Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent())); addField(new BooleanFieldEditor(Activator.PREF_ALWAYS_TARGETSELECTOR, diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java index 7a0f7c5a024..06eb83433a4 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java @@ -23,7 +23,7 @@ public class Transition implements Runnable { private int current; private int to; private int incr; - + public Transition(Control control, int current, int tick) { this.control = control; this.current = current; @@ -38,7 +38,7 @@ public class Transition implements Runnable { if (!done()) Display.getCurrent().timerExec(tick, this); } - + public void to(int to) { if (current == to) return; diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs index a787de69683..2b6ecff8a01 100644 --- a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,24 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull @@ -9,90 +29,113 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=error -org.eclipse.jdt.core.compiler.problem.deadCode=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled @@ -101,4 +144,321 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..d2dc703ba9e --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=1 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java index de69fb334f5..0c5e3ba8e1f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java @@ -27,7 +27,7 @@ import org.eclipse.launchbar.core.internal.Activator; import org.eclipse.swt.graphics.Image; public class DefaultDescriptorLabelProvider extends LabelProvider { - + private Map images = new HashMap<>(); @Override @@ -37,7 +37,7 @@ public class DefaultDescriptorLabelProvider extends LabelProvider { image.dispose(); } } - + @Override public Image getImage(Object element) { if (element instanceof ILaunchDescriptor) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java index 350b3bdab1d..1188dafcc84 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java @@ -24,7 +24,7 @@ public interface ILaunchBarLaunchConfigDialog extends ILaunchConfigurationDialog /** * The target associated with the edit session, usually the active target when the session was * started. - * + * * @return launch target */ ILaunchTarget getLaunchTarget(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java index 5944e82b5f9..96569e8110c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java @@ -53,7 +53,7 @@ public class NewLaunchConfigWizard extends Wizard implements ILaunchConfiguratio @Override public void setContainer(IWizardContainer wizardContainer) { super.setContainer(wizardContainer); - + if (wizardContainer != null) { // Edit page wants to know when it's about to change to itself ((WizardDialog) wizardContainer).addPageChangingListener(editPage); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java index f81b435bc2b..88836cdc720 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; /** * Wizard Dialog for Launch Bar's new Launch Configuration Wizard. - * + * * @since 2.3 */ public class NewLaunchConfigWizardDialog extends WizardDialog { @@ -43,7 +43,7 @@ public class NewLaunchConfigWizardDialog extends WizardDialog { protected String getDialogSettingsSectionName() { return Activator.PLUGIN_ID + ".LAUNCH_CONFIGURATIONS_DIALOG_SECTION"; //$NON-NLS-1$ } - + @Override protected IDialogSettings getDialogBoundsSettings() { IDialogSettings settings = Activator.getDefault().getDialogSettings(); @@ -53,14 +53,14 @@ public class NewLaunchConfigWizardDialog extends WizardDialog { } return section; } - + @Override protected Point getInitialSize() { try { // Check if we've saved the height before getDialogBoundsSettings().getInt("DIALOG_HEIGHT"); //$NON-NLS-1$ return super.getInitialSize(); - } catch(NumberFormatException nfe) { + } catch (NumberFormatException nfe) { // Nope, return the default size return DEFAULT_INITIAL_DIALOG_SIZE; } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index e7ecb8b73d3..cf673cad40f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -11,7 +11,7 @@ * Contributors: * Doug Schaefer * Torkild U. Resheim - add preference to control target selector - * Vincent Guignot - Ingenico - add preference to control Build button + * Vincent Guignot - Ingenico - add preference to control Build button *******************************************************************************/ package org.eclipse.launchbar.ui.internal; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index d71aa55088b..8a85d9f4beb 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -57,7 +57,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private boolean initing; public static final int ID_DUPLICATE = IDialogConstants.CLIENT_ID + 1; - public static final int ID_DELETE = IDialogConstants.CLIENT_ID + 2; + public static final int ID_DELETE = IDialogConstants.CLIENT_ID + 2; public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target, @@ -98,9 +98,11 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau String descName = labelProvider != null ? labelProvider.getText(descriptor) : descriptor.getName(); String typeName = workingCopy.getType().getName(); if (supportsTargets) { - setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit2, typeName, descName, mode.getLabel(), target.getId())); + setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit2, typeName, descName, mode.getLabel(), + target.getId())); } else { - setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit1, typeName, descName, mode.getLabel())); + setTitle( + String.format(Messages.LaunchBarLaunchConfigDialog_Edit1, typeName, descName, mode.getLabel())); } } catch (CoreException e) { Activator.log(e); @@ -217,12 +219,12 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau // insert our buttons ahead of the OK/Cancel buttons configButtons.moveAbove(okCancelButtons); - + return buttonBar; } protected Control createConfigButtons(Composite parent) { - ((GridLayout) parent.getLayout()).numColumns++; + ((GridLayout) parent.getLayout()).numColumns++; Composite composite = new Composite(parent, SWT.NONE); // create a layout with spacing and margins appropriate for the font size. GridLayout layout = new GridLayout(); @@ -233,8 +235,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); composite.setLayout(layout); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER - | GridData.VERTICAL_ALIGN_CENTER); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(data); composite.setFont(parent.getFont()); @@ -253,13 +254,13 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau } else { deleteText = Messages.LaunchBarLaunchConfigDialog_Reset; } - + // TODO if the descriptor is not a launch config, this should really say Reset createButton(composite, ID_DELETE, deleteText, false); - + return composite; } - + @Override protected void buttonPressed(int buttonId) { if (buttonId == ID_DUPLICATE) { @@ -270,7 +271,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau super.buttonPressed(buttonId); } } - + protected void deletePressed() { String title, message; if (descriptor instanceof DefaultLaunchDescriptor) { @@ -280,7 +281,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau title = Messages.LaunchBarLaunchConfigDialog_ResetTitle; message = Messages.LaunchBarLaunchConfigDialog_ResetConfirm; } - + if (MessageDialog.openConfirm(getShell(), title, String.format(message, workingCopy.getName()))) { setReturnCode(ID_DELETE); close(); @@ -291,14 +292,14 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau setReturnCode(ID_DUPLICATE); close(); } - + @Override protected void okPressed() { String newName = nameText.getText().trim(); if (!newName.equals(originalName)) { workingCopy.rename(newName); } - + if (buildTabGroup != null) { buildTabGroup.performApply(workingCopy); } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java index d18d264a8c4..7988001ce7c 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java @@ -74,13 +74,14 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { String descriptorTypeId = element.getAttribute("launchDescriptorType"); //$NON-NLS-1$ ExecutableExtension tabGroup = new ExecutableExtension<>(element, "tabGroup"); //$NON-NLS-1$ - - Map> descGroup = buildTabGroups.get(launchConfigTypeId); + + Map> descGroup = buildTabGroups + .get(launchConfigTypeId); if (descGroup == null) { descGroup = new HashMap<>(); buildTabGroups.put(launchConfigTypeId, descGroup); } - + descGroup.put(descriptorTypeId, tabGroup); } } @@ -138,12 +139,12 @@ public class LaunchBarUIManager implements ILaunchBarUIManager { workingCopy.doSave(); } break; - case LaunchBarLaunchConfigDialog.ID_DUPLICATE: - { - String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(workingCopy.getName()); - ILaunchConfigurationWorkingCopy newWorkingCopy = workingCopy.copy(newName); - newWorkingCopy.doSave(); - } + case LaunchBarLaunchConfigDialog.ID_DUPLICATE: { + String newName = DebugPlugin.getDefault().getLaunchManager() + .generateLaunchConfigurationName(workingCopy.getName()); + ILaunchConfigurationWorkingCopy newWorkingCopy = workingCopy.copy(newName); + newWorkingCopy.doSave(); + } break; case LaunchBarLaunchConfigDialog.ID_DELETE: config.delete(); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java index 1e8715cd0dd..c8b2d135337 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java @@ -69,7 +69,7 @@ public class Messages extends NLS { public static String LaunchBarLaunchConfigDialog_ResetTitle; public static String LaunchBarLaunchConfigDialog_DeleteConfirm; public static String LaunchBarLaunchConfigDialog_ResetConfirm; - + public static String LaunchConfigurationNotFound; public static String LaunchConfigurationNotFoundDesc; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java index 67a7122be7b..0a3e1bd8a01 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java @@ -190,7 +190,7 @@ public class NewLaunchConfigTypePage2 extends WizardPage { setPageComplete(false); return; } - + ILaunchConfigurationType type = (ILaunchConfigurationType) selection[0].getData(); editPage.setLaunchConfigType(type); setPageComplete(true); diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java index 329a5637ba7..4ee6c8d59de 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java @@ -1,166 +1,166 @@ -/******************************************************************************* - * Copyright (c) 2000, 2018 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 - * which accompanies this distribution, and is available at + * 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 - *******************************************************************************/ -package org.eclipse.launchbar.ui.internal.target; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.launchbar.ui.internal.Activator; -import org.eclipse.launchbar.ui.internal.Messages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.IWorkbenchWizard; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -class NewLaunchTargetWizardSelectionPage extends WizardPage { - - private Table table; - - public NewLaunchTargetWizardSelectionPage() { - super(NewLaunchTargetWizardSelectionPage.class.getName()); - setTitle(Messages.NewLaunchTargetWizardSelectionPage_Title); - setDescription(Messages.NewLaunchTargetWizardSelectionPage_Description); - } - - @Override - public void createControl(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - comp.setLayout(new GridLayout()); - - table = new Table(comp, SWT.BORDER | SWT.SINGLE); - table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - - List elements = new ArrayList<>(); - IExtensionPoint point = Platform.getExtensionRegistry() - .getExtensionPoint(Activator.PLUGIN_ID + ".launchTargetTypeUI"); //$NON-NLS-1$ - for (IExtension extension : point.getExtensions()) { - for (IConfigurationElement element : extension.getConfigurationElements()) { - String elementName = element.getName(); - if ("wizard2".equals(elementName) || "wizard".equals(elementName)) { //$NON-NLS-1$ //$NON-NLS-2$ - elements.add(element); - } - } - } - - elements.sort((o1, o2) -> { - String name1 = o1.getAttribute("name"); //$NON-NLS-1$ - String name2 = o2.getAttribute("name"); //$NON-NLS-1$ - return name1.compareTo(name2); - }); - - for (IConfigurationElement element : elements) { - String name = element.getAttribute("name"); //$NON-NLS-1$ - TableItem item = new TableItem(table, SWT.NONE); - item.setText(name); - - String iconFile = element.getAttribute("icon"); //$NON-NLS-1$ - if (iconFile != null) { - ImageDescriptor desc = Activator.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), iconFile); - if (desc != null) { - item.setImage(desc.createImage()); - } - } - - item.setData(element); - } - - table.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - getContainer().updateButtons(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - if (canFlipToNextPage()) { - getContainer().showPage(getNextPage()); - } - } - }); - - setControl(comp); - } - - @Override - public void dispose() { - for (TableItem item : table.getItems()) { - Object obj = item.getData(); - if (obj instanceof Wizard) { - ((Wizard) obj).dispose(); - } - } - super.dispose(); - } - - public ImageDescriptor getDescriptionImage(IConfigurationElement element) { - String descImage = element.getAttribute("icon"); //$NON-NLS-1$ - if (descImage == null) { - return null; - } - return AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), descImage); - } - - @Override - public boolean canFlipToNextPage() { - return table.getSelectionIndex() >= 0; - } - - @Override - public IWizardPage getNextPage() { - int i = table.getSelectionIndex(); - if (i >= 0) { - TableItem item = table.getItem(i); - Object obj = item.getData(); - Wizard nextWizard; - if (obj instanceof IConfigurationElement) { - IConfigurationElement element = (IConfigurationElement) obj; - try { - nextWizard = (Wizard) element.createExecutableExtension("class"); //$NON-NLS-1$ - nextWizard.addPages(); - if (nextWizard instanceof IWorkbenchWizard) { - ((IWorkbenchWizard) nextWizard).init(PlatformUI.getWorkbench(), new StructuredSelection()); - } - item.setData(nextWizard); - } catch (CoreException e) { - Activator.log(e); - return null; - } - } else { - nextWizard = (Wizard) obj; - } - - return nextWizard.getStartingPage(); - } - return super.getNextPage(); - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.launchbar.ui.internal.target; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.launchbar.ui.internal.Activator; +import org.eclipse.launchbar.ui.internal.Messages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.ui.IWorkbenchWizard; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +class NewLaunchTargetWizardSelectionPage extends WizardPage { + + private Table table; + + public NewLaunchTargetWizardSelectionPage() { + super(NewLaunchTargetWizardSelectionPage.class.getName()); + setTitle(Messages.NewLaunchTargetWizardSelectionPage_Title); + setDescription(Messages.NewLaunchTargetWizardSelectionPage_Description); + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + comp.setLayout(new GridLayout()); + + table = new Table(comp, SWT.BORDER | SWT.SINGLE); + table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + List elements = new ArrayList<>(); + IExtensionPoint point = Platform.getExtensionRegistry() + .getExtensionPoint(Activator.PLUGIN_ID + ".launchTargetTypeUI"); //$NON-NLS-1$ + for (IExtension extension : point.getExtensions()) { + for (IConfigurationElement element : extension.getConfigurationElements()) { + String elementName = element.getName(); + if ("wizard2".equals(elementName) || "wizard".equals(elementName)) { //$NON-NLS-1$ //$NON-NLS-2$ + elements.add(element); + } + } + } + + elements.sort((o1, o2) -> { + String name1 = o1.getAttribute("name"); //$NON-NLS-1$ + String name2 = o2.getAttribute("name"); //$NON-NLS-1$ + return name1.compareTo(name2); + }); + + for (IConfigurationElement element : elements) { + String name = element.getAttribute("name"); //$NON-NLS-1$ + TableItem item = new TableItem(table, SWT.NONE); + item.setText(name); + + String iconFile = element.getAttribute("icon"); //$NON-NLS-1$ + if (iconFile != null) { + ImageDescriptor desc = Activator.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), iconFile); + if (desc != null) { + item.setImage(desc.createImage()); + } + } + + item.setData(element); + } + + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + getContainer().updateButtons(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + if (canFlipToNextPage()) { + getContainer().showPage(getNextPage()); + } + } + }); + + setControl(comp); + } + + @Override + public void dispose() { + for (TableItem item : table.getItems()) { + Object obj = item.getData(); + if (obj instanceof Wizard) { + ((Wizard) obj).dispose(); + } + } + super.dispose(); + } + + public ImageDescriptor getDescriptionImage(IConfigurationElement element) { + String descImage = element.getAttribute("icon"); //$NON-NLS-1$ + if (descImage == null) { + return null; + } + return AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), descImage); + } + + @Override + public boolean canFlipToNextPage() { + return table.getSelectionIndex() >= 0; + } + + @Override + public IWizardPage getNextPage() { + int i = table.getSelectionIndex(); + if (i >= 0) { + TableItem item = table.getItem(i); + Object obj = item.getData(); + Wizard nextWizard; + if (obj instanceof IConfigurationElement) { + IConfigurationElement element = (IConfigurationElement) obj; + try { + nextWizard = (Wizard) element.createExecutableExtension("class"); //$NON-NLS-1$ + nextWizard.addPages(); + if (nextWizard instanceof IWorkbenchWizard) { + ((IWorkbenchWizard) nextWizard).init(PlatformUI.getWorkbench(), new StructuredSelection()); + } + item.setData(nextWizard); + } catch (CoreException e) { + Activator.log(e); + return null; + } + } else { + nextWizard = (Wizard) obj; + } + + return nextWizard.getStartingPage(); + } + return super.getNextPage(); + } + +} diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java index d6977adc0b4..981f0e5b70b 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java @@ -37,7 +37,7 @@ public interface ILaunchTargetUIManager { /** * Open a dialog to edit the specified launch target. - * + * * @param target * launch target to edit */ diff --git a/features/org.eclipse.launchbar.remote/feature.properties b/features/org.eclipse.launchbar.remote/feature.properties index 8a419623710..a500c84cb5c 100644 --- a/features/org.eclipse.launchbar.remote/feature.properties +++ b/features/org.eclipse.launchbar.remote/feature.properties @@ -7,7 +7,7 @@ # https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 -# +# # Contributors: # IBM Corporation - initial API and implementation ############################################################################### diff --git a/features/org.eclipse.launchbar/build.properties b/features/org.eclipse.launchbar/build.properties index 4cf1a1fa3f8..ade11de0837 100644 --- a/features/org.eclipse.launchbar/build.properties +++ b/features/org.eclipse.launchbar/build.properties @@ -7,7 +7,7 @@ # https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 -# +# # Contributors: # QNX - initial API and implementation ############################################################################### diff --git a/features/org.eclipse.launchbar/feature.properties b/features/org.eclipse.launchbar/feature.properties index 8660d6ae80e..abdbebf2f4b 100644 --- a/features/org.eclipse.launchbar/feature.properties +++ b/features/org.eclipse.launchbar/feature.properties @@ -7,7 +7,7 @@ # https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 -# +# # Contributors: # IBM Corporation - initial API and implementation ############################################################################### diff --git a/repo/.settings/org.eclipse.jdt.core.prefs b/repo/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..2b6ecff8a01 --- /dev/null +++ b/repo/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,464 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled +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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/repo/.settings/org.eclipse.jdt.launching.prefs b/repo/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/repo/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/repo/.settings/org.eclipse.jdt.ui.prefs b/repo/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/repo/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/repo/.settings/org.eclipse.pde.api.tools.prefs b/repo/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/repo/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/repo/.settings/org.eclipse.pde.prefs b/repo/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..d2dc703ba9e --- /dev/null +++ b/repo/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=1 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs index 97541062df6..ad05599159f 100644 --- a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,24 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull @@ -9,46 +29,61 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecation=ignore org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning @@ -56,19 +91,19 @@ org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullReference=error org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore @@ -80,8 +115,8 @@ org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning @@ -92,22 +127,338 @@ org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..51a63ec9988 --- /dev/null +++ b/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=2 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index f6aa42f4d40..9b8fd54f73c 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -130,7 +130,7 @@ public class LaunchBarManager2Test { protected ILaunchConfigurationProvider mockConfigProviderElement(String descriptorTypeId, int priority, ILaunchDescriptor descriptor, ILaunchTarget target, ILaunchConfiguration config, Object launchObj) - throws CoreException { + throws CoreException { ILaunchConfigurationProvider provider = mock(ILaunchConfigurationProvider.class); mockProviderElement(descriptorTypeId, priority, provider); doReturn(config.getType()).when(provider).getLaunchConfigurationType(descriptor, target); diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..ad05599159f 100644 --- a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs +++ b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,464 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled 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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +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 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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 +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..51a63ec9988 --- /dev/null +++ b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=2 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 From c0ea43a435b8b0f6c3eaf87b34fda925061f5b05 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 13:50:09 -0500 Subject: [PATCH 193/198] Bug 553231: Use code cleanliness script from cdt-infra Change-Id: Ie64b89f970e4e6d2cc5bf08281da4d0c49c197f9 --- check_code_cleanliness.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 check_code_cleanliness.sh diff --git a/check_code_cleanliness.sh b/check_code_cleanliness.sh new file mode 100755 index 00000000000..f914e19cc13 --- /dev/null +++ b/check_code_cleanliness.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +## +# The script is shared by all the CDT projects. When running +# local edits, you can, for example, do: +# SCRIPT_URL=file:///scratch/eclipse/src/cdt/cdt-infra/scripts/check_code_cleanliness.sh ./check_code_cleanliness.sh +## + +: ${SCRIPT_URL:=https://raw.githubusercontent.com/eclipse-cdt/cdt-infra/master/scripts/check_code_cleanliness.sh} +export COREPROJECT=bundles/org.eclipse.launchbar.core +echo Obtaining check_code_cleanliness.sh from $SCRIPT_URL +curl -sL $SCRIPT_URL | bash From 43e7fa17261300e42c23cb671df970daf1c9c720 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 14:13:40 -0500 Subject: [PATCH 194/198] Bug 553231: Apply all cleanups Change-Id: Icc2bbbd8c9b1e5c8999cf5fdada0aa01113231c6 --- .../org/eclipse/launchbar/core/internal/Activator.java | 2 ++ .../launchbar/ui/controls/internal/ConfigSelector.java | 2 +- .../launchbar/ui/controls/internal/LaunchBarControl.java | 2 +- .../ui/internal/commands/BuildActiveCommandHandler.java | 2 +- .../ui/internal/commands/StopActiveCommandHandler.java | 2 +- .../ui/internal/dialogs/NewLaunchConfigEditPage.java | 2 +- .../launchbar/core/PerTargetLaunchConfigProviderTest.java | 2 +- .../launchbar/core/internal/LaunchBarManager2Test.java | 8 ++++---- .../launchbar/core/internal/LaunchBarManagerTest.java | 6 +++--- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java index ad239646431..ba17d2770d3 100644 --- a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java @@ -32,6 +32,7 @@ public class Activator extends Plugin { private static LaunchTargetManager launchTargetManager; private static LaunchBarManager launchBarManager; + @Override public void start(BundleContext bundleContext) throws Exception { super.start(bundleContext); plugin = this; @@ -43,6 +44,7 @@ public class Activator extends Plugin { bundleContext.registerService(ILaunchBarManager.class, launchBarManager, null); } + @Override public void stop(BundleContext bundleContext) throws Exception { super.stop(bundleContext); plugin = null; diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java index 881b5e5384e..cadeb5c55a9 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java @@ -189,7 +189,7 @@ public class ConfigSelector extends CSelector { } catch (CoreException e) { return e.getStatus(); } - }; + } }.schedule(); } } diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 6014bef2fae..90d31b71a62 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -165,7 +165,7 @@ public class LaunchBarControl implements ILaunchBarListener { } catch (Exception ex) { Activator.log(ex); } - }; + } }); button.addDisposeListener(e -> image.dispose()); return button; diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java index b2a48988b8a..5ca972b1385 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java @@ -142,7 +142,7 @@ public class BuildActiveCommandHandler extends AbstractHandler { }.schedule(); return Status.OK_STATUS; - }; + } }.schedule(); } catch (CoreException e) { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java index 1607c245353..8ab0ebd033a 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java @@ -77,7 +77,7 @@ public class StopActiveCommandHandler extends AbstractHandler { } catch (CoreException e) { return e.getStatus(); } - }; + } }.schedule(); } } diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java index b77735f0015..2f825ee02bd 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java @@ -207,7 +207,7 @@ public class NewLaunchConfigEditPage extends WizardPage implements IPageChanging public ILaunchConfigurationWorkingCopy getWorkingCopy() { return super.getWorkingCopy(); } - }; + } public LaunchGroupExtension getLaunchGroup() { if (workingCopy == null) diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java index 1ea6eedbae8..c8c8158ed58 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java @@ -146,7 +146,7 @@ public class PerTargetLaunchConfigProviderTest { return config; } - }; + } @Test public void testPopulateLaunchConfiguration() throws CoreException { diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java index 9b8fd54f73c..a214309bc32 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java @@ -19,9 +19,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; @@ -113,7 +113,7 @@ public class LaunchBarManager2Test { ILaunchTargetManager getLaunchTargetManager() { return targetManager; } - }; + } @Before public void setUp() throws Exception { diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java index 0742b1711e9..cbcd097520c 100644 --- a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java +++ b/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java @@ -16,9 +16,9 @@ package org.eclipse.launchbar.core.internal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; From fd8624bdaeca5e27c8750a9bac41f01d9fcde65d Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 16:05:46 -0500 Subject: [PATCH 195/198] Bug 553231: Fix line endings Change-Id: I0fe35fd37c0425bc93d0e4b1f41e5a194a3858db --- .../org.eclipse.launchbar.remote/feature.xml | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index 230f5634b86..bd1141456db 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -1,36 +1,36 @@ - - - - - %description - - - - %copyright - - - - %license - - - - - - - + + + + + %description + + + + %copyright + + + + %license + + + + + + + From 651d5db386397150a8073890a11f61330b0462c9 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 19 Nov 2019 16:59:55 -0500 Subject: [PATCH 196/198] [releng] Bump versions to 2.4.1 Change-Id: I4a068afd842b38eca43610601091ded256854dd3 --- bundles/pom.xml | 2 +- features/org.eclipse.launchbar.remote/feature.xml | 2 +- features/org.eclipse.launchbar/feature.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- repo/pom.xml | 2 +- tests/org.eclipse.launchbar.core.tests/pom.xml | 2 +- tests/org.eclipse.launchbar.ui.tests/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bundles/pom.xml b/bundles/pom.xml index d01947db9bf..76d22172688 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.4.0-SNAPSHOT + 2.4.1-SNAPSHOT bundles-parent diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/features/org.eclipse.launchbar.remote/feature.xml index bd1141456db..4f57caf2c12 100644 --- a/features/org.eclipse.launchbar.remote/feature.xml +++ b/features/org.eclipse.launchbar.remote/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.eclipse.launchbar/feature.xml b/features/org.eclipse.launchbar/feature.xml index c5e82f2e9f5..ac37d374229 100644 --- a/features/org.eclipse.launchbar/feature.xml +++ b/features/org.eclipse.launchbar/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/pom.xml b/features/pom.xml index abb3bd8ae7e..54f9e74722a 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.4.0-SNAPSHOT + 2.4.1-SNAPSHOT features-parent diff --git a/pom.xml b/pom.xml index cdccf5f32a2..bd06b7c2a42 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.launchbar parent - 2.4.0-SNAPSHOT + 2.4.1-SNAPSHOT pom diff --git a/repo/pom.xml b/repo/pom.xml index ad04fdcb7a5..ef153f4f1ed 100644 --- a/repo/pom.xml +++ b/repo/pom.xml @@ -5,7 +5,7 @@ org.eclipse.launchbar parent - 2.4.0-SNAPSHOT + 2.4.1-SNAPSHOT ../pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/tests/org.eclipse.launchbar.core.tests/pom.xml index 3f658c3db26..80ada5c70ca 100644 --- a/tests/org.eclipse.launchbar.core.tests/pom.xml +++ b/tests/org.eclipse.launchbar.core.tests/pom.xml @@ -7,7 +7,7 @@ org.eclipse.launchbar parent - 2.4.0-SNAPSHOT + 2.4.1-SNAPSHOT ../../pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/tests/org.eclipse.launchbar.ui.tests/pom.xml index ad3efb4ef17..f0a1512c530 100644 --- a/tests/org.eclipse.launchbar.ui.tests/pom.xml +++ b/tests/org.eclipse.launchbar.ui.tests/pom.xml @@ -6,7 +6,7 @@ org.eclipse.launchbar - 2.4.0-SNAPSHOT + 2.4.1-SNAPSHOT ../../pom.xml parent From b7792368c32c957fd6c4d5a00f196ea5e5e3f6b3 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 17 Dec 2019 15:15:14 -0500 Subject: [PATCH 197/198] Add legal docs as required by Eclipse Foundation Project Handbook See https://www.eclipse.org/projects/handbook/#legaldoc-license and https://www.eclipse.org/projects/tools/documentation.php?id=tools.cdt Change-Id: Ia0e7519f8ae79d0cdde678c1cc7c588beda4e24b --- CONTRIBUTING.md | 45 ++++++++ LICENSE | 277 ++++++++++++++++++++++++++++++++++++++++++++++++ NOTICE | 180 +++++++++++++++++++++++++++++++ 3 files changed, 502 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 NOTICE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..fd5e5130340 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,45 @@ +# Contributing to the Launchbar + +Thanks for your interest in this project, part of the [Eclipse C/C++ Development Tools project](https://projects.eclipse.org/projects/tools.cdt) + +The source code can be found in the following repository: https://git.eclipse.org/c/cdt/org.eclipse.launchbar.git/ + +## Project description + +The Launchbar is a Tool Control that sits in the TOP trim bar that controls build and launch. + +## Build Instructions + +The project is a standard Maven+Tycho project and can be built with `mvn verify`. +Further information on building, +including CI information, download locations, etc can be found in the +[Wiki](https://github.com/eclipse-cdt/cdt-infra/wiki) + +## Build Instructions + +See build instructions in the [Readme](README.md#building) and details on testing in +the [test readme](src/integration-tests/README.md). Further information on building, +including CI information, download locations, etc can be found in the +[Wiki](https://github.com/eclipse-cdt/cdt-infra/wiki) + +## Eclipse Contributor Agreement + +Before your contribution can be accepted by the project team contributors must +electronically sign the Eclipse Contributor Agreement (ECA). + +* http://www.eclipse.org/legal/ECA.php + +Commits that are provided by non-committers must have a Signed-off-by field in +the footer indicating that the author is aware of the terms by which the +contribution has been provided to the project. The non-committer must +additionally have an Eclipse Foundation account and must have a signed Eclipse +Contributor Agreement (ECA) on file. + +For more information, please see the Eclipse Committer Handbook: +https://www.eclipse.org/projects/handbook/#resources-commit + +## Contact + +Contact the project developers via the project's "dev" list. + +* https://dev.eclipse.org/mailman/listinfo/cdt-dev diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..d3087e4c540 --- /dev/null +++ b/LICENSE @@ -0,0 +1,277 @@ +Eclipse Public License - v 2.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial content + Distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + where such changes and/or additions to the Program originate from + and are Distributed by that particular Contributor. A Contribution + "originates" from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's behalf. + Contributions do not include changes or additions to the Program that + are not Modified Works. + +"Contributor" means any person or entity that Distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which +are necessarily infringed by the use or sale of its Contribution alone +or when combined with the Program. + +"Program" means the Contributions Distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement +or any Secondary License (as applicable), including Contributors. + +"Derivative Works" shall mean any work, whether in Source Code or other +form, that is based on (or derived from) the Program and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. + +"Modified Works" shall mean any work in Source Code or other form that +results from an addition to, deletion from, or modification of the +contents of the Program, including, for purposes of clarity any new file +in Source Code form that contains any contents of the Program. Modified +Works shall not include works that contain only declarations, +interfaces, types, classes, structures, or files of the Program solely +in each case in order to link to, bind by name, or subclass the Program +or Modified Works thereof. + +"Distribute" means the acts of a) distributing or b) making available +in any manner that enables the transfer of a copy. + +"Source Code" means the form of a Program preferred for making +modifications, including but not limited to software source code, +documentation source, and configuration files. + +"Secondary License" means either the GNU General Public License, +Version 2.0, or any later versions of that license, including any +exceptions or additional permissions as identified by the initial +Contributor. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare Derivative Works of, publicly display, + publicly perform, Distribute and sublicense the Contribution of such + Contributor, if any, and such Derivative Works. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in Source Code or other form. This patent license shall + apply to the combination of the Contribution and the Program if, at + the time the Contribution is added by the Contributor, such addition + of the Contribution causes such combination to be covered by the + Licensed Patents. The patent license shall not apply to any other + combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to Distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + + e) Notwithstanding the terms of any Secondary License, no + Contributor makes additional grants to any Recipient (other than + those set forth in this Agreement) as a result of such Recipient's + receipt of the Program under the terms of a Secondary License + (if permitted under the terms of Section 3). + +3. REQUIREMENTS + +3.1 If a Contributor Distributes the Program in any form, then: + + a) the Program must also be made available as Source Code, in + accordance with section 3.2, and the Contributor must accompany + the Program with a statement that the Source Code for the Program + is available under this Agreement, and informs Recipients how to + obtain it in a reasonable manner on or through a medium customarily + used for software exchange; and + + b) the Contributor may Distribute the Program under a license + different than this Agreement, provided that such license: + i) effectively disclaims on behalf of all other Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and + implied warranties or conditions of merchantability and fitness + for a particular purpose; + + ii) effectively excludes on behalf of all other Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) does not attempt to limit or alter the recipients' rights + in the Source Code under section 3.2; and + + iv) requires any subsequent distribution of the Program by any + party to be under a license that satisfies the requirements + of this section 3. + +3.2 When the Program is Distributed as Source Code: + + a) it must be made available under this Agreement, or if the + Program (i) is combined with other material in a separate file or + files made available under a Secondary License, and (ii) the initial + Contributor attached to the Source Code the notice described in + Exhibit A of this Agreement, then the Program may be made available + under the terms of such Secondary Licenses, and + + b) a copy of this Agreement must be included with each copy of + the Program. + +3.3 Contributors may not remove or alter any copyright, patent, +trademark, attribution notices, disclaimers of warranty, or limitations +of liability ("notices") contained within the Program from any copy of +the Program which they Distribute, provided that Contributors may add +their own appropriate notices. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities +with respect to end users, business partners and the like. While this +license is intended to facilitate the commercial use of the Program, +the Contributor who includes the Program in a commercial product +offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes +the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every +other Contributor ("Indemnified Contributor") against any losses, +damages and costs (collectively "Losses") arising from claims, lawsuits +and other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program +in a commercial product offering. The obligations in this section do not +apply to any claims or Losses relating to any actual or alleged +intellectual property infringement. In order to qualify, an Indemnified +Contributor must: a) promptly notify the Commercial Contributor in +writing of such claim, and b) allow the Commercial Contributor to control, +and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may +participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those performance +claims and warranties, and if a court requires any other Contributor to +pay any damages as a result, the Commercial Contributor must pay +those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF +TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE. Each Recipient is solely responsible for determining the +appropriateness of using and distributing the Program and assumes all +risks associated with its exercise of rights under this Agreement, +including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs +or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS +SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other software +or hardware) infringes such Recipient's patent(s), then such Recipient's +rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably practicable. +However, Recipient's obligations under this Agreement and any licenses +granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and +may only be modified in the following manner. The Agreement Steward +reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement +Steward has the right to modify this Agreement. The Eclipse Foundation +is the initial Agreement Steward. The Eclipse Foundation may assign the +responsibility to serve as the Agreement Steward to a suitable separate +entity. Each new version of the Agreement will be given a distinguishing +version number. The Program (including Contributions) may always be +Distributed subject to the version of the Agreement under which it was +received. In addition, after a new version of the Agreement is published, +Contributor may elect to Distribute the Program (including its +Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient +receives no rights or licenses to the intellectual property of any +Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly granted +under this Agreement are reserved. Nothing in this Agreement is intended +to be enforceable by any entity that is not a Contributor or Recipient. +No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice + +"This Source Code may also be made available under the following +Secondary Licenses when the conditions for such availability set forth +in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), +version(s), and exceptions or additional permissions here}." + + Simply including a copy of this Agreement, including this Exhibit A + is not sufficient to license the Source Code under Secondary Licenses. + + If it is not possible or desirable to put the notice in a particular + file, then You may include the notice in a location (such as a LICENSE + file in a relevant directory) where a recipient would be likely to + look for such a notice. + + You may add additional accurate notices of copyright ownership. diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000000..480f8a77b41 --- /dev/null +++ b/NOTICE @@ -0,0 +1,180 @@ +# Notices for Eclipse C/C++ Development Tools + +This content is produced and maintained by the Eclipse C/C++ Development Tools +project. + +* Project home: https://projects.eclipse.org/projects/tools.cdt + +## Trademarks + +Eclipse C/C++ Development Tools, C/C++ Development Tools, Eclipse CDT, and CDT +are trademarks of the Eclipse Foundation. + +## Copyright + +All content is the property of the respective authors or their employers. For +more information regarding authorship of content, please consult the listed +source code repository logs. + +## Declared Project Licenses + +This program and the accompanying materials are made available under the terms +of the Eclipse Public License v. 2.0 which is available at +http://www.eclipse.org/legal/epl-2.0. + +SPDX-License-Identifier: EPL-2.0 + +## Source Code + +The project maintains the following source code repositories: + +* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.cdt +* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.cdt.edc +* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.cdt.master +* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.launchbar +* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.tools.templates +* https://github.com/eclipse-cdt/cdt-gdb-adapter +* https://github.com/eclipse-cdt/cdt-gdb-vscode +* https://github.com/eclipse-cdt/cdt-vscode +* https://github.com/eclipse-cdt/cdt-infra + +## Third-party Content + +This project leverages the following third party content. + +acorn (2.6.4) + +* License: MIT License + +antlr (4.5.1) + +* License: New BSD license +* Project: antlr.org +* Source: + http://search.maven.org/remotecontent?filepath=org/antlr/antlr4-runtime/4.5.1-1/antlr4-runtime-4.5.1-1-sources.jar + +Apache Commons Compress (1.6) + +* License: Apache License 2.0 + +Apache Commons Lang (3.1.0) + +* License: Apache License, 2.0 + +freemarker (2.3.22) + +* License: Apache License, 2.0 +* Project: http://freemarker.org/ +* Source: + http://search.maven.org/remotecontent?filepath=org/freemarker/freemarker/2.3.22/freemarker-2.3.22-sources.jar + +Google Gson (2.2.4) + +* License: Apache License 2.0 + +Google Guava (15.0.0) + +* License: Apache License, 2.0 + +hamcrest - all (1.1) + +* License: New BSD license + +Ispell English Word Lists (a zip file with word lists): (3.1.20) + +* License: iSpell Open Source License (based on Apache 1.1) + +Jabsorb (1.3.1) + +* License: Apache License, 2.0 + JSON License + +jcl104-over-slf4j (1.4.3) + +* License: Apache License, 2.0 + +log4j (1.2.15) + +* License: Apache License, 2.0 + +LPG parser generator (1.1) + +* License: Eclipse Public License + +meson.json SHA 550c704 (n/a) + +* License: Apache-2.0 +* Project: https://github.com/TingPing/language-meson +* Source: + https://github.com/TingPing/language-meson/blob/master/grammars/meson.json + +ninja.tmLanguage SHA 250e7af (n/a) + +* License: LicenseRef-Php_Tmbundle +* Project: https://github.com/textmate/ninja.tmbundle +* Source: + https://github.com/textmate/ninja.tmbundle/blob/master/Syntaxes/Ninja.tmLanguage + +node-bindings (n/a) + +* License: MIT + +node-tar (n/a) + +* License: MIT AND ISC +* Source: https://github.com/npm/node-tar + +react (16.8) + +* License: MIT + +request (n/a) + +* License: MIT AND BSD-3-Clause AND Apache-2.0 AND BSD-2-Clause AND + Public-Domain AND ISC AND X11 AND Unlicense AND BSD-2-Clause-FreeBSD AND + (AFL-2.1 OR BSD-3-Clause) AND (GPL-2.0 OR MIT) AND MPL-2.0 +* Source: https://github.com/request/request + +slf4j log4j12 (1.7.2) + +* License: MIT License + +slf4j-api (1.5.6) + +* License: MIT license, + MIT License with no endorsement clause + +slf4j-log4j12 (1.5.6) + +* License: MIT license, + MIT License with no endorsement clause + +tern (0.16.0) + +* License: MIT License + +TrueZip (6.6) + +* License: Apache License, 2.0 + +vscode-debugadapter (n/a) + +* License: MIT + +vscode-languageclient (5.3.0) + +* License: MIT AND ISC + +winpty Version: 10/2013 *Subset* (n/a) + +* License: MIT License + +winpty Version: 12/2013 (n/a) + +* License: MIT License + +## Cryptography + +Content may contain encryption software. The country in which you are currently +may have restrictions on the import, possession, and use, and/or re-export to +another country, of encryption software. BEFORE using any encryption software, +please check the country's laws, regulations and policies concerning the import, +possession, or use, and re-export of encryption software, to see if this is +permitted. From 533d62ce6c2061b26553efa86f89b015d6087575 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Wed, 18 Dec 2019 13:41:51 -0500 Subject: [PATCH 198/198] Bug 558439: Move launchbar plug-ins into its own folder This also removes the duplicated infra and releng code that is no longer needed in merged repo Change-Id: Ia5c52c7b087ed2612ed505c37ae00c9c6efe1f4f --- .gitattributes | 150 ------ .gitignore | 11 - .mvn/extensions.xml | 8 - CONTRIBUTING.md | 45 -- LICENSE | 277 ----------- NOTICE | 180 ------- bundles/pom.xml | 15 - check_code_cleanliness.sh | 14 - features/pom.xml | 15 - .../.classpath | 0 .../.gitignore | 0 .../org.eclipse.launchbar.core.tests/.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../about.html | 0 .../build.properties | 0 .../fragment.xml | 0 .../org.eclipse.launchbar.core.tests/pom.xml | 0 .../PerTargetLaunchConfigProviderTest.java | 0 .../core/internal/LaunchBarManager2Test.java | 0 .../core/internal/LaunchBarManagerTest.java | 0 .../internal/target/LaunchTargetTest.java | 0 .../core/tests/TargetAttributesTest.java | 0 .../org.eclipse.launchbar.core/.classpath | 0 .../org.eclipse.launchbar.core}/.gitignore | 0 .../org.eclipse.launchbar.core/.options | 0 .../org.eclipse.launchbar.core/.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../org.eclipse.launchbar.core}/about.html | 0 .../build.properties | 0 .../org.eclipse.launchbar.core/plugin.xml | 0 .../schema/launchBarContributions.exsd | 0 .../schema/launchTargetTypes.exsd | 0 .../core/AbstractLaunchConfigProvider.java | 0 .../core/DefaultLaunchConfigProvider.java | 0 .../core/DefaultLaunchDescriptor.java | 0 .../core/DefaultLaunchDescriptorType.java | 0 .../launchbar/core/ILaunchBarListener.java | 0 .../launchbar/core/ILaunchBarManager.java | 0 .../core/ILaunchConfigurationProvider.java | 0 .../launchbar/core/ILaunchDescriptor.java | 0 .../launchbar/core/ILaunchDescriptorType.java | 0 .../launchbar/core/ILaunchObjectProvider.java | 0 .../core/PerTargetLaunchConfigProvider.java | 0 .../core/ProjectLaunchConfigProvider.java | 0 .../core/ProjectLaunchDescriptor.java | 0 .../ProjectPerTargetLaunchConfigProvider.java | 0 .../launchbar/core/internal/Activator.java | 0 .../core/internal/ExecutableExtension.java | 0 .../core/internal/LaunchBarManager.java | 0 .../internal/LaunchConfigProviderInfo.java | 0 .../internal/LaunchDescriptorTypeInfo.java | 0 .../launchbar/core/internal/Messages.java | 0 .../eclipse/launchbar/core/internal/Pair.java | 0 .../internal/ProjectLaunchObjectProvider.java | 0 .../core/internal/messages.properties | 0 .../core/internal/target/LaunchTarget.java | 0 .../internal/target/LaunchTargetManager.java | 0 .../target/LaunchTargetPropertyTester.java | 0 .../target/LaunchTargetWorkingCopy.java | 0 .../target/LocalLaunchTargetProvider.java | 0 .../launchbar/core/target/ILaunchTarget.java | 0 .../core/target/ILaunchTargetListener.java | 0 .../core/target/ILaunchTargetManager.java | 0 .../core/target/ILaunchTargetManager2.java | 0 .../core/target/ILaunchTargetProvider.java | 0 .../core/target/ILaunchTargetWorkingCopy.java | 0 .../launchbar/core/target/TargetStatus.java | 0 .../ILaunchConfigurationTargetedDelegate.java | 0 .../core/target/launch/ITargetedLaunch.java | 0 .../LaunchConfigurationTargetedDelegate.java | 0 .../core/target/launch/TargetedLaunch.java | 0 .../.classpath | 0 .../.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../about.html | 0 .../build.properties | 0 .../plugin.xml | 0 .../core/RemoteLaunchTargetProvider.java | 0 .../remote/core/internal/Activator.java | 0 .../remote/core/internal/Messages.java | 0 .../internal/RemoteTargetAdapterFactory.java | 0 .../remote/core/internal/messages.properties | 0 .../.classpath | 0 .../org.eclipse.launchbar.remote.ui/.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../build.properties | 0 .../ui/RemoteLaunchTargetLabelProvider.java | 0 .../remote/ui/internal/Activator.java | 0 .../org.eclipse.launchbar.remote/.project | 0 .../build.properties | 0 .../feature.properties | 0 .../org.eclipse.launchbar.remote/feature.xml | 0 .../.classpath | 0 .../.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../about.html | 0 .../build.properties | 0 .../icons/bgButton.png | Bin .../icons/build.png | Bin .../icons/build2_24.png | Bin .../icons/build2_hot_24.png | Bin .../icons/build_16.png | Bin .../icons/config_config.png | Bin .../icons/connected.png | Bin .../icons/disconnected.png | Bin .../icons/edit_cold.png | Bin .../icons/icon_debug_32x32.png | Bin .../icons/icon_profile_32x32.png | Bin .../icons/icon_run_32x32.png | Bin .../icons/launch.png | Bin .../icons/launch2_24.png | Bin .../icons/launch2_hot_24.png | Bin .../icons/launch_16.png | Bin .../icons/launch_base_blank.png | Bin .../icons/stop.png | Bin .../icons/stop2_24.png | Bin .../icons/stop2_hot_24.png | Bin .../icons/stop_16.png | Bin .../plugin.properties | 0 .../plugin.xml | 0 .../ui/controls/internal/Activator.java | 0 .../ui/controls/internal/CButton.java | 0 .../ui/controls/internal/CSelector.java | 0 .../ui/controls/internal/ConfigSelector.java | 0 .../ui/controls/internal/EditButton.java | 0 .../ui/controls/internal/FilterControl.java | 0 .../LaunchBarButtonImageDescriptor.java | 0 .../controls/internal/LaunchBarControl.java | 0 .../controls/internal/LaunchBarInjector.java | 0 .../internal/LaunchBarListViewer.java | 0 .../LaunchBarPreferenceInitializer.java | 0 .../internal/LaunchBarPreferencePage.java | 0 .../controls/internal/LaunchBarWidgetIds.java | 0 .../ui/controls/internal/Messages.java | 0 .../ui/controls/internal/ModeSelector.java | 0 .../controls/internal/OpenLaunchSelector.java | 0 .../ui/controls/internal/TargetSelector.java | 0 .../ui/controls/internal/Transition.java | 0 .../ui/controls/internal/messages.properties | 0 .../.classpath | 0 .../org.eclipse.launchbar.ui.tests/.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../build.properties | 0 .../org.eclipse.launchbar.ui.tests/pom.xml | 0 .../launchbar/ui/tests/SWTBotCSelector.java | 0 .../ui/tests/SWTBotConfigSelector.java | 0 .../ui/tests/internal/Activator.java | 0 .../internal/AutomatedIntegrationSuite.java | 0 .../internal/CreateLaunchConfigTests.java | 0 .../org.eclipse.launchbar.ui}/.classpath | 0 .../org.eclipse.launchbar.ui}/.gitignore | 0 .../org.eclipse.launchbar.ui/.options | 0 .../org.eclipse.launchbar.ui/.project | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.jdt.launching.prefs | 0 .../.settings/org.eclipse.jdt.ui.prefs | 0 .../.settings/org.eclipse.pde.api.tools.prefs | 0 .../.settings/org.eclipse.pde.prefs | 0 .../META-INF/MANIFEST.MF | 0 .../org.eclipse.launchbar.ui}/about.html | 0 .../org.eclipse.launchbar.ui/build.properties | 0 .../icons/localTarget.png | Bin .../plugin.properties | 0 .../org.eclipse.launchbar.ui/plugin.xml | 0 .../schema/launchBarUIContributions.exsd | 0 .../schema/launchTargetTypeUI.exsd | 0 .../ui/DefaultDescriptorLabelProvider.java | 0 .../ui/ILaunchBarLaunchConfigDialog.java | 0 .../launchbar/ui/ILaunchBarUIConstants.java | 0 .../launchbar/ui/ILaunchBarUIManager.java | 0 .../launchbar/ui/NewLaunchConfigWizard.java | 0 .../ui/NewLaunchConfigWizardDialog.java | 0 .../launchbar/ui/internal/Activator.java | 0 .../internal/LaunchBarLaunchConfigDialog.java | 0 .../ui/internal/LaunchBarUIManager.java | 0 .../launchbar/ui/internal/Messages.java | 0 .../commands/BuildActiveCommandHandler.java | 0 .../ConfigureActiveLaunchHandler.java | 0 .../commands/LaunchActiveCommandHandler.java | 0 .../commands/StopActiveCommandHandler.java | 0 .../dialogs/NewLaunchConfigEditPage.java | 0 .../dialogs/NewLaunchConfigModePage.java | 0 .../dialogs/NewLaunchConfigTypePage.java | 0 .../dialogs/NewLaunchConfigTypePage2.java | 0 .../launchbar/ui/internal/messages.properties | 0 .../target/LaunchTargetUIManager.java | 0 .../target/LaunchTargetWizardDialog.java | 0 .../target/NewLaunchTargetWizard.java | 0 .../NewLaunchTargetWizardSelectionPage.java | 0 .../ui/target/ILaunchTargetUIManager.java | 0 .../ui/target/LaunchTargetWizard.java | 0 .../target/NewLaunchTargetWizardAction.java | 0 .../org.eclipse.launchbar/.project | 0 .../org.eclipse.launchbar/build.properties | 0 .../org.eclipse.launchbar/feature.properties | 0 .../org.eclipse.launchbar/feature.xml | 0 pom.xml | 393 --------------- repo/.gitignore | 1 - repo/.project | 24 - repo/.settings/org.eclipse.jdt.core.prefs | 464 ------------------ repo/.settings/org.eclipse.pde.prefs | 35 -- repo/category.xml | 12 - repo/pom.xml | 18 - .../.settings/org.eclipse.jdt.launching.prefs | 3 - .../.settings/org.eclipse.jdt.ui.prefs | 133 ----- .../.settings/org.eclipse.pde.api.tools.prefs | 184 ------- 236 files changed, 1982 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore delete mode 100644 .mvn/extensions.xml delete mode 100644 CONTRIBUTING.md delete mode 100644 LICENSE delete mode 100644 NOTICE delete mode 100644 bundles/pom.xml delete mode 100755 check_code_cleanliness.sh delete mode 100644 features/pom.xml rename {tests => launchbar}/org.eclipse.launchbar.core.tests/.classpath (100%) rename {bundles/org.eclipse.launchbar.core => launchbar/org.eclipse.launchbar.core.tests}/.gitignore (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/.project (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs (100%) rename {bundles/org.eclipse.launchbar.core => launchbar/org.eclipse.launchbar.core.tests}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {bundles/org.eclipse.launchbar.core => launchbar/org.eclipse.launchbar.core.tests}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {bundles/org.eclipse.launchbar.core => launchbar/org.eclipse.launchbar.core.tests}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF (100%) rename {bundles/org.eclipse.launchbar.core => launchbar/org.eclipse.launchbar.core.tests}/about.html (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/build.properties (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/fragment.xml (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/pom.xml (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/.classpath (100%) rename {bundles/org.eclipse.launchbar.ui => launchbar/org.eclipse.launchbar.core}/.gitignore (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/.options (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/.project (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs (100%) rename {bundles/org.eclipse.launchbar.remote.core => launchbar/org.eclipse.launchbar.core}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {bundles/org.eclipse.launchbar.remote.core => launchbar/org.eclipse.launchbar.core}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {bundles/org.eclipse.launchbar.remote.core => launchbar/org.eclipse.launchbar.core}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/META-INF/MANIFEST.MF (100%) rename {bundles/org.eclipse.launchbar.remote.core => launchbar/org.eclipse.launchbar.core}/about.html (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/build.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/plugin.xml (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/schema/launchBarContributions.exsd (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/.classpath (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/.project (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs (100%) rename {bundles/org.eclipse.launchbar.remote.ui => launchbar/org.eclipse.launchbar.remote.core}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {bundles/org.eclipse.launchbar.remote.ui => launchbar/org.eclipse.launchbar.remote.core}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {bundles/org.eclipse.launchbar.remote.ui => launchbar/org.eclipse.launchbar.remote.core}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF (100%) rename {bundles/org.eclipse.launchbar.ui.controls => launchbar/org.eclipse.launchbar.remote.core}/about.html (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/build.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/plugin.xml (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/.classpath (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/.project (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs (100%) rename {bundles/org.eclipse.launchbar.ui.controls => launchbar/org.eclipse.launchbar.remote.ui}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {bundles/org.eclipse.launchbar.ui.controls => launchbar/org.eclipse.launchbar.remote.ui}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {bundles/org.eclipse.launchbar.ui.controls => launchbar/org.eclipse.launchbar.remote.ui}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/build.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java (100%) rename {features => launchbar}/org.eclipse.launchbar.remote/.project (100%) rename {features => launchbar}/org.eclipse.launchbar.remote/build.properties (100%) rename {features => launchbar}/org.eclipse.launchbar.remote/feature.properties (100%) rename {features => launchbar}/org.eclipse.launchbar.remote/feature.xml (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/.classpath (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/.project (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs (100%) rename {bundles/org.eclipse.launchbar.ui => launchbar/org.eclipse.launchbar.ui.controls}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {bundles/org.eclipse.launchbar.ui => launchbar/org.eclipse.launchbar.ui.controls}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {bundles/org.eclipse.launchbar.ui => launchbar/org.eclipse.launchbar.ui.controls}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF (100%) rename {bundles/org.eclipse.launchbar.ui => launchbar/org.eclipse.launchbar.ui.controls}/about.html (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/build.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/bgButton.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/build.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/build2_24.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/build_16.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/config_config.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/connected.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/disconnected.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/edit_cold.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/launch.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/launch2_24.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/launch_16.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/stop.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/stop2_24.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/icons/stop_16.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/plugin.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/plugin.xml (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties (100%) rename {bundles/org.eclipse.launchbar.ui => launchbar/org.eclipse.launchbar.ui.tests}/.classpath (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/.project (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs (100%) rename {repo => launchbar/org.eclipse.launchbar.ui.tests}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {repo => launchbar/org.eclipse.launchbar.ui.tests}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {repo => launchbar/org.eclipse.launchbar.ui.tests}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/build.properties (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/pom.xml (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java (100%) rename {tests => launchbar}/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java (100%) rename {tests/org.eclipse.launchbar.ui.tests => launchbar/org.eclipse.launchbar.ui}/.classpath (100%) rename {tests/org.eclipse.launchbar.core.tests => launchbar/org.eclipse.launchbar.ui}/.gitignore (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/.options (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/.project (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs (100%) rename {tests/org.eclipse.launchbar.core.tests => launchbar/org.eclipse.launchbar.ui}/.settings/org.eclipse.jdt.launching.prefs (100%) rename {tests/org.eclipse.launchbar.core.tests => launchbar/org.eclipse.launchbar.ui}/.settings/org.eclipse.jdt.ui.prefs (100%) rename {tests/org.eclipse.launchbar.core.tests => launchbar/org.eclipse.launchbar.ui}/.settings/org.eclipse.pde.api.tools.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF (100%) rename {tests/org.eclipse.launchbar.core.tests => launchbar/org.eclipse.launchbar.ui}/about.html (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/build.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/icons/localTarget.png (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/plugin.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/plugin.xml (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java (100%) rename {bundles => launchbar}/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java (100%) rename {features => launchbar}/org.eclipse.launchbar/.project (100%) rename {features => launchbar}/org.eclipse.launchbar/build.properties (100%) rename {features => launchbar}/org.eclipse.launchbar/feature.properties (100%) rename {features => launchbar}/org.eclipse.launchbar/feature.xml (100%) delete mode 100644 pom.xml delete mode 100644 repo/.gitignore delete mode 100644 repo/.project delete mode 100644 repo/.settings/org.eclipse.jdt.core.prefs delete mode 100644 repo/.settings/org.eclipse.pde.prefs delete mode 100644 repo/category.xml delete mode 100644 repo/pom.xml delete mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs delete mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index ad8bb8f989a..00000000000 --- a/.gitattributes +++ /dev/null @@ -1,150 +0,0 @@ -* text=auto - -# Generic files -AUTHORS text -ChangeLog text -COPYING text -NEWS text -README text -*.txt text -*.md text -*.zip binary - -# C-like Sources -*.asm text -*.c text -*.cc text -*.cpp text -*.h text -*.s text -*.S text - -# C-like configuration/scripts -*.ac text -*.am text -*.bat text -*.build text -*.incl text -makefile text -Makefile text -*.mk text -*.sh text - -# Qt -*.pro text -*.qml text -*.qrc text - -# Visual Studio -*.dsp text eol=crlf -*.dsw text eol=crlf -*.filters text eol=crlf -*.sln text eol=crlf -*.vcxproj text eol=crlf - -# C output files -# (These should not normally be checked in, exceptions for pre-compiled libraries and tests) -*.o binary -*.d text -*.dll binary diff=dll -*.a binary -*.exe binary -*.out binary -*.app binary -*.jnilib binary diff=hex -*.so binary - -# Web/Javascript/Node -*.css text -*.htm text -*.html text -*.js text -*.json text -.npmignore text -package-list text -*.xml text -*.xsd text -*.xsl text -yarn.lock text -*.lock text - -# Images -*.gif binary -*.icns binary -*.ico binary -*.jpg binary -*.jpeg binary -*.png binary -*.PNG binary -*.xpm binary - -# Java/Eclipse -# remove trailing whitespace -*.java text -# remove trailing whitespace -*.properties text -.api_filters text -.classpath text -*.exsd text -*.g text -*.inf text -*.ini text -*.launch text -*.mappings text -# remove trailing whitespace -*.MF text -.options text -*.options text -*.prefs text -*.product text -.project text -*.setup text -*.target text - -# Java output files -# (These should not normally be checked in, exceptions for pre-compiled libraries and tests) -*.class binary -*.jar binary - -# Files used in tests -*.awts text -be32 binary -be32lib binary -be64 binary -be64lib binary -exe binary -exebig_g binary -exe_g binary -*.expected text -*.F90 text -*.init text -launchConfigTestGdbinit text -le32 binary -le32lib binary -le64 binary -le64lib binary -*.main text -output-1 text -*.pda text -*.rts text -test_commands text - -# Other special files -cdtOptions text -.contentsettings text -*.csv text -*.dia binary -*.dictionary text -.eclipseproduct text -.euml2 text -.gitattributes text -.gitignore text -*.patch text -*.src text -*.tmLanguage text -*.top text -*.ucd text -.umlproject text -*.upc text -# remove trailing whitespace -*.py text diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a2267a1d9bf..00000000000 --- a/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/*/*/bin -/*/*/index -/*/*/target -/workspace/ -.DS_Store -.nfs* -.polyglot.build.properties -check_code_cleanliness_workspace/ -.META-INF_MANIFEST.MF -.polyglot..META-INF_MANIFEST.MF -*.takari_issue_192 diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml deleted file mode 100644 index c81e8ae5004..00000000000 --- a/.mvn/extensions.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - org.eclipse.tycho.extras - tycho-pomless - 1.3.0 - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index fd5e5130340..00000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,45 +0,0 @@ -# Contributing to the Launchbar - -Thanks for your interest in this project, part of the [Eclipse C/C++ Development Tools project](https://projects.eclipse.org/projects/tools.cdt) - -The source code can be found in the following repository: https://git.eclipse.org/c/cdt/org.eclipse.launchbar.git/ - -## Project description - -The Launchbar is a Tool Control that sits in the TOP trim bar that controls build and launch. - -## Build Instructions - -The project is a standard Maven+Tycho project and can be built with `mvn verify`. -Further information on building, -including CI information, download locations, etc can be found in the -[Wiki](https://github.com/eclipse-cdt/cdt-infra/wiki) - -## Build Instructions - -See build instructions in the [Readme](README.md#building) and details on testing in -the [test readme](src/integration-tests/README.md). Further information on building, -including CI information, download locations, etc can be found in the -[Wiki](https://github.com/eclipse-cdt/cdt-infra/wiki) - -## Eclipse Contributor Agreement - -Before your contribution can be accepted by the project team contributors must -electronically sign the Eclipse Contributor Agreement (ECA). - -* http://www.eclipse.org/legal/ECA.php - -Commits that are provided by non-committers must have a Signed-off-by field in -the footer indicating that the author is aware of the terms by which the -contribution has been provided to the project. The non-committer must -additionally have an Eclipse Foundation account and must have a signed Eclipse -Contributor Agreement (ECA) on file. - -For more information, please see the Eclipse Committer Handbook: -https://www.eclipse.org/projects/handbook/#resources-commit - -## Contact - -Contact the project developers via the project's "dev" list. - -* https://dev.eclipse.org/mailman/listinfo/cdt-dev diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d3087e4c540..00000000000 --- a/LICENSE +++ /dev/null @@ -1,277 +0,0 @@ -Eclipse Public License - v 2.0 - - THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE - PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION - OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - - a) in the case of the initial Contributor, the initial content - Distributed under this Agreement, and - - b) in the case of each subsequent Contributor: - i) changes to the Program, and - ii) additions to the Program; - where such changes and/or additions to the Program originate from - and are Distributed by that particular Contributor. A Contribution - "originates" from a Contributor if it was added to the Program by - such Contributor itself or anyone acting on such Contributor's behalf. - Contributions do not include changes or additions to the Program that - are not Modified Works. - -"Contributor" means any person or entity that Distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which -are necessarily infringed by the use or sale of its Contribution alone -or when combined with the Program. - -"Program" means the Contributions Distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this Agreement -or any Secondary License (as applicable), including Contributors. - -"Derivative Works" shall mean any work, whether in Source Code or other -form, that is based on (or derived from) the Program and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. - -"Modified Works" shall mean any work in Source Code or other form that -results from an addition to, deletion from, or modification of the -contents of the Program, including, for purposes of clarity any new file -in Source Code form that contains any contents of the Program. Modified -Works shall not include works that contain only declarations, -interfaces, types, classes, structures, or files of the Program solely -in each case in order to link to, bind by name, or subclass the Program -or Modified Works thereof. - -"Distribute" means the acts of a) distributing or b) making available -in any manner that enables the transfer of a copy. - -"Source Code" means the form of a Program preferred for making -modifications, including but not limited to software source code, -documentation source, and configuration files. - -"Secondary License" means either the GNU General Public License, -Version 2.0, or any later versions of that license, including any -exceptions or additional permissions as identified by the initial -Contributor. - -2. GRANT OF RIGHTS - - a) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free copyright - license to reproduce, prepare Derivative Works of, publicly display, - publicly perform, Distribute and sublicense the Contribution of such - Contributor, if any, and such Derivative Works. - - b) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free patent - license under Licensed Patents to make, use, sell, offer to sell, - import and otherwise transfer the Contribution of such Contributor, - if any, in Source Code or other form. This patent license shall - apply to the combination of the Contribution and the Program if, at - the time the Contribution is added by the Contributor, such addition - of the Contribution causes such combination to be covered by the - Licensed Patents. The patent license shall not apply to any other - combinations which include the Contribution. No hardware per se is - licensed hereunder. - - c) Recipient understands that although each Contributor grants the - licenses to its Contributions set forth herein, no assurances are - provided by any Contributor that the Program does not infringe the - patent or other intellectual property rights of any other entity. - Each Contributor disclaims any liability to Recipient for claims - brought by any other entity based on infringement of intellectual - property rights or otherwise. As a condition to exercising the - rights and licenses granted hereunder, each Recipient hereby - assumes sole responsibility to secure any other intellectual - property rights needed, if any. For example, if a third party - patent license is required to allow Recipient to Distribute the - Program, it is Recipient's responsibility to acquire that license - before distributing the Program. - - d) Each Contributor represents that to its knowledge it has - sufficient copyright rights in its Contribution, if any, to grant - the copyright license set forth in this Agreement. - - e) Notwithstanding the terms of any Secondary License, no - Contributor makes additional grants to any Recipient (other than - those set forth in this Agreement) as a result of such Recipient's - receipt of the Program under the terms of a Secondary License - (if permitted under the terms of Section 3). - -3. REQUIREMENTS - -3.1 If a Contributor Distributes the Program in any form, then: - - a) the Program must also be made available as Source Code, in - accordance with section 3.2, and the Contributor must accompany - the Program with a statement that the Source Code for the Program - is available under this Agreement, and informs Recipients how to - obtain it in a reasonable manner on or through a medium customarily - used for software exchange; and - - b) the Contributor may Distribute the Program under a license - different than this Agreement, provided that such license: - i) effectively disclaims on behalf of all other Contributors all - warranties and conditions, express and implied, including - warranties or conditions of title and non-infringement, and - implied warranties or conditions of merchantability and fitness - for a particular purpose; - - ii) effectively excludes on behalf of all other Contributors all - liability for damages, including direct, indirect, special, - incidental and consequential damages, such as lost profits; - - iii) does not attempt to limit or alter the recipients' rights - in the Source Code under section 3.2; and - - iv) requires any subsequent distribution of the Program by any - party to be under a license that satisfies the requirements - of this section 3. - -3.2 When the Program is Distributed as Source Code: - - a) it must be made available under this Agreement, or if the - Program (i) is combined with other material in a separate file or - files made available under a Secondary License, and (ii) the initial - Contributor attached to the Source Code the notice described in - Exhibit A of this Agreement, then the Program may be made available - under the terms of such Secondary Licenses, and - - b) a copy of this Agreement must be included with each copy of - the Program. - -3.3 Contributors may not remove or alter any copyright, patent, -trademark, attribution notices, disclaimers of warranty, or limitations -of liability ("notices") contained within the Program from any copy of -the Program which they Distribute, provided that Contributors may add -their own appropriate notices. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities -with respect to end users, business partners and the like. While this -license is intended to facilitate the commercial use of the Program, -the Contributor who includes the Program in a commercial product -offering should do so in a manner which does not create potential -liability for other Contributors. Therefore, if a Contributor includes -the Program in a commercial product offering, such Contributor -("Commercial Contributor") hereby agrees to defend and indemnify every -other Contributor ("Indemnified Contributor") against any losses, -damages and costs (collectively "Losses") arising from claims, lawsuits -and other legal actions brought by a third party against the Indemnified -Contributor to the extent caused by the acts or omissions of such -Commercial Contributor in connection with its distribution of the Program -in a commercial product offering. The obligations in this section do not -apply to any claims or Losses relating to any actual or alleged -intellectual property infringement. In order to qualify, an Indemnified -Contributor must: a) promptly notify the Commercial Contributor in -writing of such claim, and b) allow the Commercial Contributor to control, -and cooperate with the Commercial Contributor in, the defense and any -related settlement negotiations. The Indemnified Contributor may -participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those performance -claims and warranties, and if a court requires any other Contributor to -pay any damages as a result, the Commercial Contributor must pay -those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT -PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" -BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR -IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF -TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR -PURPOSE. Each Recipient is solely responsible for determining the -appropriateness of using and distributing the Program and assumes all -risks associated with its exercise of rights under this Agreement, -including but not limited to the risks and costs of program errors, -compliance with applicable laws, damage to or loss of data, programs -or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT -PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS -SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST -PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE -EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that the -Program itself (excluding combinations of the Program with other software -or hardware) infringes such Recipient's patent(s), then such Recipient's -rights granted under Section 2(b) shall terminate as of the date such -litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign the -responsibility to serve as the Agreement Steward to a suitable separate -entity. Each new version of the Agreement will be given a distinguishing -version number. The Program (including Contributions) may always be -Distributed subject to the version of the Agreement under which it was -received. In addition, after a new version of the Agreement is published, -Contributor may elect to Distribute the Program (including its -Contributions) under the new version. - -Except as expressly stated in Sections 2(a) and 2(b) above, Recipient -receives no rights or licenses to the intellectual property of any -Contributor under this Agreement, whether expressly, by implication, -estoppel or otherwise. All rights in the Program not expressly granted -under this Agreement are reserved. Nothing in this Agreement is intended -to be enforceable by any entity that is not a Contributor or Recipient. -No third-party beneficiary rights are created under this Agreement. - -Exhibit A - Form of Secondary Licenses Notice - -"This Source Code may also be made available under the following -Secondary Licenses when the conditions for such availability set forth -in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), -version(s), and exceptions or additional permissions here}." - - Simply including a copy of this Agreement, including this Exhibit A - is not sufficient to license the Source Code under Secondary Licenses. - - If it is not possible or desirable to put the notice in a particular - file, then You may include the notice in a location (such as a LICENSE - file in a relevant directory) where a recipient would be likely to - look for such a notice. - - You may add additional accurate notices of copyright ownership. diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 480f8a77b41..00000000000 --- a/NOTICE +++ /dev/null @@ -1,180 +0,0 @@ -# Notices for Eclipse C/C++ Development Tools - -This content is produced and maintained by the Eclipse C/C++ Development Tools -project. - -* Project home: https://projects.eclipse.org/projects/tools.cdt - -## Trademarks - -Eclipse C/C++ Development Tools, C/C++ Development Tools, Eclipse CDT, and CDT -are trademarks of the Eclipse Foundation. - -## Copyright - -All content is the property of the respective authors or their employers. For -more information regarding authorship of content, please consult the listed -source code repository logs. - -## Declared Project Licenses - -This program and the accompanying materials are made available under the terms -of the Eclipse Public License v. 2.0 which is available at -http://www.eclipse.org/legal/epl-2.0. - -SPDX-License-Identifier: EPL-2.0 - -## Source Code - -The project maintains the following source code repositories: - -* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.cdt -* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.cdt.edc -* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.cdt.master -* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.launchbar -* https://git.eclipse.org/r/plugins/gitiles/cdt/org.eclipse.tools.templates -* https://github.com/eclipse-cdt/cdt-gdb-adapter -* https://github.com/eclipse-cdt/cdt-gdb-vscode -* https://github.com/eclipse-cdt/cdt-vscode -* https://github.com/eclipse-cdt/cdt-infra - -## Third-party Content - -This project leverages the following third party content. - -acorn (2.6.4) - -* License: MIT License - -antlr (4.5.1) - -* License: New BSD license -* Project: antlr.org -* Source: - http://search.maven.org/remotecontent?filepath=org/antlr/antlr4-runtime/4.5.1-1/antlr4-runtime-4.5.1-1-sources.jar - -Apache Commons Compress (1.6) - -* License: Apache License 2.0 - -Apache Commons Lang (3.1.0) - -* License: Apache License, 2.0 - -freemarker (2.3.22) - -* License: Apache License, 2.0 -* Project: http://freemarker.org/ -* Source: - http://search.maven.org/remotecontent?filepath=org/freemarker/freemarker/2.3.22/freemarker-2.3.22-sources.jar - -Google Gson (2.2.4) - -* License: Apache License 2.0 - -Google Guava (15.0.0) - -* License: Apache License, 2.0 - -hamcrest - all (1.1) - -* License: New BSD license - -Ispell English Word Lists (a zip file with word lists): (3.1.20) - -* License: iSpell Open Source License (based on Apache 1.1) - -Jabsorb (1.3.1) - -* License: Apache License, 2.0 + JSON License - -jcl104-over-slf4j (1.4.3) - -* License: Apache License, 2.0 - -log4j (1.2.15) - -* License: Apache License, 2.0 - -LPG parser generator (1.1) - -* License: Eclipse Public License - -meson.json SHA 550c704 (n/a) - -* License: Apache-2.0 -* Project: https://github.com/TingPing/language-meson -* Source: - https://github.com/TingPing/language-meson/blob/master/grammars/meson.json - -ninja.tmLanguage SHA 250e7af (n/a) - -* License: LicenseRef-Php_Tmbundle -* Project: https://github.com/textmate/ninja.tmbundle -* Source: - https://github.com/textmate/ninja.tmbundle/blob/master/Syntaxes/Ninja.tmLanguage - -node-bindings (n/a) - -* License: MIT - -node-tar (n/a) - -* License: MIT AND ISC -* Source: https://github.com/npm/node-tar - -react (16.8) - -* License: MIT - -request (n/a) - -* License: MIT AND BSD-3-Clause AND Apache-2.0 AND BSD-2-Clause AND - Public-Domain AND ISC AND X11 AND Unlicense AND BSD-2-Clause-FreeBSD AND - (AFL-2.1 OR BSD-3-Clause) AND (GPL-2.0 OR MIT) AND MPL-2.0 -* Source: https://github.com/request/request - -slf4j log4j12 (1.7.2) - -* License: MIT License - -slf4j-api (1.5.6) - -* License: MIT license, + MIT License with no endorsement clause - -slf4j-log4j12 (1.5.6) - -* License: MIT license, + MIT License with no endorsement clause - -tern (0.16.0) - -* License: MIT License - -TrueZip (6.6) - -* License: Apache License, 2.0 - -vscode-debugadapter (n/a) - -* License: MIT - -vscode-languageclient (5.3.0) - -* License: MIT AND ISC - -winpty Version: 10/2013 *Subset* (n/a) - -* License: MIT License - -winpty Version: 12/2013 (n/a) - -* License: MIT License - -## Cryptography - -Content may contain encryption software. The country in which you are currently -may have restrictions on the import, possession, and use, and/or re-export to -another country, of encryption software. BEFORE using any encryption software, -please check the country's laws, regulations and policies concerning the import, -possession, or use, and re-export of encryption software, to see if this is -permitted. diff --git a/bundles/pom.xml b/bundles/pom.xml deleted file mode 100644 index 76d22172688..00000000000 --- a/bundles/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 2.4.1-SNAPSHOT - - - bundles-parent - pom - diff --git a/check_code_cleanliness.sh b/check_code_cleanliness.sh deleted file mode 100755 index f914e19cc13..00000000000 --- a/check_code_cleanliness.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -## -# The script is shared by all the CDT projects. When running -# local edits, you can, for example, do: -# SCRIPT_URL=file:///scratch/eclipse/src/cdt/cdt-infra/scripts/check_code_cleanliness.sh ./check_code_cleanliness.sh -## - -: ${SCRIPT_URL:=https://raw.githubusercontent.com/eclipse-cdt/cdt-infra/master/scripts/check_code_cleanliness.sh} -export COREPROJECT=bundles/org.eclipse.launchbar.core -echo Obtaining check_code_cleanliness.sh from $SCRIPT_URL -curl -sL $SCRIPT_URL | bash diff --git a/features/pom.xml b/features/pom.xml deleted file mode 100644 index 54f9e74722a..00000000000 --- a/features/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 2.4.1-SNAPSHOT - - - features-parent - pom - diff --git a/tests/org.eclipse.launchbar.core.tests/.classpath b/launchbar/org.eclipse.launchbar.core.tests/.classpath similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.classpath rename to launchbar/org.eclipse.launchbar.core.tests/.classpath diff --git a/bundles/org.eclipse.launchbar.core/.gitignore b/launchbar/org.eclipse.launchbar.core.tests/.gitignore similarity index 100% rename from bundles/org.eclipse.launchbar.core/.gitignore rename to launchbar/org.eclipse.launchbar.core.tests/.gitignore diff --git a/tests/org.eclipse.launchbar.core.tests/.project b/launchbar/org.eclipse.launchbar.core.tests/.project similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.project rename to launchbar/org.eclipse.launchbar.core.tests/.project diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.core.prefs diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.prefs diff --git a/tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.core.tests/META-INF/MANIFEST.MF diff --git a/bundles/org.eclipse.launchbar.core/about.html b/launchbar/org.eclipse.launchbar.core.tests/about.html similarity index 100% rename from bundles/org.eclipse.launchbar.core/about.html rename to launchbar/org.eclipse.launchbar.core.tests/about.html diff --git a/tests/org.eclipse.launchbar.core.tests/build.properties b/launchbar/org.eclipse.launchbar.core.tests/build.properties similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/build.properties rename to launchbar/org.eclipse.launchbar.core.tests/build.properties diff --git a/tests/org.eclipse.launchbar.core.tests/fragment.xml b/launchbar/org.eclipse.launchbar.core.tests/fragment.xml similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/fragment.xml rename to launchbar/org.eclipse.launchbar.core.tests/fragment.xml diff --git a/tests/org.eclipse.launchbar.core.tests/pom.xml b/launchbar/org.eclipse.launchbar.core.tests/pom.xml similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/pom.xml rename to launchbar/org.eclipse.launchbar.core.tests/pom.xml diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java b/launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java rename to launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProviderTest.java diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java b/launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java rename to launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManager2Test.java diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java b/launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java rename to launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/LaunchBarManagerTest.java diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java b/launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java rename to launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/internal/target/LaunchTargetTest.java diff --git a/tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java b/launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java rename to launchbar/org.eclipse.launchbar.core.tests/src/org/eclipse/launchbar/core/tests/TargetAttributesTest.java diff --git a/bundles/org.eclipse.launchbar.core/.classpath b/launchbar/org.eclipse.launchbar.core/.classpath similarity index 100% rename from bundles/org.eclipse.launchbar.core/.classpath rename to launchbar/org.eclipse.launchbar.core/.classpath diff --git a/bundles/org.eclipse.launchbar.ui/.gitignore b/launchbar/org.eclipse.launchbar.core/.gitignore similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.gitignore rename to launchbar/org.eclipse.launchbar.core/.gitignore diff --git a/bundles/org.eclipse.launchbar.core/.options b/launchbar/org.eclipse.launchbar.core/.options similarity index 100% rename from bundles/org.eclipse.launchbar.core/.options rename to launchbar/org.eclipse.launchbar.core/.options diff --git a/bundles/org.eclipse.launchbar.core/.project b/launchbar/org.eclipse.launchbar.core/.project similarity index 100% rename from bundles/org.eclipse.launchbar.core/.project rename to launchbar/org.eclipse.launchbar.core/.project diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.core.prefs diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.launching.prefs diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.jdt.ui.prefs diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.pde.api.tools.prefs diff --git a/bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.core/.settings/org.eclipse.pde.prefs diff --git a/bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.core/META-INF/MANIFEST.MF similarity index 100% rename from bundles/org.eclipse.launchbar.core/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.core/META-INF/MANIFEST.MF diff --git a/bundles/org.eclipse.launchbar.remote.core/about.html b/launchbar/org.eclipse.launchbar.core/about.html similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/about.html rename to launchbar/org.eclipse.launchbar.core/about.html diff --git a/bundles/org.eclipse.launchbar.core/build.properties b/launchbar/org.eclipse.launchbar.core/build.properties similarity index 100% rename from bundles/org.eclipse.launchbar.core/build.properties rename to launchbar/org.eclipse.launchbar.core/build.properties diff --git a/bundles/org.eclipse.launchbar.core/plugin.xml b/launchbar/org.eclipse.launchbar.core/plugin.xml similarity index 100% rename from bundles/org.eclipse.launchbar.core/plugin.xml rename to launchbar/org.eclipse.launchbar.core/plugin.xml diff --git a/bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd b/launchbar/org.eclipse.launchbar.core/schema/launchBarContributions.exsd similarity index 100% rename from bundles/org.eclipse.launchbar.core/schema/launchBarContributions.exsd rename to launchbar/org.eclipse.launchbar.core/schema/launchBarContributions.exsd diff --git a/bundles/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd b/launchbar/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd similarity index 100% rename from bundles/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd rename to launchbar/org.eclipse.launchbar.core/schema/launchTargetTypes.exsd diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/AbstractLaunchConfigProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchConfigProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptor.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarListener.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchBarManager.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchConfigurationProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptor.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchDescriptorType.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ILaunchObjectProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/PerTargetLaunchConfigProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchConfigProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectLaunchDescriptor.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/ProjectPerTargetLaunchConfigProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Activator.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ExecutableExtension.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchBarManager.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchConfigProviderInfo.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/LaunchDescriptorTypeInfo.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Messages.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/Pair.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/ProjectLaunchObjectProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/messages.properties diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTarget.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetManager.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetPropertyTester.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LaunchTargetWorkingCopy.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/internal/target/LocalLaunchTargetProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetListener.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetManager2.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetProvider.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTargetWorkingCopy.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/TargetStatus.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ILaunchConfigurationTargetedDelegate.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/ITargetedLaunch.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/LaunchConfigurationTargetedDelegate.java diff --git a/bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java similarity index 100% rename from bundles/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java rename to launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/launch/TargetedLaunch.java diff --git a/bundles/org.eclipse.launchbar.remote.core/.classpath b/launchbar/org.eclipse.launchbar.remote.core/.classpath similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.classpath rename to launchbar/org.eclipse.launchbar.remote.core/.classpath diff --git a/bundles/org.eclipse.launchbar.remote.core/.project b/launchbar/org.eclipse.launchbar.remote.core/.project similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.project rename to launchbar/org.eclipse.launchbar.remote.core/.project diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.core.prefs diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.launching.prefs diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.jdt.ui.prefs diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.api.tools.prefs diff --git a/bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.remote.core/.settings/org.eclipse.pde.prefs diff --git a/bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.remote.core/META-INF/MANIFEST.MF diff --git a/bundles/org.eclipse.launchbar.ui.controls/about.html b/launchbar/org.eclipse.launchbar.remote.core/about.html similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/about.html rename to launchbar/org.eclipse.launchbar.remote.core/about.html diff --git a/bundles/org.eclipse.launchbar.remote.core/build.properties b/launchbar/org.eclipse.launchbar.remote.core/build.properties similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/build.properties rename to launchbar/org.eclipse.launchbar.remote.core/build.properties diff --git a/bundles/org.eclipse.launchbar.remote.core/plugin.xml b/launchbar/org.eclipse.launchbar.remote.core/plugin.xml similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/plugin.xml rename to launchbar/org.eclipse.launchbar.remote.core/plugin.xml diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java b/launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java rename to launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/RemoteLaunchTargetProvider.java diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java b/launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java rename to launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Activator.java diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java b/launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java rename to launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/Messages.java diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java b/launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java rename to launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/RemoteTargetAdapterFactory.java diff --git a/bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties b/launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties similarity index 100% rename from bundles/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties rename to launchbar/org.eclipse.launchbar.remote.core/src/org/eclipse/launchbar/remote/core/internal/messages.properties diff --git a/bundles/org.eclipse.launchbar.remote.ui/.classpath b/launchbar/org.eclipse.launchbar.remote.ui/.classpath similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.classpath rename to launchbar/org.eclipse.launchbar.remote.ui/.classpath diff --git a/bundles/org.eclipse.launchbar.remote.ui/.project b/launchbar/org.eclipse.launchbar.remote.ui/.project similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.project rename to launchbar/org.eclipse.launchbar.remote.ui/.project diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.core.prefs diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.launching.prefs diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.jdt.ui.prefs diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.api.tools.prefs diff --git a/bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.remote.ui/.settings/org.eclipse.pde.prefs diff --git a/bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.remote.ui/META-INF/MANIFEST.MF diff --git a/bundles/org.eclipse.launchbar.remote.ui/build.properties b/launchbar/org.eclipse.launchbar.remote.ui/build.properties similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/build.properties rename to launchbar/org.eclipse.launchbar.remote.ui/build.properties diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java b/launchbar/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java rename to launchbar/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/RemoteLaunchTargetLabelProvider.java diff --git a/bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java b/launchbar/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java similarity index 100% rename from bundles/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java rename to launchbar/org.eclipse.launchbar.remote.ui/src/org/eclipse/launchbar/remote/ui/internal/Activator.java diff --git a/features/org.eclipse.launchbar.remote/.project b/launchbar/org.eclipse.launchbar.remote/.project similarity index 100% rename from features/org.eclipse.launchbar.remote/.project rename to launchbar/org.eclipse.launchbar.remote/.project diff --git a/features/org.eclipse.launchbar.remote/build.properties b/launchbar/org.eclipse.launchbar.remote/build.properties similarity index 100% rename from features/org.eclipse.launchbar.remote/build.properties rename to launchbar/org.eclipse.launchbar.remote/build.properties diff --git a/features/org.eclipse.launchbar.remote/feature.properties b/launchbar/org.eclipse.launchbar.remote/feature.properties similarity index 100% rename from features/org.eclipse.launchbar.remote/feature.properties rename to launchbar/org.eclipse.launchbar.remote/feature.properties diff --git a/features/org.eclipse.launchbar.remote/feature.xml b/launchbar/org.eclipse.launchbar.remote/feature.xml similarity index 100% rename from features/org.eclipse.launchbar.remote/feature.xml rename to launchbar/org.eclipse.launchbar.remote/feature.xml diff --git a/bundles/org.eclipse.launchbar.ui.controls/.classpath b/launchbar/org.eclipse.launchbar.ui.controls/.classpath similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.classpath rename to launchbar/org.eclipse.launchbar.ui.controls/.classpath diff --git a/bundles/org.eclipse.launchbar.ui.controls/.project b/launchbar/org.eclipse.launchbar.ui.controls/.project similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.project rename to launchbar/org.eclipse.launchbar.ui.controls/.project diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.core.prefs diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.launching.prefs diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.jdt.ui.prefs diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.api.tools.prefs diff --git a/bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.ui.controls/.settings/org.eclipse.pde.prefs diff --git a/bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.ui.controls/META-INF/MANIFEST.MF diff --git a/bundles/org.eclipse.launchbar.ui/about.html b/launchbar/org.eclipse.launchbar.ui.controls/about.html similarity index 100% rename from bundles/org.eclipse.launchbar.ui/about.html rename to launchbar/org.eclipse.launchbar.ui.controls/about.html diff --git a/bundles/org.eclipse.launchbar.ui.controls/build.properties b/launchbar/org.eclipse.launchbar.ui.controls/build.properties similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/build.properties rename to launchbar/org.eclipse.launchbar.ui.controls/build.properties diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/bgButton.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/bgButton.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/bgButton.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/bgButton.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/build.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/build.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/build.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/build.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/build2_24.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/build2_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/build2_24.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/build2_24.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/build2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/build_16.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/build_16.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/build_16.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/build_16.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/config_config.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/config_config.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/config_config.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/config_config.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/connected.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/connected.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/connected.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/connected.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/disconnected.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/disconnected.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/disconnected.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/disconnected.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/edit_cold.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/edit_cold.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/edit_cold.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/edit_cold.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/icon_debug_32x32.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/icon_profile_32x32.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/icon_run_32x32.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/launch.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/launch.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/launch.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/launch.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/launch2_24.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/launch2_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/launch2_24.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/launch2_24.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/launch2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/launch_16.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/launch_16.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/launch_16.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/launch_16.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/launch_base_blank.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/stop.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/stop.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/stop.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/stop.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/stop2_24.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/stop2_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/stop2_24.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/stop2_24.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/stop2_hot_24.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/icons/stop_16.png b/launchbar/org.eclipse.launchbar.ui.controls/icons/stop_16.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/icons/stop_16.png rename to launchbar/org.eclipse.launchbar.ui.controls/icons/stop_16.png diff --git a/bundles/org.eclipse.launchbar.ui.controls/plugin.properties b/launchbar/org.eclipse.launchbar.ui.controls/plugin.properties similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/plugin.properties rename to launchbar/org.eclipse.launchbar.ui.controls/plugin.properties diff --git a/bundles/org.eclipse.launchbar.ui.controls/plugin.xml b/launchbar/org.eclipse.launchbar.ui.controls/plugin.xml similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/plugin.xml rename to launchbar/org.eclipse.launchbar.ui.controls/plugin.xml diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Activator.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CButton.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/CSelector.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ConfigSelector.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/EditButton.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/FilterControl.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarButtonImageDescriptor.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarInjector.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarListViewer.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferenceInitializer.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarPreferencePage.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarWidgetIds.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Messages.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/ModeSelector.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/OpenLaunchSelector.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/TargetSelector.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/Transition.java diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties b/launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties similarity index 100% rename from bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties rename to launchbar/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/messages.properties diff --git a/bundles/org.eclipse.launchbar.ui/.classpath b/launchbar/org.eclipse.launchbar.ui.tests/.classpath similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.classpath rename to launchbar/org.eclipse.launchbar.ui.tests/.classpath diff --git a/tests/org.eclipse.launchbar.ui.tests/.project b/launchbar/org.eclipse.launchbar.ui.tests/.project similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/.project rename to launchbar/org.eclipse.launchbar.ui.tests/.project diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.core.prefs diff --git a/repo/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from repo/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs diff --git a/repo/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from repo/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs diff --git a/repo/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from repo/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.prefs diff --git a/tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.ui.tests/META-INF/MANIFEST.MF diff --git a/tests/org.eclipse.launchbar.ui.tests/build.properties b/launchbar/org.eclipse.launchbar.ui.tests/build.properties similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/build.properties rename to launchbar/org.eclipse.launchbar.ui.tests/build.properties diff --git a/tests/org.eclipse.launchbar.ui.tests/pom.xml b/launchbar/org.eclipse.launchbar.ui.tests/pom.xml similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/pom.xml rename to launchbar/org.eclipse.launchbar.ui.tests/pom.xml diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java b/launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java rename to launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotCSelector.java diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java b/launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java rename to launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/SWTBotConfigSelector.java diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java b/launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java rename to launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/Activator.java diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java b/launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java rename to launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/AutomatedIntegrationSuite.java diff --git a/tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java b/launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java rename to launchbar/org.eclipse.launchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/CreateLaunchConfigTests.java diff --git a/tests/org.eclipse.launchbar.ui.tests/.classpath b/launchbar/org.eclipse.launchbar.ui/.classpath similarity index 100% rename from tests/org.eclipse.launchbar.ui.tests/.classpath rename to launchbar/org.eclipse.launchbar.ui/.classpath diff --git a/tests/org.eclipse.launchbar.core.tests/.gitignore b/launchbar/org.eclipse.launchbar.ui/.gitignore similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.gitignore rename to launchbar/org.eclipse.launchbar.ui/.gitignore diff --git a/bundles/org.eclipse.launchbar.ui/.options b/launchbar/org.eclipse.launchbar.ui/.options similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.options rename to launchbar/org.eclipse.launchbar.ui/.options diff --git a/bundles/org.eclipse.launchbar.ui/.project b/launchbar/org.eclipse.launchbar.ui/.project similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.project rename to launchbar/org.eclipse.launchbar.ui/.project diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs b/launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs rename to launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.core.prefs diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs b/launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.launching.prefs rename to launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.launching.prefs diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs b/launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.jdt.ui.prefs rename to launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.jdt.ui.prefs diff --git a/tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/.settings/org.eclipse.pde.api.tools.prefs rename to launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.api.tools.prefs diff --git a/bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs b/launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs similarity index 100% rename from bundles/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs rename to launchbar/org.eclipse.launchbar.ui/.settings/org.eclipse.pde.prefs diff --git a/bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF b/launchbar/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF similarity index 100% rename from bundles/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF rename to launchbar/org.eclipse.launchbar.ui/META-INF/MANIFEST.MF diff --git a/tests/org.eclipse.launchbar.core.tests/about.html b/launchbar/org.eclipse.launchbar.ui/about.html similarity index 100% rename from tests/org.eclipse.launchbar.core.tests/about.html rename to launchbar/org.eclipse.launchbar.ui/about.html diff --git a/bundles/org.eclipse.launchbar.ui/build.properties b/launchbar/org.eclipse.launchbar.ui/build.properties similarity index 100% rename from bundles/org.eclipse.launchbar.ui/build.properties rename to launchbar/org.eclipse.launchbar.ui/build.properties diff --git a/bundles/org.eclipse.launchbar.ui/icons/localTarget.png b/launchbar/org.eclipse.launchbar.ui/icons/localTarget.png similarity index 100% rename from bundles/org.eclipse.launchbar.ui/icons/localTarget.png rename to launchbar/org.eclipse.launchbar.ui/icons/localTarget.png diff --git a/bundles/org.eclipse.launchbar.ui/plugin.properties b/launchbar/org.eclipse.launchbar.ui/plugin.properties similarity index 100% rename from bundles/org.eclipse.launchbar.ui/plugin.properties rename to launchbar/org.eclipse.launchbar.ui/plugin.properties diff --git a/bundles/org.eclipse.launchbar.ui/plugin.xml b/launchbar/org.eclipse.launchbar.ui/plugin.xml similarity index 100% rename from bundles/org.eclipse.launchbar.ui/plugin.xml rename to launchbar/org.eclipse.launchbar.ui/plugin.xml diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd b/launchbar/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd similarity index 100% rename from bundles/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd rename to launchbar/org.eclipse.launchbar.ui/schema/launchBarUIContributions.exsd diff --git a/bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd b/launchbar/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd similarity index 100% rename from bundles/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd rename to launchbar/org.eclipse.launchbar.ui/schema/launchTargetTypeUI.exsd diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/DefaultDescriptorLabelProvider.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarLaunchConfigDialog.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIConstants.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/ILaunchBarUIManager.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizard.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/NewLaunchConfigWizardDialog.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarUIManager.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Messages.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/BuildActiveCommandHandler.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/ConfigureActiveLaunchHandler.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/LaunchActiveCommandHandler.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/commands/StopActiveCommandHandler.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigEditPage.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigModePage.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/dialogs/NewLaunchConfigTypePage2.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/messages.properties diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetUIManager.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/LaunchTargetWizardDialog.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizard.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/target/NewLaunchTargetWizardSelectionPage.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/ILaunchTargetUIManager.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/LaunchTargetWizard.java diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java b/launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java similarity index 100% rename from bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java rename to launchbar/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/target/NewLaunchTargetWizardAction.java diff --git a/features/org.eclipse.launchbar/.project b/launchbar/org.eclipse.launchbar/.project similarity index 100% rename from features/org.eclipse.launchbar/.project rename to launchbar/org.eclipse.launchbar/.project diff --git a/features/org.eclipse.launchbar/build.properties b/launchbar/org.eclipse.launchbar/build.properties similarity index 100% rename from features/org.eclipse.launchbar/build.properties rename to launchbar/org.eclipse.launchbar/build.properties diff --git a/features/org.eclipse.launchbar/feature.properties b/launchbar/org.eclipse.launchbar/feature.properties similarity index 100% rename from features/org.eclipse.launchbar/feature.properties rename to launchbar/org.eclipse.launchbar/feature.properties diff --git a/features/org.eclipse.launchbar/feature.xml b/launchbar/org.eclipse.launchbar/feature.xml similarity index 100% rename from features/org.eclipse.launchbar/feature.xml rename to launchbar/org.eclipse.launchbar/feature.xml diff --git a/pom.xml b/pom.xml deleted file mode 100644 index bd06b7c2a42..00000000000 --- a/pom.xml +++ /dev/null @@ -1,393 +0,0 @@ - - - 4.0.0 - - - 3.3.1 - - - org.eclipse.launchbar - parent - 2.4.1-SNAPSHOT - pom - - - 1.4.0 - 1.4.0 - jacoco - reuseReports - ${project.basedir}/../../target/jacoco.exec - http://download.eclipse.org/eclipse/updates/4.11 - - - - - Eclipse Public License 2.0 - - - - 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 - http://www.eclipse.org/legal/epl-v10.htm - - - - - - - platform - https://download.eclipse.org/eclipse/updates/4.13/ - p2 - - - license - http://download.eclipse.org/cbi/updates/license/ - p2 - - - cdt - http://download.eclipse.org/tools/cdt/releases/9.8 - p2 - - - remote - http://download.eclipse.org/tools/ptp/builds/remote/photon/milestones/ - p2 - - - swtbot - http://download.eclipse.org/technology/swtbot/snapshots/ - p2 - - - - - bundles/org.eclipse.launchbar.core - bundles/org.eclipse.launchbar.ui - bundles/org.eclipse.launchbar.ui.controls - features/org.eclipse.launchbar - tests/org.eclipse.launchbar.core.tests - tests/org.eclipse.launchbar.ui.tests - - bundles/org.eclipse.launchbar.remote.core - bundles/org.eclipse.launchbar.remote.ui - features/org.eclipse.launchbar.remote - - repo - - - - - cbi - https://repo.eclipse.org/content/repositories/cbi-releases/ - - - tycho-snapshots - https://repo.eclipse.org/content/repositories/tycho-snapshots/ - - - - - cdtRepo - - - cdt.repo - ${cdt-site} - p2 - - - - - macosx - - - mac - - - - -XstartOnFirstThread - - - - other-os - - - !mac - - - - - - - - production - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - false - - - - org.eclipse.tycho.extras - tycho-pack200a-plugin - ${tycho-version} - - - pack200-normalize - - normalize - - verify - - - - - org.eclipse.cbi.maven.plugins - eclipse-jarsigner-plugin - 1.1.5 - - - sign - verify - - sign - - - - - - org.eclipse.tycho.extras - tycho-pack200b-plugin - ${tycho-version} - - - pack200-pack - - pack - - verify - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - p2-metadata - - p2-metadata - - verify - - - - false - - - - - - - - - - org.eclipse.tycho - tycho-maven-plugin - ${tycho-version} - true - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - p2 - consider - - - linux - gtk - x86_64 - - - win32 - win32 - x86_64 - - - macosx - cocoa - x86_64 - - - - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - UTF-8 - - - - attach-source - - plugin-source - - - - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - ${tycho-extras-version} - - - source-feature - package - - source-feature - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - - - - - - - - - org.eclipse.tycho - tycho-compiler-plugin - ${tycho-version} - - UTF-8 - - - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - - plugin-source - - plugin-source - - - - - - org.apache.maven.plugins - maven-resources-plugin - 3.1.0 - - ISO-8859-1 - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.8 - - - com.github.spotbugs - spotbugs-maven-plugin - 3.1.10 - - true - false - - - - - check - - - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.11.0 - - utf-8 - 100 - 1.6 - xml - false - - - - - cpd-check - - - - - - org.eclipse.tycho.extras - tycho-eclipserun-plugin - ${tycho-extras-version} - - -application org.eclipse.ant.core.antRunner -buildfile - customBuildCallbacks.xml build.index - - - org.apache.ant - eclipse-plugin - - - org.eclipse.help.base - eclipse-plugin - - - org.eclipse.ant.core - eclipse-plugin - - - - - - platform - p2 - ${help-docs-eclipserun-repo} - - - - - - - eclipse-run - - compile - - - - - - - diff --git a/repo/.gitignore b/repo/.gitignore deleted file mode 100644 index b83d22266ac..00000000000 --- a/repo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/repo/.project b/repo/.project deleted file mode 100644 index a73ac2695be..00000000000 --- a/repo/.project +++ /dev/null @@ -1,24 +0,0 @@ - - - org.eclipse.launchbar-repo - - - - - - - - - - parent-pom.xml - 1 - PARENT-1-PROJECT_LOC/pom.xml - - - - - copy_PARENT - $%7BPARENT-1-PROJECT_LOC%7D - - - diff --git a/repo/.settings/org.eclipse.jdt.core.prefs b/repo/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2b6ecff8a01..00000000000 --- a/repo/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,464 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullable.secondary= -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.APILeak=warning -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning -org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled -org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.release=disabled -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 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -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 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 -org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true -org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true -org.eclipse.jdt.core.formatter.comment.format_block_comments=false -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -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 -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/repo/.settings/org.eclipse.pde.prefs b/repo/.settings/org.eclipse.pde.prefs deleted file mode 100644 index d2dc703ba9e..00000000000 --- a/repo/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,35 +0,0 @@ -compilers.f.unresolved-features=1 -compilers.f.unresolved-plugins=1 -compilers.incompatible-environment=1 -compilers.p.build=1 -compilers.p.build.bin.includes=1 -compilers.p.build.encodings=2 -compilers.p.build.java.compiler=2 -compilers.p.build.java.compliance=1 -compilers.p.build.missing.output=2 -compilers.p.build.output.library=1 -compilers.p.build.source.library=1 -compilers.p.build.src.includes=1 -compilers.p.deprecated=1 -compilers.p.discouraged-class=1 -compilers.p.internal=1 -compilers.p.missing-packages=2 -compilers.p.missing-version-export-package=2 -compilers.p.missing-version-import-package=2 -compilers.p.missing-version-require-bundle=2 -compilers.p.no-required-att=0 -compilers.p.no.automatic.module=1 -compilers.p.not-externalized-att=1 -compilers.p.service.component.without.lazyactivation=1 -compilers.p.unknown-attribute=1 -compilers.p.unknown-class=1 -compilers.p.unknown-element=1 -compilers.p.unknown-identifier=1 -compilers.p.unknown-resource=1 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.s.create-docs=false -compilers.s.doc-folder=doc -compilers.s.open-tags=1 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/repo/category.xml b/repo/category.xml deleted file mode 100644 index 7e3314d878e..00000000000 --- a/repo/category.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/repo/pom.xml b/repo/pom.xml deleted file mode 100644 index ef153f4f1ed..00000000000 --- a/repo/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - org.eclipse.launchbar - parent - 2.4.1-SNAPSHOT - ../pom.xml - - - repo - eclipse-repository - - - org.eclipse.launchbar.repo - - diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs deleted file mode 100644 index f8a131b56e0..00000000000 --- a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.launching.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning -org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index e44576346c4..00000000000 --- a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,133 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=false -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_modifiers=false -cleanup.remove_redundant_semicolons=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=false -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=false -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_CDT -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_CDT -formatter_settings_version=14 -internal.default.compliance=user -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=1000 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=1000 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=true -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -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=true -sp_cleanup.remove_redundant_type_arguments=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=true -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index ec9fbf321d0..00000000000 --- a/tests/org.eclipse.launchbar.ui.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,184 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error -ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -CLASS_ELEMENT_TYPE_ADDED_FIELD=Error -CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error -CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error -CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error -ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error -ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error -ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error -INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error -INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Error -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error -MISSING_EE_DESCRIPTIONS=Warning -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=false -changed_execution_env=Error -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -incompatible_api_component_version_report_major_without_breaking_change=Warning -incompatible_api_component_version_report_minor_without_api_change=Warning -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Error -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning