Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid - using the Selection Service
Grid - using the Selection Service [message #598709] Mon, 30 November 2009 08:05 Go to next message
Michael Lindner is currently offline Michael LindnerFriend
Messages: 10
Registered: November 2009
Junior Member
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 #598715 is a reply to message #598709] Mon, 30 November 2009 12:15 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6488
Registered: July 2009
Senior Member
You need to use a GridViewer and register it in the selection service.

Tom

Michael Lindner schrieb:
> 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 #598718 is a reply to message #598709] Mon, 30 November 2009 15:48 Go to previous messageGo to next message
Michael Lindner is currently offline Michael LindnerFriend
Messages: 10
Registered: November 2009
Junior Member
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...
Re: Grid - using the Selection Service [message #598742 is a reply to message #598709] Tue, 01 December 2009 14:31 Go to previous message
Michael Lindner is currently offline Michael LindnerFriend
Messages: 10
Registered: November 2009
Junior Member
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
Previous Topic:Grid - using the Selection Service
Next Topic:PGroup leak problem
Goto Forum:
  


Current Time: Tue Jul 23 04:50:09 GMT 2019

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

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

Back to the top