Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBotTreeItem.getTooltipText(SWTBotTreeItem.getTooltipText() returns "")
SWTBotTreeItem.getTooltipText [message #1756064] Fri, 10 March 2017 13:52 Go to next message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 60
Registered: October 2010
Member
Have you tried getTooltipText for SWTBotTreeItem or SWTBotTableItem?
It returns "" for me. I looked into the code. I thought that it would return "" for any TreeItem, TableItem and similar objects that occur within specific controls.

SWT's TreeItem has swt.widgets.Widget as baseclass which does not provide getToolTipText() method. So AbstractSWTBot.getToolTipText() when calls ReflectionInvoker's run() method for TreeItem, it throws NoSuchMethodException and hence returns "".

The application can use jface's CellLabelProvider to provide tooltip. It may not be possible for swtbot to access those things but returning "" also can mislead.
Am I correct or am I missing something? Please share your thoughts.
Re: SWTBotTreeItem.getTooltipText [message #1756069 is a reply to message #1756064] Fri, 10 March 2017 15:03 Go to previous messageGo to next message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 84
Registered: July 2009
Member
Hi Aparna,

Interesting. What I see in ColumnViewerToolTipSupport is that the CellLabelProvider can use native tool tip or not.

If it is using native tool tip, the tool tip is added to the Tree widget (not the TreeItem), presumably after it has received a SWT.MouseHover event. SWTBot would need to invoke reflection on the Tree instead of the TreeItem.

If it is not using native tool tip, the tool tip is added to its own Shell that is managed by the JFace ToolTip class. SWTBot would need to examine the Shell contents, I think the text is put in a CLabel child of the Shell.

I'm not sure if SWTBot is supposed to support these JFace features though... Do we need a JFaceBot project? Wink

Patrick
Re: SWTBotTreeItem.getTooltipText [message #1756084 is a reply to message #1756069] Fri, 10 March 2017 17:20 Go to previous messageGo to next message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 60
Registered: October 2010
Member
Hi Patrick,
My application gives different tooltip on each treeitem.
I think that, SWTBotTreeItem.getToolTipText always returns "". This is because ReflectionInvoker.run line 53 "w.getClass().getMethod(methodName, new Class[]{})" will always give NoSuchMethodException because swt.widgets.TreeItem does not support getToolTipText(). Is it correct?
Thanks,
Aparna
Re: SWTBotTreeItem.getTooltipText [message #1756087 is a reply to message #1756084] Fri, 10 March 2017 18:39 Go to previous messageGo to next message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 60
Registered: October 2010
Member
Thanks. I need to get tooltip differently rather than going through SWTBotTreeItem.getToolTipText
JFaceBot is needed Smile
Re: SWTBotTreeItem.getTooltipText [message #1756167 is a reply to message #1756087] Mon, 13 March 2017 10:45 Go to previous message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 60
Registered: October 2010
Member
Thanks Patrick. Your reply helped us a lot. We were not having native tooltip. Now we implemented CellLabelProvider.useNativeToolTip() to make it native. After sending MouseHover, now I'm getting tooltip on tree.
Thanks Smile
Previous Topic:Reference a target file as platform configuration
Next Topic:Test failing with _cairo_format_from_content: Assertion `!"reached"' fail
Goto Forum:
  


Current Time: Thu Apr 18 09:12:06 GMT 2024

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

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

Back to the top