java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4089
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
I added a SystemOption via layer, but changes are not persisted...? E-mail
User Rating: / 0
PoorBest 

To correctly register a SystemOption, you need to place a *.settings file somewhere beneath Services/ in your XML layer. Normally you will also create a .shadow somewhere in UI/Services/ to ensure it is displayed to the user in the Options window.

Sometimes people try to put the *.settings file directly in UI/Services/. This will not work correctly. SharedClassObject.findObject will create an instance of your option - but a default instance only, because it only looks in Services/ to find a default or customized version of the option bean. Changes will never be persisted to disk, because findObject does not know of a *.settings file associated with the option and will consider it to be a transient (in-memory) option only. In this situation you might see the symptom that changes are persisted only if you open the Options dialog and select your setting before first attempting to access it from code.

Check the Services API for the full scoop.

Also make sure that you are firing a property change from your setter methods - typically this is done using putProperty(PROP_FOO_BAR, newValue, true) - and that the property name matches the introspected JavaBeans? property name, i.e. for setFooBar the property name should be fooBar. Remember as well that if newValue.equals(oldValue), no property will be fired (standard behavior of java.beans.PropertyChangeSupport) - this can happen if you have a complex structured value type and attempt to modify a portion of the structure without creating a fresh value object, in which case oldValue == newValue.

Source: NetBeans FAQ


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.