1 4 package org.oddjob.designer.model; 5 6 import java.util.ArrayList ; 7 import java.util.Iterator ; 8 import java.util.List ; 9 10 11 16 public class GroupBase { 17 18 private final String heading; 19 private final List elements = new ArrayList (); 20 21 public GroupBase(String heading) { 22 this.heading = heading; 23 } 24 25 public String getTitle() { 26 return this.heading; 27 } 28 29 protected void addElement(DesignDefinition elementField) { 30 elements.add(elementField); 31 } 32 33 public DesignDefinition get(int index) { 34 return (DesignDefinition) elements.get(index); 35 } 36 37 public int size() { 38 return elements.size(); 39 } 40 41 public boolean isPopulated() { 42 boolean populated = false; 43 for (Iterator it = elements.iterator(); it.hasNext(); ) { 44 if (((DesignDefinition) it.next()).isPopulated()) { 45 populated = true; 46 } 47 } 48 return populated; 49 } 50 } 51 | Popular Tags |