commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: [digester] setting parent properties after the child's
Date Fri, 01 Dec 2006 23:55:51 GMT
On Fri, 2006-12-01 at 14:58 -0800, Dmitry Beransky wrote:
> Hi,
> 
> I can't figure out how to properly set up rules so that this test does not fail:

[snip] 

> The problem is that the rules above result in roughly the following
> sequence of calls:
> 
>    JMenu menu = new JMenu()
>    JMenuItem item = new JMenuItem();
>    item.setTitle("Copy");
>    Action action = new DefaultEditorKit.CopyAction();
>    item.setAction(action);
> 
> and setting action on a menu item will override previously set text.
> What I need to do is to set the item's text AFTER setting the action:
> 
>    JMenu menu = new JMenu()
>    JMenuItem item = new JMenuItem();
>    Action action = new DefaultEditorKit.CopyAction();
>    item.setAction(action);
>    item.setTitle("Copy");
> 
> any recommendations on how to change digester rules to accomplish that?

The digester FAQ is here:
  http://wiki.apache.org/jakarta-commons/Digester/FAQ

The section titled
  "How do I get CallMethodRule to fire before SetNextRule?"
might be what you need..

Regards,

Simon





---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message