Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » realizable row header width
realizable row header width [message #1009784] Fri, 15 February 2013 17:55 Go to next message
Martin Jacob is currently offline Martin Jacob
Messages: 116
Registered: July 2009
Senior Member
Hi all,

is there a way to make the row header width realizable by the user? I know how to set the row header
with but then its fixed.

The row header layer as is at the moment.

public RowHeaderLayerStack(IDataProvider dataProvider, BodyLayerStack pBodyLayer) {
DataLayer dataLayer = new DataLayer(dataProvider, 200, 20);
dataLayer.setColumnsResizableByDefault(true);
RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(dataLayer, pBodyLayer,
pBodyLayer.getSelectionLayer());
setUnderlyingLayer(rowHeaderLayer);
}

But setColumnsResizableByDefault() does not have an effect.

any hints are appreciated, Martin
Re: realizable row header width [message #1010768 is a reply to message #1009784] Mon, 18 February 2013 07:57 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1301
Registered: July 2012
Senior Member
Hi,

what do you mean with realizable? Or do you mean resizable?

If you want to make your RowHeader resizable in terms of cell width you need to register the ui bindings for that. Have a look at the DefaultColumnResizeBindings to see what bindings that are.

Hope that helps,
Dirk
Re: realizable row header width [message #1010836 is a reply to message #1010768] Mon, 18 February 2013 10:10 Go to previous message
Martin Jacob is currently offline Martin Jacob
Messages: 116
Registered: July 2009
Senior Member
Hi Dirk,

yah sorry for the typo. I mean resizeable ...

Your solution works great! Thanks. I just changed the GridRegion to ROW_HEADER and add the
configuration to the table.

natTable.addConfiguration(new AbstractUiBindingConfiguration() {

@Override
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());
}
});

Martin


schrieb Dirk Fauth, Am 18.02.2013 08:57:
> Hi,
>
> what do you mean with realizable? Or do you mean resizable?
>
> If you want to make your RowHeader resizable in terms of cell width you need to register the ui
> bindings for that. Have a look at the DefaultColumnResizeBindings to see what bindings that are.
>
> Hope that helps, Dirk
Previous Topic:Lazy Loading / Paging
Next Topic:Custom IConfigLabelAccumulator gets same row positions even after scrolling the table
Goto Forum:
  


Current Time: Thu Oct 02 08:28:54 GMT 2014

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

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