我有带有列和行标题的 NatTable,并为此使用 CornerLayer。如何使行和列标题像任何其他列或行一样可调整大小?
问问题
555 次
1 回答
1
您需要将必要的绑定注册到标题区域
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());
}
});
于 2016-07-29T08:24:49.090 回答