[java-gnome-hackers] GtkBuilder branch
Brought to you by:
afcowie
From: Vreixo F. L. <met...@ya...> - 2011-06-18 13:58:20
|
Hi all! I have created a branch with my approach to expose GtkBuilder, available at: http://research.operationaldynamics.com/bzr/java-gnome/hackers/vreixo/gtkbuilder/ I plan to expose GtkBuilder as an annotation-based way of creating user interfaces, following the approach of Francho Bulgarelli to libglade, submitted several years ago. In fact, my work is mainly an adaptation of Franco's implementation, although I also plan to make some changes. I don't want to follow with my discussion without first thank Franco for his huge contribution. The work in my branch is still in a preliminary stage, but you can already figure out the idea by looking at my code. Please download the branch and focus on org.gnome.gtk.Builder I have added a tiny demo application in doc/examples/builder, NotesDemo.java, that shows the possibilities of an annotation-based approach. Further work will address the signal connection by means of annotation, and many other things. I'm aware of the problems of GtkBuilder and similar approaches (that build user interfaces with an external program and then load them from an XML file), mainly related with the lack of type-safety (and note, however, that the annotation-based approach reduces its impact by detecting the possible problems at load time, without needing to execute all possible code paths). Anyway, this method for creating UI is very common in the java world (they come to my mind web-related frameworks such as JSP/JSTL, Tapestry, GWT's UiBinder, or the mobile Android platform with his layouts). Many java developers use to work this way and, indeed, it has several advantages too. I thus think we should offer support for this way of working in java-gnome, and the annotation-based approach is, in my opinion, the best one. I hope you take a look at the code and tell me your opinions about it, and any idea that could improve it. I'll try to provide a good implementation of GtkBuilder, making it easy for developers by means of the powerful capabilities of the Java platform. But, at the same time, I'll try to reduce as much as possible the limitations of the approach. If any of you have experience with GtkBuilder (I have not), please tell me what are the things you want support for in java-gnome, but also the main problems you've found when working with it, so we can address them the best possible way. Thanks in advance, Best regards Vreixo Formoso |