Problem with beans [message #128273] |
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
|
|
|
Re: Problem with beans [message #128312 is a reply to message #128273] |
Tue, 11 July 2006 13:44 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You need to also have the getJavaInitializationString() method that
returns the exact initialization code to use. Otherwise the VE has no
idea how to generate it in the code.
--
Thanks,
Rich Kulp
|
|
|
Re: Problem with beans [message #128436 is a reply to message #128312] |
Tue, 11 July 2006 21:17 |
Eclipse User |
|
|
|
Originally posted by: phaedrus.gmx.net
On Tue, 11 Jul 2006 09:44:04 -0400, Rich Kulp
<richkulp@us.NO_SPAM.ibm.com> wrote:
>You need to also have the getJavaInitializationString() method that
>returns the exact initialization code to use. Otherwise the VE has no
>idea how to generate it in the code.
Thanks a lot.
I've completely overlooked that.
Alex
|
|
|
Re: Problem with beans [message #613506 is a reply to message #128273] |
Tue, 11 July 2006 13:44 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You need to also have the getJavaInitializationString() method that
returns the exact initialization code to use. Otherwise the VE has no
idea how to generate it in the code.
--
Thanks,
Rich Kulp
|
|
|
Re: Problem with beans [message #613516 is a reply to message #128312] |
Tue, 11 July 2006 21:17 |
Eclipse User |
|
|
|
Originally posted by: phaedrus.gmx.net
On Tue, 11 Jul 2006 09:44:04 -0400, Rich Kulp
<richkulp@us.NO_SPAM.ibm.com> wrote:
>You need to also have the getJavaInitializationString() method that
>returns the exact initialization code to use. Otherwise the VE has no
>idea how to generate it in the code.
Thanks a lot.
I've completely overlooked that.
Alex
|
|
|
Powered by
FUDForum. Page generated in 0.03478 seconds