litesoft
Diff Revisions
949
vs
950
for /trunk/Java/KeyHole/src/org/litesoft/aokeyhole/swing/namevaluecomponents/NamedPositiveIntegerFieldComponent.java
|
@@ -1,18 +1,18 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.aokeyhole.swing.namevaluecomponents; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.aokeyhole.objects.support.*; |
5 |
|
- |
import org.litesoft.aokeyhole.toolkit.*; |
6 |
|
- |
|
7 |
|
- |
public class NamedPositiveIntegerFieldComponent extends NamedNumericFieldComponent { |
8 |
|
- |
public NamedPositiveIntegerFieldComponent( NameValueComponentParams pParams ) { |
9 |
|
- |
super( pParams ); |
10 |
|
- |
} |
11 |
|
- |
|
12 |
|
- |
@Override |
13 |
|
- |
protected Object mutateChangeTo( Object pLastValue, Object pCurValue ) { |
14 |
|
- |
String input = super.mutateChangeTo( pLastValue, pCurValue ).toString().trim(); |
15 |
|
- |
|
16 |
|
- |
return AbstractBase.allDigits( input ) ? input : pLastValue; |
17 |
|
- |
} |
18 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.aokeyhole.swing.namevaluecomponents; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.aokeyhole.objects.support.*; |
|
5 |
+ |
import org.litesoft.aokeyhole.toolkit.*; |
|
6 |
+ |
|
|
7 |
+ |
public class NamedPositiveIntegerFieldComponent extends NamedNumericFieldComponent { |
|
8 |
+ |
public NamedPositiveIntegerFieldComponent( NameValueComponentParams pParams ) { |
|
9 |
+ |
super( pParams ); |
|
10 |
+ |
} |
|
11 |
+ |
|
|
12 |
+ |
@Override |
|
13 |
+ |
protected Object mutateChangeTo( Object pLastValue, Object pCurValue ) { |
|
14 |
+ |
String input = super.mutateChangeTo( pLastValue, pCurValue ).toString().trim(); |
|
15 |
+ |
|
|
16 |
+ |
return AbstractBase.allDigits( input ) ? input : pLastValue; |
|
17 |
+ |
} |
|
18 |
+ |
} |