1 package com.teamkonzept.field; 2 3 import com.teamkonzept.lib.*; 4 import org.w3c.dom.*; 5 6 12 public class TKEmbededSwitch 13 extends TKFieldSwitch 14 { 15 17 public TKEmbededSwitch( TKVector alternatives ) 18 { 19 initFieldSwitch("", "", alternatives, null, CHECK_UNDEFINED); 20 } 21 22 27 public void setEmbedName (String name) 28 { 29 fieldName = name; 30 } 31 32 public Object getDefault( String alternative ) 33 { 34 TKBaseField field = (TKBaseField) fieldHash.get( alternative ); 35 if( field == null ) return getDefault(); 36 return new TKFieldSwitchData( alternative, alternative, field.getDefault() ); 37 } 38 39 public void fillIntoDOM (Document doc, Element node, Object data) 40 throws DOMException 41 { 42 TKFieldSwitchData switchData = (TKFieldSwitchData) data; 43 44 if (switchData.alternative.length() > 0) 45 { 46 TKBaseField field = (TKBaseField) fieldHash.get(switchData.alternative); 47 field.fillIntoDOM(doc, node, switchData.data); 48 } 49 } 50 51 } 52 | Popular Tags |