Object obj = ssel.getFirstElement();
if (obj instanceof IJavaElement) {
obj = ((IJavaElement)obj).getResource();
}
if (obj instanceof IResource) {
IContainer container;
if (obj instanceof IContainer) {
container = (IContainer) obj;
} else {
container = ((IResource) obj).getParent();
}
containerText.setText(container.getFullPath().toString());
while (container != null) {
if (container instanceof IProject) {
project = (IProject)container;
}
container = container.getParent();
}
}
}
name.setText(defaultName());
}