Package org.apache.cocoon.portal.layout

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


            }
            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


            if (layout instanceof CompositeLayout) {
                // 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

        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

        if ( layout != null ) {
            this.init();
            if ( layout instanceof CompositeLayout ) {
                final CompositeLayout cl = (CompositeLayout)layout;
                while ( cl.getItems().size() > 0 ) {
                    final Item i = cl.getItem(0);
                    this.remove( i.getLayout() );
                }
            }
            Item parent = layout.getParent();
            if ( parent != null && parent.getParent() != null) {
                parent.getParent().removeItem( parent );
            }
           
            PortalService service = null;
            EventManager eventManager = null;
            try {
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

    private String getLabel(ChangeAspectDataEvent event) {
        CompositeLayout layout = (CompositeLayout) event.getTarget();
        int i = ((Integer) event.getData()).intValue();

        Item item = layout.getItem(i);
        StringBuffer key = new StringBuffer("");
        if (item instanceof NamedItem) {
            getKey(item, key);
        }
        return key.toString();
View Full Code Here

    * @param item An Item.
    * @param key The StringBuffer in which to create the page label.
    */
    private void getKey(Item item, StringBuffer key) {
        CompositeLayout parentLayout = item.getParent();
        Item parentItem = parentLayout.getParent();

        if (parentItem != null) {
            getKey(parentItem, key);
        }

View Full Code Here

      // an empty item can not be handled by the LayoutFactory, do the job manual:
      if (lay == null) {
        List items = ((NamedItem)layoutObj).getParent().getItems();
        for (ListIterator iter = items.listIterator(); iter.hasNext(); ) {
         
          Item itemElem = (Item) iter.next();
         
          if( itemElem.equals(layoutObj)) {
            items.remove (iter.nextIndex()-1);
            return true;
          }
        }
      } else if(lay.getParent() instanceof NamedItem) {
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.