From e5a69f8c921ae10fec431a835faa5f813c2f666b Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 29 Oct 2018 17:30:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-11714=20=E5=BC=80=E6=94=BE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/properties/PropertyTab.java | 5 ++++ .../ParameterExpandablePaneUIProvider.java | 26 +++++++++++++++++++ ...ractParameterExpandablePaneUIProvider.java | 19 ++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/designer/properties/PropertyTab.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractParameterExpandablePaneUIProvider.java diff --git a/designer-base/src/main/java/com/fr/design/designer/properties/PropertyTab.java b/designer-base/src/main/java/com/fr/design/designer/properties/PropertyTab.java new file mode 100644 index 0000000000..2bd49a14ab --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/designer/properties/PropertyTab.java @@ -0,0 +1,5 @@ +package com.fr.design.designer.properties; + +public enum PropertyTab { + ATTR, MOBILE +} diff --git a/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java new file mode 100644 index 0000000000..c5fb252058 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java @@ -0,0 +1,26 @@ +package com.fr.design.fun; + +import com.fr.design.designer.properties.PropertyTab; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.stable.fun.mark.Mutable; + +/** + * created by hades on 18/10/16 + * 该接口支持在设计器cpt&frm参数界面的属性和移动端下添加一个UIExpandablePane(可展开面板) + */ +public interface ParameterExpandablePaneUIProvider extends Mutable { + + String XML_TAG = "ParameterExpandablePaneUIProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 如果面板不存在,则创建可展开面板并添加子容器;否则在某个tabPane下的UIExpandablePane实例中增加子容器 + * + * @param propertyTab 可展开面板放在哪个propertyTab下,例如属性或者移动端 + * @param UIExpandablePaneName 可扩展面板名称 + * @return UIExpandablePane + */ + UIExpandablePane createUIExpandablePane(PropertyTab propertyTab, String UIExpandablePaneName); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractParameterExpandablePaneUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractParameterExpandablePaneUIProvider.java new file mode 100644 index 0000000000..a357958ca9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractParameterExpandablePaneUIProvider.java @@ -0,0 +1,19 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ParameterExpandablePaneUIProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +@API(level = ParameterExpandablePaneUIProvider.CURRENT_LEVEL) +public abstract class AbstractParameterExpandablePaneUIProvider extends AbstractProvider implements ParameterExpandablePaneUIProvider{ + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} From f4029d13b6c7b14653d72b46c1c53646d833c7dc Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 29 Oct 2018 19:41:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=90=8D=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/ParameterExpandablePaneUIProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java index c5fb252058..90639cb2f2 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java @@ -18,9 +18,9 @@ public interface ParameterExpandablePaneUIProvider extends Mutable { * 如果面板不存在,则创建可展开面板并添加子容器;否则在某个tabPane下的UIExpandablePane实例中增加子容器 * * @param propertyTab 可展开面板放在哪个propertyTab下,例如属性或者移动端 - * @param UIExpandablePaneName 可扩展面板名称 + * @param uiExpandablePaneName 可扩展面板名称 * @return UIExpandablePane */ - UIExpandablePane createUIExpandablePane(PropertyTab propertyTab, String UIExpandablePaneName); + UIExpandablePane createUIExpandablePane(PropertyTab propertyTab, String uiExpandablePaneName); } From 987f312759e630bfbcf72a733e51574380d4478e Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 2 Nov 2018 12:26:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-11714=20=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9A=E4=B9=89=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E5=9C=A8=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=81=9A?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/ParameterExpandablePaneUIProvider.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java index 90639cb2f2..3ca917c41f 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java @@ -15,12 +15,17 @@ public interface ParameterExpandablePaneUIProvider extends Mutable { int CURRENT_LEVEL = 1; /** - * 如果面板不存在,则创建可展开面板并添加子容器;否则在某个tabPane下的UIExpandablePane实例中增加子容器 + * 创建可展开面板并添加子容器 * - * @param propertyTab 可展开面板放在哪个propertyTab下,例如属性或者移动端 - * @param uiExpandablePaneName 可扩展面板名称 * @return UIExpandablePane */ - UIExpandablePane createUIExpandablePane(PropertyTab propertyTab, String uiExpandablePaneName); + UIExpandablePane createUIExpandablePane(); + + /** + * 指定添加UIExpandablePane到哪个PropertyTab下,例如属性,移动端 + * + * @return PropertyTab + */ + PropertyTab addToWhichPropertyTab(); } From 005004fabaed3f86c3069ea78bd74663152c1a80 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 2 Nov 2018 12:34:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-11714=20=E5=BC=80=E6=94=BE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E5=BA=94=E7=9A=84=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/parameter/RootDesignDefinePane.java | 18 ++++++++++++++++++ .../designer/mobile/ParaMobileDefinePane.java | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java index 75a8c61fe5..b25f167522 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java @@ -1,14 +1,17 @@ package com.fr.design.parameter; import com.fr.base.BaseUtils; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.PropertyGroupPane; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.properties.PropertyTab; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.fun.ParameterExpandablePaneUIProvider; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; @@ -30,6 +33,7 @@ import javax.swing.Icon; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; +import java.util.Set; /** * Created by ibm on 2017/8/2. @@ -63,9 +67,23 @@ public class RootDesignDefinePane extends AbstractDataModify { JPanel layoutPane = createBoundsPane(); UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Size"), 280, 20, layoutPane); this.add(layoutExpandablePane, BorderLayout.CENTER); + this.addExtraUIExpandablePaneFromPlugin(); } + private void addExtraUIExpandablePaneFromPlugin() { + Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ParameterExpandablePaneUIProvider.XML_TAG); + JPanel panel = FRGUIPaneFactory.createYBoxEmptyBorderPane(); + for (ParameterExpandablePaneUIProvider provider : pluginCreators) { + UIExpandablePane uiExpandablePane = provider.createUIExpandablePane(); + PropertyTab propertyTab = provider.addToWhichPropertyTab(); + if (uiExpandablePane != null && propertyTab == PropertyTab.ATTR) { + panel.add(uiExpandablePane); + } + } + this.add(panel, BorderLayout.SOUTH); + } + public JPanel createBoundsPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 6b65324840..c7b2ed5981 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -1,8 +1,11 @@ package com.fr.design.widget.ui.designer.mobile; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.properties.PropertyTab; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.fun.ParameterExpandablePaneUIProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.FormDesigner; @@ -14,6 +17,7 @@ import com.fr.form.ui.container.WSortLayout; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.util.Set; /** * Created by plough on 2018/2/5. @@ -33,9 +37,23 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.add(getMobileWidgetListPane(), BorderLayout.CENTER); + this.addExtraUIExpandablePaneFromPlugin(); this.repaint(); } + private void addExtraUIExpandablePaneFromPlugin() { + Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ParameterExpandablePaneUIProvider.XML_TAG); + JPanel panel = FRGUIPaneFactory.createYBoxEmptyBorderPane(); + for (ParameterExpandablePaneUIProvider provider : pluginCreators) { + UIExpandablePane uiExpandablePane = provider.createUIExpandablePane(); + PropertyTab propertyTab = provider.addToWhichPropertyTab(); + if (uiExpandablePane != null && propertyTab == PropertyTab.MOBILE) { + panel.add(uiExpandablePane); + } + } + this.add(panel, BorderLayout.SOUTH); + } + // 控件顺序 private UIExpandablePane getMobileWidgetListPane() { mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData());