use of org.bndtools.api.NamedPlugin in project bndtools by bndtools.
the class GeneratedResourcesPreferencePage method createVersionControlGroup.
private Control createVersionControlGroup(Composite composite) {
Collection<NamedPlugin> allPluginsInformation = versionControlIgnoresManager.getAllPluginsInformation();
if (allPluginsInformation == null || allPluginsInformation.isEmpty()) {
Label lbl = new Label(composite, SWT.None);
lbl.setText("No version control system support detected");
return lbl;
}
Group versionControlIgnoresMainGroup = new Group(composite, SWT.NONE);
versionControlIgnoresMainGroup.setText(Messages.BndPreferencePage_versionControlIgnoresGroup_text);
final Button btnVersionControlIgnoresCreate = new Button(versionControlIgnoresMainGroup, SWT.CHECK);
btnVersionControlIgnoresCreate.setText(Messages.BndPreferencePage_versionControlIgnoresCreate_text);
btnVersionControlIgnoresCreate.setSelection(versionControlIgnoresCreate);
Group versionControlIgnoresGroup = new Group(versionControlIgnoresMainGroup, SWT.NONE);
final Set<Button> versionControlIgnoresGroupButtons = new HashSet<Button>();
for (NamedPlugin info : allPluginsInformation) {
final String pluginName = info.getName();
final Button btnVersionControlIgnoresPlugin = new Button(versionControlIgnoresGroup, SWT.CHECK);
versionControlIgnoresGroupButtons.add(btnVersionControlIgnoresPlugin);
if (info.isDeprecated()) {
btnVersionControlIgnoresPlugin.setText(pluginName + Messages.BndPreferencePage_namedPluginDeprecated_text);
} else {
btnVersionControlIgnoresPlugin.setText(pluginName);
}
Boolean checked = versionControlIgnoresPlugins.get(pluginName);
if (checked == null) {
checked = Boolean.FALSE;
versionControlIgnoresPlugins.put(pluginName, checked);
}
btnVersionControlIgnoresPlugin.setSelection(checked.booleanValue());
btnVersionControlIgnoresPlugin.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
versionControlIgnoresPlugins.put(pluginName, btnVersionControlIgnoresPlugin.getSelection());
checkValid();
}
});
}
versionControlIgnoresGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
versionControlIgnoresGroup.setLayout(new GridLayout(Math.max(4, allPluginsInformation.size()), true));
versionControlIgnoresMainGroup.setLayout(new GridLayout(1, true));
btnVersionControlIgnoresCreate.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
versionControlIgnoresCreate = btnVersionControlIgnoresCreate.getSelection();
for (Button button : versionControlIgnoresGroupButtons) {
button.setEnabled(versionControlIgnoresCreate);
}
checkValid();
}
});
return versionControlIgnoresMainGroup;
}
use of org.bndtools.api.NamedPlugin in project bndtools by bndtools.
the class GeneratedResourcesPreferencePage method performOk.
@Override
public boolean performOk() {
BndPreferences prefs = new BndPreferences();
prefs.setEnableSubBundles(enableSubs);
prefs.setNoAskPackageInfo(noAskPackageInfo);
prefs.setUseAliasRequirements(useAliasRequirements);
prefs.setHeadlessBuildCreate(headlessBuildCreate);
Collection<NamedPlugin> pluginsInformation = headlessBuildManager.getAllPluginsInformation();
if (pluginsInformation.size() > 0) {
prefs.setHeadlessBuildPlugins(headlessBuildPlugins);
}
prefs.setVersionControlIgnoresCreate(versionControlIgnoresCreate);
pluginsInformation = versionControlIgnoresManager.getAllPluginsInformation();
if (pluginsInformation.size() > 0) {
prefs.setVersionControlIgnoresPlugins(versionControlIgnoresPlugins);
}
return true;
}
Aggregations