|
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.
|