From 2d4a7c8bcb1d6455048e3f9b7b182fac8e49e5f6 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 8 Apr 2021 16:59:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-50096=20=E6=95=B0=E6=8D=AE=E5=A1=AB?= =?UTF-8?q?=E5=85=85=E6=97=B6=E4=B8=8D=E9=9C=80=E8=A6=81=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 20187bd50..94a612b66 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -205,6 +205,7 @@ public class JDBCDefPane extends JPanel { jdbcDatabase = new JDBCDatabaseConnection(); } this.jdbcDatabase = jdbcDatabase; + this.dbtypeComboBox.removeActionListener(dbtypeActionListener); if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { this.dbtypeComboBox.setSelectedItem("Access"); @@ -229,6 +230,7 @@ public class JDBCDefPane extends JPanel { this.dbtypeComboBox.setSelectedItem(OTHER_DB); } } + this.dbtypeComboBox.addActionListener(dbtypeActionListener); this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); this.urlTextField.setText(jdbcDatabase.getURL()); this.userNameTextField.setText(jdbcDatabase.getUser()); From 3660aba3911adcc043852269d41cd1f673acb1c0 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Fri, 9 Apr 2021 18:26:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-50598=20=E6=95=B0=E5=AD=97=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=A1=86=E8=BE=93=E5=85=A5=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/itextfield/UINumberField.java | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java index 62d24c56a..0d1287d8c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java @@ -4,16 +4,11 @@ import com.fr.base.Utils; import com.fr.general.ComparatorUtils; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; - -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; import java.awt.Dimension; import java.awt.Toolkit; -import java.awt.event.InputMethodEvent; -import java.awt.event.InputMethodListener; /** * Number Field. @@ -39,11 +34,6 @@ public class UINumberField extends UITextField { private boolean isContentChanged = false; private boolean fillNegativeNumber = true; - /** - * 输入法输入完成一个字符输入过程的标记。开始输入的时候是true,输入完矫正光标后为false - */ - private boolean isInputMethodOnceInserting = false; - private int insertOffset = 0; public UINumberField() { this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH); @@ -64,7 +54,6 @@ public class UINumberField extends UITextField { this.minValue = minValue; this.maxValue = maxValue; setFieldDocument(); - initFieldListener(); } public void setFieldDocument() { @@ -72,31 +61,6 @@ public class UINumberField extends UITextField { initListener(); } - private void initFieldListener() { - addInputMethodListener(new InputMethodListener() { - @Override - public void inputMethodTextChanged(InputMethodEvent event) { - isInputMethodOnceInserting = true; - } - - @Override - public void caretPositionChanged(InputMethodEvent event) { - } - }); - - addCaretListener(new CaretListener() { - @Override - public void caretUpdate(CaretEvent e) { - if (isInputMethodOnceInserting) { - isInputMethodOnceInserting = false; - setCaretPosition(insertOffset); - } else { - insertOffset = e.getDot(); - } - } - }); - } - public void canFillNegativeNumber(boolean fillNegativeNumber) { this.fillNegativeNumber = fillNegativeNumber; } @@ -221,13 +185,6 @@ public class UINumberField extends UITextField { super.insertString(offset, s, a); } - public void remove(int offs, int len) throws BadLocationException { - if (isInputMethodOnceInserting) { - return; - } - super.remove(offs, len); - } - // kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100. // 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难.. private boolean notChange(String strNew) {