Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Including "standard" actions in popups (context menus)
Including "standard" actions in popups (context menus) [message #42452] Wed, 21 May 2003 12:43 Go to next message
Eclipse UserFriend
Originally posted by: daniel_nospam.enigmatec.net

Hi there,

I'm developing a view to act as a specialised resource navigator over
project resources in our plug in.

As part of this development I'd like to provide the "standard" actions you
see in context menus in other views such as the Resource Navigator and the
JDT Package Explorer. Such actions are the "New..." (which leads to a
submenu), "Open" etc. Obviously as well as displaying the actions I'd want
the action itself to be handed of to the "default" handler (whatever that
is).

I assumed it'd be an easy matter of adding a specific GroupMarker to the
menu from the IWorkbenchActionConstants interface but I've had no luck - no
errors but nothing shows up. Obviously I do this when the menuAboutToShow()
method is run.

I've had a look at how the JDT does it but it's rather complex. Is there an
easy way of accomplishing this?

Thanks, Dan
Re: Including "standard" actions in popups (context menus) [message #44380 is a reply to message #42452] Thu, 22 May 2003 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

The ResourceNavigator creates a MainActionGroup that creates subgroups with actions for the context menu, workbench menus, toolbar
etc.
If you subclass from ResourceNavigator you should get the default menu. Unfortunately there is no good way to customize this other
than adding actions to the MB_ADDITIONS group. If you want to do more you have to copy the MainActionGroup.

One 3.0 plan item is to make the Navigator easier to customize and most importantly reduce the need for specialized Navigator style
views. Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=36961 and add a description of your use case and what you would need
to customise in the existing Navigator. Do you see a real need for a separate view or could you use the regular Navigator if it had
better ways to tailor it to your content, actions etc.

Knut
"Dan Gravell" <daniel_nospam@enigmatec.net> wrote in message news:Xns9382B43D24790danielnospamenigmate@204.138.98.10...
> Hi there,
>
> I'm developing a view to act as a specialised resource navigator over
> project resources in our plug in.
>
> As part of this development I'd like to provide the "standard" actions you
> see in context menus in other views such as the Resource Navigator and the
> JDT Package Explorer. Such actions are the "New..." (which leads to a
> submenu), "Open" etc. Obviously as well as displaying the actions I'd want
> the action itself to be handed of to the "default" handler (whatever that
> is).
>
> I assumed it'd be an easy matter of adding a specific GroupMarker to the
> menu from the IWorkbenchActionConstants interface but I've had no luck - no
> errors but nothing shows up. Obviously I do this when the menuAboutToShow()
> method is run.
>
> I've had a look at how the JDT does it but it's rather complex. Is there an
> easy way of accomplishing this?
>
> Thanks, Dan
Re: Including "standard" actions in popups (context menus) [message #44963 is a reply to message #44380] Fri, 23 May 2003 03:58 Go to previous message
Eclipse UserFriend
Originally posted by: daniel_nospam.enigmatec.net

"Knut Radloff" <knut_radloff@oti.com> wrote in
news:baj493$3q3$1@rogue.oti.com:
Thanks for the reply Knut.

In the end yesterday I solved this myself, but I can see where you're
coming from when you say merely extend the ResourceNavigator. The issue
there is that I've used this project as a tutorial into Eclipse development
so I've been walking a winding path to my destination, if you will.

In the end I actually solved it with reference to the Package Explorer in
the JDT, which I've used as my model of development a lot so far as there
is some shared functionality.

What I have is an ActionGroup specialisation which handles the filling of
context menus etc. The ActionGroups children then delegate to the core
Eclipse Actions such as New... Open etc.

Again, thanks for your time, Dan

> The ResourceNavigator creates a MainActionGroup that creates subgroups
> with actions for the context menu, workbench menus, toolbar etc.
> If you subclass from ResourceNavigator you should get the default
> menu. Unfortunately there is no good way to customize this other than
> adding actions to the MB_ADDITIONS group. If you want to do more you
> have to copy the MainActionGroup.
>
> One 3.0 plan item is to make the Navigator easier to customize and
> most importantly reduce the need for specialized Navigator style
> views. Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=36961
> and add a description of your use case and what you would need to
> customise in the existing Navigator. Do you see a real need for a
> separate view or could you use the regular Navigator if it had better
> ways to tailor it to your content, actions etc.
>
> Knut
Previous Topic:plug-in works fine in Run-time Workbench, gets NoClassDefFoundError when installed in the workbench
Next Topic:Threads and Monitors view does not work...
Goto Forum:
  


Current Time: Tue Jul 22 12:56:12 EDT 2025

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

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

Back to the top