javaeclipse-rcpnattable

Table resizing and occupy the space left by vertical scrollbar


I want the table to resize and occupy the space left by vertical scrollbar when I delete the rows.

This is the table with vertical scrollbar:

And when I delete the rows, then I get this the table without vertical scrollbar:

.

I tried using

natTable natTable = new NatTable(panel, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED | SWT.V_SCROLL);

and was working fine but the horizontal scrollbar was not coming even after I tried to set it from the viewportlayer.


Solution

  • First, of course with that code the horizontal scrollbar is not coming, you did not set the style bit to include a horizontal scrollbar. You should leave the default style bits in place and let NatTable do the necessary actions.

    Second, you are not providing enough information on your setup. Are you using percentage sized columns? What are you triggering to delete a row? Is it a custom command or the NatTable default command?

    What I know is that there is an issue with percentage sizing and setting the scrollbar invisible because that does not trigger a resize on the Composite. Feel free to create a ticket so I can have a look at this.