Browse Source

Merge pull request #1530 in DESIGN/design from ~HARRISON/design:feature/10.0 to feature/10.0

* commit '8e3adfb68f7930be3605f528313e8b3dcbdf4adc':
  REPORT-27647 模板组件的安装下载-模板组件复用插件 处理下可能的 npe
  REPORT-27647 模板组件的安装下载-模板组件复用插件 修复部分监听上的问题
persist/11.0
Harrison 5 years ago
parent
commit
e59463f6ad
  1. 4
      designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java
  2. 27
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  3. 10
      designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java
  4. 12
      designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java
  5. 2
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java

4
designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java

@ -14,6 +14,10 @@ public interface PropertyItemPaneProvider<T> extends Mutable {
String XML_TAG = "PropertyItemPaneProvider";
int FIRST = 100;
int LAST = -100;
/**
* 独一无二的标志
*

27
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -145,7 +145,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
};
PluginListenerRegistration.getInstance().listen(
PluginEventType.AfterRun,
new PluginEventListener() {
new PluginEventListener(PropertyItemPaneProvider.FIRST) {
@Override
public void on(PluginEvent event) {
PluginContext context = event.getContext();
@ -159,7 +159,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}, filter);
PluginListenerRegistration.getInstance().listen(
PluginEventType.BeforeStop,
new PluginEventListener(10) {
new PluginEventListener(PropertyItemPaneProvider.FIRST) {
@Override
public void on(PluginEvent event) {
PluginContext context = event.getContext();
@ -205,6 +205,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
itemBean.getBtnIconName(),
itemBean.getVisibleModes(),
itemBean.getEnableModes());
String btnIconBaseDir = itemBean.getBtnIconBaseDir();
if (StringUtils.isNotEmpty(btnIconBaseDir)) {
propertyItem.setIconBaseDir(btnIconBaseDir);
}
UIButton button = propertyItem.getButton();
List<ActionListener> buttonListeners = itemBean.getButtonListeners();
for (ActionListener buttonListener : buttonListeners) {
@ -648,14 +652,21 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String ICON_SUFFIX_DISABLED = "_disabled.png";
private static final String ICON_SUFFIX_SELECTED = "_selected.png";
private String btnIconName;
private String iconBaseDir;
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
private final Color selectedBtnBackground = new Color(0xF5F5F7);
private Color originBtnBackground;
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) {
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes);
}
public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes) {
this.name = name;
this.title = title;
this.btnIconName = btnIconName;
this.iconBaseDir = iconBaseDir;
initButton();
initPropertyPanel();
initModes(visibleModes, enableModes);
@ -713,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);
@ -793,7 +813,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
private String getBtnIconUrl() {
return ICON_BASE_DIR + btnIconName + iconSuffix;
return getIconBaseDir() + btnIconName + iconSuffix;
}
public void resetButtonIcon() {

10
designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java

@ -11,6 +11,7 @@ public class PropertyItemBean {
private String name;
private String title;
private String btnIconName;
private String btnIconBaseDir;
private EastRegionContainerPane.PropertyMode[] visibleModes;
private EastRegionContainerPane.PropertyMode[] enableModes;
private List<ActionListener> buttonListeners;
@ -42,6 +43,15 @@ public class PropertyItemBean {
this.btnIconName = btnIconName;
}
public String getBtnIconBaseDir() {
return btnIconBaseDir;
}
public void setBtnIconBaseDir(String btnIconBaseDir) {
this.btnIconBaseDir = btnIconBaseDir;
}
public EastRegionContainerPane.PropertyMode[] getVisibleModes() {
return visibleModes;
}

12
designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java

@ -43,9 +43,12 @@ public class SnapChatConfig implements XMLable {
@Override
public void readXML(XMLableReader reader) {
String tagName = reader.getTagName();
if ("MarkReadMap".equals(tagName)) {
readMarkReadMapXML(reader);
if (reader.isChildNode()) {
if ("item".equals(reader.getTagName())) {
String tmpVal = reader.getElementValue();
Boolean markRead = Boolean.valueOf(tmpVal);
markReadMap.put(reader.getAttrAsString("key", StringUtils.EMPTY), markRead);
}
}
}
@ -62,9 +65,6 @@ public class SnapChatConfig implements XMLable {
reader.readXMLObject(new XMLReadable() {
@Override
public void readXML(XMLableReader reader) {
String tmpVal = reader.getElementValue();
Boolean markRead = Boolean.valueOf(tmpVal);
markReadMap.put(reader.getAttrAsString("key", StringUtils.EMPTY), markRead);
}
});
}

2
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -148,7 +148,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
}
};
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun,
new PluginEventListener() {
new PluginEventListener(PropertyItemPaneProvider.LAST) {
@Override
public void on(PluginEvent event) {
PluginContext context = event.getContext();

Loading…
Cancel
Save