Package com.volantis.mcs.protocols.assets

Examples of com.volantis.mcs.protocols.assets.TextAssetReference


        policyMock.expects.getAlternatePolicy(PolicyType.TEXT)
                .returns(alternativeMock).any();

        ImageAssetReference test = createTestInstance(policyReferenceMock);
        TextAssetReference fallback = test.getTextFallback();
        assertNotNull("fallback should exist", fallback);
    }
View Full Code Here


        policyMock.expects.getAlternatePolicy(PolicyType.TEXT)
                .returns(alternativeMock).any();

        ImageAssetReference test = createTestInstance(policyReferenceMock);
        TextAssetReference fallback = test.getTextFallback();
        assertNull("fallback should not exist", fallback);
    }
View Full Code Here

            MarinerPageContext pageContext,
            com.volantis.mcs.papi.XFFormFieldAttributes attributes,
            com.volantis.mcs.protocols.XFFormFieldAttributes pattributes)
            throws ProtocolException {

        TextAssetReference object;

        if (logger.isDebugEnabled()) {
            logger.debug("Doing field");
        }
        // Set the caption pane and entry pane.
View Full Code Here

            // by the protocol.
            com.volantis.mcs.protocols.XFUploadAttributes pattributes
                    = new com.volantis.mcs.protocols.XFUploadAttributes();

            // Initialise the attributes specific to this field.
            TextAssetReference object;
            String value;

            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();
View Full Code Here

        if (value == null) {
            // This code should be removed when we stop defaulting to the caption
            // value.
            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();
            TextAssetReference object
                    = resolver.resolveQuotedTextExpression(
                    attributes.getCaption());
            String caption = getPlainText(object);
            if (caption != null) {
                value = caption;
View Full Code Here

        if (value == null) {
            // This code should be removed when we stop defaulting to the caption
            // value.
            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();
            TextAssetReference object
                    = resolver.resolveQuotedTextExpression(
                    attributes.getCaption());
            String caption = getPlainText(object);
            if (caption != null) {
                value = caption;
View Full Code Here

        PAPIInternals.initialiseFocusEventAttributes(pageContext,
                attributes,
                pattributes);

        String value;
        TextAssetReference shortcut = null;
        TextAssetReference accessKey = null;

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Resolve the shortcut string to a mariner expression
View Full Code Here

        // for MTXT resource
        if (variantType == VariantType.TEXT) {
            PolicyReferenceResolver resolver = pageContext
                    .getPolicyReferenceResolver();
            TextAssetReference textReference = resolver
                    .resolveUnquotedTextExpression(src);

            final String text = textReference.getText(TextEncoding.PLAIN);
            if (text != null) {
                // We have found the text, so let's try and write it out to
                // attributes
                attributes.setTextContainer(text);
            } else {
View Full Code Here

                        .resolvePolicyExpression(((StyleComponentURI)labelContent).getExpression());

                // Create image asset from the policy and get fallback
                DefaultComponentImageAssetReference imageAsset = new DefaultComponentImageAssetReference(
                        policyReference, assetResolver);
                TextAssetReference textAsset = imageAsset.getTextFallback();

                // If e.g policy file is missing and as consequence textAsset == null,
                // throw suitable exception
                if (null == textAsset) {
                    throw new ProtocolException(exceptionLocalizer.format(
                            "missing-policy-failure", policyReference.getName()));
                }

                // Return text in plain encoding, or empty string
                textLabel = textAsset.getText(TextEncoding.PLAIN);
                if (null == textLabel) {
                    textLabel = "";
                }
            } else if (labelContent instanceof StyleString) {
                textLabel = ((StyleString)labelContent).getString();
View Full Code Here

    protected void writeMenuTextToBuffer(OutputBuffer output, MenuItem item) {

        final DOMOutputBuffer domOutput = (DOMOutputBuffer) output;

        // Render the shortcut text
        TextAssetReference shortcut = item.getShortcut();
        final String shortcutText = (shortcut == null ? null :
                shortcut.getText(TextEncoding.PLAIN));
        domOutput.appendEncoded(shortcutText);
        // Then a space
        domOutput.appendEncoded(" ");
        // And finally the text of the menu itself.
        final OutputBuffer text = item.getLabel().getText().getText();
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.assets.TextAssetReference

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.