Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to distinguish between user selection and programatic selection with ListSelectionListener



I have wondered if there was a 'good' solution to this problem. I come across it mostly when initializing my GUI state after loading a project in my application. I don't wan the GUI components to fire events that cause me to update my project document or otherwise mark it as 'modified' by the user.

I always felt that there should be a method to set the state without trigger listeners.. but it seems that would require two kinds of listeners... if views listen to the model to show the proper state then initializing the model from some document should fire those events to cause the GUI to show the correct state. However if my listeners are tracking changes to the model to change my document based on user actions, I don't want these to be called when initializing the model from the project document. It seems that there should be view listeners and action listeners - where 'action' listeners are not called when the model is changed by something other than the GUI... anyway it seems that the design of Swing coudl have been a bit easier to work with in this respect.

Scott
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.