Community
Participate
Working Groups
Created attachment 136210 [details] Patch against HEAD of project org.eclipse.jface.examples.databinding Submitting a new JFace DataBinding snippet that demonstrates binding a ComboViewer to a Java enum. This patch changes the org.eclipse.jface.examples.databinding project to be Java 1.5 dependent.
This patch introduces a new dependency on J2SE 1.5, which in turn causes over 300 new compiler warnings due to generics. The snippet itself is good, I'm just not sure we want to introduce a 1.5 dependency when none of the other snippets require it. Maybe comment out the enum and put a Java 1.4-friendly equivalent in its place? e.g. class Person { public static final Person Male = new Person("Male"); public static final Person Female = new Person("Female"); public static final Person Unknown = new Person("Unknown"); private final String name; private Person(String name) { this.name = name; } public String toString() { return name; } public static Person[] values() { return new Person[] { Male, Female, Unknown }; } }
Not too late for RC3 since this patch is for non-production code.
I would like to see us start using 1.5 in the snippets. I imagine how to bind using enum types is a common question that clients have. How about we move to 1.5 but turn off the warnings for now?
Would you like a patch that eliminates the warnings? It's usually not too much work with Quick Fix, and I have some time on my hands thee days...
No need, I disabled two compiler options for generics and all the warnings went away. I plan to commit that change along with the patch. Boris, +1?
+1 from me.
Released to HEAD > 20090522
Thanks for the patch!
I've updated http://wiki.eclipse.org/JFace_Data_Binding/Snippets#Viewers to include the new snippet.