Community
Participate
Working Groups
Build Identifier: I20091210-1301 Bidi bug. Lined Resources path containing Hebrew character is displayed incorrect. This bug is one of the cases that are described in Bug 130587. It is excluded to a separate bug, since bug 130587 contains different cases that needed different fixes. Reproducible: Always Steps to Reproduce: 1.Run Eclipse with Hebrew locale (-nl iw), eclipse is mirrored 2. Open Preferences-> General->Workspace->Linked Resources dialog 3. Add variable with folder containing Hebrew characters, for example variable "aaa" and folder C:\XXX, where XXX are Hebrew characters 4. Inspect display in Defined path variables list. Expected result C:\XXX - aaa Actual result XXX\:aaa - C
Created attachment 155676 [details] patch To resolve the bug, TextProcessor#process is applied on the TabelItem text, see item.setText(varName + " - " + TextProcessor.process(value.toOSString())); If the GUI is mirrored, the variable should be on the right side of the list. For this case Unicode control character RLM is added before " - " string, see item.setText(varName + RLM + " - " + TextProcessor.process(value.toOSString())); Attached is the patch.
Thanks Helena, I'll look at the patch later this week. How does this work for other user of the PathVariablesGroup class - the PathVariableSelectionDialog?
What is a scenario to get PathVariableSelectionDialog? I believe that path will be displayed correct, but to test it I need a scenario. Thanks
(In reply to comment #3) > What is a scenario to get PathVariableSelectionDialog? I believe that path will > be displayed correct, but to test it I need a scenario. Thanks That is an API and so can be included by plug-in developers in their code. The Javadoc gives this example: PathVariableSelectionDialog dialog = new PathVariableSelectionDialog(getShell(), IResource.FOLDER); dialog.open(); String[] result = (String[]) dialog.getResult(); I don't really expect any problems there, but it is worth checking that it still works on a BiDi system.
By the way, the file PathVariablesGroup changed recenly - Serge made three columns with a separate column for the name. Could you update the pach? item.setText(0, varName); item.setText(1, removeParentVariable(value.toOSString())); item.setText(2, resolvedValue.toOSString()); probably it will become something like: item.setText(1, TextProcessor.process(removeParentVariable(value.toOSString()))); item.setText(2, TextProcessor.process(resolvedValue.toOSString())); Also, could you update copyright header with your information?
Created attachment 157268 [details] updated patch Attached is updated patch, the code is changed according to changes in PathVariablesGroup file. PathVariableSelectionDialog looks OK on Bidi system
Thanks Helena! It looks good, I'll release it as soon as we have M5 declared (this is the week with builds towards the Milestone 5 so we are releasing only critical fixes that have to be in this milestone.)
Opps, sorry, the file got changed again. I believe that code that puts IPaths in the screen now lives in the ValueLabelProvider subclass of the PathVariablesGroup: class ValueLabelProvider extends CellLabelProvider { public String getToolTipText(Object element) { ... IPath resolvedValue = ...; return resolvedValue.toOSString(); // <= add TextProcessor here? } ... public void update(ViewerCell cell) { IPath value = ...; cell.setText(removeParentVariable(value.toOSString())); //<= TextProcessor? } } By the way, when a user presses "Edit" button, the PathVariableDialog shows the file path as well. Does it need to have a TextProcessor warpper added?
(In reply to comment #8) > Opps, sorry, the file got changed again. I believe that code that puts IPaths > in the screen now lives in the ValueLabelProvider subclass of the > PathVariablesGroup: > > class ValueLabelProvider extends CellLabelProvider > { > public String getToolTipText(Object element) { > ... > IPath resolvedValue = ...; > return resolvedValue.toOSString(); // <= add TextProcessor here? > } > ... > public void update(ViewerCell cell) { > IPath value = ...; > cell.setText(removeParentVariable(value.toOSString())); //<= TextProcessor? > } > } > > > By the way, when a user presses "Edit" button, the PathVariableDialog shows the > file path as well. Does it need to have a TextProcessor warpper added? I suppose it does. Is there a way to convert back the locale string to a standard windows OS String? That would be required since the user can edit the content.
(In reply to comment #9) > Is there a way to convert back the locale string to a standard windows OS > String? That would be required since the user can edit the content. Yes, the TextProcessor#deprocess() should do the trick.
Created attachment 159097 [details] new patch (In reply to comment #8) The file PathVariablesGroup.java is changed as proposed in comment #8 Regarding PathVariableDialog, the path appears there on 2 controls: "Location" and "Resolved location". "Resolved location" is fixed using TextProcessor#process. Unfortunately, TextProcessor#process is not solution for "Location" control, since it is editable, "dynamic" case of complex expression. There is dependency on bug [Bug 230854] [Bidi] support for text input widgets, we'll add code for "Location" when Bug 230854 will be resolved. (In reply to comment #9 and #10) TextProcessor#deprocess() can be used to remove contol characters from the "processed" string. But I do not see need to use it in PathVariablesGroup and PathVariableDialog. TextProcessor#process was applied on the strings used for display, the values of the items are not changed. Attached patch contains changed for files PathVariablesGroup.java and PathVariableDialog.java
Thank you Helena! The "new patch" applied to CVS Head.
Helena, could you verify that the bug is fixed using a recent I-build (I20100309-0100 or later) and, if it is, mark this bug as verified?
verified