1 10 11 package org.enhydra.jawe.xml.elements; 12 13 import org.enhydra.jawe.xml.*; 14 import org.enhydra.jawe.xml.panels.*; 15 16 21 public class EnumerationType extends XMLCollection { 22 25 public EnumerationType () { 26 super(null); 27 setRequired(true); 28 } 29 30 36 public XMLElement generateNewElement() { 37 EnumerationValue ev=new EnumerationValue(); 38 ev.setRequired(true); 39 return ev; 40 } 41 42 53 public XMLPanel getPanel () { 54 controlledPanel=new XMLListPanel(this,"",false,true,false) { 55 public boolean checkRequired () { 56 if (isReadOnly || (refCollectionElements.size()>0)) { 57 return true; 58 } else { 59 XMLPanel.errorMessage(this.getDialog(),getOwner().toLabel(),"", 60 XMLUtil.getLanguageDependentString("ErrorTheListMustContainAtLeastOneElement")); 61 controlPanel.getComponent(1).requestFocus(); 62 return false; 63 } 64 } 65 }; 66 controlPanel=new XMLListControlPanel(this,"",true,false,true); 67 return new XMLGroupPanel(this,new XMLPanel[]{ 68 controlledPanel,controlPanel},toLabel(),XMLPanel.BOX_LAYOUT, 69 false,true); 70 } 71 72 79 public Object clone () { 80 EnumerationType t=(EnumerationType)super.clone(); 81 return t; 82 } 83 84 } 85 | Popular Tags |