event handling with swixml

View: New views
4 Messages — Rating Filter:   Alert me  

event handling with swixml

by Carlsbad Cubes mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


_______________________________________________
Forum mailing list
Forum@...
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com

.diff (16K) Download Attachment

Re: event handling with swixml

by Carlsbad Cubes mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <kiruta@...>:

> 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
>
>
>

_______________________________________________
Forum mailing list
Forum@...
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com

Re: event handling with swixml

by Carlsbad Cubes mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I want to inform you that SwiXAT (a complete and free MVC framework based on SwiXML - http://www.swixat.org) has addressed and resolved this problem by adopting the following syntax:

<TextField id="myText" ...>
   <MouseEvents id="mouse" onClicked="actionOne" onDblClicked="actionTwo"/>
   <FocusEvents id="focus" onFocusGained="actionThree" .../>
   ...
</TextField>

It's possible to handle a lot of events, as, for example:
<MouseEvents>, <FocusEvents>, <KeyEvents>, <PropertyChangeEvents>, <ComponentEvents>, <MouseWheelEvents>, etc...

The execution of the actions can be delegated either to script code (BeanShell and Groovy languages supported) or to compiled java classes.
Anyway, the script code must be written OUTSIDE the gui descriptor file, because by design we do not allow to mix XML and JavaScript code.

The above features are actually available only in the CVS, but within the end of this week the next official version (0.4.5) will be released, along with the complete documentation about all these new features.

Regards
Paolo Marrone


----- Original Message -----
From: "List for Users of Carlsbad Cubes' Technologies and Products" <Forum@...>
To: Forum@...
Subject: Re: [Forum] event handling with swixml
Date: Tue, 6 Sep 2005 17:32:55 +0200

>
> 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 <kiruta@...>:
> > 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
> >
> >
> >
>
> _______________________________________________
> Forum mailing list
> Forum@...
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com



Paolo Marrone


--



_______________________________________________
Forum mailing list
Forum@...
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com

Re: event handling with swixml

by Carlsbad Cubes mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the note.
I think I'll give it a try.

Cheers,
Vitali

2005/9/6, List for Users of Carlsbad Cubes' Technologies and Products
<Forum@...>:

> Hi,
> I want to inform you that SwiXAT (a complete and free MVC framework based on SwiXML - http://www.swixat.org) has addressed and resolved this problem by adopting the following syntax:
>
> <TextField id="myText" ...>
>    <MouseEvents id="mouse" onClicked="actionOne" onDblClicked="actionTwo"/>
>    <FocusEvents id="focus" onFocusGained="actionThree" .../>
>    ...
> </TextField>
>
> It's possible to handle a lot of events, as, for example:
> <MouseEvents>, <FocusEvents>, <KeyEvents>, <PropertyChangeEvents>, <ComponentEvents>, <MouseWheelEvents>, etc...
>
> The execution of the actions can be delegated either to script code (BeanShell and Groovy languages supported) or to compiled java classes.
> Anyway, the script code must be written OUTSIDE the gui descriptor file, because by design we do not allow to mix XML and JavaScript code.
>
> The above features are actually available only in the CVS, but within the end of this week the next official version (0.4.5) will be released, along with the complete documentation about all these new features.
>
> Regards
> Paolo Marrone
>
>
> ----- Original Message -----
> From: "List for Users of Carlsbad Cubes' Technologies and Products" <Forum@...>
> To: Forum@...
> Subject: Re: [Forum] event handling with swixml
> Date: Tue, 6 Sep 2005 17:32:55 +0200
>
> >
> > 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 <kiruta@...>:
> > > 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
> > >
> > >
> > >
> >
> > _______________________________________________
> > Forum mailing list
> > Forum@...
> > http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
>
>
> Paolo Marrone
>
>
> --
>
>
>
> _______________________________________________
> Forum mailing list
> Forum@...
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>

_______________________________________________
Forum mailing list
Forum@...
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com