|
|
Re: Selecting the entire row [message #1403566 is a reply to message #1403245] |
Thu, 24 July 2014 12:39 |
Panisha RN Messages: 43 Registered: May 2013 |
Member |
|
|
Thanks for the reply. It worked.
Now i have a another problem where in i have to select the entire row on right click.
I tried
natTable.getUiBindingRegistry().registerMouseDownBinding(MouseEventMatcher.bodyRightClick(SWT.NONE), new SelectRowAction());
It does not call the action all.
Also tried this one.
uiBindingRegistry.registerFirstMouseDownBinding(new MouseEventMatcher(SWT.NONE, GridRegion.BODY, MouseEventMatcher.RIGHT_BUTTON), new IMouseAction()
{
ViewportSelectRowAction selectRowAction = new ViewportSelectRowAction(false, false);
@Override
public void run(NatTable natTable, MouseEvent event)
{
int rowPosition = LayerUtil.convertRowPosition(natTable, natTable.getRowPositionByY(event.y), selectionLayer);
if (!selectionLayer.isRowPositionSelected(rowPosition))
{
selectRowAction.run(natTable, event);
}
}
});
}
Run method itself doesnot get called.
Can someone help me.
|
|
|
|
Re: Selecting the entire row [message #1403585 is a reply to message #1403572] |
Thu, 24 July 2014 13:52 |
Panisha RN Messages: 43 Registered: May 2013 |
Member |
|
|
It works but another question.
If i have mutiple Mouse event binding registered how does it work?
Eg i have some thing like following:
natTable.addConfiguration(new AbstractUiBindingConfiguration()
{
public void configureUiBindings(UiBindingRegistry uiBindingRegistry)
{
uiBindingRegistry.registerFirstMouseDownBinding(new MouseEventMatcher(SWT.NONE, GridRegion.BODY, MouseEventMatcher.RIGHT_BUTTON), new
PopupMenuAction(bodyMenu));
uiBindingRegistry.registerFirstSingleClickBinding(new MouseEventMatcher(SWT.NONE, GridRegion.BODY, MouseEventMatcher.RIGHT_BUTTON), new IMouseAction()
{
@Override
public void run(NatTable natTable, MouseEvent event)
{
int rowPosition = LayerUtil.convertRowPosition(natTable,
natTable.getRowPositionByY(event.y), selectionLayer);
System.out.println("Position is " + rowPosition);
}
});
}
});
In this case if i right click on the row it does not get selected.
If i have only one binding it works fine, m oment i inroduce other one it just shows the popup menu, but does not get selected.
I want both action to be preformed when i right click on the row\
i.e row selection and context menu popup.
Please help me to achieve that.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25316 seconds