use of bndtools.editor.contents.PackageInfoDialog in project bndtools by bndtools.
the class ExportPatternsListPart method doAddClauses.
@Override
protected void doAddClauses(Collection<? extends ExportedPackage> pkgs, int index, boolean select) {
List<FileVersionTuple> missingPkgInfoDirs;
try {
missingPkgInfoDirs = new ArrayList<FileVersionTuple>(findSourcePackagesWithoutPackageInfo(pkgs));
} catch (Exception e) {
ErrorDialog.openError(getManagedForm().getForm().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error finding source package for exported 1packages.", e));
missingPkgInfoDirs = Collections.emptyList();
}
List<FileVersionTuple> generatePkgInfoDirs = new ArrayList<FileVersionTuple>(missingPkgInfoDirs.size());
BndPreferences prefs = new BndPreferences();
boolean noAskPackageInfo = prefs.getNoAskPackageInfo();
if (noAskPackageInfo || missingPkgInfoDirs.isEmpty()) {
generatePkgInfoDirs.addAll(missingPkgInfoDirs);
} else {
PackageInfoDialog dlg = new PackageInfoDialog(getSection().getShell(), missingPkgInfoDirs);
if (dlg.open() == Window.CANCEL)
return;
prefs.setNoAskPackageInfo(dlg.isDontAsk());
generatePkgInfoDirs.addAll(dlg.getSelectedPackageDirs());
}
try {
generatePackageInfos(generatePkgInfoDirs);
} catch (CoreException e) {
ErrorDialog.openError(getManagedForm().getForm().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error generated packageinfo files.", e));
}
// Actually add the new exports
super.doAddClauses(pkgs, index, select);
}
Aggregations