|
From: Peter De B. <pet...@gm...> - 2008-07-16 08:15:31
|
On Mon, Jul 14, 2008 at 4:58 PM, Jim Moore <moo...@gm...> wrote:
> It might work, but I was thinking about being able to do something like:
>
> AppWindow.buildMenuBar() {
> List<Command> cmds = getCurrentView().getCommands();
> //...
> }
>
> Which you wouldn't be able to do lazily unless there was something that
> registered the list of everything that the view would want ahead of time.
>
> How about this compromise?
>
> @View class SampleView {
> @Command public void cmd1() { ... }
> @Command public void cmd2() { ... }
> protected List<String> getCommandNames() { ... }
> }
>
> where initCommands(..) returns back the commands that are defined in the
> class or its ancestors, along with any commands that are defined in
> getCommandNames() for "external" commands. Even do some automatic
> namespacing for the commands in the class, like "sampleView.cmd1".
>
> Obviously there still needs to be a command decorator that sets the icon,
> description, etc. on the Command instances from properties files and/or the
> information in the @Command annotation...
>
The command decorator you're talking about is the next thing on my list: a
bunch of custom BeanPostProcessors that handle injection of these resources
(label, title, tooltip, icon, ...).
These infrastructure classes are also needed for
applications/views/dialogs/...
>
> -Jim Moore
>
>
>
> On Mon, Jul 14, 2008 at 4:56 AM, Peter De Bruycker <
> pet...@gm...> wrote:
>
>> Some more thoughts:
>>
>> I think you need to get rid of the AbstractView.getCommandNames method.
>> It's another method you need to update when adding a new command. The
>> createButton method should lazily fetch command instances when needed,
>> possibly caching them somewhere.
>>
>> wdyt?
>>
>> Peter
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Springframework-rcp-dev mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev
>
>
|