/*******************************************************************************
- * Copyright (c) 2009, 2010, 2011 Ericsson
+ * Copyright (c) 2009, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
IPath path = resource.getLocation();
if (path != null && (trace.getParent() instanceof TmfTraceFolder)) {
- String location = path.toString();
TmfExperimentFolder experimentFolder = trace.getProject().getExperimentsFolder();
// Propagate the removal to traces
for (ITmfProjectModelElement experiment : experimentFolder.getChildren()) {
List<ITmfProjectModelElement> toRemove = new LinkedList<ITmfProjectModelElement>();
for (ITmfProjectModelElement child : experiment.getChildren()) {
- if (child.getResource().getLocation().toString().equals(location)) {
+ if (child.getName().equals(trace.getName())) {
toRemove.add(child);
}
}