Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319618 - [context-menu] Tool tip not shown in status bar for command contributions items
Summary: [context-menu] Tool tip not shown in status bar for command contributions items
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Uwe Stieber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 323141
  Show dependency tree
 
Reported: 2010-07-12 13:28 EDT by Uwe Stieber CLA
Modified: 2010-12-01 03:42 EST (History)
1 user (show)

See Also:


Attachments
Patch adding the CommandContributionItem awareness (2.46 KB, patch)
2010-07-12 13:57 EDT, Uwe Stieber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Stieber CLA 2010-07-12 13:28:24 EDT
Within the RSE system view, or table view, if a context menu item is contributed via org.eclipse.ui.menu and becomes a "CommandContributionItem", the RSE menu listener cannot deal with this type of menu items and does not show the tool tip of this icon within the status bar. This looks very inconsistent and not explainable to the user, and it blocks one of our product requirements.
Comment 1 Uwe Stieber CLA 2010-07-12 13:41:34 EDT
CQID: WIND00222944
Comment 2 Uwe Stieber CLA 2010-07-12 13:57:20 EDT
Created attachment 174075 [details]
Patch adding the CommandContributionItem awareness
Comment 3 Uwe Stieber CLA 2010-07-13 06:30:53 EDT
Patch committed to HEAD
Comment 4 Martin Oberhuber CLA 2010-07-13 08:14:10 EDT
I am concerned about using introspection here, and I have filed bug 319693 against Platform/UI to get proper API for retrieving the tooltip text from a CommandContributionItem.

I would like to hear the Platform/UI team's response before relying on introspection here, before I release this change into the 3.2.1 stream.

Moreover, from the attached patch the the introspection call for retrieving the "widget" seems unnecessary since the widget is already known to RSE as "event.widget" in widgetArmed(ArmEvent event) - see
  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewMenuListener.java?root=DSDP_Project&view=markup
Comment 5 Martin Oberhuber CLA 2010-08-19 09:40:03 EDT
I'm releasing the change to 3.2.1 , and filed bug 323141 to use real API once it's available from the Platform.
Comment 6 David McKnight CLA 2010-11-30 10:01:48 EST
I've noticed I get the following error in SystemViewMenuListener line 171 with this change:
The method getData() is undefined for the type CommandContributionItem	

Is this expected?
Comment 7 Uwe Stieber CLA 2010-11-30 10:49:13 EST
You need Eclipse 3.7 M3 as target platform to make it build.
Comment 8 David McKnight CLA 2010-11-30 11:48:28 EST
(In reply to comment #7)
> You need Eclipse 3.7 M3 as target platform to make it build.

Okay.  Is there no way to make the code compile for earlier releases as well?
Comment 9 Uwe Stieber CLA 2010-12-01 01:50:41 EST
Sure, by using reflection instead. Martin O. made the change to use the 3.7 API, so I guess he had been OK with making 3.7 M3 the minimum for the required build target platform. It runs with older Eclipse versions nonetheless btw.
Comment 10 Martin Oberhuber CLA 2010-12-01 03:42:02 EST
We cannot use the new API when we compile against old Eclipse.

The code has a fallback for _running_ on old Eclipse but we need to _compile_ against new Eclipse. Advantage of using the new API is that we're protected from internal changes in the Platform.