Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Context menu for table viewer
Context menu for table viewer [message #629265] Mon, 27 September 2010 11:59 Go to next message
Eclipse UserFriend
HI all

I have table viewer i want menu option in context menu or view toolbar to be enabled only when user has selected row in the table else menu option has to disabled when user has not selected any row.

can any one how to implent this ...

Thanks
Ashok
Re: Context menu for table viewer [message #629400 is a reply to message #629265] Tue, 28 September 2010 02:33 Go to previous messageGo to next message
Eclipse UserFriend
On 27.09.2010 17:59, ashok_kumar_rr@yahoo.com wrote:
> HI all
>
> I have table viewer i want menu option in context menu or view toolbar
> to be enabled only when user has selected row in the table else menu
> option has to disabled when user has not selected any row.

Just create a MenuManager as in

http://www.vogella.de/articles/EclipseCommands/article.html# contextmenu

and use the known techniques to contribute/constrain actions/commands
via extension point to the popup menu of this TableViewer.

If you have more than one context menu (popup menu) in your view, you
should create the MenuManager with the constructor that acce3pts a
(unique) id as its second constructor argument and use this ID (instead
of the view ID) as targetID when attempting to add a viewerContribution
when working with actions or when attempting to specify the locationURI
when working with commands.

Don't forget to register as selection provider as shown in above link.

HTH & Greetings from Bremen,

Daniel Krügler
Re: Context menu for table viewer [message #629846 is a reply to message #629265] Wed, 29 September 2010 13:58 Go to previous message
Eclipse UserFriend
Hi

Thanks for reply ...

Its working for the first time..

i have refresh action in my view . when user select refresh button
it clear the table and fetch the data from the database and then load the data to the table at that point of time menu item are not removed/disabled table row is not selected.

any solution for this ???

thanks
ashok

[Updated on: Wed, 29 September 2010 13:59] by Moderator

Previous Topic:eclipse workebench plugin start problem
Next Topic:Optimize TreeViewer refresh()
Goto Forum:
  


Current Time: Sun Jul 06 23:48:22 EDT 2025

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

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

Back to the top