Package org.apache.cocoon.portal.layout

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


            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


     * @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 instanceof CompositeLayout ) {
                final CompositeLayout cl = (CompositeLayout)layout;
                final Iterator i = cl.getItems().iterator();
                while ( i.hasNext() ) {
                    final Item current = (Item)i.next();
                    this.cacheLayouts( layoutMap, current.getLayout() );
                }
            }
        }       
    }
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

    Object layoutObj = getLayoutElement (layout, id, "", 1);
    if (layoutObj == null) return false;
   
    // do the job:
    Layout lay;
    Item item;
    if (layoutObj instanceof NamedItem) {
      lay =  ((NamedItem)layoutObj).getLayout();
      if (lay == null)
        item = (NamedItem) layoutObj;
      else
        item = lay.getParent();
    }
    else {
      lay = (Layout) layoutObj;
      item = lay.getParent();
    }
   
    // find element in the list and move it:
    List items = item.getParent().getItems();
    for (ListIterator iter = items.listIterator(); iter.hasNext(); ) {
     
      Item itemElem = (Item) iter.next();
     
      if(itemElem.equals(item)) {
       
        int pos = iter.nextIndex()-1;
        int newpos = pos;
        if (moveUp)
          newpos --;
View Full Code Here

   
    try {
      Layout nObj = lf.newInstance(type);
      pm.register(nObj);
     
      Item e = new Item();
      nObj.setParent(e);
      e.setLayout(nObj);
     
      if (lay != null)
        ((CompositeLayout) lay).addItem(e);
      else
      {
        NamedItem ni = (NamedItem)layoutObj;
        nObj.setParent(ni);
        ni.setLayout(nObj);
      }
     
    } catch (ProcessingException e) {
      e.printStackTrace();
    }
    }
View Full Code Here

        if (lay == null) {
         
          ((NamedItem)layoutObj).setLayout(tab);
        }
        else {
          Item m = new Item();
          m.setParent((CompositeLayout) lay);
          ((CompositeLayout) lay).addItem(m);
          m.setLayout(tab);
        }
       
      } catch (ProcessingException e) {
        e.printStackTrace();
      }
View Full Code Here

        CopletInstanceData cinst = cf.newInstance(cd);
        CopletLayout lay = (CopletLayout) lf.newInstance("coplet");
        lay.setCopletInstanceData(cinst);
       
         if(obj instanceof Item) {
           Item item = (Item) obj;
           item.setLayout(lay);
           lay.setParent(item);
         } else if(obj instanceof CompositeLayout) {
           CompositeLayout cl = (CompositeLayout) obj;
           Item item = new Item();
           item.setLayout(lay);
           lay.setParent(item);
           cl.addItem(item);
         }
        
      } catch (ProcessingException e) {
View Full Code Here

       
        int currentpos = pos;
        pos = 1;
        while (i.hasNext()) {
         
          Item current = (Item) i.next();
         
          if (id.equals((prefix+currentpos+"."+pos)))
            return current;
         
          Object lay = getLayoutElement(current.getLayout(), id, prefix+currentpos+"."+pos+".",1);
          if(lay != null)
            return lay;
         
          pos ++;
        }
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

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.