use of aQute.bnd.build.model.clauses.HeaderClause in project bnd by bndtools.
the class HeaderClauseListConverter method convert.
public List<R> convert(String input) throws IllegalArgumentException {
if (input == null)
return null;
List<R> result = new ArrayList<R>();
Parameters header = new Parameters(input);
for (Entry<String, Attrs> entry : header.entrySet()) {
String key = Processor.removeDuplicateMarker(entry.getKey());
HeaderClause clause = new HeaderClause(key, entry.getValue());
result.add(itemConverter.convert(clause));
}
return result;
}
use of aQute.bnd.build.model.clauses.HeaderClause in project bnd by bndtools.
the class BndEditModel method addBundleBlueprint.
public void addBundleBlueprint(String location) {
List<HeaderClause> bpLocations = getBundleBlueprint();
if (bpLocations == null)
bpLocations = new ArrayList<HeaderClause>();
else
bpLocations = new ArrayList<HeaderClause>(bpLocations);
bpLocations.add(new HeaderClause(location, null));
setBundleBlueprint(bpLocations);
}
use of aQute.bnd.build.model.clauses.HeaderClause in project bndtools by bndtools.
the class PluginsPart method doEdit.
void doEdit() {
HeaderClause header = (HeaderClause) ((IStructuredSelection) viewer.getSelection()).getFirstElement();
if (header != null) {
Attrs copyOfProperties = new Attrs(header.getAttribs());
IConfigurationElement configElem = configElements.get(header.getName());
PluginEditWizard wizard = new PluginEditWizard(configElem, copyOfProperties);
WizardDialog dialog = new WizardDialog(getManagedForm().getForm().getShell(), wizard);
if (dialog.open() == Window.OK && wizard.isChanged()) {
header.getAttribs().clear();
header.getAttribs().putAll(copyOfProperties);
viewer.update(header, null);
markDirty();
}
}
}
use of aQute.bnd.build.model.clauses.HeaderClause in project bndtools by bndtools.
the class PluginsPart method doAdd.
void doAdd() {
PluginSelectionWizard wizard = new PluginSelectionWizard();
WizardDialog dialog = new WizardDialog(getManagedForm().getForm().getShell(), wizard);
if (dialog.open() == Window.OK) {
HeaderClause newPlugin = wizard.getHeader();
data.add(newPlugin);
viewer.add(newPlugin);
markDirty();
}
}
use of aQute.bnd.build.model.clauses.HeaderClause in project bndtools by bndtools.
the class BlueprintXmlFileWizard method updateBundleBlueprintIfNecessary.
private void updateBundleBlueprintIfNecessary(BndEditModel editModel, String blueprintrelativePath) {
boolean alreadyMatched = false;
List<HeaderClause> bundleBlueprint = editModel.getBundleBlueprint();
if (bundleBlueprint != null) {
for (HeaderClause hc : bundleBlueprint) {
String clause = hc.getName();
if (clause.length() == 0) {
clause = OSGI_INF_BLUEPRINT_XML;
} else if (clause.endsWith("/")) {
clause += "*.xml";
}
// Match either absolute or Glob
if ((!clause.contains("*") && clause.equals(blueprintrelativePath)) || (Glob.toPattern(clause).matcher(blueprintrelativePath).matches())) {
alreadyMatched = true;
break;
}
}
}
if (!alreadyMatched) {
if ((Glob.toPattern(OSGI_INF_BLUEPRINT_XML).matcher(blueprintrelativePath).matches()))
editModel.addBundleBlueprint(OSGI_INF_BLUEPRINT_XML);
else
editModel.addBundleBlueprint(blueprintrelativePath);
}
}
Aggregations