|
From: Arne L. <Arn...@ar...> - 2008-07-14 18:15:19
|
Hi Jim,
what about something like this:
@View(externalCommands = {"ext1", "ext2"})
public class SampleView {
}
Regards,
Arne
Jim Moore schrieb:
> 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...
>
> -Jim Moore
>
>
> On Mon, Jul 14, 2008 at 4:56 AM, Peter De Bruycker
> <pet...@gm... <mailto: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
>
|