From 61cd191cb10de001c0e1d61e3b60314b003b65c9 Mon Sep 17 00:00:00 2001 From: Bryant Date: Tue, 20 Aug 2019 09:43:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-20868=20sonar=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/columnrow/ColumnRowPane.java | 2 ++ .../fr/design/gui/controlpane/ObjectUIControlPane.java | 4 ++-- .../main/java/com/fr/design/gui/date/UIDatePicker.java | 10 ++++++++-- .../java/com/fr/design/gui/demo/LoadingPaneDemo.java | 1 + .../com/fr/design/gui/frpane/LoadingBasicPaneTest.java | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java index 615a17bce..e94b18269 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java @@ -146,6 +146,8 @@ public class ColumnRowPane extends JPanel implements UIObserver { if (cftf != null) { cftf.setColumns(3); // specify more width than we need cftf.setHorizontalAlignment(UITextField.LEFT); + }else { + throw new IllegalArgumentException("Spinner'Editor can not be null!"); } ((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java index c5786b4c6..be169a744 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java @@ -1,8 +1,8 @@ package com.fr.design.gui.controlpane; import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import com.fr.design.beans.BasicBeanPane; +import com.fr.stable.AssistUtils; /** * Created by plough on 2017/8/1. @@ -48,7 +48,7 @@ public abstract class ObjectUIControlPane extends UIListControlPane { if (constructor != null) { return constructor; } else { - if (cls.getName() == Object.class.getName()) { + if (AssistUtils.equals(cls.getName(),Object.class.getName())) { return null; } return getConstructor(clazz, cls.getSuperclass()); diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java b/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java index fb44f618f..be3ef20a3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java @@ -157,7 +157,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { /** * 设置当前选择的日期 */ - public void setSelectedDate(Date date) throws ParseException { + public synchronized void setSelectedDate(Date date) throws ParseException { if (date == null) { this.setSelectedItem(null); } else { @@ -165,6 +165,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { } } + @Override public void setSelectedItem(Object anObject) { model.setSelectedItem(anObject); super.setSelectedItem(anObject); @@ -192,12 +193,14 @@ public class UIDatePicker extends UIComboBox implements Serializable { setBorder(BorderFactory.createEmptyBorder()); } + @Override public void hide() { if (isWillHide) { super.hide(); } } + @Override public void show() { if (isWillHide || UIDatePicker.this.isEnabled() == false) { return; @@ -211,6 +214,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { /** * 显示弹出面板 */ + @Override protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { @@ -250,12 +254,14 @@ public class UIDatePicker extends UIComboBox implements Serializable { } } + @Override protected ComboBoxUI getUIComboBoxUI() { return new UIComboBoxUI() { + @Override protected ComboPopup createPopup() { return new DatePopup(comboBox); } - + @Override public void mousePressed(MouseEvent e) { if (UIDatePicker.this.isPopupVisible()) { isWillHide = true; diff --git a/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java b/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java index 2eb93ad3e..b17323774 100644 --- a/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java +++ b/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java @@ -35,6 +35,7 @@ public class LoadingPaneDemo extends JPanel { Thread.sleep(500); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } container.add(new UIButton(i + "adfadwdadawdwad")); } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java index 7c454ad71..e3a1ae7d7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java @@ -24,6 +24,7 @@ public class LoadingBasicPaneTest { Thread.sleep(500); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } container.add(new UIButton(i + "adfadwdadawdwad")); }