1 4 package org.oddjob.designer.model; 5 6 import org.oddjob.designer.arooa.DesignIH; 7 8 11 public class ElementField implements DesignDefinition { 12 13 private final String title; 14 private final DesignAttribute designElement; 15 16 public ElementField(String title, DesignAttribute el) { 17 if (title == null) { 18 throw new NullPointerException ("Null title not allowed!"); 19 } 20 if (el == null) { 21 throw new NullPointerException ("Null DesignElement not allowed!"); 22 } 23 this.title = title; 24 this.designElement = el; 25 } 26 27 public String getTitle() { 28 return title; 29 } 30 31 public DesignAttribute getDesignElement() { 32 return designElement; 33 } 34 35 39 public boolean isPopulated() { 40 if (designElement.attribute() != null) { 41 return true; 42 } 43 DesignIH dih = DesignIH.getHelper(designElement.getClass()); 44 if (dih.hasDetailData(designElement)) { 45 return true; 46 } 47 return false; 48 } 49 50 53 public void accept(DesignProcessor processor) { 54 processor.onElementField(this); 55 } 56 } 57 | Popular Tags |