if (!selection.isEmpty())
{
for (Iterator<IPackageImport> i = selection.iterator(); i.hasNext();)
{
IPackageImport packageImport = i.next();
NewResourceSelectionDialog<? extends IPackageModelElement> dialog = ResourcesDialogHelper.createImportDialog(
getSection().getShell(), "Edit Imported Package", getProjectModel(),
packageImport, getBundle().getBundleInfo().getImports());
if (dialog.open() == Window.OK)
{
changed = true;
IPackageImport newImport = ModelElementFactory.getInstance().newModelElement(
IPackageImport.class);
newImport.setPackageName(dialog.getSelectedName());
newImport.setVersions(dialog.getSelectedVersions());
newImport.setOptional(dialog.isOptional());
getBundle().getBundleInfo().removeImport(packageImport);
getBundle().getBundleInfo().addImport(newImport);
}
}