Package com.nexirius.framework.htmlview

Examples of com.nexirius.framework.htmlview.HTMLTranslator


     */
    public void translate(HTMLSessionVariable sessionVariable, HTMLParser parser)
            throws Exception {
        String name = getName();

        HTMLTranslator htmlTranslator = parser.getResolver().getHTMLTranslator();

        String translatedName;

        if (htmlTranslator instanceof ClientResource) {
            ClientResource cr = (ClientResource) htmlTranslator;

            Color color = cr.getColor(name);
            StringBuffer result = new StringBuffer(7);
            String s = Integer.toHexString(color.getRed());

            result.append('#');

            if (s.length() == 1) {
                result.append('0');
            } else

                result.append(s);

            s = Integer.toHexString(color.getGreen());

            if (s.length() == 1) {
                result.append('0');
            } else

                result.append(s);

            s = Integer.toHexString(color.getBlue());

            if (s.length() == 1) {
                result.append('0');
            } else

                result.append(s);

            translatedName = result.toString();
        } else {

            translatedName = htmlTranslator.translate(name + ".color");
        }

        parser.getOut().write(translatedName.getBytes());
    }
View Full Code Here

TOP

Related Classes of com.nexirius.framework.htmlview.HTMLTranslator

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.