Package org.apache.cocoon.portal.layout

Examples of org.apache.cocoon.portal.layout.Item


        return "";
    }

    private String getRoot(CompositeLayout layout, StringBuffer root) {
        for (int j=0; j < layout.getSize(); j++) {
            Item tab = layout.getItem(j);
            if (tab instanceof NamedItem) {
                if (root.length() > 0) {
                    root.append(".");
                }
                root.append(((NamedItem)tab).getName());
                Layout child = tab.getLayout();
                if (child != null && child instanceof CompositeLayout) {
                    getRoot((CompositeLayout)child, root);
                }
                break;
            }
View Full Code Here


     * @param parentEvents
     */
    private List populate(CompositeLayout layout, Map map, String name, List parentEvents) {
        List lhList = null;
        for (int j = 0; j < layout.getSize(); j++) {
            Item tab = layout.getItem(j);
            ChangeAspectDataEvent event =
                new ChangeAspectDataEvent(layout, this.aspectName, new Integer(j));
            StringBuffer label = new StringBuffer(name);
            if (label.length() > 0) {
                label.append(".");
            }
            label.append((tab instanceof NamedItem) ? ((NamedItem) tab).getName() :
                Integer.toString(j));
            List events = new ArrayList(parentEvents);
            events.add(event);
            Layout child = tab.getLayout();
            List allEvents = null;
            if (child != null && child instanceof CompositeLayout) {
                allEvents = populate((CompositeLayout) child, map, label.toString(), events);
            }
            if (this.nonStickyTabs) {
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.cocoon.portal.layout.CompositeLayout#createNewItem()
     */
    public Item createNewItem() {
        if ( this.itemClassName == null ) {
            return new Item();
        }
        try {
            return (Item)ClassUtils.newInstance(this.itemClassName);
        } catch (Exception ignore) {
            return new Item();
        }
    }
View Full Code Here

     */
    public Layout copy() {
        CompositeLayoutImpl clone = (CompositeLayoutImpl)super.copy();
        final Iterator i = this.items.iterator();
        while ( i.hasNext() ) {
            final Item current = (Item)i.next();
            final Item clonedItem = current.copy(clone);
            clone.addItem(clonedItem);
        }
        return clone;
    }
View Full Code Here

            }
            if ( layout instanceof CompositeLayout ) {
                CompositeLayout cl = (CompositeLayout)layout;
                Iterator i = cl.getItems().iterator();
                while ( i.hasNext() ) {
                    Item current = (Item)i.next();
                    this.cacheLayouts( layoutMap, current.getLayout() );
                }
            }
        }
       
    }
View Full Code Here

                // step through all it's child layouts and cache them too
                CompositeLayout cl = (CompositeLayout) layout;
                Iterator i = cl.getItems().iterator();
                while (i.hasNext())
                {
                    Item current = (Item) i.next();
                    this.cacheLayouts(layoutMap, current.getLayout());
                }
            }
        }

    }
View Full Code Here

     * Returns the name of the new named item in the tab layout
     * @return String the name of the new item
     */
    private String getNewInstanceTabName(CompositeLayout layout) {
        Integer data = (Integer) layout.getAspectData("tab");
        Item selectedItem = (NamedItem) layout.getItem(data.intValue());

        if (selectedItem instanceof NamedItem) {
            return ((NamedItem) selectedItem).getName();
        }
        else {
View Full Code Here

                Iterator itemIterator = ((CompositeLayout)layout).getItems().iterator();
                while ( itemIterator.hasNext() ) {
                    this.remove( ((Item)itemIterator.next()).getLayout());              
                }
            }
            Item parent = layout.getParent();
            if ( parent != null && parent.getParent() != null) {
                parent.getParent().removeItem( parent );
            }
           
            PortalService service = null;
            try {
                service = (PortalService)this.manager.lookup(PortalService.ROLE);
View Full Code Here

  throws SAXException {
        if ( layout instanceof CompositeLayout) {
            CompositeLayout compositeLayout = (CompositeLayout)layout;
            // loop over all rows
            for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();) {
                Item item = (Item) iter.next();
                this.processItem(item, handler, service);
            }
        } else {
            throw new SAXException("CompositeLayout expected.");
        }
View Full Code Here

                Iterator itemIterator = ((CompositeLayout)layout).getItems().iterator();
                while ( itemIterator.hasNext() ) {
                    this.remove( ((Item)itemIterator.next()).getLayout());              
                }
            }
            Item parent = layout.getParent();
            if ( parent != null && parent.getParent() != null) {
                parent.getParent().removeItem( parent );
            }
           
            if ( layout instanceof CopletLayout ) {
                CopletFactory factory = null;
                try {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.layout.Item

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.