This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 429756 - [Contributions] Handled Tool Item should use Command's name if no Label is specified
Summary: [Contributions] Handled Tool Item should use Command's name if no Label is sp...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Lars Vogel CLA
QA Contact: Daniel Rolka CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-06 06:43 EST by Dmitry Spiridenok CLA
Modified: 2014-04-29 09:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Spiridenok CLA 2014-03-06 06:43:47 EST
In the Application Model Editor it's possible to specify a Handled Tool Item and configure it to use some command. If no 'Label' property is explicitly specified for the Handle Tool Item, it will be displayed without a label. However because no label is displayed, it'll be hard to find that item on the final user interface.

I wasted much time trying to figure out why my item was missing on the user interface checking all kind of application model configurations until i realized that the item is displayed but not really visible because of missing label.

Potential solutions could be either mark the 'Label' property as mandatory and clearly display it in the GUI (see bug 429595) or by default use the name of the Command as the label for the Handled Tool Item.
Comment 1 Paul Webster CLA 2014-03-06 10:25:17 EST
Please do not change those fields, unless this only ever a problem with the application editor and never a problem at runtime.  You are not familiar with where the fix has to go.

PW
Comment 2 Dmitry Spiridenok CLA 2014-03-06 10:57:53 EST
Sorry, I was not really familiar with the way the tooling works.
 
I saw the change in the project and thought that I've initially submitted this bug to a wrong project. That's why I reverted it to my original selection (which was not correct as I understand now).

I'll pay more attention to the changes other people make to my bug reports (now I know how it works).
Comment 3 Paul Webster CLA 2014-03-06 10:59:47 EST
The org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateMenuItem() has the code where we drop through to the command name if the label is not initialized.

In setting the tooltip, we use a similar pattern. org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.getToolTipText()

Are you talking about using a text label on the toolitem itself (as opposed to the tooltip + an icon)?  That's currently set in org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateToolItem()

PW
Comment 4 Dmitry Spiridenok CLA 2014-03-06 15:36:48 EST
Not sure what exactly goes wrong. I will try to find it out by looking at both places.
Comment 5 Dmitry Spiridenok CLA 2014-03-06 16:37:15 EST
I think I know what's going wrong, it's indeed updateToolItem() that should be fixed. I've looked at updateMenuItem() but its implementation also needs some improvement.
I'll need to figure out what the real implementation should be but this will take some time...
Comment 6 Lars Vogel CLA 2014-03-06 17:03:18 EST
(In reply to D. Spiridenok from comment #5)
> I think I know what's going wrong, it's indeed updateToolItem() that should
> be fixed. I've looked at updateMenuItem() but its implementation also needs
> some improvement.

If you see room for improvement sin updateMenuItem() this should be potentially handled by a new bug report.
Comment 7 Dmitry Spiridenok CLA 2014-03-07 16:24:57 EST
(In reply to Lars Vogel from comment #6)
> (In reply to D. Spiridenok from comment #5)
> > I think I know what's going wrong, it's indeed updateToolItem() that should
> > be fixed. I've looked at updateMenuItem() but its implementation also needs
> > some improvement.
> 
> If you see room for improvement sin updateMenuItem() this should be
> potentially handled by a new bug report.

Submitted Bug 429919 for that. It seems to be not that simple to clean up updateMenuItem(), so would like to have additional information before start changing.
Comment 8 Dmitry Spiridenok CLA 2014-03-07 16:27:03 EST
https://git.eclipse.org/r/23071
Comment 9 Lars Vogel CLA 2014-03-10 08:46:00 EDT
Fixed with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=74fd99e788df5a0366286b6b72682b71cbe7a990

Thanks a lot Dzmitry, great to see your contributions coming in after our RCP training!
Comment 10 Lars Vogel CLA 2014-03-10 08:46:10 EDT
.
Comment 11 Dmitry Spiridenok CLA 2014-03-10 08:47:55 EDT
You are welcome! 
It's always fun to fix the bugs I submitted myself :)
Comment 12 Lars Vogel CLA 2014-04-29 09:14:54 EDT
Verified in Build id: I20140427-2030