From: Larry S. <lst...@ny...> - 2006-01-31 14:55:28
|
Hi Joe, I'm sure I'm missing something unique in your application, but it seems that you are asking about recreating a significant chunk of code, but I don't see why you would need to do so. The AbstractTableMasterForm already creates a GL around the bound property's collection. The current Form instances already handle dealing with individual elements of the collection, so I can't see why you would need to create your own FormModel implementation. As I said, I'm obviously missing something, so maybe you can explain why the existing implementations will not work for you. Thanks, Larry. > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On Behalf Of > Graham, Joseph x66237 > Sent: Monday, January 30, 2006 7:41 PM > To: spr...@li... > Subject: [Springframework-rcp-dev] spring-rich-forms: how to implement > AbstractTableMasterForm using GlazedLists model archetype > > Hello, > I was wondering how i could implement an AbstractTableMasterForm using the > Glazed Lists (GL) model types. For example I have a SortedList type > similar to "IssueList" (in the glazed list examples). I then create an > EventTableModel pipeline using a custom TableFormat type which is then > used to populate a JTable. For now I am only interested in making the > JTable portion of the TableMasterForm happy. These look very close but > without spending any more hours scouring through source for clues I was > hoping someone could give me some clues to stick in my clue-bag on how to > set up a HierFormModel to populate the JTable for this type of form. > > Here is what I have so far: > 1. I subclassed AbstractTableMasterForm (duh) and created a zero-argument > constructor and am planning on passing the HierFormModel object from the > zero-argument (default) constructor. > 2. I subclassed AbstractFormModel (i saw the Default.. subclass but > ignored it, because it implemented Validating...) > 3. To create the ValueModel i subclassed AbstractValueModel. > > My assumptions are as follows: > 1. I write a wrapper around the GL EventList's inner Collection > (ArrayList) type that is actually holding the data. > 2. The form model maps to the "keys" of the array list (i.e. fieldName) > and the ValueModel maps to the values contained therein. > 3. I answer the requests for the keys by returning the ValueModel for the > field by handling either the pre or post? ProcessNewValueModel events? (I > will check the DefaultFormModel for how this is implemented) > 4. I pass this FormModel instance as the HierFormModel parameter in the > AbstractTableMasterForm subclass. > > Right now I have a static array list of a particular class (simple class > with 6 fields) I would like to bind this model to, but later this will > change. > I also wanted to know how I could follow the GL approach for updating the > model concurrently? How could I spawn a daemon thread and update the > underlying HeirFormModel ? > > Any examples or hints would be greatly appreciated. > > Thanks, > Joe Graham |