Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Problem with beans
Problem with beans [message #613503] Tue, 11 July 2006 12:57
Eclipse UserFriend
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
Previous Topic:Can we add a control in to a shell, programmatically?
Next Topic:Overwrite
Goto Forum:
  


Current Time: Tue Apr 23 10:41:00 GMT 2024

Powered by FUDForum. Page generated in 0.03071 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top