use of bndtools.preferences.BndPreferences in project bndtools by bndtools.
the class BndEditor method showHighestPriorityPage.
void showHighestPriorityPage() {
int selectedPrio = Integer.MIN_VALUE;
String selected = null;
BndPreferences prefs = new BndPreferences();
if (prefs.getEditorOpenSourceTab()) {
selected = SOURCE_PAGE;
selectedPrio = 0;
} else {
for (Object pageObj : pages) {
IFormPage page = (IFormPage) pageObj;
int priority = 0;
if (page instanceof IPriority)
priority = ((IPriority) page).getPriority();
if (priority > selectedPrio) {
selected = page.getId();
selectedPrio = priority;
}
}
}
if (selected != null)
setActivePage(selected);
}
use of bndtools.preferences.BndPreferences 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);
}
use of bndtools.preferences.BndPreferences in project bndtools by bndtools.
the class ReposTemplateLoader method addPreferenceConfiguredRepos.
private static void addPreferenceConfiguredRepos(List<Repository> repos, Reporter reporter) {
BndPreferences bndPrefs = null;
try {
bndPrefs = new BndPreferences();
} catch (Exception e) {
// e.printStackTrace();
}
if (bndPrefs != null && bndPrefs.getEnableTemplateRepo()) {
List<String> repoUris = bndPrefs.getTemplateRepoUriList();
try {
FixedIndexedRepo prefsRepo = loadRepo(repoUris);
repos.add(prefsRepo);
} catch (IOException | URISyntaxException ex) {
reporter.exception(ex, "Error loading preference repository: %s", repoUris);
}
}
}
Aggregations