Browse Source

REPORT-20868 sonar问题修复

research/11.0
Bryant 5 years ago
parent
commit
61cd191cb1
  1. 2
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java
  3. 10
      designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java
  4. 1
      designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java
  5. 1
      designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java

2
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() {

4
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());

10
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;

1
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"));
}

1
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"));
}

Loading…
Cancel
Save