Browse Source
Merge in DESIGN/design from ~DESTINY.LIN/design:release/11.0 to release/11.0 * commit 'fbe7375e684e154ec7068c47372b4c58a18e8404': REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭 修改方法名 REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭 修改方法名 REPORT-100458 【版本管理二期】迁移弹窗,保留版本的输入框没有非法值校验 REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭 REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭newui
Destiny.Lin-林锦龙
1 year ago
9 changed files with 168 additions and 19 deletions
@ -0,0 +1,59 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import com.fr.design.editor.editor.IntegerEditor; |
||||
import com.fr.design.gui.itextfield.UIIntNumberField; |
||||
import com.fr.design.gui.itextfield.UINumberField; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
|
||||
import java.awt.event.FocusAdapter; |
||||
import java.awt.event.FocusEvent; |
||||
|
||||
/** |
||||
* 正整数输入框 |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/25 |
||||
*/ |
||||
public class UIPositiveIntEditor extends IntegerEditor { |
||||
private static final int DEFAULT_COLUMNS = 4; |
||||
|
||||
private static final int MIN = 1; |
||||
private static final int MAX = 99999; |
||||
|
||||
private static final int DEFAULT_VALUE = 60; |
||||
|
||||
public UIPositiveIntEditor(Integer value) { |
||||
super(value); |
||||
numberField.setMaxValue(MAX); |
||||
numberField.setMinValue(MIN); |
||||
initNumberFieldListener(); |
||||
} |
||||
|
||||
public UIPositiveIntEditor(Integer value, Integer min, Integer max) { |
||||
super(value); |
||||
numberField.setMaxValue(max); |
||||
numberField.setMinValue(min); |
||||
initNumberFieldListener(); |
||||
} |
||||
|
||||
private void initNumberFieldListener() { |
||||
numberField.addFocusListener(new FocusAdapter() { |
||||
@Override |
||||
public void focusLost(FocusEvent e) { |
||||
if (StringUtils.isEmpty(numberField.getTextValue())) { |
||||
numberField.setValue(DEFAULT_VALUE); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected UINumberField createNumberField() { |
||||
UIIntNumberField field = new UIIntNumberField(); |
||||
field.setColumns(DEFAULT_COLUMNS); |
||||
return field; |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import com.fr.design.gui.ispinner.UISpinner; |
||||
import com.fr.design.gui.itextfield.UIIntNumberField; |
||||
import com.fr.design.gui.itextfield.UINumberField; |
||||
|
||||
/** |
||||
* 只允许输入正整数的Spinner |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/25 |
||||
*/ |
||||
public class UIPositiveIntSpinner extends UISpinner { |
||||
private static final int DEFAULT_COLUMNS = 5; |
||||
|
||||
|
||||
public UIPositiveIntSpinner() { |
||||
} |
||||
|
||||
public UIPositiveIntSpinner(double minValue, double maxValue, double dierta) { |
||||
super(minValue, maxValue, dierta); |
||||
} |
||||
|
||||
public UIPositiveIntSpinner(double minValue, double maxValue, double dierta, double defaultValue) { |
||||
super(minValue, maxValue, dierta, defaultValue); |
||||
} |
||||
|
||||
public UIPositiveIntSpinner(double minValue, double maxValue, double dierta, double defaultValue, boolean fillNegativeNumber) { |
||||
super(minValue, maxValue, dierta, defaultValue, fillNegativeNumber); |
||||
} |
||||
|
||||
@Override |
||||
protected UINumberField initNumberField() { |
||||
UIIntNumberField field = new UIIntNumberField(); |
||||
field.setColumns(DEFAULT_COLUMNS); |
||||
return field; |
||||
} |
||||
} |
Loading…
Reference in new issue