Package nextapp.echo2.webrender

Examples of nextapp.echo2.webrender.ServerMessage


     * @param table the table
     */
    private void renderDisposeDirective(RenderContext rc, Table table) {
       DomUpdate.renderStyleSheetRemoveRule(rc.getServerMessage(), "TD.c-" + table.getRenderId());
        ServerMessage serverMessage = rc.getServerMessage();
        Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_PREREMOVE,
                "EchoTable.MessageProcessor", "dispose"new String[0], new String[0]);
        Element itemElement = serverMessage.getDocument().createElement("item");
        itemElement.setAttribute("eid", ContainerInstance.getElementId(table));
        itemizedUpdateElement.appendChild(itemElement);
    }
View Full Code Here


    /**
     * @see nextapp.echo2.webcontainer.DomUpdateSupport#renderHtml(nextapp.echo2.webcontainer.RenderContext,
     *      nextapp.echo2.app.update.ServerComponentUpdate, org.w3c.dom.Node, nextapp.echo2.app.Component)
     */
    public void renderHtml(RenderContext rc, ServerComponentUpdate update, Node parentNode, Component component) {
        ServerMessage serverMessage = rc.getServerMessage();
        serverMessage.addLibrary(TABLE_SERVICE.getId());
        Table table = (Table) component;
       
        renderInitDirective(rc, table);
       
        Border border = (Border) table.getRenderProperty(Table.PROPERTY_BORDER);
View Full Code Here

     * @param rc the relevant <code>RenderContext</code>
     * @param table the table
     */
    private void renderInitDirective(RenderContext rc, Table table) {
        String elementId = ContainerInstance.getElementId(table);
        ServerMessage serverMessage = rc.getServerMessage();
        Document document = serverMessage.getDocument();
       
        boolean rolloverEnabled = ((Boolean) table.getRenderProperty(Table.PROPERTY_ROLLOVER_ENABLED,
                Boolean.FALSE)).booleanValue();
        boolean selectionEnabled = ((Boolean) table.getRenderProperty(Table.PROPERTY_SELECTION_ENABLED,
                Boolean.FALSE)).booleanValue();
       
        String rolloverStyle = "";
        if (rolloverEnabled) {
            CssStyle rolloverCssStyle = new CssStyle();
            ColorRender.renderToStyle(rolloverCssStyle,
                    (Color) table.getRenderProperty(Table.PROPERTY_ROLLOVER_FOREGROUND),
                    (Color) table.getRenderProperty(Table.PROPERTY_ROLLOVER_BACKGROUND));
            FontRender.renderToStyle(rolloverCssStyle,
                    (Font) table.getRenderProperty(Table.PROPERTY_ROLLOVER_FONT));
            FillImageRender.renderToStyle(rolloverCssStyle, rc, this, table, IMAGE_ID_ROLLOVER_BACKGROUND,
                    (FillImage) table.getRenderProperty(Table.PROPERTY_ROLLOVER_BACKGROUND_IMAGE),
                    FillImageRender.FLAG_DISABLE_FIXED_MODE);
            if (rolloverCssStyle.hasAttributes()) {
                rolloverStyle = rolloverCssStyle.renderInline();
            }
        }
       
        String selectionStyle = "";
        if (selectionEnabled) {
            CssStyle selectionCssStyle = new CssStyle();
            ColorRender.renderToStyle(selectionCssStyle,
                    (Color) table.getRenderProperty(Table.PROPERTY_SELECTION_FOREGROUND),
                    (Color) table.getRenderProperty(Table.PROPERTY_SELECTION_BACKGROUND));
            FontRender.renderToStyle(selectionCssStyle,
                    (Font) table.getRenderProperty(Table.PROPERTY_SELECTION_FONT));
            FillImageRender.renderToStyle(selectionCssStyle, rc, this, table, IMAGE_ID_SELECTION_BACKGROUND,
                    (FillImage) table.getRenderProperty(Table.PROPERTY_SELECTION_BACKGROUND_IMAGE),
                    FillImageRender.FLAG_DISABLE_FIXED_MODE);
            if (selectionCssStyle.hasAttributes()) {
                selectionStyle = selectionCssStyle.renderInline();
            }
        }
       
        Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_POSTUPDATE,
                "EchoTable.MessageProcessor", "init",  TABLE_INIT_KEYS,
                new String[]{rolloverStyle, selectionStyle});
        Element itemElement = document.createElement("item");
        itemElement.setAttribute("eid", elementId);
        if (table.isHeaderVisible()) {
View Full Code Here

    /**
     * @see nextapp.echo2.webcontainer.ComponentSynchronizePeer#renderAdd(nextapp.echo2.webcontainer.RenderContext,
     *      nextapp.echo2.app.update.ServerComponentUpdate, java.lang.String, nextapp.echo2.app.Component)
     */
    public void renderAdd(RenderContext rc, ServerComponentUpdate update, String targetId, Component component) {
        ServerMessage serverMessage = rc.getServerMessage();
        serverMessage.addLibrary(SPLIT_PANE_SERVICE.getId());
        SplitPane splitPane = (SplitPane) component;
        renderInitDirective(rc, splitPane, targetId);
        Component[] children = splitPane.getVisibleComponents();
        for (int i = 0; i < children.length; ++i) {
            renderChild(rc, update, splitPane, children[i]);
View Full Code Here

     * @param splitPane the <code>SplitPane</code>
     * @param index the index of the child to add
     */
    private void renderAddChildDirective(RenderContext rc, ServerComponentUpdate update, SplitPane splitPane, int index) {
        String elementId = ContainerInstance.getElementId(splitPane);
        ServerMessage serverMessage = rc.getServerMessage();
        Element partElement = serverMessage.addPart(ServerMessage.GROUP_ID_UPDATE, "EchoSplitPane.MessageProcessor");
        Element addChildElement = serverMessage.getDocument().createElement("add-child");
        addChildElement.setAttribute("eid", elementId);
        addChildElement.setAttribute("index", Integer.toString(index));
        Component child = splitPane.getVisibleComponent(index);
        renderLayoutData(rc, addChildElement, child, index);
        partElement.appendChild(addChildElement);
View Full Code Here

    /**
     * @see nextapp.echo2.webcontainer.ComponentSynchronizePeer#renderDispose(nextapp.echo2.webcontainer.RenderContext,
     *      nextapp.echo2.app.update.ServerComponentUpdate, nextapp.echo2.app.Component)
     */
    public void renderDispose(RenderContext rc, ServerComponentUpdate update, Component component) {
        ServerMessage serverMessage = rc.getServerMessage();
        serverMessage.addLibrary(SPLIT_PANE_SERVICE.getId());
        renderDisposeDirective(rc, (SplitPane) component);
    }
View Full Code Here

     * @param rc the relevant <code>RenderContext</code>
     * @param splitPane the <code>SplitPane</code>
     */
    private void renderDisposeDirective(RenderContext rc, SplitPane splitPane) {
        String elementId = ContainerInstance.getElementId(splitPane);
        ServerMessage serverMessage = rc.getServerMessage();
        Element initElement = serverMessage.appendPartDirective(ServerMessage.GROUP_ID_PREREMOVE,
                "EchoSplitPane.MessageProcessor", "dispose");
        initElement.setAttribute("eid", elementId);
    }
View Full Code Here

     * @param targetId the id of the container element
     */
    private void renderInitDirective(RenderContext rc, SplitPane splitPane, String targetId) {
        String elementId = ContainerInstance.getElementId(splitPane);
        boolean vertical = isOrientationVertical(splitPane);
        ServerMessage serverMessage = rc.getServerMessage();
        Element partElement = serverMessage.addPart(ServerMessage.GROUP_ID_UPDATE, "EchoSplitPane.MessageProcessor");
        Element initElement = serverMessage.getDocument().createElement("init");
        initElement.setAttribute("container-eid", targetId);
        initElement.setAttribute("eid", elementId);

        initElement.setAttribute("position", Integer.toString(getSeparatorPosition(splitPane)));
       
View Full Code Here

     * @param splitPane the <code>SplitPane</code>
     * @param index the index of the child to remove
     */
    private void renderRemoveChildDirective(RenderContext rc, SplitPane splitPane, int index) {
        String elementId = ContainerInstance.getElementId(splitPane);
        ServerMessage serverMessage = rc.getServerMessage();
        Element partElement = serverMessage.addPart(ServerMessage.GROUP_ID_REMOVE, "EchoSplitPane.MessageProcessor");
        Element removeChildElement = serverMessage.getDocument().createElement("remove-child");
        removeChildElement.setAttribute("eid", elementId);
        removeChildElement.setAttribute("index", Integer.toString(index));
        partElement.appendChild(removeChildElement);
    }
View Full Code Here

     * @param rc the relevant <code>RenderContext</code>
     * @param splitPane the <code>SplitPane</code>
     */
    private void renderSetSeparatorPositionDirective(RenderContext rc, SplitPane splitPane) {
        String elementId = ContainerInstance.getElementId(splitPane);
        ServerMessage serverMessage = rc.getServerMessage();
        Element partElement = serverMessage.addPart(ServerMessage.GROUP_ID_REMOVE, "EchoSplitPane.MessageProcessor");
        Element setSeparatorPositionElement = serverMessage.getDocument().createElement("set-separator-position");
        setSeparatorPositionElement.setAttribute("eid", elementId);
        setSeparatorPositionElement.setAttribute("position", Integer.toString(getSeparatorPosition(splitPane)));
        partElement.appendChild(setSeparatorPositionElement);
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.webrender.ServerMessage

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.