Package org.apache.cocoon.portal.layout

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


    /* (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

      // 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

            ChangeAspectDataEvent e = (ChangeAspectDataEvent)event;
            CompositeLayout layout = (CompositeLayout)e.getTarget();
            int i = ((Integer)e.getData()).intValue();

            Item item = layout.getItem(i);
            if (item instanceof NamedItem) {
                StringBuffer key = new StringBuffer("");
                getKey(item, key);

                if (this.labelManager.getPageLabelEvents(key.toString()) != null) {
View Full Code Here

                ChangeAspectDataEvent e = (ChangeAspectDataEvent) event;
                CompositeLayout layout = (CompositeLayout) e.getTarget();
                int i = ((Integer) e.getData()).intValue();

                Item item = layout.getItem(i);
                if (value.length() > 0) {
                    value.append('.');
                }
                if (item instanceof NamedItem) {
                    value.append(((NamedItem)item).getName());
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.