Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Issue with scroll bar for NatTable freeze command(FreezeColumn command ,the horizonatal scroll disappears)
Issue with scroll bar for NatTable freeze command [message #1495631] Tue, 02 December 2014 11:25 Go to next message
Amruta Sardeshmukh is currently offline Amruta SardeshmukhFriend
Messages: 25
Registered: September 2014
Junior Member
Basically I have implemened NatTable on custom panel,the custom panel has been implemented through eclipse plugins.There is FreezeColumn command implemented for freezing the columns.My NatTable has more than 37 columns.The Freeze works well till column 12 but after that if I try to apply freeze command to any of the columns later than that, then the viewport layer suddenly jumps to inital columns of NatTable and the horizontal scroll disappears.

final int colIndex = getColumnIndexByPosition (obj.getColumnPosition());

natTable.doCommand(new FreezeColumnCommand(natTable.getLayer(), colIndex));

Re: Issue with scroll bar for NatTable freeze command [message #1495657 is a reply to message #1495631] Tue, 02 December 2014 11:46 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Possibly related to the ViewportLayer since you are firing a command down the layer stack for a index that might not be visible. Maybe it helps to programmatically scroll prior freezing.
Re: Issue with scroll bar for NatTable [message #1495783 is a reply to message #1495631] Tue, 02 December 2014 14:06 Go to previous messageGo to next message
ambuj bhargava is currently offline ambuj bhargavaFriend
Messages: 19
Registered: July 2014
Junior Member
Hi Dirk

I have implemented the NatTable and it has 15 columns. The issue I am facing is when user clicks on the cell of the Nat Table. The horizontal scroll automatically shifts to extreme left which is quite disturbing.

How to avoid this automatic shifting of the scroll bar.

Regards
Ambuj
Re: Issue with scroll bar for NatTable [message #1495826 is a reply to message #1495783] Tue, 02 December 2014 14:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I don't understand what you mean
Re: Issue with scroll bar for NatTable [message #1495935 is a reply to message #1495826] Tue, 02 December 2014 16:44 Go to previous messageGo to next message
Amruta Sardeshmukh is currently offline Amruta SardeshmukhFriend
Messages: 25
Registered: September 2014
Junior Member
Can you suggest some NATTabel example which I can refer to for programatic scroll
Re: Issue with scroll bar for NatTable [message #1495944 is a reply to message #1495935] Tue, 02 December 2014 16:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
No, there is no such example. But Google helps on this: http://lmgtfy.com/?q=nattable+scroll+programmatically

https://www.eclipse.org/forums/index.php/t/628001/
http://stackoverflow.com/questions/17593049/scroll-nattable-programmatically
Re: Issue with scroll bar for NatTable [message #1495972 is a reply to message #1495935] Tue, 02 December 2014 17:21 Go to previous messageGo to next message
Amruta Sardeshmukh is currently offline Amruta SardeshmukhFriend
Messages: 25
Registered: September 2014
Junior Member
While debugging I have observed in the FreezeHelper.freeze

IUniqueIndexLayer scrollableLayer = viewportLayer.getScrollableLayer();
int originX = bottomRightPosition.columnPosition == scrollableLayer.getColumnCount() - 1 ? scrollableLayer.getWidth() : scrollableLayer.getStartXOfColumnPosition(bottomRightPosition.columnPosition + 1);
int originY = bottomRightPosition.rowPosition == scrollableLayer.getRowCount() - 1 ? scrollableLayer.getHeight() : scrollableLayer.getStartYOfRowPosition(bottomRightPosition.rowPosition + 1);


For problematic condition following are the values for
originX = 1147
originY =0

Could this be the issue.Is there any way where I can set the scrollableLayer to correct position.
Re: Issue with scroll bar for NatTable [message #1495977 is a reply to message #1495972] Tue, 02 December 2014 17:26 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
What is correct? AFAIK this is intended so if a users performs a freeze operation in scrolled state the NatTable shows only the last column(s) of the frozen region. That is how freeze should work. Otherwise what should happen if the freeze region is bigger than the available space to render? The freeze region is not intended to scroll as it should stay per definition.

Of course you can hack by setting the viewportlayer origin manually for programmatic scrolling. For this see the links I posted above.
Re: Issue with scroll bar for NatTable [message #1499704 is a reply to message #1495977] Fri, 05 December 2014 10:47 Go to previous messageGo to next message
Amruta Sardeshmukh is currently offline Amruta SardeshmukhFriend
Messages: 25
Registered: September 2014
Junior Member
I have been able to avoid the scroll bar disappear by adjusting setTopLeftPosition in freeze layer:

freezeLayer.setTopLeftPosition(topLeftPosition.columnPosition, topLeftPosition.rowPosition);
freezeLayer.setBottomRightPosition(bottomRightPosition.columnPosition, bottomRightPosition.rowPosition);

however I would be intrested to reset the vertical scroll bar to extreme left i.e.

I have tried to acheive it with
viewPortLayer.setOriginX and setOriginY but I am not able to exactly identify the X coordinate to reset the scroll bar.

Could you please point me to the correct method to invoke.
Re: Issue with scroll bar for NatTable [message #1500111 is a reply to message #1499704] Fri, 05 December 2014 17:54 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I still don't understand what you are doing and what your issue is. IMHO you are trying to perform an action that can not be performed because it brings NatTable in an inconsistent state. Your "workaround" to set the freeze states afterwards again to some value you think that is correct.

Saying that I can't tell you what you should do or which method you should invoke since IMHO you are doing things you shouldn't do, and I don't know how to doing things wrong.
Previous Topic:Conditional Formatting for values calculated by the IGroupBySummaryProvider
Next Topic:Possible Memory Leak in NatCombo
Goto Forum:
  


Current Time: Tue Mar 09 08:30:58 GMT 2021

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

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

Back to the top