1 7 package org.ejtools.adwt.editor; 8 9 import java.util.Iterator ; 10 import java.util.StringTokenizer ; 11 import java.util.Vector ; 12 13 21 public class IteratorEditor extends GenericEditor 22 { 23 24 public IteratorEditor() 25 { 26 this.value = (new Vector ()).iterator(); 27 } 28 29 30 35 public String getAsText() 36 { 37 String result = ""; 38 Iterator iterator = (Iterator ) this.value; 39 while (iterator.hasNext()) 40 { 41 result = result + iterator.next(); 42 if (iterator.hasNext()) 43 { 44 result = result + ","; 45 } 46 } 47 return result; 48 } 49 50 51 56 public void setAsText(String s) 57 { 58 StringTokenizer st = new StringTokenizer (s, ","); 59 Vector parsed = new Vector (); 60 while (st.hasMoreTokens()) 61 { 62 parsed.add(st.nextToken()); 63 } 64 this.value = parsed.iterator(); 65 this.firePropertyChange(); 66 } 67 } 68 | Popular Tags |