|
From: Jim M. <moo...@gm...> - 2008-07-15 01:35:17
|
Arne, I considered something like that, but the kicker was the need for a
getComponent() method for Views. Since there's no reasonable way (I could
come up with) to do that without implementing an interface, Views may as
well use interfaces and inheritance. Besides, @View(externalCommands =
{"ext1", "ext2"}) feels too much like trying to "program" with annotation
rather than letting them just provide meta-data. If someone can show me a
reasonable way to do getComponent() via annotations that isn't more of a
hassle/confusing than an interface, then I'd love to make them "pure POJOs".
On Mon, Jul 14, 2008 at 2:15 PM, Arne Limburg <Arn...@ar...> wrote:
> 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
> >
>
>
> -------------------------------------------------------------------------
> 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
>
|