From f279194bba6b963ca30facc4e4c479efca434d83 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 23 Mar 2020 14:12: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=201=E3=80=81=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=202?= =?UTF-8?q?=E3=80=81=E5=88=A4=E7=A9=BA=203=E3=80=81=E6=8E=A5=E5=8F=A3=20xm?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/ComponentLibraryPaneProcessor.java | 28 ++++++++++++++++++- .../design/notification/SnapChatConfig.java | 7 +++-- .../pane/ComponentLibraryPaneCreator.java | 8 ++++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java b/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java index 88385a11b1..7b484b156d 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java @@ -8,24 +8,50 @@ import com.fr.stable.fun.mark.Immutable; import javax.swing.JPanel; /** + * 组件库面板处理器 + * * created by Harrison on 2020/03/16 **/ public interface ComponentLibraryPaneProcessor extends Immutable { - String XML_TAG = "ParameterExpandablePaneUIProvider"; + String XML_TAG = "ComponentLibraryPaneProcessor"; int CURRENT_LEVEL = 1; + /** + * 创建展示面板 + * + * @param isEdit 是否可以编辑 + * @return 展示面板 + */ UIScrollPane createShowPanel(boolean isEdit); + /** + * 创建菜单的上部面板 + * + * @return 面板 + */ JPanel createMenuNorthPane(); + /** + * 创建复选框 + * + * @return 复选框 + */ UIComboBox createMenuComBox(); void parentView(DockingView dockingView); + /** + * 父面板 + * + * @param panel 面板 + */ void parentPane(JPanel panel); + /** + * 创建完成 + */ void complete(); } diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java index c9cc177640..04170e3be8 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java @@ -1,5 +1,6 @@ package com.fr.design.notification; +import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLable; @@ -63,7 +64,7 @@ public class SnapChatConfig implements XMLable { public void readXML(XMLableReader reader) { String tmpVal = reader.getElementValue(); Boolean markRead = Boolean.valueOf(tmpVal); - markReadMap.put(reader.getAttrAsString("key", ""), markRead); + markReadMap.put(reader.getAttrAsString("key", StringUtils.EMPTY), markRead); } }); } @@ -82,7 +83,7 @@ public class SnapChatConfig implements XMLable { @Override public Object clone() throws CloneNotSupportedException { - - return null; + + return super.clone(); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java index 97425fdb4f..8cb5d15334 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java @@ -59,10 +59,14 @@ public class ComponentLibraryPaneCreator { menuPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); JPanel menuPanelNorthPane = processor.createMenuNorthPane(); - menuPanel.add(menuPanelNorthPane, BorderLayout.NORTH); + if (menuPanelNorthPane != null) { + menuPanel.add(menuPanelNorthPane, BorderLayout.NORTH); + } UIComboBox menuPanelComboBox = processor.createMenuComBox(); - menuPanel.add(menuPanelComboBox, BorderLayout.CENTER); + if (menuPanelComboBox != null) { + menuPanel.add(menuPanelComboBox, BorderLayout.CENTER); + } return menuPanel; } }