ModelFieldEditorFactory.java 文件源码

java
阅读 50 收藏 0 点赞 0 评论 0

项目:scanning 作者:
private CellEditor getNumberEditor(FieldValue field, final Class<? extends Object> clazz, Composite parent) {

        FieldDescriptor anot = field.getAnnotation();
        NumberCellEditor textEd = null;
        if (anot!=null) {
        textEd = new NumberCellEditor(parent, clazz, getMinimum(field, anot), getMaximum(field, anot), getUnit(field, anot), SWT.NONE);

        if (anot.numberFormat()!=null && !"".equals(anot.numberFormat())) {
            textEd.setDecimalFormat(anot.numberFormat());
            }

        } else {
        textEd = new NumberCellEditor(parent, clazz, SWT.NONE);
        }

        //textEd.setAllowInvalidValues(true);
        if (anot!=null && anot.validif().length()>0) {
        final ValidIfDecorator deco = new ValidIfDecorator(field.getName(), field.getModel(), anot.validif());
        textEd.setDelegateDecorator(deco);
        }

    return textEd;
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号