Re: event handling with swixml
List for Users of Carlsbad Cubes' Technologies and Products <[email protected]> Tue, 6 Sep 2005 17:32:55 +0200
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
Any thoughts on the topic so far? Well, If any event handling support within descriptor file is against swixml ideology then how about that - could swixml provide some kind of callback api so that when it encounters unknown attribute it allows user's application to handle it? At the moment it just put them as clientProperty to the swing component. Best wishes, Vitali 2005/8/23, Vitali Kiruta <[email protected]>: > Hi, > > I know this question (see subj.) was already raised couple of times > but I would like > to discuss it one more time. > > First let me say that I agree with the statement that we should not do any > scripting in xml file. Personally I don't like the idea of > incorporating BeanShell, Groovy > or any other scripting language into gui descriptor file. swixml > should probably remain > purely declarative language. > > But still would be nice to ease event handling. > > So when I'm talking about adding some feature into framework that > facilitate work > with events I would call this feature 'binding' rather then scripting. > The concept would be in a way similar to the automatic fields mapping > which swixml does now. > Similarly we could have swixml mapping gui events to proper methods in > client's class. For example syntax could look like this: > > <textfield id="myText" keyPressed="handleKeyPressed"/> > or > <label id="myLabel" mousePressed="handleMousePressed" /> > > where myText and myLabel are fields while handleKeyPressed and > handleMousePressed are methods in client object. > > Actually we've implemented this kind of extension in our project and > it serves quite good > so far. In fact it didn't require a lot of coding so adding it to the > siwxml core won't add much complexity to the project. > > I'm sending a patch here. As you can see it has only one extra class > and few lines > added to Parser class. > > I'd be happy if swixml's authors could spare some time to consider the patch. > If you need more examples let me know. > Thanks in advance, > > Vitali > > >