Re: parameters for actions?

<[email protected]> Wed, 26 Jan 2005 10:00:05 +0100
Newsgroups gmane.comp.embedded.carlsbad-cubes
Organization http://freemail.web.de/
Message-ID <[email protected]>
List for Users of Carlsbad Cubes' Technologies and Products <[email protected]> schrieb am 26.01.05 02:31:18:
> 
> When I started looking at actions in SWIXML, I was thinking that the
> specified action would be a method and the syntax of the XML would allow
> for specifying parameters to that method.  

Hi,

besides the "commmand" for a (e.g.) button which you may 
access via actionEvent.getActionCommand() there are no
parameters.

> 
> It appears that the specified action is always a class, not a method
> (please correct me if I'm wrong).  If this is true, how can I specify

The "action" attribute always specifies a public field in the object
given to the SwingEngine constructor or in the class SwingEngine is
derived from.

> what parameters this action should look for when it responds to it's
> associated event? Does the action class need to be written in a way
> where it is expecting to find certain values of widgets through the
> component hierarchy?  The examples seem to perform very basic actions,
> and don't use any parameters or components in their methods, so they are
> not helping me very much. 

What is your goal? Write a huge actionPerformed() method switching over
the possible parameters it received? Why not write them seperatly as 
Actions in the first place? Or even as standalone classes using initclass?
So you may activate them at your wish and don't need to change the 
code checking your parameters if you do not need a certain business
logic anymore.

Frank

> 
> 
> I don't want to get into comparing XMLGUI frameworks, but since I see
> occasional references to Thinlet which gives me the impression that many
> on this forum are also familiar with Thinlet, I want to use Thinlet as
> an example.  In Thinlet, it appears that actions are tied to methods,
> and you can specify parameters for those methods.  I guess this was more
> of what I was expecting to see when looking at SWIXML. 
> 
> Any information on this subject will help me alot!  Thanks. 
> 
>  
> 
> 
> 
> 
> _______________________________________________
> Forum mailing list
> [email protected]
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com