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

Bug 424231

Summary: replace "&&" with "&" in setPartName(String)
Product: [RT] RAP Reporter: David Becker <david.becker>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: ivan
Version: 2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description David Becker CLA 2013-12-17 07:51:42 EST
In RCP a single "&" makes the next Glyph a Hotkey for the Part, but in RAP there is not the same behavior.
RCP:
setPartName("A&B") produces "A_B" (where "_" is below the "B" and makes the Part react to [ALT] + [B]
setPartName("A&&B") produces "A&B"
RAP
setPartName("A&B") produces "A&B" (no Hotkey)
setPartName("A&&B") produces "A&&B"

This different behavior makes it difficult to single-source, so I would like it when setPartName() would react the same way.
I don't need the hotkey funktion, so I replaced all "&" in my Titles with "&&", but now they don't look nice with RAP. Is there a workaround to check at runtime whether the code is run in a RAP or in a RCP environment?
Comment 1 Ivan Furnadjiev CLA 2013-12-17 10:02:32 EST
The ampersand character is escaped in DefaultTabItem#updateTabText. See line 115:
http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.7/org.eclipse.ui/workbench/3.7.0/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabItem.java?av=f
This is the original workbench code. Please note that the workbench used by RAP is based on 3.7.
Comment 2 David Becker CLA 2013-12-17 12:24:14 EST
Thank you for the clarification.

I build as a workaround:
2 bundles with export the same package
 -> 1 package does nothing with the string (imported by RAP)
 -> 1 package replaces "&" with "&&" (imported by RCP)

Are there Plans to backport recent changes in RCP into RAP-workbench?
Comment 3 Ivan Furnadjiev CLA 2013-12-17 12:46:50 EST
I'll mark this bug as INVALID as the code in question is original workbench 3.7 code. Updating the workbench to more recent code-base requires a lot of effort and we have no resources to do it in a close future. Any valuable contributions are welcomed.
Comment 4 Ralf Sternberg CLA 2013-12-19 10:50:19 EST
David, which RCP version did you use? If this issue is fixed in the 3.8 workbench code, we could get the change into RAP. Or is it only fixed in the Eclipse 4 compatibility layer?
Comment 5 David Becker CLA 2014-01-23 10:09:32 EST
Ralf, sorry for late response - I was on vacation.
I used RCP 4.2