Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335593 - [BiDi] Cannot load mirrored Help Contents button image on JFace dialog
Summary: [BiDi] Cannot load mirrored Help Contents button image on JFace dialog
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.8 M2   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-27 12:01 EST by Kit Lo CLA
Modified: 2011-09-19 09:29 EDT (History)
6 users (show)

See Also:


Attachments
Cannot load mirrored Help Contents button image on JFace dialog (42.80 KB, image/png)
2011-01-27 12:01 EST, Kit Lo CLA
no flags Details
jface plugin extract (15.19 KB, image/jpeg)
2011-08-29 10:18 EDT, Ghada Selim CLA
no flags Details
help image path (45.35 KB, image/jpeg)
2011-08-29 10:23 EDT, Ghada Selim CLA
no flags Details
Proposed Patch (1.27 KB, patch)
2011-09-05 06:39 EDT, Ghada Selim CLA
no flags Details | Diff
Mirrored help image for bidi support (1.14 KB, image/gif)
2011-09-05 09:38 EDT, Ghada Selim CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kit Lo CLA 2011-01-27 12:01:59 EST
Created attachment 187750 [details]
Cannot load mirrored Help Contents button image on JFace dialog

Help Contents button image on JFace dialog should be mirrored. I created an Arabic language pack with a mirrored image for the Help Contents button and launched Eclipse in Arabic. However, the Help Contents button image on JFace dialog is not mirrored. See attached screen capture.

I believe the problem is in JFaceResources#initializeDefaultImages. ICONS_PATH has a value of "$nl$/icons/full/". But, that's not where the mirrored image of "help.gif" is located in the Arabic language pack. If I change the path to "$nl$/org/eclipse/jface/dialogs/images/", then the mirrored image for the Help Contents button is loaded properly.
Comment 1 Paul Webster CLA 2011-02-01 08:36:48 EST
See bug 153933 comment #6

You have to provide the mirror icon in both locations, AFAICT.

PW
Comment 2 Kit Lo CLA 2011-02-02 09:34:57 EST
I still think that there is a problem with the ICONS_PATH when declaring the help image in JFaceResources#initializeDefaultImages.

ICONS_PATH folder is not where the "help.gif" image is located in org.eclipse.jface plugin. We should either move the "help.gif" image to the ICONS_PATH folder (/icons/full) in the org.eclipse.jface plugin, or use the correct path (/org/eclipse/jface/dialogs/images) when declaring the help image in JFaceResources#initializeDefaultImages.

Language fragments follow the folder structure of the host plugins when creating the translated Java resource files and translated images. How would an adopter know that he needs to place an extra copy of the image to another location?
Comment 3 Paul Webster CLA 2011-02-08 11:04:33 EST
(In reply to comment #2)
> ICONS_PATH folder is not where the "help.gif" image is located in
> org.eclipse.jface plugin.

It's in both locations, at least in my org.eclipse.jface plugin.

For something that's been like that for so long, I can't really change it (not for such a low-level plugin like JFace).

PW
Comment 4 Ghada Selim CLA 2011-08-29 10:18:37 EDT
Created attachment 202323 [details]
jface plugin extract
Comment 5 Ghada Selim CLA 2011-08-29 10:23:58 EDT
Created attachment 202324 [details]
help image path

I downloaded the development environment from both CVS and GIT and I can see that the plugin project "org.eclipse.jface" includes the folder "icons/full" which contains the "help.gif" image, however the plugin jar "org.eclipse.jface" in the run time eclipse doesn't contain this folder.Please find a screen shot for the extracted plugin.`						

So there are two cases:
1)When launching eclipse runtime in arabic or english, the help.gif is loaded from "org/eclipse/jface/dialogs/images/" folder as the "$nl$/icons/full/" folder doesn't exist in the plugin jar. 

2)When launching eclipse as an eclipse application using the code from CVS or GIT in arabic or english, the image is loaded from "$nl$/icons/full/" as it does exist in the development code.

Attached is a simple flow chart describing how the location of the help image is specified at runtime. Referring to this flow, I think we have two solutions:

1)If icons/full folder will be included in the "org.eclipse.jface" plugin(at runtime), then the mirrored help image should be added into a folder "nl/ar/icons/full" in the language pack.

2)If icons/full is not included within the structure of "org.eclipse.jface" plugin(and this is the current case), then the mirrored help image should be added to "nl\ar\org\eclipse\jface\dialogs\images" in the language pack. This will require change the default path of help image in JFaceResources.initializeDefaultImages() to point to "$nl$/org/eclipse/jface/dialogs/images/"
Comment 6 Ghada Selim CLA 2011-09-05 06:39:37 EDT
Created attachment 202745 [details]
Proposed Patch

Please find the proposed patch for solution 2.
Comment 7 Ghada Selim CLA 2011-09-05 09:38:30 EDT
Created attachment 202752 [details]
Mirrored help image for bidi support
Comment 8 Oleg Besedin CLA 2011-09-12 11:54:54 EDT
(In reply to comment #5)
> 1)When launching eclipse runtime in arabic or english, the help.gif is loaded
> from "org/eclipse/jface/dialogs/images/" folder as the "$nl$/icons/full/"
> folder doesn't exist in the plugin jar. 
> 
> 2)When launching eclipse as an eclipse application using the code from CVS or
> GIT in arabic or english, the image is loaded from "$nl$/icons/full/" as it
> does exist in the development code.

That's the bug - the "icons" directory should have being included in the build.properties file.

I fixed that for 3.8M2 / 4.2M2:

In R3 development (for 3.8M2):
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R3_development&id=920dec3c603401149235fbbf4fd50ab84fac3481

In R4 developemnt (for 4.2M2):
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=266e10d9af03766f178f5c6674c5026be33a1f00

With this issue fixed, the localized help image should be placed in the $nl$/icons/full directory. For Arabic that would probably be:

nl/ar/icons/full/help.gif

With localized image placed in the proper location there is no need to change path lookup.
Comment 9 Ghada Selim CLA 2011-09-18 08:05:48 EDT
Verified in Build: I20110915-1308,
I added the help image in the path "nl/ar/icons/full" of the Arabic pack and it is working fine, I recommend to close this defect as Fixed.
Comment 10 Oleg Besedin CLA 2011-09-19 09:26:49 EDT
.
Comment 11 Oleg Besedin CLA 2011-09-19 09:29:16 EDT
(In reply to comment #9)
> Verified in Build: I20110915-1308,

Thank you!