| Summary: | Keysequence embedded into updated label of rendered MHandledToolItem | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Brian de Alwis <bsd> | ||||||
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | remy.suen | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 4.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Brian de Alwis
Is this a new bug (presumably caused by the renderer changes on Friday to support translations)? (In reply to comment #1) > Is this a new bug (presumably caused by the renderer changes on Friday to > support translations)? I don't think so. The code is: private void setItemText(MToolItem model, ToolItem item) { String text = model.getLabel(); if (model instanceof MHandledItem) { ... TriggerSequence sequence = [BindingService].getBestSequenceFor(handledItem); if (sequence != null) { text = text + '\t' + sequence.format(); } item.setText(text); } ... } The changes for translation replaced String text = model.getLabel(); with String text = model.getLocalizedLabel(); Created attachment 189144 [details]
Proposed patch to ToolItemRenderer
I suppose this problem isn't commonly seen as most ToolItems in actual use specify an icon. I think the code came from a copy-n-paste from HandledMenuItemRenderer.
Embedding the keysequence is definitely not correct for the ToolItem label. But it would make sense for the tooltip?
Created attachment 192083 [details]
v02
setItemText() doesn't need to compute the tooltip at all; that's done in getToolTipText() directly below.
Patch v02 committed to HEAD |