Problem with beans [message #613503] |
Tue, 11 July 2006 12:57 |
Eclipse User |
|
|
|
Originally posted by: phaedrus.gmx.net
Hello
i'm having trouble editing beans properties using VE.
The bean is located in the same package as the container class.
My PropertyEditor looks like this:
//---------------------------------------------------------- ---------
public class SegmentDigitEditor extends
java.beans.PropertyEditorSupport {
private Integer digit = 0;
public Object getValue(){
return new Integer(this.digit);
}
public void setValue(Object o){
if(o instanceof Integer)
this.digit= (Integer)o;
else
this.digit = 0;
firePropertyChange();
}
public String getAsText(){
return this.digit.toString();
}
public void setAsText(String s){
this.digit = new Integer(Integer.parseInt(s));
firePropertyChange();
}
}
//---------------------------------------------------------- -----------
The corresponding property is of type Integer and the class has
getter-/setter methods:
public Integer getDigit() { return digit; }
public void setDigit(Integer digit){ this.digit = digit; }
However, if I try to change the property to let's say Integer(5),
i get:
segmentDigit.setDigit(???);
in the source code, instead of
segmentDigit.setDigit(new Integer(5));
what might i have done wrong?
Thanks in advance
Alex
|
|
|
Powered by
FUDForum. Page generated in 0.03071 seconds