}
return mediaKeys;
}
public static IContainer retrieveDesignContainerFromSelection(IStructuredSelection selection) {
IContainer container = null;
if (selection.getFirstElement() instanceof IContainer) {
container = (IContainer) selection.getFirstElement();
} else if (selection.getFirstElement() instanceof IFile) {
container = ((IFile)selection.getFirstElement()).getParent();
} else if (selection.getFirstElement() instanceof IJavaProject) {
container = ((IJavaProject)selection.getFirstElement()).getProject();
}
if (container != null) {
if (WGADesignStructureHelper.isDesignFolder(container)) {
return container;
}
container = container.getParent();
while (container != null) {
if (WGADesignStructureHelper.isDesignFolder(container)) {
return container;
}
container = container.getParent();
}
}
return null;
}