New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cursor position tool should consider locale when parsing coord string #330
Conversation
Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
Great, thanks for this fix Any chance to implement tests for these scenarios. would help to assure for future refactorings/changes. |
I guess Also I'm not sure if test would fail if it runs different locale settings. in static |
CursorPositionTest to better handle Locale settings. Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
Hi @fgdrf , I proceed with another commit which provides a refactored implementation of CursorPositionTest that checks parsing using 2 different Locales (one where decimal separator in . and another one with ,) Furthermore I proceed with further enhancements in CursorPosition so that:
P.S: the formatting of the CursorPosition class is awful. Maybe it is worth after reviewing these commits and before closing the PR to apply style formatter to the whole class. |
classes Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
Hi @fgdrf , |
Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
import org.junit.runners.model.Statement; | ||
|
||
/** JUnit rule for taking control over the Locale. */ | ||
public final class DefaultLocaleRule implements TestRule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess regarding Eclipse IP its not allowed to copy code from other projects. So it can inspire uDig but this class needs to be re-written or we add a dependency to the project to use it as a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class is quite elementary in terms of behavior and applied logic. Would it be OK if I just rename it (for example ConfigureLocaleRule) and possibly alter a couple of Comments
CursorPosition parse Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
Latest commit addresses:
|
CI-BUILD : https://ci.eclipse.org/udig/job/uDig-PR/35/ |
Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
Hmm the failure seems to be related to the naming convention of the concrete test classes which should be in the the form XXXXXTest.java otherwise the class is not recognized as a junit test from maven. I rename them so now the test should be OK. Please re-run jenkins CI |
here we go : https://ci.eclipse.org/udig/job/uDig-PR/36/ |
@fgdrf , If jenkins job executes without errors I would strongly suggest before you merge the PR to let me push another commit for fixing formatting in CursorPosition class which as I mentioned in a previous comment is "awful". |
Job feedback looks good, waiting for your re-formatings |
Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
I just apply udig formatting to CursorPosition class. I also slightly reformat the modified test classes |
https://ci.eclipse.org/udig/job/uDig-PR/37/ was fine. Thanks for contributing! |
…locationtech#330) Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
Setting the coordinate in the cursor position textbox seems to be problematic when locale used is one that uses comma (,) separator instead of dot (.)
before this patch --> based on the locale of the application the format displayed could be either:
xxxx.xxxx, yyyy.yyyy (i.e. US locale) or xxxx,xxxx, yyyy,yyyy (i.e. German or France locale). In the latter case when trying to center the viewport around the coordinate the coord coefficient parsing is problematic.
Afte the patch --> based on the locale of the application the format displayed could be either:
xxxx.xxxx yyyy.yyyy (i.e. US locale) or xxxx,xxxx yyyy,yyyy (i.e. German or France locale). Parsing and viewport setting does not suffer from the issue of multiple commas and works correct
Signed-off-by: Nikolaos Pringouris nprigour@gmail.com