use of org.eclipse.epp.internal.mpc.core.model.Iu in project epp.mpc by eclipse.
the class IuContentHandler method startElement.
@Override
public void startElement(String uri, String localName, Attributes attributes) {
if (localName.equals("iu")) {
// $NON-NLS-1$
model = new Iu();
// FIXME at some point we sent optional, at another required, so we handle both for now...
Boolean optional = null;
// $NON-NLS-1$
String optionalValue = attributes.getValue(NS_URI, "optional");
if (optionalValue != null) {
optional = Boolean.valueOf(optionalValue);
}
// $NON-NLS-1$
String requiredValue = attributes.getValue(NS_URI, "required");
if (requiredValue != null) {
Boolean required = Boolean.valueOf(requiredValue);
optional = optional == null ? !required : optional && !required;
}
if (optional != null) {
model.setOptional(optional);
}
// $NON-NLS-1$
String selectedValue = attributes.getValue(NS_URI, "selected");
if (selectedValue != null) {
model.setSelected(Boolean.valueOf(selectedValue));
}
capturingContent = true;
}
}
use of org.eclipse.epp.internal.mpc.core.model.Iu in project epp.mpc by eclipse.
the class MarketplaceCatalogTest method setupNodes.
protected void setupNodes() {
Node node = new Node();
node.setName("Not installed");
node.setId("1001");
node.setIus(new Ius());
node.getIus().getIuElements().add(new Iu("org.example.notinstalled.iu"));
discoveryNodes.add(node);
node = new Node();
node.setName("Up to date");
node.setId("1002");
node.setIus(new Ius());
node.getIus().getIuElements().add(new Iu("org.example.installed.iu"));
discoveryNodes.add(node);
installedNodes.add(node);
node = new Node();
node.setName("Update available");
node.setId("1003");
node.setIus(new Ius());
node.getIus().getIuElements().add(new Iu("org.example.updateable.iu"));
discoveryNodes.add(node);
installedNodes.add(node);
updateAvailable.add(node);
}