Grid - using the Selection Service [message #500894] |
Mon, 30 November 2009 03:05  |
Eclipse User |
|
|
|
Hello,
I'm new to Nebula and RCP and my problem is that I don't know how to use the Grid with the RCP Selection Service.
In my RCP Application i have a view with a grid - but how can i get the current selection of the grid so i can use it in my command handlers?
|
|
|
|
|
|
Re: Grid - using the Selection Service [message #501208 is a reply to message #500894] |
Tue, 01 December 2009 09:31  |
Eclipse User |
|
|
|
Thank you for your help
I think I understand the concepts of the JFace viewer so far, but I don't want to create my own DomainObjects but instead use the standard GridItems.
Or are they not supported by the GridTreeViewer?
It is clear now that I have to use the setInput() Method instead of interfacing with the underlying control.
Michael
|
|
|
Re: Grid - using the Selection Service [message #598725 is a reply to message #500993] |
Mon, 30 November 2009 20:59  |
Eclipse User |
|
|
|
Whenever using a viewer you should not interface with the underlying
control but using LabelProvider and ContentProviders.
You need to get familiar with JFace concepts.
Tom
Michael Lindner schrieb:
> Ok I tried to use a GridTreeViewer and my view looks like this:
>
> viewer = new GridTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL
> | SWT.V_SCROLL);
> GridColumn column = new GridColumn(viewer,SWT.NONE);
> column.setWidth(200);
> column.setText("foo");
> column.setTree(true);
> GridColumn column2 = new GridColumn(viewer,SWT.None);
> column2.setWidth(200);
> column2.setText("bar");
>
> viewer.setContentProvider(new MyContentProvider());
> viewer.getGrid().setHeaderVisible(true);
>
> Now I add GridItems to the viewer
>
> GridItem item1 = new GridItem(viewer.getGrid(),SWT.NONE);
> GridItem item2 = new GridItem(item1,SWT.NONE);
>
>
> When I run the application the Rootelement(item1) is displayed with a
> plus, but when I klick on the plus nothing happens...
|
|
|
Powered by
FUDForum. Page generated in 0.03882 seconds