| Summary: | [DataBinding] Support custom getters/setters | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Aaron Digulla <digulla> |
| Component: | UI | Assignee: | Boris Bokowski <bokowski> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P5 | CC: | djo |
| Version: | 3.2 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Aaron Digulla
Is what you are doing backed by the Java Beans specification? Maybe the easiest thing would be to write your own updatable factory for this special case. If collection properties are not language specific, you would only have to write your own version of JavaBeansUpdatableValue. However, before you put a lot of effort into this, I should give you a heads up that we are currently refactoring the framework, so you might want to wait a couple of days until we are done with the refactoring. > Is what you are doing backed by the Java Beans specification? Probably not. I think for Java Beans, your getters must be without arguments. I guess I could solve the problem with an interface but I'd really like a solution where you can register special getters/setters which is not possible with the current framework. OTOH, my current solution lacks flexibility because I can only register my accessor factories globally which means that you'll have them anywhere even if you need something else in one place. > we are currently refactoring the framework What are the chances of accepting my patch after M5? > I guess I could solve the problem with an interface but I'd really like a > solution where you can register special getters/setters which is not possible > with the current framework. This is not possible with the provided BeansUpdatableFactory, but should be possible with a custom updatable factory. > What are the chances of accepting my patch after M5? I would have to look at the patch. In general, we like community involvement! Sorry for the noise, I accidentally clicked a radio button and then Commit instead of just Commit. I'm trying to adjust my patches to your changes. Currently, I'm getting this exception: BindingException: could not find updatable for Property(de.philmanndark.writertool.model.impl.AuthorImpl, content.lcontent().summary, ...) Background: This happens in the details view because nothing in the master is selected. What I don't understand is why it works for "simple" properties (like "name")? Is there some magic when the UpdatableValue is the current selection? Maybe the best solution would be to supply an abstract interface which is used to get and set values out of objects. One way would be the Bean API but that would allow complex ways. The first step in this direction would be to get rid of the property names which show up in a whole lot of places. These make it very hard to exchange the current getter/setter system with something more flexible. I would suggest writing your own factory for observable objects, and use BeansObservables or SWTObservables as an example. I don't believe we should try to solve this within the framework. |