}
}
} catch (Exception e) {
DesignerPlugin.log(e);
}
ElementListSelectionDialog dialog =
new ElementListSelectionDialog(getShell(),
new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT));
dialog.setIgnoreCase(false);
dialog.setTitle("Package selection");
dialog.setMessage("Select package for View:");
dialog.setHelpAvailable(false);
dialog.setElements(packages.toArray());
{
IPackageFragment packageFragment = packageRoot.getPackageFragment(packageField.getText());
if (packageFragment != null && packageFragment.exists()) {
dialog.setInitialSelections(new Object[]{packageFragment});
}
}
if (dialog.open() == Window.OK) {
Object element = dialog.getFirstResult();
if (element instanceof IPackageFragment) {
IPackageFragment packageFragment = (IPackageFragment) element;
packageField.setTextWithoutUpdate(packageFragment.getElementName());
}
}