Package com.volantis.mcs.policies

Examples of com.volantis.mcs.policies.PolicyReference


                        POLICY_FACTORY.createURLContentBuilder();
                urlContent.setURL(urlText.getText());

                String baseUrlString = baseURLText.getText();
                if (baseUrlString != null && baseUrlString.length() > 0) {
                    PolicyReference baseURL =
                            POLICY_FACTORY.createPolicyReference(
                                    baseUrlString, PolicyType.BASE_URL);
                    urlContent.setBaseURLPolicyReference(baseURL);
                }
View Full Code Here


                    setEmbeddedCheckbox(false);
                    setEmbeddedText("");
                    setURLText(content.getURL());
                    setLayoutEnabled(false);
                    setThemeEnabled(false);
                    PolicyReference baseUrl = content.getBaseURLPolicyReference();
                    if (baseUrl != null && baseUrl.getName() != null) {
                        setBaseURL(baseUrl.getName());
                    } else {
                        setBaseURL("");
                    }

                    composite.setProperty(
View Full Code Here

            int size = alternatePolicies.size();

            for (int i = 0; i < size; i++) {
                Proxy itemProxy = alternatePolicies.getItemProxy(i);
                Object modelObject = itemProxy.getModelObject();
                PolicyReference ref = (PolicyReference) modelObject;
                Text text = (Text) typesToTextComponents
                        .get(ref.getExpectedPolicyType());
                text.setText(ref.getName());
            }

            // Register the listeners for the fallback GUI components
            for (int i = 0; i < types.length; i++) {
                final PolicyType type = types[i];
View Full Code Here

        ListProxy alternatePolicies =
                (ListProxy) ((BeanProxy) context.getInteractionModel()).
                        getPropertyProxy(PolicyModel.ALTERNATE_POLICIES);
        int size = alternatePolicies.size();
        for (int i = size - 1; i >= 0; i--) {
            PolicyReference reference = (PolicyReference)
                    alternatePolicies.getItemProxy(i).getModelObject();
            if (reference.getExpectedPolicyType().equals(type)) {
                Operation removeOp = alternatePolicies
                        .prepareRemoveProxyItemOperation(
                                alternatePolicies.getItemProxy(i));
                context.executeOperation(removeOp);
            }
        }

        // Do not add an empty policy value as this is illlegal
        if (policy != null && policy.trim().length() > 0) {
            PolicyReference newReference = PolicyFactory.getDefaultInstance().
                    createPolicyReference(policy, type);
            Operation addOp =
                    alternatePolicies
                            .prepareAddModelItemOperation(newReference);
            context.executeOperation(addOp);
View Full Code Here

        editor.setLayoutData(data);


        editor.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                PolicyReference newValue = editor.getValue();
                propertyChanged(descriptor, newValue);
            }
        });

        // Remember the controls that are used for this property.
View Full Code Here

     * This tests the retrieval of a component identity from the test instance
     */
    public void testGetComponentIdentity() throws Exception {
        AbstractComponentImageAssetReference test =
                (AbstractComponentImageAssetReference)createTestInstance(policyReferenceMock);
        PolicyReference testReference = test.getPolicyReference();
        assertNotNull("The reference should not be null", testReference);
        assertEquals("The references should match", policyReferenceMock, testReference);
    }
View Full Code Here

        fetcherMock.expects.fetchPolicy(policyReferenceMock)
                .returns(policyMock).any();

        AbstractComponentImageAssetReference test =
                (AbstractComponentImageAssetReference)createTestInstance(policyReferenceMock);
        PolicyReference testReference = test.getPolicyReference();
        assertNotNull("The reference should not be null", testReference);
        assertEquals("The references should match", normalReferenceMock, testReference);
    }
View Full Code Here

        } else if (value instanceof StyleURI) {
            // Nothing to do.
            image = value;
        } else if (value instanceof StyleComponentURI) {
            StyleComponentURI componentURI = (StyleComponentURI) value;
            PolicyReference reference = resolver.evaluateExpression(
                    componentURI.getExpression());
            String uri = resolver.resolveImage(reference);
            if (uri != null) {
                image = styleValueFactory.getURI(null, uri);
            }
View Full Code Here

            image = value;
        } else if (value instanceof StyleComponentURI) {
            // The value is a component reference that needs resolving to
            // a URI.
            StyleComponentURI componentURI = (StyleComponentURI) value;
            PolicyReference reference = resolver.evaluateExpression(
                    componentURI.getExpression());
            String uri = resolver.resolveVideo(reference);
            if (uri != null) {
                image = styleValueFactory.getURI(componentURI, uri);
            }
View Full Code Here

            text = value;
        } else if (value instanceof StyleComponentURI) {
            // The value is a component reference that needs resolving to
            // a URI.
            StyleComponentURI componentURI = (StyleComponentURI) value;
            PolicyReference reference = resolver.evaluateExpression(
                    componentURI.getExpression());
            String string = resolver.resolveText(reference, requiredEncodings);
            if (string != null) {
                text = styleValueFactory.getString(value, string);
            }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.policies.PolicyReference

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.