Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Command in context menu???
Command in context menu??? [message #325837] Thu, 28 February 2008 15:10 Go to next message
Eclipse UserFriend
Originally posted by: nomail.nomail.com

I want to do something very simple: provide the cut/copy/paste-commands
in a context menu of a text widget.

I tried the following (simplified):

MenuManager menu = new MenuManager();
menu.add(ActionFactory.CUT.create(window));
menu.add(ActionFactory.COPY.create(window));
menu.add(ActionFactory.PASTE.create(window));
textWidget.setMenu(menu.createContextMenu(textWidget));

This works until the current selection changed. Then, all three menu
items are disabled. Why?

Any better suggestions?

ftl
Re: Command in context menu??? [message #325840 is a reply to message #325837] Thu, 28 February 2008 15:42 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Those aren't commands, they're actions ... also, they're not the actions
that do any work, they're retargetable actions.

There's an article on workbench actions at
http://www.eclipse.org/articles/ as well as more information in
Help>Help Contents>Platform Plug-in Developer Guide

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:dynamic instanceof
Next Topic:PDE Builder not finding my plugin
Goto Forum:
  


Current Time: Fri Jul 12 08:40:03 GMT 2024

Powered by FUDForum. Page generated in 0.43206 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top