I'm trying to test by SWTBot hyperlinks inside my Eclipse's text editor. The problem is that the hyperlinks are shown on demand (an Eclipse feature), meaning - the token changes is revealed as hyperLink only when mouse moves over it + a keyboard key (Ctrl or Alt) is pressed.
How can I simulate in SWTBot the mouse-move together with a key pressed?
When mouse moves over a link, then a
MouseEventis generated. SomeMouseMotionListener(or maybeMouseListener) consumes this event and then shows hiperlink for you. You can simulate this event:The
InputEvent.ALT_DOWN_MASKin the constructor means that Alt is pressed. Note that you should define whatComponentresponsible for consuming events in your case.You can find more information in the tutorial How to Write a Mouse Listener and MouseEvent API