[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: tooltips for the generated editor

Did you take a look at the Snippet Eike referenced? The thing you need
is ColumnViewerToolTipSupport and the really important thing (and I
think here your problem will start) is that you have to use a
ColumnViewerLabelProvider and implement the getTooltipText() method.

If using ColumnViewerLabelProvider (or better a kind of
CellLabelProvider) then you should take a look at
http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet031TableViewerCustomTooltipsMultiSelection

Tom

Gilbert Mirenque schrieb:
> Hi Eike,
> thanks for the link. I don't really know where to add the tool tips. I
> tried to do the following just to test if it works:
> 
> in the generated createPages() method I modified it for the first tab
> like this
> 
> ViewerPane viewerPane =
> 	new ViewerPane(getSite().getPage(), CRUISeMetaModelEditor.this) {
> 	@Override
> 	public Viewer createViewer(Composite composite) {
> 		Tree tree = new Tree(composite, SWT.MULTI);
> 		TreeViewer newTreeViewer = new TreeViewer(tree);
> 		tree.setToolTipText("Test tooltip");
> 		return newTreeViewer;
> 	}
> 	//...
> };
> 
> But the test tooltip will only be shown if I hover the tree-less area.
> Want to say that if I hover the tree and elements of it the tooltip
> won't be displayed, only around of the tree it will be displayed. The
> other issue is how to determine which element will be hovered actually.
> Adding a MouseListener?
> 
> 
> Eike Stepper wrote:
>> Hi Gilbert,
>>
>> Have you tried some of the snippets? -->
>> http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet011CustomTooltips
>>
>> Cheers
>> /Eike