1 16 package com.blandware.atleap.webapp.taglib.core.menu.context; 17 18 import com.blandware.atleap.webapp.taglib.core.util.ContextMenuItem; 19 20 import javax.servlet.jsp.tagext.SimpleTagSupport ; 21 import java.util.ArrayList ; 22 import java.util.List ; 23 24 32 public class ItemContainerSupport extends SimpleTagSupport implements ItemContainer { 33 34 36 40 protected List menus = new ArrayList (); 41 42 45 public ItemContainerSupport() { 46 } 47 48 51 public void storeItem(Integer index, ContextMenuItem item) { 52 List menu = new ArrayList (); 54 int i = index.intValue(); 55 if ( i < menus.size() ) { 56 menu = (List ) menus.get(i); 57 } 58 menu.add(item); 60 if ( i < menus.size() ) { 62 menus.set(i, menu); 63 } else { 64 menus.add(menu); 65 } 66 } 67 68 } 69 | Popular Tags |