forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
925 B
43 lines
925 B
5 years ago
|
package com.fanruan.api.design.ui.editor;
|
||
|
|
||
|
import com.fanruan.api.util.GeneralKit;
|
||
|
|
||
|
/**
|
||
|
* @author richie
|
||
|
* @version 10.0
|
||
|
* Created by richie on 2019/11/1
|
||
|
* 用于编辑和展示长整型数值的编辑器
|
||
|
* TODO:待补充文档
|
||
|
*/
|
||
|
public class TypeLongEditor extends BaseNumberEditor<Long> {
|
||
|
|
||
|
public TypeLongEditor() {
|
||
|
super();
|
||
|
}
|
||
|
|
||
|
public TypeLongEditor(Long value, String name) {
|
||
|
super(value, name);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean accept(Object object) {
|
||
|
return object instanceof Long;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Long getValue() {
|
||
|
return (long) (int) this.numberField.getValue();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void setValue(Long value) {
|
||
|
if (value == null) {
|
||
|
value = 0L;
|
||
|
}
|
||
|
this.numberField.setInteger(true);
|
||
|
this.numberField.setValue(value.intValue());
|
||
|
oldValue = GeneralKit.objectToString(value);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|