mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 439833 - Allow Launch Configuration Deletion from Launch Bar
Also a slight refactoring of ILaunchConfigurationProvider for to enable this. Change-Id: I3e51e2277ee1a2b8875790d02ab6e5350595c946 Signed-off-by: Jonathan Williams <jonwilliams@qnx.com> Reviewed-on: https://git.eclipse.org/r/30078 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> Tested-by: Hudson CI
This commit is contained in:
parent
cc2fe9086b
commit
b9764a20a4
3 changed files with 30 additions and 12 deletions
|
@ -29,10 +29,10 @@ public interface ILaunchConfigurationProvider {
|
||||||
* is properly constructed by sending in a launch object to the launch manager.
|
* is properly constructed by sending in a launch object to the launch manager.
|
||||||
*
|
*
|
||||||
* @param configuration
|
* @param configuration
|
||||||
* @return
|
* @return boolean - was the launch configuration added by this provider?
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException;
|
boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the launch configuration type used to launch the descriptor on this target type.
|
* Returns the launch configuration type used to launch the descriptor on this target type.
|
||||||
|
@ -58,8 +58,9 @@ public interface ILaunchConfigurationProvider {
|
||||||
* A launch configuration has been removed.
|
* A launch configuration has been removed.
|
||||||
*
|
*
|
||||||
* @param configuration
|
* @param configuration
|
||||||
|
* @return boolean - was the launch configuration removed by this provider?
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
void launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException;
|
boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class DefaultLaunchConfigurationProvider implements ILaunchConfigurationP
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean ownsLaunchConfiguration(ILaunchConfiguration configuration) throws CoreException {
|
public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException {
|
||||||
// We may own it but return false to let it percolate through to the descriptor type.
|
// We may own it but return false to let it percolate through to the descriptor type.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,8 @@ public class DefaultLaunchConfigurationProvider implements ILaunchConfigurationP
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launchConfigurationRemoved(ILaunchConfiguration configation) throws CoreException {
|
public boolean launchConfigurationRemoved(ILaunchConfiguration configation) throws CoreException {
|
||||||
// The descriptor will handle the remove.
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,19 +456,19 @@ public class LaunchBarManager extends PlatformObject implements ILaunchBarManage
|
||||||
@Override
|
@Override
|
||||||
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
|
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
|
||||||
try {
|
try {
|
||||||
boolean owned = false;
|
boolean added = false;
|
||||||
// TODO filter by launch configuration type
|
// TODO filter by launch configuration type
|
||||||
|
|
||||||
for (Map<String, ILaunchConfigurationProvider> targetMap : configProviders.values()) {
|
for (Map<String, ILaunchConfigurationProvider> targetMap : configProviders.values()) {
|
||||||
for (ILaunchConfigurationProvider configProvider : targetMap.values()) {
|
for (ILaunchConfigurationProvider configProvider : targetMap.values()) {
|
||||||
if (configProvider.ownsLaunchConfiguration(configuration)) {
|
if (configProvider.launchConfigurationAdded(configuration)) {
|
||||||
owned = true;
|
added = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!owned) {
|
if (!added) {
|
||||||
launchObjectAdded(configuration);
|
launchObjectAdded(configuration);
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
|
@ -484,8 +484,25 @@ public class LaunchBarManager extends PlatformObject implements ILaunchBarManage
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
|
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
|
||||||
// TODO Auto-generated method stub
|
try {
|
||||||
|
boolean removed = false;
|
||||||
|
// TODO filter by launch configuration type
|
||||||
|
|
||||||
|
for (Map<String, ILaunchConfigurationProvider> targetMap : configProviders.values()) {
|
||||||
|
for (ILaunchConfigurationProvider configProvider : targetMap.values()) {
|
||||||
|
if (configProvider.launchConfigurationRemoved(configuration)) {
|
||||||
|
removed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!removed) {
|
||||||
|
launchObjectRemoved(configuration);
|
||||||
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
Activator.log(e.getStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue