|
From: Jan H. <jh...@sc...> - 2008-01-07 07:42:50
|
I think you see quite clearly. The current implementation does not seem to be easily extensible. You could suggest/implement some enhancements to the class to provide better overriding support. Kind Regards, Jan On Mon, 2008-01-07 at 09:17 +0200, Rogan Dawes wrote: > Hi folks, > > I would like to implement some additional menu items on the > TextComponentPopup menu, that can modify the text in the JTextComponent > in various ways. > > I see that there is an overridable method which *SHOULD* suit my purposes: > > <http://spring-rich-c.svn.sourceforge.net/viewvc/spring-rich-c/trunk/spring-richclient/support/src/main/java/org/springframework/richclient/text/TextComponentPopup.java?view=log> > > protected CommandGroup getEditableCommandGroup() { > CommandGroup editGroup = > getCommandManager().getCommandGroup("textEditMenu"); > if (editGroup == null) { > editGroup = getCommandManager().createCommandGroup( > "textEditMenu", > new Object[] { GlobalCommandIds.UNDO, GlobalCommandIds.REDO, > "separator", GlobalCommandIds.CUT, > GlobalCommandIds.COPY, GlobalCommandIds.PASTE, > "separator", GlobalCommandIds.SELECT_ALL > } > ); > } > return editGroup; > } > > So, in theory, I could just define a "textEditMenu" command group in > commands-context.xml, and have my additional commands show up. However, > I don't see how to get access to the TextComponent in question in my own > commands. The Copy/Paste/etc commands that the TextComponent uses are > all defined as inner classes, and can access the TextComponent in that > way. But how do I get hold of it in my own (non-inner) class? > > Is it some magic about Targetable commands that I am not seeing? > > Thanks > > Rogan > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Springframework-rcp-dev mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev **** DISCLAIMER **** http://www.schaubroeck.be/maildisclaimer.htm |