Community
Participate
Working Groups
Build Identifier: 3.5.2: 20100218-1602 Trying to add custom tooltips on a common navigator view does not work. For now, I simply try this : ColumnViewerToolTipSupport.enableFor(commonViewer) And the label provider of this common viewer is an extension of CellLabelProvider with proper method definition for tooltip. The thing is that it does not work. When debugging, I can see a call to ColumnViewerToolTipSupport.shouldCreateToolTip(Event) going till line : String text = labelProvider.getToolTipText(element); Everything looks fine except that this labelProvider is not mine. Instead, it is a NavigatorDecoratingLabelProvider which inherit from the default tooltip methods implementation which do nothing. Reproducible: Always Steps to Reproduce: 1. Define a common navigator view based on a class extending CommonNavigator 2. Extend the following method : @Override protected CommonViewer createCommonViewer(Composite aParent) { final CommonViewer viewer = super.createCommonViewer(aParent); ColumnViewerToolTipSupport.enableFor(viewer); aParent); } 3. Provide a LabelProvider in the common navigator definition which extends CellLabelProvider, overriding these 2 methods : @Override public boolean useNativeToolTip(Object object) { return true; } @Override public String getToolTipText(Object element) { return "tooltip"; }
I have the same problem. A solution would be to implement the tooltip related functions in the following way (shown for getToolTipText, almost identical for other tooltip related functions): if (provider instanceof CellLabelProvider) { return ((CellLabelProvider) provider).getToolTipText (element); } return null; As a workaround, I use my label provider directly, but I loose existing decoration support in NavigatorDecoratingLabelProvider. I'm currently implementing tool tip support for the model explorer within Papyrus (MDT project) an would really like to see this fixed. Another aspect of the problem (design fault) in this context: the tooltip related methods in CellLabelProvider should have been extracted into an interface, since the application label provider sometimes has to inherit from an existing framework w/o tooltip support (in my case MoDisco) and thus cannot inherit from the CellLabelProvider.
This seems to be a duplicate of bug 223392.
Thanks!
Not fixed, dup. *** This bug has been marked as a duplicate of bug 223392 ***