Skip to main content


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 16:39 Go to next message
Yoed Yahav is currently offline Yoed YahavFriend
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 16: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 14:05 Go to previous message
Yoed Yahav is currently offline Yoed YahavFriend
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 14:07]

Report message to a moderator

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


Current Time: Thu Mar 28 08:15:52 GMT 2024

Powered by FUDForum. Page generated in 0.02194 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top