Community
Participate
Working Groups
Created attachment 256116 [details] shared string Description: Mnemonic key is useless in tooltip text. It seems the text is shared with other UI string which requires mnemonic key setting. For example of there is only one PII string of "Show Failures Only" in WSW45AAP001 and there is mnemonic key setting with "&". TestRunnerViewPart_show_failures_only=Show &Failures Only PII strings needs to be separated for each two cases. In this place no need mnemonic key. Steps: Double Click eclipse.exe Click Window -> Show View -> Others... Expand Java -> JUnit Click OK button Hover the "Show Skipped Tests Only" icon Build label: 20150820-0900-Runtime-win64 Language: Japanese and others language TCT: https://www-607.ibm.com/software/globalization/translationcommunications/BaseServlet.wss?taskName=ReadArticlePre&arrefnum=7701817298&prrefnum=2000005978
In languages using a latin script, this is not a problem and not even visible. E.g. org.eclipse.swt.widgets.ToolItem#setToolTipText(String) says: * The mnemonic indicator (character '&') is not displayed in a tool tip. => Only visible in languages where memonics are not taken from the label text but appended in parentheses like "(&M)". We can either fix these issues in SWT by making Widget#fixMnemonic(String) remove such mnemonics as well. Or we fix the problems client-side and add a note to all #setToolTipText(String) APIs that clients shouldn't rely on that feature because it doesn't work for all scripts. I found another instance of this problem in PDE source editors here: org.eclipse.pde.internal.ui.editor.actions.HyperlinkAction#generateActionText()
Moving to SWT. All #setToolTipText(String) APIs should make sure that CJK-style mnemonics of the form " (&C)" at the end of the tooltip text are not shown in tooltips (for any character "C"). The only reasonable intention behind dropping the mnemonics in setToolTipText(..) is to allow the reuse of a label as a tooltip. If CJK-style mnemonics are not supported, this effectively makes the feature useless for translated products. The fix may require implementations to use Widget#fixMnemonic(..) in more situations than before (i.e. also in cases where mnemonics were already dropped by the native widget).
Niraj, can you please take a look at this for 4.7?
I could reproduce this issue at my end, by installing Japanese language pack from below update site: http://download.eclipse.org/technology/babel/update-site/R0.14.1/neon and launch eclipse with -nl ja option. I have a working fix for this problem, will share a gerrit patch shortly.
New Gerrit change created: https://git.eclipse.org/r/97197
(In reply to Eclipse Genie from comment #5) > New Gerrit change created: https://git.eclipse.org/r/97197 Hi Markus, Will you be able to review above patch for Oxygen RC1 ?
The patch looks more or less OK, but RC1 is too late for such a behavior change. The problem is not new at all, and it's not a major issue. Additional changes for 4.8: - Javadoc of all #setToolTipText(String) methods should describe the new behavior - the Widget#fixMnemonic(..) methods that take a "boolean spaces" parameter should be removed. This parameter is false everywhere. - implement the same on GTK On the Mac, such mnemoncis don't make sense, but I don't see any code that would remove them. And removing them in general is even harder, since many labels and menu items have additional trailing characters like "Command(&M)...", "Label(&L):". => Mac support would be a separate topic.
(In reply to Markus Keller from comment #7) > The patch looks more or less OK, but RC1 is too late for such a behavior > change. The problem is not new at all, and it's not a major issue. > > Additional changes for 4.8: > - Javadoc of all #setToolTipText(String) methods should describe the new > behavior Updated the gerrit with updated JavaDoc for ToolItem#setToolTipText(String). Will push that shortly. > - the Widget#fixMnemonic(..) methods that take a "boolean spaces" parameter > should be removed. This parameter is false everywhere. Will address these with separate gerrit for JavaDoc changes and above refactoring as required. > - implement the same on GTK > > On the Mac, such mnemoncis don't make sense, but I don't see any code that > would remove them. And removing them in general is even harder, since many > labels and menu items have additional trailing characters like > "Command(&M)...", "Label(&L):". => Mac support would be a separate topic. Raised bug 527028 for GTK and Over to Lakshmi for evaluating Mac side.
Gerrit change https://git.eclipse.org/r/97197 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=5cd7382e6d7091900bdcc0aff73a38c1ee866d50
(In reply to Eclipse Genie from comment #9) > Gerrit change https://git.eclipse.org/r/97197 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=5cd7382e6d7091900bdcc0aff73a38c1ee866d50 Core issue is resolved, verified the above specific fix in latest Build id: I20171113-2000 Need to verify the tooltip behavior with other SWT widgets and will update the JavaDoc for setToolTipText() method accordingly.
(In reply to Niraj Modi from comment #10) > Need to verify the tooltip behavior with other SWT widgets and will update > the JavaDoc for setToolTipText() method accordingly. Should we retarget to M5 or can this be done within a couple of days?
(In reply to Mickael Istria from comment #11) > (In reply to Niraj Modi from comment #10) > > Need to verify the tooltip behavior with other SWT widgets and will update > > the JavaDoc for setToolTipText() method accordingly. > > Should we retarget to M5 or can this be done within a couple of days? Not expecting major changes here, trying to complete this for M4 itself.
(In reply to Niraj Modi from comment #10) > (In reply to Eclipse Genie from comment #9) > > Gerrit change https://git.eclipse.org/r/97197 was merged to [master]. > > Commit: > > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > > ?id=5cd7382e6d7091900bdcc0aff73a38c1ee866d50 > > Core issue is resolved, verified the above specific fix in latest Build id: > I20171113-2000 > > Need to verify the tooltip behavior with other SWT widgets and will update > the JavaDoc for setToolTipText() method accordingly. Verified the tool-tip behavior for CJK-style mnemonics with the other SWT widgets on Windows. Code fix made in comment 9 applies to all the SWT widgets, except for TrayItem widget which already has this behavior via native. Hence, inline with the ToolItem#setToolTipText(String string) method JavaDoc, similar JavaDoc changes are need for the all SWT widget #setToolTipText method. Sharing a gerrit shortly.
New Gerrit change created: https://git.eclipse.org/r/112826
Gerrit change https://git.eclipse.org/r/112826 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=72e0779f76f39ae558c7aa87762d3c886c1b94e6
Resolving now.
Verified using Eclipse Build id: I20171205-2000 on Win7 for Japanese language.