bnmjkm / opal

Automatically exported from code.google.com/p/opal
0 stars 0 forks source link

PropertyTable throws exeption when numerical value is typed empty Strimg #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build a table with PTIntegerEditor (or float)
2. while editing this filed remove letters until ""
3. Interger Parsing exeption is thrown

What is the expected output? What do you see instead?
-

What version of the product are you using? On what operating system?
V0.9.9e on win7

Please provide any additional information below.

In PTIntegerEditor:
...
public Object convertValue() {
    return Integer.parseInt(this.text.getText());
...

a fix could be:
public Object convertValue() {
        int ret = 0;        
    try{
        ret = Integer.parseInt(this.text.getText());
       }catch(NumberFormatException e){         
        ret = 0;
        this.text.setText("0");
    }       
    return  ret; 
}

Original issue reported on code.google.com by asoffice...@gmail.com on 11 Jul 2014 at 11:24

GoogleCodeExporter commented 8 years ago
Fixed in V1.0.0

Original comment by laurent....@gmail.com on 16 Jul 2014 at 8:24