ElementTreeSelectionDialog dialog =
new ElementTreeSelectionDialog(getControl().getShell(),
new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_BASICS),
new JavaPackageElementContentProvider());
dialog.setInput(project);
dialog.addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof IPackageFragment) {
return !((IPackageFragment) element).getElementName().equals("");