public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof IFolder) {
IFolder folder = (IFolder) element;
IWebflowModel model = Activator.getModel();
IWebflowProject project = model.getProject(folder.getProject());
if (project != null) {
String path = folder.getProjectRelativePath().toString() + '/';
for (IWebflowConfig config : project.getConfigs()) {
if (config.getResource().getProjectRelativePath()
.toString().startsWith(path)) {
return true;
}
}
}
return false;
} else if (element instanceof IFile) {
IFile file = (IFile) element;
IWebflowModel model = Activator.getModel();
IWebflowProject project = model.getProject(file.getProject());
if (project != null) {
for (IWebflowConfig config : project.getConfigs()) {
// The following comparison works for archived config files
// too
if (config.getResource().equals(file)) {
return true;
}