I have NatTable with column and row headers, and use CornerLayer for it. How to make row and column headers resizable like any other column or row?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You need to register the necessary bindings to the header regions
gridLayer.addConfiguration(new AbstractUiBindingConfiguration() {
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
uiBindingRegistry.registerFirstMouseMoveBinding(
new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 0),
new ColumnResizeCursorAction());
uiBindingRegistry.registerFirstMouseDragMode(
new ColumnResizeEventMatcher(SWT.NONE, GridRegion.ROW_HEADER, 1),
new ColumnResizeDragMode());
uiBindingRegistry.registerFirstMouseMoveBinding(
new RowResizeEventMatcher(SWT.NONE, GridRegion.COLUMN_HEADER, 0),
new RowResizeCursorAction());
uiBindingRegistry.registerFirstMouseDragMode(
new RowResizeEventMatcher(SWT.NONE, GridRegion.COLUMN_HEADER, 1),
new RowResizeDragMode());
}
});