Community
Participate
Working Groups
On the newsgroup[1] there was a question about how to retrieve the model object in and instance of IBindingListener. Currently the only way to do this is by referencing the bean in the listener. That works but it seems like we should be able to provide a mixin interface, must like ISWTObservable, for bean observables. It would look something like... public interface IBeanObservable { public Object getBean(); public PropertyDescriptor getPropertyDescriptor(); } I still need to think about it a bit but wanted to get a bug logged. Comments are encouraged. [1] http://www.eclipse.org/newsportal/article.php?id=61666&group=eclipse.platform#61666
Yes. This is needed. We had to add this behavior to the old API...
+1 IBeanObservable is not intended to be implemented by clients, right?
(In reply to comment #2) > +1 > > IBeanObservable is not intended to be implemented by clients, right? > Correct. I think I'll need to change my strategy a bit after looking through the code though. Every observable retrieved will be able to expose the PropertyDescriptor but not all have a bean to expose (e.g. maps). Plus we return quite a few types of bean observables: IObservableValue, IObservableList, IObservableSet, and IObservableMap. So I need to think about that a bit because I'm not too fond of exposing 5 new interfaces: IBeanObservable, IBeanObservableValue, IBeanObservableList, IBeanObservableSet, and IBeanObservableMap.
Here's what I'm proposing after speaking with Boris for a bit on the subject... public interface IBeanObservable { public PropertyDescriptor getPropertyDescriptor(); public Object getObserved(); } The implementations returned will implement this interface and when needed the client will have to down cast to it rather than having an interface for every type (e.g. IBeanObservableValue, IBeanObservableList, etc.). The reason for the name of getObserved() and not getBean() is that it won't be a bean in all cases. For example an IObservableMap will be observing an IObservableSet and the detail observables will be observing another observable as well. The only return values that won't implement the interface will be the implementations returned for the observable factories because they're not implementations of IObservable.
FIXED > 20070127. All observables returned from the factory implement IBeanObservable.
VERIFIED in I20070206-0010.