Community
Participate
Working Groups
Eric pointed out that as we move forward with other kinds of life cycle events, there will be a need for several publish methods. (One patch I submitted had the method in ModelServiceImpl where it was used by brintToTop). There are also several "static" kinds of methods being "generated" in UIEvents ... the build methods, and the non lifecycle events themselves come to mind. To make adding these methods easier than pasting in long strings of escaped Java text I suggest that we create a class E4Events.java and make UIEvents.java a subclass of it. Then we can move everything that is not truly generated up from UIEvents into E4Events.
Meh ... While mocking up the shape described above it leads to some unwanted behaviour/refactoring in calling code that revolve around having to access statics from a super class directly. It's kind of wonky and not worth doing, especially since it seems that UIEvent is API now.
Eric had a simple suggestion that, after playing around with it I liked. I propose that we modify GenTopic so that it only outputs the interface definitions for the items generated from the model. It will NOT generate the import statements, copyrights, class definitions, life cycle events or static utility methods and fields. All the non-generated code would just be hand written and left in the file with a comment saying essentially (Copy generated code here). This should work just fine as long as we have no intentions of trying to create a fully automated tool ... which is just fine for us.
We both noticed that when we were adding the 'life cycle' events (bug 357255) that adding 'printf' statements to generate code was 'less than optimal'. Since the current work flow is to run the 'GenTopic' application and manually Copy/Paste the result into the file we'd just need to add the comments to an existing UIEvents file and remove the part of the generator that emits code (adding comments on how to generate what goes between the comments...;-). Dean, you want it, you got it...if you can get me a patch soonest, this has got to be a lob ball after the save perspective stuff...;-).
Created attachment 203900 [details] Change so GenTopic only generates model code Here is a patch so that GenTopic now only generates interface definitions from the model. It does not try to generated class comments, headers, imports, static methods and the like. This patch also includes the new UIEvents.java which has the hand crafted class comments, headers, static build methods etc.
Pushed in >20110823. commit 76e60e7106717654a87cab8926f9e960bcd1b8cd This should make it easier to hand-modify the non-generated code...
Verified on I20111014-1625