Package nextapp.echo2.webrender

Examples of nextapp.echo2.webrender.ServerMessage


     *
     * @param rc the relevant <code>RenderContext</code>
     * @param contentPane the <code>ContentPane</code>
     */
    private void renderDisposeDirective(RenderContext rc, ContentPane contentPane) {
        ServerMessage serverMessage = rc.getServerMessage();
        Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_PREREMOVE,
                "EchoContentPane.MessageProcessor", "dispose"new String[0], new String[0]);
        Element itemElement = serverMessage.getDocument().createElement("item");
        itemElement.setAttribute("eid", ContainerInstance.getElementId(contentPane));
        itemizedUpdateElement.appendChild(itemElement);
    }
View Full Code Here


     *      nextapp.echo2.app.update.ServerComponentUpdate, org.w3c.dom.Node, nextapp.echo2.app.Component)
     */
    public void renderHtml(RenderContext rc, ServerComponentUpdate update, Node parentNode, Component component) {
        ContentPane contentPane = (ContentPane) component;
       
        ServerMessage serverMessage = rc.getServerMessage();
        serverMessage.addLibrary(CONTENT_PANE_SERVICE.getId());

        Document document = parentNode.getOwnerDocument();
        Element divElement = document.createElement("div");
        divElement.setAttribute("id", ContainerInstance.getElementId(component));
       
View Full Code Here

     * @param rc the relevant <code>RenderContext</code>
     * @param contentPane the <code>ContentPane</code>
     */
    private void renderInitDirective(RenderContext rc, ContentPane contentPane) {
        String elementId = ContainerInstance.getElementId(contentPane);
        ServerMessage serverMessage = rc.getServerMessage();

        Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_POSTUPDATE,
                "EchoContentPane.MessageProcessor", "init", new String[0], new String[0]);
        Element itemElement = serverMessage.getDocument().createElement("item");
        itemElement.setAttribute("eid", elementId);
        Extent horizontalScroll = (Extent) contentPane.getRenderProperty(ContentPane.PROPERTY_HORIZONTAL_SCROLL);
        if (horizontalScroll != null && horizontalScroll.getValue() != 0) {
            itemElement.setAttribute("horizontal-scroll", ExtentRender.renderCssAttributeValue(horizontalScroll));
        }
View Full Code Here

     * @param contentPane the <code>ContentPane</code>
     * @param horizontal a flag indicating whether the horizontal (true) or
     *        vertical (false) scroll bar position should be updated
     */
    private void renderScrollDirective(RenderContext rc, ContentPane contentPane, boolean horizontal) {
        ServerMessage serverMessage = rc.getServerMessage();
        Element scrollElement =
                serverMessage.appendPartDirective(ServerMessage.GROUP_ID_POSTUPDATE, "EchoContentPane.MessageProcessor",
                horizontal ? "scroll-horizontal" : "scroll-vertical");
        Extent position = (Extent) contentPane.getRenderProperty(
                horizontal ? ContentPane.PROPERTY_HORIZONTAL_SCROLL : ContentPane.PROPERTY_VERTICAL_SCROLL, EXTENT_0);
        scrollElement.setAttribute("eid", ContainerInstance.getElementId(contentPane));
        scrollElement.setAttribute("position", ExtentRender.renderCssAttributeValue(position));
View Full Code Here

     */
    public void renderHtml(RenderContext rc, ServerComponentUpdate addUpdate, Node parentNode, Component component) {
        TextArea textArea = (TextArea) component;
        String elementId = ContainerInstance.getElementId(component);
       
        ServerMessage serverMessage = rc.getServerMessage();
        serverMessage.addLibrary(TEXT_COMPONENT_SERVICE.getId());
       
        Element textAreaElement = parentNode.getOwnerDocument().createElement("textarea");
        textAreaElement.setAttribute("id", elementId);
       
        if (textArea.isFocusTraversalParticipant()) {
View Full Code Here

     */
    public void renderHtml(RenderContext rc, ServerComponentUpdate addUpdate, Node parentNode, Component component) {
        TextField textField = (TextField) component;
        String elementId = ContainerInstance.getElementId(textField);

        ServerMessage serverMessage = rc.getServerMessage();
        serverMessage.addLibrary(TEXT_COMPONENT_SERVICE.getId());
       
        Element inputElement = parentNode.getOwnerDocument().createElement("input");
        inputElement.setAttribute("id", elementId);
        if (textField instanceof PasswordField) {
            inputElement.setAttribute("type", "password");
View Full Code Here

     *
     * @param rc the relevant <code>RenderContext</code>
     * @param button the button
     */
    private void renderDisposeDirective(RenderContext rc, AbstractButton button) {
        ServerMessage serverMessage = rc.getServerMessage();
        Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_PREREMOVE,
                "EchoButton.MessageProcessor", "dispose"new String[0], new String[0]);
        Element itemElement = serverMessage.getDocument().createElement("item");
        itemElement.setAttribute("eid", ContainerInstance.getElementId(button));
        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(BUTTON_SERVICE.getId());
        AbstractButton button = (AbstractButton) component;
        Element containerDivElement = renderButtonContainer(rc, parentNode, button);
        renderInitDirective(rc, button);
        renderButtonContent(rc, containerDivElement, button);
    }
View Full Code Here

     * @param rc the relevant <code>RenderContext</code>
     * @param button the button
     */
    private void renderInitDirective(RenderContext rc, AbstractButton button) {
        String elementId = ContainerInstance.getElementId(button);
        ServerMessage serverMessage = rc.getServerMessage();
        FillImage backgroundImage = (FillImage) button.getRenderProperty(AbstractButton.PROPERTY_BACKGROUND_IMAGE);
       
        boolean rolloverEnabled = ((Boolean) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_ENABLED,
                Boolean.FALSE)).booleanValue();
        boolean pressedEnabled = ((Boolean) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_ENABLED,
                Boolean.FALSE)).booleanValue();
       
        String pressedStyle = "";
        String rolloverStyle = "";
       
        String defaultIconUri = null;
        String rolloverIconUri = null;
        String pressedIconUri = null;
       
        if (rolloverEnabled || pressedEnabled) {
            boolean hasIcon = button.getRenderProperty(AbstractButton.PROPERTY_ICON) != null;
            if (hasIcon) {
                defaultIconUri = ImageTools.getUri(rc, this, button, IMAGE_ID_ICON);
            }
           
            if (rolloverEnabled) {
                CssStyle rolloverCssStyle = new CssStyle();
                BorderRender.renderToStyle(rolloverCssStyle,
                        (Border) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_BORDER));
                ColorRender.renderToStyle(rolloverCssStyle,
                        (Color) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_FOREGROUND),
                        (Color) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_BACKGROUND));
                FontRender.renderToStyle(rolloverCssStyle,
                        (Font) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_FONT));
                if (backgroundImage != null) {
                    FillImageRender.renderToStyle(rolloverCssStyle, rc, this, button, IMAGE_ID_ROLLOVER_BACKGROUND,
                            (FillImage) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_BACKGROUND_IMAGE),
                            FillImageRender.FLAG_DISABLE_FIXED_MODE);
                }
                if (rolloverCssStyle.hasAttributes()) {
                    rolloverStyle = rolloverCssStyle.renderInline();
                }
                if (hasIcon) {
                    ImageReference rolloverIcon = (ImageReference) button.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_ICON);
                    if (rolloverIcon != null) {
                        rolloverIconUri = ImageTools.getUri(rc, this, button, IMAGE_ID_ROLLOVER_ICON);
                    }
                }
            }
           
            if (pressedEnabled) {
                CssStyle pressedCssStyle = new CssStyle();
                BorderRender.renderToStyle(pressedCssStyle,
                        (Border) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_BORDER));
                ColorRender.renderToStyle(pressedCssStyle,
                        (Color) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_FOREGROUND),
                        (Color) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_BACKGROUND));
                FontRender.renderToStyle(pressedCssStyle,
                        (Font) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_FONT));
                if (backgroundImage != null) {
                    FillImageRender.renderToStyle(pressedCssStyle, rc, this, button, IMAGE_ID_PRESSED_BACKGROUND,
                            (FillImage) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_BACKGROUND_IMAGE),
                            FillImageRender.FLAG_DISABLE_FIXED_MODE);
                }
                if (pressedCssStyle.hasAttributes()) {
                    pressedStyle = pressedCssStyle.renderInline();
                }
                if (hasIcon) {
                    ImageReference pressedIcon = (ImageReference) button.getRenderProperty(AbstractButton.PROPERTY_PRESSED_ICON);
                    if (pressedIcon != null) {
                        pressedIconUri = ImageTools.getUri(rc, this, button, IMAGE_ID_PRESSED_ICON);
                    }
                }
            }
        }
       
        CssStyle defaultCssStyle = renderDefaultStyle(rc, button);
        String defaultStyle = defaultCssStyle.renderInline();
       
        Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_POSTUPDATE,
                "EchoButton.MessageProcessor", "init",  BUTTON_INIT_KEYS, new String[]{defaultStyle, rolloverStyle, pressedStyle});
        Element itemElement = serverMessage.getDocument().createElement("item");
        itemElement.setAttribute("eid", elementId);
        if (defaultIconUri != null) {
            itemElement.setAttribute("default-icon", defaultIconUri);
        }
        if (rolloverIconUri != null) {
View Full Code Here

    /**
     * @see nextapp.echo2.webrender.service.SynchronizeService#renderInit(nextapp.echo2.webrender.Connection,
     *      org.w3c.dom.Document)
     */
    protected ServerMessage renderInit(Connection conn, Document clientMessageDocument) {
        ServerMessage serverMessage = new ServerMessage();
        RenderContext rc = new RenderContextImpl(conn, serverMessage);
        ContainerInstance containerInstance = rc.getContainerInstance();
        try {
            serverMessage.addLibrary(WEB_CONTAINER_SERVICE.getId());
           
            processClientMessage(conn, clientMessageDocument);

            if (!containerInstance.isInitialized()) {
                containerInstance.init(conn);
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.