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());
}