Home » Eclipse Projects » NatTable » Row headers column vertical resize possibility(nattable configuration)
Row headers column vertical resize possibility [message #1114981] |
Mon, 23 September 2013 09:55  |
Eclipse User |
|
|
|
How can I make the row headers column - in my case it's the RowHeaderLayer - to be able to be resized vertically by user (not autoresized)?
The was no such example in the nattable examples, in all examples the row header column resize possibility was blocked.
I tried to set:
dataLayer.setColumnPositionResizable(0, true);
but it didn't work.
Best regards
Wojtek
|
|
|
Re: Row headers column vertical resize possibility [message #1115042 is a reply to message #1114981] |
Mon, 23 September 2013 11:13   |
Eclipse User |
|
|
|
Never tried it before, but I guess you need to register the corresponding bindings to the row header similar to the DefaultColumnResizeBindings. Might look like this:
public class MyRowHeaderResizeBindings extends AbstractUiBindingConfiguration {
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
// Mouse move - Show resize cursor
uiBindingRegistry.registerFirstMouseMoveBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 0), new ColumnResizeCursorAction());
uiBindingRegistry.registerMouseMoveBinding(new MouseEventMatcher(), new ClearCursorAction());
// Column resize
uiBindingRegistry.registerFirstMouseDragMode(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1), new ColumnResizeDragMode());
uiBindingRegistry.registerDoubleClickBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1), new AutoResizeColumnAction());
uiBindingRegistry.registerSingleClickBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1), new NoOpMouseAction());
}
}
That configuration then needs to be added to the NatTable before calling configure().
|
|
|
Re: Row headers column vertical resize possibility [message #1128083 is a reply to message #1115042] |
Mon, 07 October 2013 06:11  |
Eclipse User |
|
|
|
This is exactly, what I wanted. Thank you Dirk.
Actually, I've added those bindings as a configuration to the corner layer, to make the resize possible also for the corner cell, not only for the row headers.
I've also registred the corner regions like this:
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
// Mouse move - Show resize cursor
uiBindingRegistry.registerFirstMouseMoveBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 0), new ColumnResizeCursorAction());
uiBindingRegistry.registerFirstMouseMoveBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.CORNER, 0), new ColumnResizeCursorAction());
uiBindingRegistry.registerMouseMoveBinding(new MouseEventMatcher(), new ClearCursorAction());
// Column resize
uiBindingRegistry.registerFirstMouseDragMode(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1), new ColumnResizeDragMode());
uiBindingRegistry.registerFirstMouseDragMode(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.CORNER, 1), new ColumnResizeDragMode());
uiBindingRegistry.registerDoubleClickBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1), new AutoResizeColumnAction());
uiBindingRegistry.registerSingleClickBinding(new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1), new NoOpMouseAction());
}
Regards,
Wojtek
[Updated on: Mon, 07 October 2013 06:14] by Moderator
|
|
|
Goto Forum:
Current Time: Mon Jul 14 13:11:31 EDT 2025
Powered by FUDForum. Page generated in 0.07555 seconds
|