Package com.volantis.mcs.eclipse.ab.editors.devices

Examples of com.volantis.mcs.eclipse.ab.editors.devices.ListPolicyValueModifier


        if (dram == null) {
            throw new IllegalArgumentException("Cannot be null: " +
                    "dram.");
        }

        ListPolicyValueModifier listPVM = null;

        // Retrieve the policy type element.
        Element policyTypeElement =
                dram.getTypeDefinitionElement(policyName);

        if (policyTypeElement != null) {

            if (!policyTypeElement.getName().
                    equals(DeviceRepositorySchemaConstants.
                    POLICY_DEFINITION_TYPE_ELEMENT_NAME)) {
                throw new IllegalStateException("The policy type " +
                        "element for " + policyName + " is " +
                        "named " + policyTypeElement.getName() +
                        ". Expected " + DeviceRepositorySchemaConstants.
                        POLICY_DEFINITION_TYPE_ELEMENT_NAME);
            }

            SelectionDialog dialog = null;

            Element unorderedSetElement = policyTypeElement.getChild(
                    DeviceRepositorySchemaConstants.
                    POLICY_DEFINITION_UNORDEREDSET_ELEMENT_NAME,
                    policyTypeElement.getNamespace());

            // Retrieve the selection element for the named policy.
            Element selectionElement = unorderedSetElement.getChild(
                    DeviceRepositorySchemaConstants.
                    POLICY_DEFINITION_SELECTION_ELEMENT_NAME,
                    unorderedSetElement.getNamespace());

            if (selectionElement != null) {
                // There are values to select so create the
                // selection dialog with the selection element
                // for the named policy.
                dialog = new PolicyValueSelectionDialog(
                        parent.getShell(),
                        policyName,
                        selectionElement);
            }

            // Create the ListValueBuilder for unordered lists
            // with the selection dialog, if any.
            ListValueBuilder listVB =
                    new ListValueBuilder(parent,
                            false, dialog);

            listPVM = new ListPolicyValueModifier(listVB, policyName, dram);
        } else {
            throw new IllegalStateException("The policy type " +
                    " element for " +
                    policyName + " is null.");
        }
View Full Code Here


        if (dram == null) {
            throw new IllegalArgumentException("Cannot be null: " +
                    "dram.");
        }

        ListPolicyValueModifier listPVM = null;

        // Retrieve the policy type element.
        Element policyTypeElement =
                dram.getTypeDefinitionElement(policyName);

        if (policyTypeElement != null) {

            if (!policyTypeElement.getName().
                    equals(DeviceRepositorySchemaConstants.
                    POLICY_DEFINITION_TYPE_ELEMENT_NAME)) {
                throw new IllegalStateException("The policy type " +
                        "element for " + policyName + " is " +
                        "named " + policyTypeElement.getName() +
                        ". Expected " + DeviceRepositorySchemaConstants.
                        POLICY_DEFINITION_TYPE_ELEMENT_NAME);
            }

            SelectionDialog dialog = null;

            Element orderedSetElement = policyTypeElement.getChild(
                    DeviceRepositorySchemaConstants.
                    POLICY_DEFINITION_ORDEREDSET_ELEMENT_NAME,
                    policyTypeElement.getNamespace());

            // Retrieve the selection element for the named policy.
            Element selectionElement = orderedSetElement.getChild(
                    DeviceRepositorySchemaConstants.
                    POLICY_DEFINITION_SELECTION_ELEMENT_NAME,
                    orderedSetElement.getNamespace());

            if (selectionElement != null) {
                dialog = new PolicyValueSelectionDialog(
                        parent.getShell(),
                        policyName, selectionElement);
            }
            ListValueBuilder listVB =
                    new ListValueBuilder(parent, true, dialog);

            listPVM = new ListPolicyValueModifier(listVB, policyName, dram);
        } else {
            throw new IllegalStateException("The policy type " +
                    "element for " + policyName + " is null.");
        }
        return listPVM;
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.ab.editors.devices.ListPolicyValueModifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.