From 655c147802b70ae23a654d461b4e717c6d4ab423 Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 25 Mar 2020 14:55:58 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD-?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E5=A4=84=E7=90=86=E4=B8=8B=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E7=9A=84=20npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index d73f36a7a8..9276bd5c62 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -200,21 +200,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { String key = provider.key(); PropertyItemBean itemBean = provider.getItem(); - String btnIconBaseDir = itemBean.getBtnIconBaseDir(); - PropertyItem propertyItem; - if (StringUtils.isEmpty(btnIconBaseDir)) { - propertyItem = new PropertyItem(itemBean.getName(), - itemBean.getTitle(), - itemBean.getBtnIconName(), - itemBean.getVisibleModes(), - itemBean.getEnableModes()); - } else{ - propertyItem = new PropertyItem(itemBean.getName(), + PropertyItem propertyItem = new PropertyItem(itemBean.getName(), itemBean.getTitle(), itemBean.getBtnIconName(), - btnIconBaseDir, itemBean.getVisibleModes(), itemBean.getEnableModes()); + String btnIconBaseDir = itemBean.getBtnIconBaseDir(); + if (StringUtils.isNotEmpty(btnIconBaseDir)) { + propertyItem.setIconBaseDir(btnIconBaseDir); } UIButton button = propertyItem.getButton(); List buttonListeners = itemBean.getButtonListeners(); @@ -730,7 +723,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer { this.isEnabled = isEnabled; button.setEnabled(isEnabled); } - + + public void setIconBaseDir(String iconBaseDir) { + this.iconBaseDir = iconBaseDir; + } + + private String getIconBaseDir() { + + return StringUtils.isEmpty(iconBaseDir) ? ICON_BASE_DIR : iconBaseDir; + } + private void initPropertyPanel() { propertyPanel = new JPanel(); propertyPanel.setBackground(Color.pink); @@ -811,7 +813,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - return iconBaseDir + btnIconName + iconSuffix; + + return getIconBaseDir() + btnIconName + iconSuffix; } public void resetButtonIcon() {