launchProject(project, mode);
} else if (selected instanceof IFile && ((IFile) selected).getName().endsWith(LaunchConstants.EXT_BNDRUN)) {
IFile bndRunFile = (IFile) selected;
launchBndRun(bndRunFile, mode);
} else if (selected instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) selected;
IJavaElement javaElement = (IJavaElement) adaptable.getAdapter(IJavaElement.class);
if (javaElement != null) {
launchJavaElement(javaElement, mode);
} else {
IResource resource = (IResource) adaptable.getAdapter(IResource.class);
if (resource != null && resource != selected)
launchSelectedObject(resource, mode);
}
}
}