插件开发工具库,推荐依赖该工具库。
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.
 
 

47 lines
1.0 KiB

package com.fanruan.api.design.ui.editor;
import com.fanruan.api.design.DesignKit;
import com.fr.base.Utils;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/11/1
* 用于编辑和展示双精度浮点型数值的编辑器
* TODO:待补充文档
*/
public class TypeDoubleEditor extends BaseNumberEditor<Double> {
public TypeDoubleEditor() {
this(0.0);
}
public TypeDoubleEditor(Double value) {
super(value, DesignKit.i18nText("Fine-Design_Basic_Parameter_Double"));
}
@Override
public boolean accept(Object object) {
return object instanceof Double;
}
@Override
public Double getValue() {
return this.numberField.getValue();
}
@Override
public void setValue(Double value) {
if (value == null) {
value = (double) 0;
}
this.numberField.setInteger(false);
this.numberField.setValue(value);
oldValue = Utils.objectToString(value);
}
public String getIconName() {
return "type_double";
}
}