Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » notify(SWT.MouseEnter) is not sent to the widget
notify(SWT.MouseEnter) is not sent to the widget [message #848859] Wed, 18 April 2012 12:39 Go to next message
Yoed Yahav is currently offline Yoed Yahav
Messages: 7
Registered: April 2012
Junior Member
Hi,

We've been banging our heads against the wall on that...

We created our own Control class, and Label and Button classes that extend it which uses SWT Label/Button and SWT Control for the creation of the widgets, and implemented SWT.MouseEnter, SWT.MouseUp etc. on it so a label can behave as a button.

It seems that SWTBot manages to identify the label widgets themselves (using the labelWidget.setData("org.eclipse.swtbot.widget.key", key)), but when we tried to send notify(SWT.MouseEnter) to the widget it doesn't seem to do the trick.

Because SWTBotLabel doesn't support click or mouse.hover methods we extended it to MySWTBotLabel and added a hover and click methods that sends "notify(<SWT.eventType>)" to the widget.

BTW, Our own Button widgets were identified and clicked upon by SWTBot with no issues. (there was no need to create our own SWTBotButton class)

How can we debug it? Why isn't the notify method working properly?

Thank you for any reference!

[Updated on: Wed, 18 April 2012 12:42]

Report message to a moderator

Re: notify(SWT.MouseEnter) is not sent to the widget [message #865657 is a reply to message #848859] Mon, 30 April 2012 10:05 Go to previous message
Yoed Yahav is currently offline Yoed Yahav
Messages: 7
Registered: April 2012
Junior Member
Hi,

I just wanted to update, for all of you who see this post and want a solution - after struggling with it for a while I've found the reason.
The SWTBot notify method didn't work because one of the composite parents of the control wasn't enabled which caused the notify to fail.

At first I created a workaround using my own version of notify (used notifyListeners) to send the exact event straight to the control itself, this way:

Event event = new Event();
event.type = SWT.MouseEnter;
...
event.widget = myLabelWidget;
myLabelWidget.notifyListeners(SWT.MouseEnter, event);


After debugging further I've found that I needed to enable the composite anyway so I fixed that and removed the workaround.


[Updated on: Mon, 30 April 2012 10:07]

Report message to a moderator

Previous Topic:SwtBot for embedded OLE application?
Next Topic:WidgetNotFoundException: The widget was null.
Goto Forum:
  


Current Time: Sat Aug 23 13:37:55 EDT 2014

Powered by FUDForum. Page generated in 0.01478 seconds