Package nextapp.echo2.app

Examples of nextapp.echo2.app.Column


     * @param rc the relevant <code>RenderContext</code>
     * @param update the update
     */
    private void renderAddChildren(RenderContext rc, ServerComponentUpdate update) {
        Element domAddElement = DomUpdate.renderElementAdd(rc.getServerMessage());
        Column column = (Column) update.getParent();
        String elementId = ContainerInstance.getElementId(column);
       
        Component[] components = update.getParent().getVisibleComponents();
        Component[] addedChildren = update.getAddedChildren();
       
        for (int componentIndex = components.length - 1; componentIndex >= 0; --componentIndex) {
            boolean childFound = false;
            for (int addedChildrenIndex = 0; !childFound && addedChildrenIndex < addedChildren.length; ++addedChildrenIndex) {
                if (addedChildren[addedChildrenIndex] == components[componentIndex]) {
                    DocumentFragment htmlFragment = rc.getServerMessage().getDocument().createDocumentFragment();
                    renderChild(rc, update, htmlFragment, column, components[componentIndex]);
                    if (componentIndex == components.length - 1) {
                        DomUpdate.renderElementAddContent(rc.getServerMessage(), domAddElement, elementId, htmlFragment);
                    } else {
                        DomUpdate.renderElementAddContent(rc.getServerMessage(), domAddElement,elementId,
                                elementId + "_cell_" + ContainerInstance.getElementId(components[componentIndex + 1]),
                                htmlFragment);
                    }
                    childFound = true;
                }
            }
        }

        // Special case: Recall the child which was rendered at the last index of the column on the previous
        // rendering.  If this child is still present but is no longer at the last index, render a spacing
        // cell beneath it (if necessary).
        ColumnPeerRenderState renderState = (ColumnPeerRenderState) rc.getContainerInstance().getRenderState(column);
        if (renderState != null && renderState.lastChild != null) {
            int previousLastChildIndex = column.visibleIndexOf(renderState.lastChild);
            if (previousLastChildIndex != -1 && previousLastChildIndex != column.getVisibleComponentCount() - 1) {
                // At this point it is known that the child which was previously last is present, but is no longer last.

                // In the event the child was removed and re-added, the special case is unnecessary.
                boolean lastChildMoved = false;
                for (int i = 0; i < addedChildren.length; ++i) {
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) {
        Column column = (Column) component;
       
        Document document = parentNode.getOwnerDocument();
        Element divElement = document.createElement("div");
        divElement.setAttribute("id", ContainerInstance.getElementId(column));
       
        CssStyle divCssStyle = new CssStyle();
        BorderRender.renderToStyle(divCssStyle, (Border) column.getRenderProperty(Column.PROPERTY_BORDER));
        ColorRender.renderToStyle(divCssStyle, (Color) column.getRenderProperty(Column.PROPERTY_FOREGROUND),
                (Color) column.getRenderProperty(Column.PROPERTY_BACKGROUND));
        FontRender.renderToStyle(divCssStyle, (Font) column.getRenderProperty(Column.PROPERTY_FONT));
        Insets insets = (Insets) column.getRenderProperty(Column.PROPERTY_INSETS);
        if (insets == null) {
            divCssStyle.setAttribute("padding", "0px");
        } else {
            InsetsRender.renderToStyle(divCssStyle, "padding", insets);
        }
       
        divElement.setAttribute("style", divCssStyle.renderInline());
       
        parentNode.appendChild(divElement);
       
        Component[] children = column.getVisibleComponents();
        for (int i = 0; i < children.length; ++i) {
            renderChild(rc, update, divElement, component, children[i]);
        }
       
        storeRenderState(rc, column);
View Full Code Here

    protected JbsContentPane initPnButtons() {
        pnButtons = new JbsContentPane();
        Row mainRow = new Row();
        mainRow.setAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
        mainRow.setInsets(new Insets(new JbsExtent(5), new JbsExtent(5)));

        btnOK = new JbsButton(JbsL10N.getString("Generic.ok"));
        btnOK.setAlignmentHorizontal(Alignment.CENTER);
        btnOK.setWidth(new JbsExtent(80));
        btnOK.addActionListener(new ActionListener() {
View Full Code Here

        this.getBtnMain().setBackground(Color.WHITE);
        this.getBtnMain().setBorder(BorderEx.NONE);
        this.getBtnMain().setRolloverBackground(Color.WHITE);
        this.getBtnMain().setRolloverBorder(BorderEx.NONE);

        this.setToggleIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setTogglePressedIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setToggleRolloverIcon(new ResourceImageReference(IMG_DROPDOWN));
       

        /*
        this.getBtnMain().addActionListener(new ActionListener() {

View Full Code Here

     * @param title The title of the button
     */
    public JbsAccPaneButton(String imgFileName, String title) {
        super();
        try {
            ResourceImageReference ref = new ResourceImageReference(Styles.getIconPath() + imgFileName);
            this.setIcon(ref);
        } catch (Exception e) {
            logger.debug(Styles.getIconPath() + imgFileName + " not found.");
        }
        this.setStyleName("Default");
View Full Code Here

        this.setBorder(BorderEx.NONE);
        this.setRolloverBorder(BorderEx.NONE);
        this.setTarget(this.getBtnMain());
        this.setPopUp(this.getMnuMain());
        this.setToggleIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setTogglePressedIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setToggleRolloverIcon(new ResourceImageReference(IMG_DROPDOWN));
    }
View Full Code Here

    public void addControl(String groupName, Component control) {
        this.addControl(groupName, groupName, control);
    }

    public void addSeparator(String groupName) {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15, JbsExtent.PX));
        row.setLayoutData(layout);
        this.addControl(groupName, row);
    }
View Full Code Here

        spMain.add(pnMain);
    }

    protected JbsContentPane initPnButtons() {
        pnButtons = new JbsContentPane();
        Row mainRow = new Row();
        mainRow.setAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
        mainRow.setInsets(new Insets(new JbsExtent(5), new JbsExtent(5)));

        btnOK = new JbsButton(JbsL10N.getString("Generic.ok"));
        btnOK.setAlignmentHorizontal(Alignment.CENTER);
        btnOK.setWidth(new JbsExtent(80));
        btnOK.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                postDialog();
            }
        });
        mainRow.add(btnOK);

        btnCancel = new JbsButton(JbsL10N.getString("Generic.cancel"));
        btnCancel.setAlignmentHorizontal(Alignment.CENTER);
        btnCancel.setWidth(new JbsExtent(80));
        btnCancel.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                cancelDialog();
            }
        });
        mainRow.add(btnCancel);

        /*
        KeyStrokeListener ks = new KeyStrokeListener();
        ks.addKeyCombination(KeyStrokeListener.VK_RETURN,"OK");
        ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE,"CANCEL");
        ks.addActionListener(new ActionListener() {
        private static final long serialVersionUID = 1L;
        public void actionPerformed(ActionEvent arg0) {
        if (arg0.getActionCommand().equals("OK"))
        postDialog();
        else if (arg0.getActionCommand().equals("CANCEL"))
        cancelDialog();
        }
        });
        mainRow.add(ks);
        mainRow.add(this.createKeyStrokeListener());
         */
        mainRow.add(this.getKeystrokeListener());
        pnButtons.add(mainRow);
        return pnButtons;
    }
View Full Code Here

        this.setMaximizable(false);
        this.setKeystrokeListener(this.createKeyStrokeListener());
        this.setPostOnEnterKey(true);
        this.setCancelOnEscKey(true);

        SplitPane spMain = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new JbsExtent(45));

        this.add(spMain);
        spMain.add(initPnButtons());

        pnMain = new JbsContentPane();
        spMain.add(pnMain);
    }
View Full Code Here

    protected void addAction(String actionCommand) {
        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(new ActionEvent(JbsDialogWindow.this, actionCommand));
            } catch (Throwable t) {
                logger.error("Error adding action.",t);
            }
        }
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Column

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.