mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
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 <jjohnstn@redhat.com>
This commit is contained in:
parent
653bd51fa8
commit
16c7075763
4 changed files with 47 additions and 11 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: LaunchBar Core
|
Bundle-Name: LaunchBar Core
|
||||||
Bundle-SymbolicName: org.eclipse.launchbar.core;singleton:=true
|
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-Activator: org.eclipse.launchbar.core.internal.Activator
|
||||||
Bundle-Vendor: Eclipse CDT
|
Bundle-Vendor: Eclipse CDT
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
|
|
|
@ -26,12 +26,13 @@ import org.eclipse.launchbar.core.internal.Activator;
|
||||||
import org.eclipse.launchbar.core.target.ILaunchTarget;
|
import org.eclipse.launchbar.core.target.ILaunchTarget;
|
||||||
import org.eclipse.launchbar.core.target.ILaunchTargetListener;
|
import org.eclipse.launchbar.core.target.ILaunchTargetListener;
|
||||||
import org.eclipse.launchbar.core.target.ILaunchTargetManager;
|
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.ILaunchTargetProvider;
|
||||||
import org.eclipse.launchbar.core.target.TargetStatus;
|
import org.eclipse.launchbar.core.target.TargetStatus;
|
||||||
import org.osgi.service.prefs.BackingStoreException;
|
import org.osgi.service.prefs.BackingStoreException;
|
||||||
import org.osgi.service.prefs.Preferences;
|
import org.osgi.service.prefs.Preferences;
|
||||||
|
|
||||||
public class LaunchTargetManager implements ILaunchTargetManager {
|
public class LaunchTargetManager implements ILaunchTargetManager, ILaunchTargetManager2 {
|
||||||
|
|
||||||
private Map<String, Map<String, ILaunchTarget>> targets;
|
private Map<String, Map<String, ILaunchTarget>> targets;
|
||||||
private Map<String, IConfigurationElement> typeElements;
|
private Map<String, IConfigurationElement> typeElements;
|
||||||
|
@ -188,7 +189,7 @@ public class LaunchTargetManager implements ILaunchTargetManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ILaunchTarget addLaunchTarget(String typeId, String id) {
|
public ILaunchTarget addLaunchTargetNoNotify(String typeId, String id) {
|
||||||
initTargets();
|
initTargets();
|
||||||
Map<String, ILaunchTarget> type = targets.get(typeId);
|
Map<String, ILaunchTarget> type = targets.get(typeId);
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
|
@ -212,19 +213,25 @@ public class LaunchTargetManager implements ILaunchTargetManager {
|
||||||
ILaunchTarget target = new LaunchTarget(typeId, id, child);
|
ILaunchTarget target = new LaunchTarget(typeId, id, child);
|
||||||
type.put(id, target);
|
type.put(id, target);
|
||||||
prefs.flush();
|
prefs.flush();
|
||||||
|
|
||||||
synchronized (listeners) {
|
|
||||||
for (ILaunchTargetListener listener : listeners) {
|
|
||||||
listener.launchTargetAdded(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
} catch (BackingStoreException e) {
|
} catch (BackingStoreException e) {
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
return null;
|
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
|
@Override
|
||||||
public void removeLaunchTarget(ILaunchTarget target) {
|
public void removeLaunchTarget(ILaunchTarget target) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.launchbar"
|
id="org.eclipse.launchbar"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="2.2.3.qualifier"
|
version="2.3.0.qualifier"
|
||||||
provider-name="%providerName"
|
provider-name="%providerName"
|
||||||
license-feature="org.eclipse.license"
|
license-feature="org.eclipse.license"
|
||||||
license-feature-version="0.0.0">
|
license-feature-version="0.0.0">
|
||||||
|
|
Loading…
Add table
Reference in a new issue