1 5 14 package com.teamkonzept.web.templates; 15 16 import java.io.*; 17 18 import com.teamkonzept.lib.*; 19 import com.teamkonzept.lib.templates.*; 20 21 24 public class TKOptionTag extends TKValueTag { 25 static final int TAG_TYPE = TKSelectTag.TAG_TYPE+1; 26 27 36 public TKOptionTag( TKTemplateSyntax parent, String def, boolean hasSubTags ) throws TKTemplateSyntaxException 37 { 38 super( parent, def, hasSubTags ); 39 } 40 41 53 public String apply( TKTemplateData td ) throws TKTemplateSyntaxException 54 { 55 56 return "<OPTION" 57 +( matches( td ) ? " SELECTED" : "" ) 58 + " VALUE=\"" + getValue( td ) + "\">"; 59 } 60 61 public void apply(TKTemplateData td, Writer writer) 62 throws TKTemplateSyntaxException, IOException 63 { 64 writer.write ("<OPTION" 65 +( matches( td ) ? " SELECTED" : "" ) 66 + " VALUE=\"" + getValue( td ) + "\">"); 67 } 68 69 } 70 71 72 | Popular Tags |