Skip to main content



      Home
Home » Eclipse Projects » NatTable » realizable row header width
realizable row header width [message #1009784] Fri, 15 February 2013 12:55 Go to next message
Eclipse UserFriend
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 02:57 Go to previous messageGo to next message
Eclipse UserFriend
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 05:10 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 19:21:18 EDT 2025

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

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

Back to the top