|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| IteratorEditor.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* EJTools, the Enterprise Java Tools
|
|
| 3 |
*
|
|
| 4 |
* Distributable under LGPL license.
|
|
| 5 |
* See terms of license at www.gnu.org.
|
|
| 6 |
*/
|
|
| 7 |
package org.ejtools.adwt.editor;
|
|
| 8 |
|
|
| 9 |
import java.util.Iterator;
|
|
| 10 |
import java.util.StringTokenizer;
|
|
| 11 |
import java.util.Vector;
|
|
| 12 |
|
|
| 13 |
/**
|
|
| 14 |
* Description of the Class
|
|
| 15 |
*
|
|
| 16 |
* @author Laurent Etiemble
|
|
| 17 |
* @version $Revision: 1.5 $
|
|
| 18 |
* @todo Javadoc to complete
|
|
| 19 |
* @todo Swing editor to complete
|
|
| 20 |
*/
|
|
| 21 |
public class IteratorEditor extends GenericEditor |
|
| 22 |
{
|
|
| 23 |
/** Constructor for the PropertiesEditor object */
|
|
| 24 | 0 |
public IteratorEditor()
|
| 25 |
{
|
|
| 26 | 0 |
this.value = (new Vector()).iterator(); |
| 27 |
} |
|
| 28 |
|
|
| 29 |
|
|
| 30 |
/**
|
|
| 31 |
* Getter for the asText attribute
|
|
| 32 |
*
|
|
| 33 |
* @return The value of asText attribute
|
|
| 34 |
*/
|
|
| 35 | 0 |
public String getAsText()
|
| 36 |
{
|
|
| 37 | 0 |
String result = "";
|
| 38 | 0 |
Iterator iterator = (Iterator) this.value;
|
| 39 | 0 |
while (iterator.hasNext())
|
| 40 |
{
|
|
| 41 | 0 |
result = result + iterator.next(); |
| 42 | 0 |
if (iterator.hasNext())
|
| 43 |
{
|
|
| 44 | 0 |
result = result + ",";
|
| 45 |
} |
|
| 46 |
} |
|
| 47 | 0 |
return result;
|
| 48 |
} |
|
| 49 |
|
|
| 50 |
|
|
| 51 |
/**
|
|
| 52 |
* Setter for the asText attribute
|
|
| 53 |
*
|
|
| 54 |
* @param s The new value for asText attribute
|
|
| 55 |
*/
|
|
| 56 | 0 |
public void setAsText(String s) |
| 57 |
{
|
|
| 58 | 0 |
StringTokenizer st = new StringTokenizer(s, ","); |
| 59 | 0 |
Vector parsed = new Vector();
|
| 60 | 0 |
while (st.hasMoreTokens())
|
| 61 |
{
|
|
| 62 | 0 |
parsed.add(st.nextToken()); |
| 63 |
} |
|
| 64 | 0 |
this.value = parsed.iterator();
|
| 65 | 0 |
this.firePropertyChange();
|
| 66 |
} |
|
| 67 |
} |
|
| 68 |
|
|
||||||||||