Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » IConfiguration initialized multiple times
IConfiguration initialized multiple times [message #1435958] Thu, 02 October 2014 07:30 Go to next message
Michael Heiß is currently offline Michael HeißFriend
Messages: 19
Registered: November 2013
Location: Graz, Austria
Junior Member
Hi,

I recently observed that a configuration is initialized more than once during a single call against NatTable#configure().

Layers that i am using (in that order):
ZoomedDataLayer
ColumnReorderLayer
ColumnHideShowLayer
NatSelectionLayer
ViewportLayer
FreezeLayer
CompositeFreezeLayer

Due to my layer configuration the configure gets called 4 times for the same configuration instance. The duplicate calls are caused by the CompositeFreezLayer as this layer gets the freeze, viewport and selection layer and also calls the configure on those. Is this behavior intended?

Can also be reproduced using the sample application. Add a breakpoint into the DefaultSelectionBindings#configureUiBindings method and open the FreezeExample.

Regards,
Michael
Re: IConfiguration initialized multiple times [message #1436325 is a reply to message #1435958] Thu, 02 October 2014 18:51 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2525
Registered: July 2012
Senior Member
I don't think it is intended, but thinking of the current architecture I understand why it is that way. The ViewportLayer is part of all regions in the CompositeFreezeLayer. And with the mechanism to call configure() of the underlying layers in all regions, configure() is calles in the body layer stack layers multiple times.

Is this an issue somehow? AFAIK it wasn't an issue before.
Re: IConfiguration initialized multiple times [message #1436618 is a reply to message #1436325] Fri, 03 October 2014 06:13 Go to previous messageGo to next message
Michael Heiß is currently offline Michael HeißFriend
Messages: 19
Registered: November 2013
Location: Graz, Austria
Junior Member
We directly register a MouseListener to the underlying widget and that is now done more than once. But that's not a problem i can simply check whether the configuration has already been initialized Smile
Don't know if adding a KeyEventMatcher or a MouseEventMatcher more than once is a trouble for the NatTable itself. But as everything is working fine i assume it's not a problem Smile

[Updated on: Fri, 03 October 2014 06:14]

Report message to a moderator

Re: IConfiguration initialized multiple times [message #1436644 is a reply to message #1436618] Fri, 03 October 2014 07:11 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2525
Registered: July 2012
Senior Member
Why are you registering a MouseListener via NatTable configuration? What kind of listener?

We would need to check whether the configuration is added more than once in the registry. And I agree that this is not perfect the way it is. Maybe we can add a configuration initialized check in general to the layers. But that needs to be tested well to ensure that there are no issues in building up configurations.

Nevertheless thanks for the hint, surely something for improvements. Smile
Re: IConfiguration initialized multiple times [message #1436743 is a reply to message #1436644] Fri, 03 October 2014 10:48 Go to previous message
Michael Heiß is currently offline Michael HeißFriend
Messages: 19
Registered: November 2013
Location: Graz, Austria
Junior Member
This is an older release of our software where we also use an older version of the NatTable. The version that we use there does not have the fix that you did some time ago regarding the context menu that does not always show up when right clicking.
Therefore we decided to simply register a mouse listener to open the context menu instead of doing it with a MouseEventMatcher.
Previous Topic:Different Editor for MULTI_EDIT
Next Topic:change active cell
Goto Forum:
  


Current Time: Sun Nov 19 06:37:08 GMT 2017

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

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