DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page How to Register TableViewer in a Dialog as a Selection Provider
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Nov 2009
Default How to Register TableViewer in a Dialog as a Selection Provider - 11-24-2009, 04:18 PM

I currently have a Dialog that contains a TableViewer which displays rows of data. The TableViewer has a popup menu that has the Copy command contributed to it via the plugin.xml file.

The copy command shows up fine in the popup menu, however it is not enabled correctly. I believe this is because the handler associated with the Copy command contains an "enabledWhen" clause that enables the handler based on the current selection but since my table viewer is in a Dialog, I cannot register my table as a selection provider via getSite().setSelectionProvider(). The Copy command works correctly when I remove the "enabledWhen" clause.

Is there a way to set a TableViewer as a selection provider in the workbench when the TableViewer is located in a Dialog and not a view part (i.e. view or editor)? I need the workbench to know about the selection changes in my Dialog's table viewer so that the commands get updated correctly.

Thanks.
Reply With Quote
Reply

Tags
command, dialog, handler, provider, selection

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Register a Context Menu from a Dialog WhoDat Eclipse 0 11-17-2009 03:08 PM
Multi row selection in TableViewer with Editing Support m_kasid Eclipse 2 06-11-2009 12:22 PM
Property View Label Provider herciu.adrian Eclipse 1 05-19-2009 06:24 AM
Multiple selection in TableViewer jayjamba Eclipse 6 07-22-2008 03:16 AM
Java Service Provider problem island Java 0 03-30-2008 10:39 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com