Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Context menus on views
Context menus on views [message #461300] Mon, 08 January 2007 22:54 Go to next message
Eclipse UserFriend
Hi,

A view in my RCP application may consist of multiple table viewers (or
even a combination of table/list/tree viewrs). In all the examples I
have seen so far, there is only one content viewer per view and hence
that viewer is used when registering context menu for the view and
setMenu is called on that viewers control.

What is the best way to register context menus if the view consists of
multiple content viewers?

I made my view implement ISelectionProvider and register as the
selection provider to the site when I call registerContextMenu. The view
also listens to selection changed events from the various content
viewers and propagates the selection to the workbench. But looks like I
need to call setMenu on each of the viewer's control. In some cases I
may not have direct access to the viewer. It may be embedded within
other components/composites. Calling setMenu on the top level composite
that hosts the various content viewers does not seem to work.

I don't want to register multiple menu managers with the site since each
of those should have a different target ID and hence any viewer
contributions made to the view needs to be done as many times as the
number of viewers in the view.

What is the right way to achieve this?

Thanks
Anand

--
____________________________________________________________ ______________________

Anand Narasimhan
anandn@cisco.com
Re: Context menus on views [message #461338 is a reply to message #461300] Tue, 09 January 2007 09:51 Go to previous messageGo to next message
Eclipse UserFriend
I think you have 2 options:

1) ID each context menu separately for each table that you need to use.
Then you are correct, you will have to contribute actions to each
context menu separately.

2) Create multiple menu managers (one for each table), but register them
all with the same ID (but still different selection providers). I think
(although I'm not sure) that means each menu manager will be filled with
the same information.


Later,
PW
Re: Context menus on views [message #461359 is a reply to message #461338] Tue, 09 January 2007 14:27 Go to previous message
Eclipse UserFriend
Paul,

Thanks for the reply. Option# 1 is definitely not something I want to
do. I will try option# 2.

Anand

Paul Webster wrote:
> I think you have 2 options:
>
> 1) ID each context menu separately for each table that you need to use.
> Then you are correct, you will have to contribute actions to each
> context menu separately.
>
> 2) Create multiple menu managers (one for each table), but register them
> all with the same ID (but still different selection providers). I think
> (although I'm not sure) that means each menu manager will be filled with
> the same information.
>
>
> Later,
> PW


--
____________________________________________________________ _________________________

Anand Narasimhan
anandn@cisco.com
Previous Topic:Best place to initialize data?
Next Topic:How to enable the Save-Action
Goto Forum:
  


Current Time: Fri Mar 21 04:35:34 EDT 2025

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

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

Back to the top