Skip to main content



      Home
Home » Eclipse Projects » NatTable » Resize one column when selected all rows
Resize one column when selected all rows [message #1727579] Thu, 24 March 2016 03:39 Go to next message
Eclipse UserFriend
When I select all rows, then resize one column width, all column width resized, is it the right behavior? Or, is there any solution to help me only resize one column with when selected all rows? Please see Setp_3.png
  • Attachment: Step_3.png
    (Size: 131.26KB, Downloaded 239 times)
Re: Resize one column when selected all rows [message #1727582 is a reply to message #1727579] Thu, 24 March 2016 04:28 Go to previous messageGo to next message
Eclipse UserFriend
When you select all rows it also means you select all columns. You basically perform a select all. If you select multiple columns (full column selection) a resize is intended to resize all fully selected columns.

Quote:
is it the right behavior?


From my understanding it is.

Quote:
is there any solution to help me only resize one column with when selected all rows?


That behavior is implemented in SelectionLayer#handleColumnResizeCommand(ColumnResizeCommand). If you expect a different behavior feel free to extend SelectionLayer and do whatever you expect that should happen.
Re: Resize one column when selected all rows [message #1727584 is a reply to message #1727582] Thu, 24 March 2016 04:45 Go to previous messageGo to next message
Eclipse UserFriend
Thanks
Re: Resize one column when selected all rows [message #1730772 is a reply to message #1727582] Thu, 28 April 2016 07:50 Go to previous message
Eclipse UserFriend
Dirk Fauth wrote on Thu, 24 March 2016 08:28
When you select all rows it also means you select all columns. You basically perform a select all. If you select multiple columns (full column selection) a resize is intended to resize all fully selected columns.

Quote:
is it the right behavior?


From my understanding it is.


hmmm...
as we had the same issue a few weeks ago, I compared the NatTable behavior to Excel behavior.

While Excel can decide, whether a column is fully selected or all data rows are selected, NatTable cannot. It's quiet irritating, when you use a NatGridLayerPainter with full row selection and having a few rows only, so the NatTable gets "filled" with empty rows.

If you select all rows, there are still the empty rows, rendered by NatGridLayerPainter, that are not selected. But when you change a single column width, NatTable changes all the available columns to the same width, as all available data rows are selected Wink

When selecting all data rows in Excel - leaving the empty rows unselected - and changing a single column, only the single column will resize.


Dirk Fauth wrote on Thu, 24 March 2016 08:28
Quote:
is there any solution to help me only resize one column with when selected all rows?


That behavior is implemented in SelectionLayer#handleColumnResizeCommand(ColumnResizeCommand). If you expect a different behavior feel free to extend SelectionLayer and do whatever you expect that should happen.


We solved this by simply delegating the ColumnResizeCommand to the underlying layer in our own SelectionLayer implementation.

    @Override
    protected boolean handleColumnResizeCommand (ColumnResizeCommand pCommand)
    {
        return underlyingLayer.doCommand (pCommand);
    }


Markus
Previous Topic:Columns are not editable
Next Topic:Can I add an icon in RowHeader in NatTable ?
Goto Forum:
  


Current Time: Sat Jun 21 03:19:51 EDT 2025

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

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

Back to the top