Package com.volantis.mcs.protocols.styles

Examples of com.volantis.mcs.protocols.styles.PropertyHandler


        // Initialise the style value handlers.
        paneTableChecker = new XHTMLFullPaneTableChecker();
        paneTableChecker.setWidthChecker(widthHandler);

        ValueHandler valueHandler = new PositivePixelLengthHandler();
        PropertyHandler propertyHandler = new EdgePropertyHandler(
                PropertyGroups.PADDING_PROPERTIES, valueHandler,
                NoopPropertyUpdater.getDefaultInstance());
        paddingHandler = new DefaultingPropertyHandler(
                propertyHandler, "0");
    }
View Full Code Here


        // add the super classes attributes first
        super.addGridAttributes (element, attributes);

        Styles styles = attributes.getStyles();
        String value;
        PropertyHandler widthHandler;

        widthHandler = getCorrectWidthHandler(element);
        // Render the various attributes into a StringBuffer
        if ((value = widthHandler.getAsString(styles)) != null) {
            element.setAttribute ("width", value);
        }

        addTableAttributes(element, attributes);
    }
View Full Code Here

        // rendering a pane table which will always be optimised then we need
        // to keep the style value as we know that the HTML will be thown away.
        // See 2005110903/2005113024.
        //
        // Default to removing the width: after creating the HTML version.
        PropertyHandler widthRenderer = widthHandler;
        // If we are rendering a pane table..
        if (table) {
            // and if we are always going to optimise this pane table
            String optimize = getOptimizeAttributeValue(attributes.getPane());
            if (OptimizationConstants.OPTIMIZE_ALWAYS.equals(optimize)) {
                // Then do not remove the width: after creating the HTML
                // version.
                // todo: better: maybe we do not need to bother rendering width
                // into the html at all since it will be discarded anyway?
                widthRenderer = tableWidthChecker;
            } else {
                widthRenderer = tableWidthHandler;
            }
        }

        // TODO: should this significance check be done automagically by
        // the handler? (and by extension, all handlers?)
        // TODO: investigate to see if we need render table and non-table
        // widths differently as was done in pre 3.5 versions. This may require
        // refactoring the significance checking out of PropertyHandler into
        // a higher level object so that we can define a different significance
        // for both pane tables and cells.
        // NOTE: significant check must be done before getAsString because the
        // latter is destructive.
        final boolean significant = widthRenderer.isSignificant(styles);
        String value;
        if ((value = widthRenderer.getAsString(styles)) != null) {
            if (significant) {
                element.setAttribute("width", value);
            } else {
                // throw away the value otherwise it stays in the theme
                // and will be used by CSS aware browsers to override
View Full Code Here

            Element element,
            RowIteratorPaneAttributes attributes) {

        Styles styles = attributes.getStyles();
        String value;
        PropertyHandler widthHandler = getCorrectWidthHandler(element);

        if ((value = widthHandler.getAsString(styles)) != null) {
            element.setAttribute("width", value);
        }

        if (attributes.getPane() != null) {
            addOptimizeAttribute(element, attributes.getPane());
View Full Code Here

            // Emulate using a "logical" width attribute. This will be
            // translated into an actual attribute by the transformer.

            final Styles styles = attributes.getStyles();

            PropertyHandler widthHandler = getCorrectWidthHandler(element);
            final boolean significant =
                    widthHandler.isSignificant(styles);
            String value;
            if ((value = widthHandler.getAsString(styles)) != null) {
                if (significant) {
                    element.setAttribute("width", value);
                } else {
                    // throw away the value otherwise it stays in the theme
                    // and will be used by CSS aware browsers to override
View Full Code Here

        return new DefaultMenuModule(getRendererContext(),
                rendererFactory);
    }

    protected PropertyHandler getCorrectWidthHandler(Element element) {
        PropertyHandler widthHandler;
        if (element.getName().equals("table")) {
            widthHandler = tableWidthHandler;
        } else {
            widthHandler = this.widthHandler;
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.styles.PropertyHandler

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.