Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 527028

Summary: [GTK][api] TVT_IES45_JDT: Command name with "Command (&M)"-style mnemonic should not be reused as tooltip
Product: [Eclipse Project] Platform Reporter: Niraj Modi <niraj.modi>
Component: SWTAssignee: Sravan Kumar Lakkimsetti <sravankumarl>
Status: RESOLVED FIXED QA Contact: Niraj Modi <niraj.modi>
Severity: normal    
Priority: P3 CC: arunkumar.thondapu, bsd, cjxu, daniel_megert, kitlo, kqli, libingw, lshanmug, markus.kell.r, niraj.modi, sarika.sinha, simeon.danailov.andreev, sravankumarl, xbpan
Version: 4.5Flags: niraj.modi: review+
Target Milestone: 4.10 M1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/122771
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=72c7a218c9727d9f05050c9d47828a82a6978516
https://bugs.eclipse.org/bugs/show_bug.cgi?id=549065
Whiteboard:
Bug Depends on: 475858    
Bug Blocks:    

Description Niraj Modi CLA 2017-11-09 01:27:42 EST
+++ This bug was initially created as a clone of Bug #475858 +++
Below bug is to take care of the fix on GTK/Linux.

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
Comment 1 Niraj Modi CLA 2017-12-01 04:30:54 EST
Hi Sravan,
Please see if you can accommodate this bug for M5 ?
Comment 2 Sravan Kumar Lakkimsetti CLA 2018-01-23 03:27:35 EST
Will look into this early M6
Comment 3 Leo Ufimtsev CLA 2018-02-27 09:17:41 EST
(In reply to Sravan Kumar Lakkimsetti from comment #2)
> Will look into this early M6

Should we move to M7?
Comment 4 Lakshmi P Shanmugam CLA 2018-03-12 00:26:11 EDT
Moving to M7.
Comment 5 Sravan Kumar Lakkimsetti CLA 2018-05-08 03:50:59 EDT
I will look into this in RC1
Comment 6 Eclipse Genie CLA 2018-05-16 08:22:10 EDT
New Gerrit change created: https://git.eclipse.org/r/122771
Comment 7 Niraj Modi CLA 2018-05-21 08:26:32 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/122771

With above patch, issue still reproducible... try installing Japanese language pack from below update site: http://download.eclipse.org/technology/babel/update-site/R0.15.0/oxygen
and launch eclipse with -nl ja option and see JUnits view.
Comment 8 Niraj Modi CLA 2018-05-22 02:35:09 EDT
(In reply to Niraj Modi from comment #7)
> (In reply to Eclipse Genie from comment #6)
> > New Gerrit change created: https://git.eclipse.org/r/122771
> 
> With above patch, issue still reproducible... try installing Japanese
> language pack from below update site:
> http://download.eclipse.org/technology/babel/update-site/R0.15.0/oxygen
> and launch eclipse with -nl ja option and see JUnits view.

+1
Functionality wise the latest code fixes the above mentioned problem seen with patch 2, have verified the patch on Ubunut16.
Comment 9 Sarika Sinha CLA 2018-05-22 03:01:21 EDT
I don't think it is a must for RC2. Putting in 4.9 M1 will be a much safer option.
Comment 10 Dani Megert CLA 2018-05-22 03:25:13 EDT
(In reply to Sarika Sinha from comment #9)
> I don't think it is a must for RC2. Putting in 4.9 M1 will be a much safer
> option.

I agree.
Comment 11 Sravan Kumar Lakkimsetti CLA 2018-05-22 04:36:02 EDT
(In reply to Dani Megert from comment #10)
> (In reply to Sarika Sinha from comment #9)
> > I don't think it is a must for RC2. Putting in 4.9 M1 will be a much safer
> > option.
> 
> I agree.

I am differing to 4.9 based on above comments
Comment 12 Sravan Kumar Lakkimsetti CLA 2018-08-29 04:39:31 EDT
We are not able to complete the review in 4.9. We will push this change in 4.10M1
Comment 14 Sravan Kumar Lakkimsetti CLA 2018-09-14 04:51:57 EDT
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/122771 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=72c7a218c9727d9f05050c9d47828a82a6978516

Merged to master
Comment 15 Simeon Andreev CLA 2019-07-08 09:10:10 EDT
The fix here causes a regression. Tables/Trees with with a '(' in the table/tree column header have *sometimes* underscored '('.

I'm not 100% sure how to reproduce it with Eclipse (SWT/JFace) only. We observe the following stack trace:

"main" #1 prio=6 os_prio=0 tid=0x00007ffff0050000 nid=0x5661 runnable [0x00007ffff59bd000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.widgets.Widget.fixMnemonic(Widget.java:1065)
        at org.eclipse.swt.widgets.Widget.fixMnemonic(Widget.java:1033)
        at org.eclipse.swt.widgets.Widget.fixMnemonic(Widget.java:1029)
        at org.eclipse.swt.widgets.TreeColumn.setText(TreeColumn.java:655)
        ...

The string input of the method "org.eclipse.swt.widgets.Widget.fixMnemonic(String, boolean, boolean)" is: "(Hardware)"

This results in an underscore being pre-prended, so the label is (wrongly so): "_(Hardware)"

During debugging, I observe that the '(' case falls through to the '_' case, which I don't think is intended?

The code is:

case '(':
	if (removeAppended && i + 4 == string.length () && text [i + 1] == '&' && text [i + 3] == ')') {
		if (replace) result [j++] = ' ';
		i += 4;
		break; // break switch case only if we are removing the mnemonic otherwise fall through
	}
case '_':
	if (replace) result [j++] = '_';
	//FALL THROUGH

Unfortunately we see this only after switching perspectives (switching to a perspective that has a view open, the view has tree with a '(' symbol in its tree column header). So its not easy to create an SWT-only snippet.
Comment 16 Dani Megert CLA 2019-07-10 11:06:18 EDT
(In reply to Simeon Andreev from comment #15)
Please file a bug with steps to reproduce.
Comment 17 Simeon Andreev CLA 2019-07-10 11:15:36 EDT
(In reply to Dani Megert from comment #16)
> (In reply to Simeon Andreev from comment #15)
> Please file a bug with steps to reproduce.

I've opened 549065, which in the meantime is also fixed.