This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 424723 - [BiDi] [BDL] Provide a Globalization Preferences dialog
Summary: [BiDi] [BDL] Provide a Globalization Preferences dialog
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M6   Edit
Assignee: Moshe WAJNBERG CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on: 428977
Blocks:
  Show dependency tree
 
Reported: 2013-12-29 05:28 EST by Moshe WAJNBERG CLA
Modified: 2014-03-06 05:16 EST (History)
6 users (show)

See Also:


Attachments
The New Globalization preference dialog (14.72 KB, patch)
2013-12-29 05:46 EST, Moshe WAJNBERG CLA
no flags Details | Diff
Adding the new dialog to the General Preferences (1.31 KB, patch)
2013-12-29 05:47 EST, Moshe WAJNBERG CLA
no flags Details | Diff
Sample UI for control over g11n prefs. (100.84 KB, image/png)
2013-12-29 07:00 EST, Tomer Mahlin CLA
no flags Details
The new Globalization preferences dialog (15.83 KB, patch)
2014-01-14 07:25 EST, Moshe WAJNBERG CLA
no flags Details | Diff
Screenshot for the G11N Preferences dialog (82.82 KB, image/jpeg)
2014-01-14 08:27 EST, Moshe WAJNBERG CLA
no flags Details
The new Globalization preferences dialog (20.88 KB, patch)
2014-01-15 11:11 EST, Moshe WAJNBERG CLA
no flags Details | Diff
Capture screen for the G11N Preferences dialog (50.01 KB, image/jpeg)
2014-01-15 11:24 EST, Moshe WAJNBERG CLA
no flags Details
The new Globalization preferences dialog (20.96 KB, patch)
2014-01-21 10:10 EST, Moshe WAJNBERG CLA
no flags Details | Diff
Screenshot for the G11N Preferences dialog (107.38 KB, image/jpeg)
2014-01-21 10:11 EST, Moshe WAJNBERG CLA
no flags Details
The new Globalization Preferences dialog (20.02 KB, patch)
2014-02-02 10:37 EST, Moshe WAJNBERG CLA
no flags Details | Diff
Screenshot for the G11N Prefs dialog (78.22 KB, image/jpeg)
2014-02-02 10:38 EST, Moshe WAJNBERG CLA
no flags Details
cleansed fix (24.50 KB, patch)
2014-02-17 13:49 EST, Markus Keller CLA
no flags Details | Diff
Globalization Preferences dialog Help (4.04 KB, patch)
2014-02-18 08:37 EST, Moshe WAJNBERG CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Moshe WAJNBERG CLA 2013-12-29 05:28:15 EST
We need to provide a Globalization Preferences dialog to set the following properties:

- Layout direction of the GUI 
- Bidi preferences : bidiSupport flag and textDirection
- Calendar type.
Comment 1 Moshe WAJNBERG CLA 2013-12-29 05:46:17 EST
Created attachment 238600 [details]
The New Globalization preference dialog

Hello Markus,

Could you please review this patch for the new Globalization preference dialog
Please note that we also need to add the layout direction and calendar type preferences.

But I would like to have your feedback before completing the work

Thank you very much for your review

Best Regards
Comment 2 Moshe WAJNBERG CLA 2013-12-29 05:47:23 EST
Created attachment 238601 [details]
Adding the new dialog to the General Preferences
Comment 3 Tomer Mahlin CLA 2013-12-29 06:58:47 EST
Just a couple of words on the background and motivation. 
We are not adding any new preferences which have not existed before. All we do is to add a convenient way to control globalization (or Bidi) preferences for the end user. At the moment those preferences are controlled via command line.

The rational for that is as follows:

1. A lot of end user facing components based on Eclipse don't expect any command line level configuration. Namely end users are not expected to access the command line.

2. Globalization / Bidi proprieties in the preferences are associated with display aspect of the product which by its nature is very individual and thus is expected to be controlled by the end user. Configuration via GUI is considered much more convenient. 

3. Finally, we got explicit requests from products adopting Bidi feature in the platform (such as control over base text direction and support for structured text) to provide explicit GUI level control over those preferences.
Comment 4 Tomer Mahlin CLA 2013-12-29 07:00:15 EST
Created attachment 238602 [details]
Sample UI for control over g11n prefs.
Comment 5 Tomer Mahlin CLA 2013-12-29 14:19:25 EST
Command line options responsible for invocation of bidi support and specification of base text direction value were introduced via bug 307307 .
API for control over base text direction currently guided by command line options were introduced via bug 402256 .
Comment 6 Tomer Mahlin CLA 2013-12-29 14:21:57 EST
Specification of calendar type was available as part of providing support for Unicode locale extensions specification in the command line. For more details please see bug 243270 .
Comment 7 Markus Keller CLA 2014-01-13 10:17:25 EST
>We are not adding any new preferences which have not existed before.

The command line switches ensured that the whole application runs with the same constant settings. The preferences are something new, because these settings were typically not changed dynamically before.

IMO, we can add the preference page if the "You may have to restart" note is acceptable.

Preferences should be initialized explicitly in WorkbenchPreferenceInitializer#initializeDefaultPreferences(). Open a call hierarchy on other IPreferenceConstants fields to see that.

UI problems:
- needs mnemonics
- needs colon after "Text direction"
- Combo should be on the same line as "Text direction:"
- Combo should not take full width
- We don't use the term "widget" in the UI, and a widget can't be restarted. Better don't name an entity at all and say e.g.: "A restart is required for these preferences to take full effect."
- Why is "Default" in the Combo? Do we need that option at all? Without further explanations, the user can't know what that "default" means. Is it the OS default? Or the default for the OS locale? Or the default for the Eclipse locale?
- Is "Bidi" a common term for end users? Shouldn't this be a bit more verbose?
Comment 8 Tomer Mahlin CLA 2014-01-13 10:57:40 EST
"You may have to restart" note is acceptable.

Bidi is a short form of bidirectional. So we will change: 
    Bidi preferences to "Bidirectional support preferences"
    Enable Bidi support to "Enable bidirectional support"
Comment 9 Moshe WAJNBERG CLA 2014-01-14 07:25:57 EST
Created attachment 238959 [details]
The new Globalization preferences dialog
Comment 10 Moshe WAJNBERG CLA 2014-01-14 07:29:36 EST
(In reply to Markus Keller from comment #7)
> >We are not adding any new preferences which have not existed before.
> 
> The command line switches ensured that the whole application runs with the
> same constant settings. The preferences are something new, because these
> settings were typically not changed dynamically before.
> 
> IMO, we can add the preference page if the "You may have to restart" note is
> acceptable.
> 
> Preferences should be initialized explicitly in
> WorkbenchPreferenceInitializer#initializeDefaultPreferences(). Open a call
> hierarchy on other IPreferenceConstants fields to see that.
> 
Done

> UI problems:
> - needs mnemonics
I put mnemonics on both Enable Bidi support checkbox and Text Direction combo

> - needs colon after "Text direction"
Done
> - Combo should be on the same line as "Text direction:"
Done
> - Combo should not take full width
Done
> - We don't use the term "widget" in the UI, and a widget can't be restarted.
> Better don't name an entity at all and say e.g.: "A restart is required for
> these preferences to take full effect."
Done
> - Why is "Default" in the Combo? Do we need that option at all? Without
> further explanations, the user can't know what that "default" means. Is it
> the OS default? Or the default for the OS locale? Or the default for the
> Eclipse locale?
It is OS default. I updated the label
> - Is "Bidi" a common term for end users? Shouldn't this be a bit more
> verbose?
I changed
    Bidi preferences to "Bidirectional support preferences"
    Enable Bidi support to "Enable bidirectional support"
according to Tomer's suggestion
Comment 11 Moshe WAJNBERG CLA 2014-01-14 07:30:40 EST
Hello Markus,

I addressed your commnents
Can you please review the changes?

Thank you

Best Regards
Comment 12 Moshe WAJNBERG CLA 2014-01-14 08:27:39 EST
Created attachment 238963 [details]
Screenshot for the G11N Preferences dialog
Comment 13 Markus Keller CLA 2014-01-14 14:24:58 EST
OK, please finish the dialog. I won't test/release several iterations.

If you don't plan to add the other options mentioned in comment 0, then you have to remove the Group around the options.

IPreferenceConstants.TEXT_DIRECTION should correctly document supported values, and the default should not be set to an unsupported value.

Make a pass over the Javadocs and fix wrong information and incorrect language.

What's the take if the old command line arguments are supplied? Do they override the stored settings, or do they set the defaults?
Comment 14 Moshe WAJNBERG CLA 2014-01-15 11:11:20 EST
Created attachment 239021 [details]
The new Globalization preferences dialog
Comment 15 Moshe WAJNBERG CLA 2014-01-15 11:16:05 EST
(In reply to Markus Keller from comment #13)
> OK, please finish the dialog. I won't test/release several iterations.
> 
> If you don't plan to add the other options mentioned in comment 0, then you
> have to remove the Group around the options.
> 
> IPreferenceConstants.TEXT_DIRECTION should correctly document supported
> values, and the default should not be set to an unsupported value.

IPreferenceConstants.TEXT_DIRECTION may have the following values: "ltr", "rtl","auto" and "". I documented this in the IPreferenceConstants source

> 
> Make a pass over the Javadocs and fix wrong information and incorrect
> language.
> 
> What's the take if the old command line arguments are supplied? Do they
> override the stored settings, or do they set the defaults?

if user specified values in both command line and Preferences G11N dialog the G11N dialog has the precedence.
Of course if default values are specified in the G11N pref dialog then we take the command line options (if any)
Comment 16 Moshe WAJNBERG CLA 2014-01-15 11:16:53 EST
Hello Markus,

I think I finished the dialog.
Can you please review the changes?

Thank you

Best Regards
Comment 17 Moshe WAJNBERG CLA 2014-01-15 11:24:58 EST
Created attachment 239022 [details]
Capture screen for the G11N Preferences dialog
Comment 18 Markus Keller CLA 2014-01-20 10:48:08 EST
(In reply to Moshe WAJNBERG from comment #17)
> Created attachment 239022 [details]
> Capture screen for the G11N Preferences dialog

Please clean up the widget arrangements. Indent dependent options. Align the combos. See existing Eclipse preference pages like Java > Editor > Content Assist for ideas.

Is the group really necessary? It looks strange to have one option outside a group and the others in a group.

Is there really no restart required to activate changes in Unicode locale extensions? I don't know those APIs are typically used, but I guess some widgets also need to be re-created to take the new options into account.
Comment 19 Moshe WAJNBERG CLA 2014-01-21 10:10:59 EST
Created attachment 239188 [details]
The new Globalization preferences dialog
Comment 20 Moshe WAJNBERG CLA 2014-01-21 10:11:58 EST
Created attachment 239189 [details]
Screenshot for the G11N Preferences dialog
Comment 21 Moshe WAJNBERG CLA 2014-01-21 10:14:56 EST
(In reply to Markus Keller from comment #18)
> (In reply to Moshe WAJNBERG from comment #17)
> > Created attachment 239022 [details]
> > Capture screen for the G11N Preferences dialog
> 
> Please clean up the widget arrangements. Indent dependent options. Align the
> combos. See existing Eclipse preference pages like Java > Editor > Content
> Assist for ideas.

I indented the dependent options and aligned the combos (i attached a screenshot)
> 
> Is the group really necessary? It looks strange to have one option outside a
> group and the others in a group.
> 
> Is there really no restart required to activate changes in Unicode locale
> extensions? I don't know those APIs are typically used, but I guess some
> widgets also need to be re-created to take the new options into account.

Yes you are right. I made the note applicable for all the G11N preferences
Comment 22 Moshe WAJNBERG CLA 2014-01-21 10:15:38 EST
Hello Markus,

I think I addressed your comments
Can you please review the changes?

Thank you

Best Regards
Comment 23 Markus Keller CLA 2014-01-31 15:48:22 EST
> Is the group really necessary?

You didn't answer this question, and I still think the group should be removed. What has the graphical layout direction to do with bidi? It's only one direction.

The right-aligned combos are strange when the dialog happens to be wider than usual.

You should put all these controls into a single GridLayout with two columns. The text field can be full-width, but the combos best go with their default width and left-aligned. Hard-coded pixel widths are not a good solution.

To separate the three main options vertically, you may want to add an empty row in between (e.g. put a Label without text there).
Comment 24 Tomer Mahlin CLA 2014-02-02 05:42:27 EST
(In reply to Markus Keller from comment #23)
> I still think the group should be removed.

We don't mind to remove it if this is so important. 
The idea was to group together all Bidi unique options and separate 
them from the rest of globalization options.

> What has the graphical layout direction to do with bidi? 
> It's only one direction.

"Graphical layout direction" is equvalent to dir attribute. 
When dir = LTR the UI flow is from left to right (not mirrored screen)
When dir = RTL the UI flow is from right to left (mirrored screen)
This is VERY unique bidi property which controlls if UI
appears flipped or not.
Comment 25 Moshe WAJNBERG CLA 2014-02-02 10:37:48 EST
Created attachment 239558 [details]
The new Globalization Preferences dialog
Comment 26 Moshe WAJNBERG CLA 2014-02-02 10:38:40 EST
Created attachment 239559 [details]
Screenshot for the G11N Prefs dialog
Comment 27 Moshe WAJNBERG CLA 2014-02-02 10:39:55 EST
(In reply to Markus Keller from comment #23)
> > Is the group really necessary?
> 
> You didn't answer this question, and I still think the group should be
> removed. What has the graphical layout direction to do with bidi? It's only
> one direction.

OK. I removed the group.

> The right-aligned combos are strange when the dialog happens to be wider
> than usual.
> 
> You should put all these controls into a single GridLayout with two columns.
> The text field can be full-width, but the combos best go with their default
> width and left-aligned. Hard-coded pixel widths are not a good solution.
> 
> To separate the three main options vertically, you may want to add an empty
> row in between (e.g. put a Label without text there).

OK. That's what I have done
Comment 28 Moshe WAJNBERG CLA 2014-02-02 10:40:44 EST
Hello Markus,

I think I addressed all your comments
Can you please review the changes?

Thank you

Best Regards
Comment 29 Moshe WAJNBERG CLA 2014-02-06 09:22:22 EST
Hello Markus,

Any updates ?

Thank you
Comment 30 Markus Keller CLA 2014-02-17 13:49:44 EST
Created attachment 240045 [details]
cleansed fix

The text field and combos were still not aligned as they should be.

The two bidi-related options didn't work at all. The dialog page called BidiUtils.setTextDirection(""), which threw IAEs, and the initialization of the graphical layout direction in Workbench.createAndRunWorkbench(...).new Runnable() {...}.run() was too late to be picked up by the main workbench window.

I've moved this into WorkbenchPlugin#getDefaultOrientation().

I've also added preference keywords.


Moshe, please provide a help page for this preference page and register it in /org.eclipse.platform.doc.user/contexts_Workbench.xml like this:

    <context id="globalization_preference_page_context">
        <description>Allows you to configure Bidi and other globalization preferences.</description>
        <topic label="Preferences - Globalization" href="reference/ref-globalizationprefs.htm"/>
    </context>

I've already set this context ID in the GlobalizationPreferencePage in the patch.

Moshe, please test all options on the preference page again.

And you have to sign the https://wiki.eclipse.org/CLA (can't commit anything without that).
Comment 31 Moshe WAJNBERG CLA 2014-02-18 08:37:51 EST
Created attachment 240066 [details]
Globalization Preferences dialog Help
Comment 32 Moshe WAJNBERG CLA 2014-02-18 08:39:41 EST
(In reply to Markus Keller from comment #30)
> Created attachment 240045 [details]
> cleansed fix
> 
> The text field and combos were still not aligned as they should be.
> 
> The two bidi-related options didn't work at all. The dialog page called
> BidiUtils.setTextDirection(""), which threw IAEs, and the initialization of
> the graphical layout direction in Workbench.createAndRunWorkbench(...).new
> Runnable() {...}.run() was too late to be picked up by the main workbench
> window.
> 
> I've moved this into WorkbenchPlugin#getDefaultOrientation().
> 
> I've also added preference keywords.
> 
> 
> Moshe, please provide a help page for this preference page and register it
> in /org.eclipse.platform.doc.user/contexts_Workbench.xml like this:
> 
>     <context id="globalization_preference_page_context">
>         <description>Allows you to configure Bidi and other globalization
> preferences.</description>
>         <topic label="Preferences - Globalization"
> href="reference/ref-globalizationprefs.htm"/>
>     </context>
> 
> I've already set this context ID in the GlobalizationPreferencePage in the
> patch.

I attached a patch for the help page.
> 
> Moshe, please test all options on the preference page again.
> 
 
Your changes look good. Thanks
> And you have to sign the https://wiki.eclipse.org/CLA (can't commit anything
> without that).

I commited to CLA
Comment 33 Markus Keller CLA 2014-02-24 16:07:03 EST
(In reply to Markus Keller from comment #30)
> Created attachment 240045 [details] [diff]
> cleansed fix

Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=cd159efd28799e71212681b63bc74f016fb538b9

(In reply to Moshe WAJNBERG from comment #31)
> Created attachment 240066 [details] [diff]
> Globalization Preferences dialog Help

Released with quite a few fixes as http://git.eclipse.org/c/platform/eclipse.platform.common.git/commit/?id=20c7376e4580defd673c0ff1854f38a70777e00e
Comment 34 Paul Webster CLA 2014-02-25 05:59:39 EST
Look like this causes bug 428977.  Probably accessing preferences from within the WorkbenchPlugin causes the workspace to be set in OSGi.

PW
Comment 35 Markus Keller CLA 2014-02-25 07:28:43 EST
(In reply to Paul Webster from comment #34)
Sorry about that. Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=416e5203747845a5938c2c195941f3e2c19b94ac for bug 428977.

The workbench window still comes up as RTL if the workspace preference is set like that. The workspace chooser dialog obviously can't respect a workspace setting, since the workspace is not yet known.

If a product wants to set the workspace chooser to RTL, then it has to use the command line option -dir rtl .
Comment 36 Moshe WAJNBERG CLA 2014-03-06 05:16:34 EST
Verified on the 05/05 build

Thank you very much Markus for your help