简体   繁体   中英

How to get the mouse position from nattable cell for rcptt testing?

As i started working on RCPTT and for testing context menu on NatTable it needs mouse x & y coordinates, but i want to test it with cell position instead x & y positions of mouse.

So i taught of writing custom implementation for RCPTT for mose-press ecl-command with cell positions.

To do this i need to get the mouse coordinates after selecting the cell.

Is there a way to find the mouse position after selecting /editing the cell with EditCellCommand/SelectCellCommand?

So i will pass the cell positions for custom mouse-press ecl-commant instead mouse pointers and then trig the cell command and get the mouse cordinates and then use this coordinates for mouse press ecl command.

That is an SWT related question and not NatTable specific. I think the answer is already given in this topic: How can I get the relative and absolute cursor position?

I found the way to get the x and y positions from the cell bound.

ILayerCell cell = nattable.getLayer().getCellByPosition(this.COL_ONE, this.ROW_TWO);
Rectangle bounds = cell.getBounds();
int x = bounds.x;
int y = bounds.y;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM