[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] Re: Linking View vs Editor(ISelectionProvider ISelectionListener)
|
Hi!
Well your code is nice. But I`d like to have 'more' decopled code than yours. Here, reference to that TableViewer is - tight coupling. As I understood Eclipse can provide mechanism for Listening for whole Views. As I understand it must look something like this
<code>
class TableView extends ViewPart (implements ???) {
private TableViewer tableViewer;
...
private void createTable() {
...
this.getSite().setSelectionProvider(tableViewer);
}
...
}
class SomeApplicationClass implements ISelectionListener {
public void selectionChanged(IWorkbenchPart part, ISelection incoming) {
// Selection containing elements
if (incoming instanceof IStructuredSelection) {
selection = (IStructuredSelection) incoming;
id (selection instanceof TableView) {
/* do whatever you want with the selection which contains selected table-elements */
}
}
}
But I just missing something, this doesn`t work.
--
View in EZ forum: http://www.eclipsezone.com/eclipse/forums/m91954282.html