From caf8788a56089e1745fc183357a314ddfc82d91f Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 29 Sep 2017 16:41:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4683=20[9.0=E4=BA=8C=E8=BD=AE=E5=9B=9E?= =?UTF-8?q?=E5=BD=92]=E5=A4=8D=E9=80=89=E6=A1=86=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=80=BC=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=BB=91=E5=AE=9A=E5=AD=97=E6=AE=B5=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/icombobox/LazyComboBox.java | 2 ++ .../src/com/fr/design/gui/itextfield/UITextField.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java b/designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java index 5ff9330295..2d69c2fc83 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java +++ b/designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java @@ -175,8 +175,10 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen this.item = item; this.setting = true; + textField.setSetting(true); String newText = (item == null) ? "" : item.toString(); textField.setText(newText); + textField.setSetting(false); this.setting = false; } diff --git a/designer_base/src/com/fr/design/gui/itextfield/UITextField.java b/designer_base/src/com/fr/design/gui/itextfield/UITextField.java index 7df91335c2..76dad8e30a 100644 --- a/designer_base/src/com/fr/design/gui/itextfield/UITextField.java +++ b/designer_base/src/com/fr/design/gui/itextfield/UITextField.java @@ -25,6 +25,8 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs private String textFeildName = ""; private GlobalNameListener globalNameListener = null; private Dimension preferredSize = null; + //有些情况下setText的时候不希望触发attributeChange,添加一个属性标识 + private boolean isSetting = false; public UITextField() { super(); @@ -79,6 +81,7 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs } + public void setPreferredSize(Dimension preferredSize) { this.preferredSize = preferredSize; } @@ -88,6 +91,9 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs } protected void attributeChange() { + if(isSetting){ + return; + } if (globalNameListener != null && shouldResponseNameListener()) { globalNameListener.setGlobalName(textFeildName); }