Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Command Framework in custom editor
Command Framework in custom editor [message #334648] Mon, 23 February 2009 09:26 Go to next message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

I have build a custom editor (based on a TreeViewer) with a context menu
that is currently generated programatically. After converting some other
part of my code to use the command framework, I'd like to use the
command framework in my editor as well. However I was unable to find any
information, as to how I might declaratively specify the commands.
Documentation on ECF appears to be a bit thin anyway (one wiki page that
I know of). Where can I look for further reading about context menus in
custom editors?

As an added complication: there is one submenu that has to be created
programmatically at runtime (using model data). Can this be achieved
when using ECF?

Regards
Damian Philipp
Re: Command Framework in custom editor [message #334660 is a reply to message #334648] Mon, 23 February 2009 19:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Damian Philipp wrote:
> Hello,
>
> I have build a custom editor (based on a TreeViewer) with a context menu
> that is currently generated programatically. After converting some other
> part of my code to use the command framework, I'd like to use the
> command framework in my editor as well. However I was unable to find any
> information, as to how I might declaratively specify the commands.

There are a couple of wiki's mentioned in my sig, plus examples in the
org.eclipse.ui.examples.contributions plugin (available in cvs
:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse )

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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Command Framework in custom editor [message #334672 is a reply to message #334660] Tue, 24 February 2009 10:12 Go to previous message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

thank you for your reply.

Paul Webster schrieb:
> There are a couple of wiki's mentioned in my sig,

I have seen those sites already. They were very helpful in integrating
commands in other popup menus (namely that of the Project Explorer).

But they don't say anything about how to get popup menus working on
custom parts.

> plus examples in the
> org.eclipse.ui.examples.contributions plugin (available in cvs
> :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse )

This on the other hand was very helpful. For future reference, the
following code enabled PCF popup menus on the viewer in my editor:

MenuManager contextMenu = new MenuManager();
contextMenu.setRemoveAllWhenShown(true);

getSite().registerContextMenu(contextMenu, viewer);
Control control = viewer.getControl();
Menu menu = contextMenu.createContextMenu(control);
control.setMenu(menu);

Perhaps this could be added to the wiki?

Now there is just one other problem - other plugin contributions are
showing up on my editor, where it just doesn't make any sense. Example:
How do you create a "Run configuration" for a string that you are about
to translate?

Oh well, after all this digging I might just have to go back to
programatically creating actions.

But thanks to you anyway!
Regards
Damian Philipp
Previous Topic:How do I find new Extension Points?
Next Topic:How do I activate the Quick Fix command in a context menu?
Goto Forum:
  


Current Time: Thu Apr 18 16:08:45 GMT 2024

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

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

Back to the top