Browse Source

REPORT-27647 模板组件的安装下载-模板组件复用插件

处理下可能的 npe
persist/11.0
Harrison 5 years ago
parent
commit
8e3adfb68f
  1. 27
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

27
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(),
PropertyItem propertyItem = new PropertyItem(itemBean.getName(),
itemBean.getTitle(),
itemBean.getBtnIconName(),
itemBean.getVisibleModes(),
itemBean.getEnableModes());
} else{
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<ActionListener> buttonListeners = itemBean.getButtonListeners();
@ -731,6 +724,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
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() {

Loading…
Cancel
Save