Skip to main content


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 JacobFriend
Messages: 191
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 FauthFriend
Messages: 2902
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 JacobFriend
Messages: 191
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:MultiRowHideCommand
Goto Forum:
  


Current Time: Thu Apr 25 21:01:39 GMT 2024

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

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

Back to the top