Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » No selection without CompositeLayer?
No selection without CompositeLayer? [message #1046733] Mon, 22 April 2013 09:42 Go to next message
Joachim Fuchs is currently offline Joachim FuchsFriend
Messages: 34
Registered: February 2013
Member
Hi,

there seems to be an unexpected difference between

...
ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
natTable = new NatTable(parent, viewportLayer , false);
...


and

...
ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
CompositeLayer compositeLayer = new CompositeLayer(1, 1);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 0);
natTable = new NatTable(parent, natLayer, false);
...


To my surprise only the version with the composite layer results in a table that reacts on mouseclicks (selection and editing). Why is that? am I missing some important point?

As far as I understand the com[posite layer it is only responsible for composing a table from different layers. Right?

There is some
compositeLayer.registerCommandHandler(new EditCellCommandHandler());
compositeLayer.registerEventHandler(new InlineCellEditEventHandler(compositeLayer));

but if I apply all this to the viewportlayer it does not make a difference.

Thanks for your help.

J
Re: No selection without CompositeLayer? [message #1046744 is a reply to message #1046733] Mon, 22 April 2013 10:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
The difference is this:

Quote:
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 0);


which adds the GridRegion.BODY region label which gets interpreted by handlers etc.
Re: No selection without CompositeLayer? [message #1046768 is a reply to message #1046744] Mon, 22 April 2013 10:44 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
To be more precise, in the DefaultEditBindings the mouse action bindings are registered against the GridRegion.BODY label. You need to adjust this to make the bindings work.
Re: No selection without CompositeLayer? [message #1046777 is a reply to message #1046768] Mon, 22 April 2013 10:57 Go to previous messageGo to next message
Joachim Fuchs is currently offline Joachim FuchsFriend
Messages: 34
Registered: February 2013
Member
In other words the DefaultEditBindings expect the cells to be labelled as GridRegion.BODY which could be achieved by a) adding this label manually or b) customizing the bindings? I understand that. But in the case described above there was no way to select a cell nor to expand/collapse a tree node. The selection related code was the same in both cases.
Re: No selection without CompositeLayer? [message #1046781 is a reply to message #1046777] Mon, 22 April 2013 11:03 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
The same applies for the selection. Have a look at the DefaultSelectionBindings.

We work around that issue usually by applying the region label to the ViewportLayer like this

viewportLayer.setRegionName(GridRegion.BODY);


We will look at this in our future architecture. But for now this should solve your issues.
Re: No selection without CompositeLayer? [message #1046787 is a reply to message #1046781] Mon, 22 April 2013 11:12 Go to previous message
Joachim Fuchs is currently offline Joachim FuchsFriend
Messages: 34
Registered: February 2013
Member
Yes it does. Thank you for clarifying this.
Previous Topic:Problem in PercentageSizingExample
Next Topic:Viewport merge - testers needed!
Goto Forum:
  


Current Time: Tue Mar 19 03:09:58 GMT 2024

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

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

Back to the top