[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Tooltip on TreeView leaves

Hello!

I've tried both of your suggestions (as you see some days) but I don't
get it how to (simply) add the tool tip to a TreeView - better said - to
a TreeObject (what would be a leave in the tree).

Could you please give me an example implementation of it (see code
example in original post)? I wouldn't be bugging you about this if it
wasn't important, so please excuse me for this.

Thank you many times in advance.

Werner


Tom Schindl schrieb:
> This is part of JFace 3.3 and you can use my backport of JFace-Viewers
> if you need it now and/or find your own path ;-)
> 
> 
> http://tom-eclipse-dev.blogspot.com/
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet011CustomTooltips.java?rev=HEAD&content-type=text/vnd.viewcvs-markup
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=83200
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163274
> 
> Tom
> 
> 
> Werner Janjic schrieb:
>> Hi!
>>
>> Nobody an idea on this? Even a "no this is not possible" would already
>> help ;-)
>>
>> Thx!
>>
>> Werner Janjic schrieb:
>>> Hello!
>>>
>>> I've implemented a data tree view for a plugin I am developing. After
>>> hours of searching, I've still not found an opportunity to show tool-tip
>>> information on the tree's parent or leave objects.
>>>
>>> There is no TreeParent.setToolTip("abc") or TreeObject.setToolTip("abc")
>>> method to be found.
>>>
>>> I saw some workaround for tables but I wasn't able to transfer them to
>>> Treeviews.
>>>
>>> Is it somehow possible to have a tool-tip shown up when I stop with the
>>> mouse over a TreeView leave? Perhaps over an ActionListener which I am
>>> quite new to.
>>>
>>> Thank you in advance for your help. Here my code for the initialization:
>>>
>>> ---- schnipp ----
>>>
>>> private void initialize() {
>>>  if (resultMap != null) {
>>>   TreeParent root = new TreeParent(searchString);
>>> 				
>>>   Iterator it = resultMap.keySet().iterator();
>>>   while (it.hasNext()) {
>>>   String link = (String)it.next();
>>>   System.out.println("- " + link);
>>>   TreeParent par = new TreeParent(link);
>>>   Vector leaves = (Vector)resultMap.get(link);
>>>   Iterator leaveIt = leaves.iterator();
>>>   while (leaveIt.hasNext()) {
>>>    TreeObject to = new TreeObject((String)leaveIt.next());
>>>    par.addChild(to);
>>>   }
>>>   root.addChild(par);
>>>  }
>>> 				
>>>  if (invisibleRoot == null)
>>>   invisibleRoot = new TreeParent("");
>>> 				
>>>   invisibleRoot.setParent(root);
>>>   invisibleRoot.addChild(root);
>>>  } else {
>>>   // if you want to show something although there are no results
>>>   // implement it here!
>>>  }
>>> }
>>>
>>>
>>> ---- schnapp ----