Just marking something as bound in the BeanInfo doesn't actually make it so. Bound properties are properties supporting property change events. Are you using PropertyChangeSupport in your properties? Meaning are you firing property change events?
An older tutorial not using the listeners bound to a specific property name per se (has to be done with code by who ever adds the listener...in this case the NB RCP APIs should handle that):
http://java.sun.com/docs/books/tutorial/javabeans/properties/bound.htmlAnd the latest JavaDocs for PropertyChangeSupport:
http://java.sun.com/javase/6/docs/api/java/beans/PropertyChangeSupport.htmlBasically:
public class MyBean {
private PropertyChangeSupport pcs = null;
public MyBean(){
pcs = new PropertyChangeSupport(this);
}
private String name = "";
public void setName(String name){
String old = this.name;
this.name = name;
pcs.firePropertyChange("name", old, name);
}
public String getName(){
return this.name;
}
public void addPropertyChangeListener( PropertyChangeListener listener )
{
this.pcs.addPropertyChangeListener( listener );
}
public void removePropertyChangeListener( PropertyChangeListener listener )
{
this.pcs.removePropertyChangeListener( listener );
}
public void addPropertyChangeListener(String propName, PropertyChangeListener listener )
{
this.pcs.addPropertyChangeListener(propName, listener );
}
public void removePropertyChangeListener(String propName, PropertyChangeListener listener )
{
this.pcs.removePropertyChangeListener(propName, listener );
}
public PropertyChangeListener[] getPropertyChangeListeners(){
return this.pcs.getPropertyChangeListeners();
}
public PropertyChangeListener[] getPropertyChangeListeners(String propName){
return this.pcs.getPropertyChangeListeners(propName);
}
}
So, if you are not doing that you would experience problems.
Wade
==================
Wade Chandler, CCE
Software Engineer and Developer
Certified Forensic Computer Examiner
NetBeans Dream Team Member and Contributor
http://www.certified-computer-examiner.comhttp://wiki.netbeans.org/wiki/view/NetBeansDreamTeamhttp://www.netbeans.org----- Original Message ----
> From: rhizomorph <
khufu_lotus@...>
> To:
dev@...
> Sent: Tuesday, June 16, 2009 12:08:42 PM
> Subject: [openide-dev] Value of Bean properties are updated, but the Property Sheet doesn't refresh?
>
> I have a Bean for which I would like one property to change depending on whether
> or not another property for that same Bean has been changed. Functionally, I can
> get this to work. But visually, the property sheet is not updating the values
> that it displays until I place the cursor in that field. For example, let's say
> I have a Bean with the following properties:
>
>
>
> Color color
>
> int size
>
> float opacity
>
> Theme theme (enum)
>
>
>
> In this case, selecting a particular Theme will assign values to color, size,
> and opacity all at once. And when I do this, the actual object on the screen IS
> being updated to reflect that all the properties have just been modified.
> HOWEVER, the values for those same properties that are actually displayed in the
> Property Sheet do not change. How can I force the Property Sheet to
> refresh/update the values it's displaying when one of them is changed? I tried
> making all my properties "bound" in the BeanInfo file, but that doesn't do it.