Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 61819 Details for
Bug 144936
TVT3.2:TCT825: DA: Wrong decimal period in Configure Slider Properties (vertical)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
bug144936.txt (text/plain), 5.44 KB, created by
Ashish Patel
on 2007-03-23 09:24:13 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ashish Patel
Created:
2007-03-23 09:24:13 EDT
Size:
5.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.statistical.ui >Index: src/org/eclipse/hyades/statistical/ui/internal/views/linegraph/ConfigureVerticalSlider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.statistical.ui/src/org/eclipse/hyades/statistical/ui/internal/views/linegraph/ConfigureVerticalSlider.java,v >retrieving revision 1.2 >diff -u -r1.2 ConfigureVerticalSlider.java >--- src/org/eclipse/hyades/statistical/ui/internal/views/linegraph/ConfigureVerticalSlider.java 29 Mar 2006 10:42:16 -0000 1.2 >+++ src/org/eclipse/hyades/statistical/ui/internal/views/linegraph/ConfigureVerticalSlider.java 22 Mar 2007 18:43:44 -0000 >@@ -11,6 +11,9 @@ > **********************************************************************/ > package org.eclipse.hyades.statistical.ui.internal.views.linegraph; > >+import java.text.NumberFormat; >+import java.text.ParseException; >+ > import org.eclipse.hyades.statistical.ui.StatisticalMessages; > import org.eclipse.hyades.ui.widgets.zoomslider.ZoomSlider; > import org.eclipse.jface.dialogs.IDialogConstants; >@@ -108,10 +111,11 @@ > > public void addPickers(Composite composite) > { >-/* double maxLimit = slider.getMaxLimit(); >- double minLimit = slider.getMinLimit(); >-*/ double maxVisible = slider.getMaxVisible(); >- double minVisible = slider.getMinVisible(); >+ >+ /* Format the numbers based on the current locale */ >+ NumberFormat numFormat = NumberFormat.getInstance(); >+ String maxVisible = numFormat.format( slider.getMaxVisible() ); >+ String minVisible = numFormat.format( slider.getMinVisible() ); > > GridLayout layout = new GridLayout(); > composite.setLayout(layout); >@@ -147,7 +151,7 @@ > data.horizontalAlignment = SWT.FILL; > data.verticalAlignment = SWT.CENTER; > minVisibleText.setLayoutData(data); >- minVisibleText.setText(Double.toString(minVisible)); >+ minVisibleText.setText( minVisible ); > > label = new Label(visibleGroup, SWT.NONE); > label.setText(StatisticalMessages.VISIBLE_END_LABEL); >@@ -167,7 +171,7 @@ > data.verticalAlignment = SWT.CENTER; > data.widthHint = 50; > maxVisibleText.setLayoutData(data); >- maxVisibleText.setText(Double.toString(maxVisible)); >+ maxVisibleText.setText( maxVisible ); > > > /* Group limitGroup = new Group(composite, SWT.NONE); >@@ -238,8 +242,19 @@ > protected void okPressed() > { > title = titleText.getText(); >- maxVisible = Double.parseDouble(maxVisibleText.getText()); >- minVisible = Double.parseDouble(minVisibleText.getText()); >+ >+ NumberFormat numFormat = NumberFormat.getInstance(); >+ try { >+ Number maxNum = numFormat.parse( maxVisibleText.getText() ); >+ Number minNum = numFormat.parse( minVisibleText.getText() ); >+ maxVisible = maxNum.doubleValue(); >+ minVisible = minNum.doubleValue(); >+ } catch (ParseException e) { >+ /* handle exception case */ >+ maxVisible = slider.getMaxVisible(); >+ minVisible = slider.getMinVisible(); >+ } >+ > /* maxLimit = Double.parseDouble(maxLimitText.getText()); > minLimit = Double.parseDouble(minLimitText.getText()); > */ super.okPressed(); >@@ -273,25 +288,33 @@ > > public void modifyText(ModifyEvent e) > { >- try >- { >- maxVisible = Double.parseDouble(maxVisibleText.getText()); >- } >- catch (NumberFormatException ex) >- { >+ /* Attempt to verify the max number to ensure it valides >+ * against the locale */ >+ NumberFormat numFormat = NumberFormat.getInstance(); >+ try { >+ Number maxNum = numFormat.parse( maxVisibleText.getText() ); >+ maxVisible = maxNum.doubleValue(); >+ } catch (ParseException pe) { >+ setErrorMessage(StatisticalMessages.ERROR_MAXVISIBLE); >+ return; >+ } catch (NumberFormatException ex) { > setErrorMessage(StatisticalMessages.ERROR_MAXVISIBLE); > return; > } >- try >- { >- minVisible = Double.parseDouble(minVisibleText.getText()); >- } >- catch (NumberFormatException ex) >- { >+ >+ /* Attempt to verify the min number to ensure it valides >+ * against the locale */ >+ try { >+ Number minNum = numFormat.parse( minVisibleText.getText() ); >+ minVisible = minNum.doubleValue(); >+ } catch (ParseException pe) { > setErrorMessage(StatisticalMessages.ERROR_MINVISIBLE); >- return; >+ return; >+ } catch (NumberFormatException ex) { >+ setErrorMessage(StatisticalMessages.ERROR_MINVISIBLE); >+ return; > } >- >+ > /* try > { > maxLimit = Double.parseDouble(maxLimitText.getText()); >@@ -336,14 +359,18 @@ > if (newString.trim().equals("-")) > return; > >- try >- { >- Double.parseDouble(newString); >- } >- catch (Exception ex) >- { >- e.doit = false; >+ /* Attempt to parse the number to verify that it validates with the >+ * current locale settings */ >+ NumberFormat numFormat = NumberFormat.getInstance(); >+ try { >+ Number num = numFormat.parse( newString ); >+ double con = num.doubleValue(); >+ } catch (ParseException pe) { >+ e.doit = false; >+ } catch (NumberFormatException ex) { >+ e.doit = false; > } >+ > } > > private String checkConfiguration(double minVisible, double maxVisible, double resolution)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 144936
:
43283
| 61819