Search in sources :

Example 1 with Iu

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;
    }
}
Also used : Iu(org.eclipse.epp.internal.mpc.core.model.Iu)

Example 2 with Iu

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);
}
Also used : Ius(org.eclipse.epp.internal.mpc.core.model.Ius) IIus(org.eclipse.epp.mpc.core.model.IIus) Node(org.eclipse.epp.internal.mpc.core.model.Node) INode(org.eclipse.epp.mpc.core.model.INode) Iu(org.eclipse.epp.internal.mpc.core.model.Iu) IIu(org.eclipse.epp.mpc.core.model.IIu)

Aggregations

Iu (org.eclipse.epp.internal.mpc.core.model.Iu)2 Ius (org.eclipse.epp.internal.mpc.core.model.Ius)1 Node (org.eclipse.epp.internal.mpc.core.model.Node)1 IIu (org.eclipse.epp.mpc.core.model.IIu)1 IIus (org.eclipse.epp.mpc.core.model.IIus)1 INode (org.eclipse.epp.mpc.core.model.INode)1