Package nextapp.echo2.app

Examples of nextapp.echo2.app.Component


    private class NullComponent extends Component { }
   
    public void testHorizontalWithComponentLTR() {
        Alignment alignment;
        CssStyle cssStyle = new CssStyle();
        Component component = new NullComponent();
        component.setLayoutDirection(LayoutDirection.LTR);
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertNull(cssStyle.getAttribute("text-align"));
       
View Full Code Here


    }
   
    public void testHorizontalWithComponentRTL() {
        Alignment alignment;
        CssStyle cssStyle = new CssStyle();
        Component component = new NullComponent();
        component.setLayoutDirection(LayoutDirection.RTL);
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertNull(cssStyle.getAttribute("text-align"));
       
View Full Code Here

                trElement.setAttribute("style", "height:" + ExtentRender.renderCssAttributeValue(gridProcessor.getRowHeight(rowIndex)));
            }
            tbodyElement.appendChild(trElement);
           
            for (int columnIndex = 0; columnIndex < columnCount; ++columnIndex) {
                Component cell = gridProcessor.getContent(columnIndex, rowIndex);
                if (cell == null) {
                    Element tdElement = document.createElement("td");
                    trElement.appendChild(tdElement);
                    continue;
                }
View Full Code Here

       
        if (cssStyle.hasAttributes()) {
            divElement.setAttribute("style", cssStyle.renderInline());
        }

        Component child = component.getVisibleComponent(0);
        ComponentSynchronizePeer syncPeer = SynchronizePeerFactory.getPeerForComponent(child.getClass());
       
        if (syncPeer instanceof DomUpdateSupport) {
            ((DomUpdateSupport) syncPeer).renderHtml(rc, update, divElement, child);
        } else {
            syncPeer.renderAdd(rc, update, getContainerId(child), child);
View Full Code Here

            border = (Border) table.getRenderProperty(Table.PROPERTY_BORDER);
        }
       
        int columns = table.getColumnModel().getColumnCount();
        for (int columnIndex = 0; columnIndex < columns; ++columnIndex) {
            Component childComponent = table.getCellComponent(columnIndex, rowIndex);
            Element tdElement = document.createElement("td");
            tdElement.setAttribute("id", elementId + "_cell_" + childComponent.getRenderId());
           
            CssStyle tdCssStyle = new CssStyle();
           
            if (inlineStyleRequired) {
                BorderRender.renderToStyle(tdCssStyle, border);
View Full Code Here

        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);
        renderChild(rc, update, splitPane, child);
    }
View Full Code Here

     * @param component the <code>Component</code> to analyze
     * @return <code>true</code> if the <code>Component</code> has been
     *         rendered to the client
     */
    private boolean isRendered(ContainerInstance ci, Component component) {
        Component parent = component.getParent();
        if (parent == null) {
            return true;
        }
        ComponentSynchronizePeer syncPeer = SynchronizePeerFactory.getPeerForComponent(parent.getClass());
        if (syncPeer instanceof LazyRenderContainer) {
            boolean rendered = ((LazyRenderContainer) syncPeer).isRendered(ci, parent, component);
            if (!rendered) {
                return false;
            }
View Full Code Here

     *        retrieve focus information from
     */
    private void processClientFocusedComponent(RenderContext rc, Document clientMessageDocument) {
        if (clientMessageDocument.getDocumentElement().hasAttribute("focus")) {
            String focusedComponentId = clientMessageDocument.getDocumentElement().getAttribute("focus");
            Component component = null;
            if (focusedComponentId.length() > 2) {
                // Valid component id.
                component = rc.getContainerInstance().getComponentByElementId(focusedComponentId);
            }
            ApplicationInstance applicationInstance = rc.getContainerInstance().getApplicationInstance();
View Full Code Here

                // Dispose of removed descendants.
                Component[] removedDescendants = componentUpdates[i].getRemovedDescendants();
                disposeComponents(rc, componentUpdates[i], removedDescendants);
   
                // Perform update.
                Component parentComponent = componentUpdates[i].getParent();
                if (!isAncestor(fullyReplacedHierarchies, parentComponent)) {
                    // Only perform update if ancestor of updated component is NOT contained in
                    // the set of components whose descendants were fully replaced.
                    ComponentSynchronizePeer syncPeer = SynchronizePeerFactory.getPeerForComponent(parentComponent.getClass());
                    String targetId;
                    if (parentComponent.getParent() == null) {
                        targetId = null;
                    } else {
                        ComponentSynchronizePeer parentSyncPeer
                                = SynchronizePeerFactory.getPeerForComponent(parentComponent.getParent().getClass());
                        targetId = parentSyncPeer.getContainerId(parentComponent);
                    }
                    boolean fullReplacement = syncPeer.renderUpdate(rc, componentUpdates[i], targetId);
                    if (fullReplacement) {
                        // Invoke renderDispose() on hierarchy of components destroyed by
View Full Code Here

     *        being performed, i.e., whether this method is being invoked from
     *        <code>renderInit()</code>
     */
    private void setFocus(RenderContext rc, boolean initial) {
        ApplicationInstance applicationInstance = rc.getContainerInstance().getApplicationInstance();
        Component focusedComponent = null;
        if (initial) {
            focusedComponent = applicationInstance.getFocusedComponent();
        } else {
            ServerUpdateManager serverUpdateManager = applicationInstance.getUpdateManager().getServerUpdateManager();
            PropertyUpdate focusUpdate =
                    serverUpdateManager.getApplicationPropertyUpdate(ApplicationInstance.FOCUSED_COMPONENT_CHANGED_PROPERTY);
            if (focusUpdate != null) {
                focusedComponent = (Component) focusUpdate.getNewValue();
            }
        }

        if (focusedComponent != null) {
            ComponentSynchronizePeer componentSyncPeer
                    = SynchronizePeerFactory.getPeerForComponent(focusedComponent.getClass());
            if (componentSyncPeer instanceof FocusSupport) {
                ((FocusSupport) componentSyncPeer).renderSetFocus(rc, focusedComponent);
            }
        }
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Component

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.