From 20e489848ead746bd81099dc1d3ffd0bc5150c72 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 20 May 2016 17:09:19 +0800 Subject: [PATCH 01/37] =?UTF-8?q?=E6=A8=A1=E6=9D=BFweb=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=89=93=E4=B8=8D=E5=BC=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/background/BackgroundFactory.java | 21 ++++++++++++------- .../fr/design/module/ChartDesignerModule.java | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java index 2706f81b1e..61b444a6cc 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java @@ -21,6 +21,13 @@ public class BackgroundFactory { private static Map, BackgroundUIWrapper> map = new LinkedHashMap<>(); private static Map, BackgroundUIWrapper> browser = new LinkedHashMap<>(); + private static final int NULL_BACKGROUND_INDEX = 0; + private static final int COLOR_BACKGROUND_INDEX = 1; + private static final int TEXTURE_BACKGROUND_INDEX = 2; + private static final int PATTERN_BACKGROUND_INDEX = 3; + private static final int GRADIENT_BACKGROUND_INDEX = 4; + private static final int IMAGE_BACKGROUND_INDEX = 5; + static { registerUniversal(map); registerImageBackground(map); @@ -32,25 +39,25 @@ public class BackgroundFactory { private static void registerUniversal(Map, BackgroundUIWrapper> map) { map.put(null, BackgroundUIWrapper.create() - .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null"))); + .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null")).setIndex(NULL_BACKGROUND_INDEX)); map.put(ColorBackground.class, BackgroundUIWrapper.create() - .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color"))); + .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color")).setIndex(COLOR_BACKGROUND_INDEX)); map.put(TextureBackground.class, BackgroundUIWrapper.create() - .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture"))); + .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture")).setIndex(TEXTURE_BACKGROUND_INDEX)); map.put(PatternBackground.class, BackgroundUIWrapper.create() - .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern"))); + .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern")).setIndex(PATTERN_BACKGROUND_INDEX)); map.put(GradientBackground.class, BackgroundUIWrapper.create() - .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color"))); + .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color")).setIndex(GRADIENT_BACKGROUND_INDEX)); } private static void registerImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image"))); + .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); } private static void registerBrowserImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image"))); + .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); } private static void registerExtra(Map, BackgroundUIWrapper> map) { diff --git a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java index 7a209855f1..fd90e3160e 100644 --- a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java @@ -1 +1 @@ -package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { DesignModuleFactory.registerExtraWidgetOptions(options4Show()); } }); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file +package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { DesignModuleFactory.registerExtraWidgetOptions(options4Show()); } }); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if(rowChart == null) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file From e41cd5adeadeeccc7af1ad2d05963f7a84fdaed8 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 21 May 2016 13:06:29 +0800 Subject: [PATCH 02/37] 11 --- .../style/background/BackgroundFactory.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java index 61b444a6cc..2706f81b1e 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java @@ -21,13 +21,6 @@ public class BackgroundFactory { private static Map, BackgroundUIWrapper> map = new LinkedHashMap<>(); private static Map, BackgroundUIWrapper> browser = new LinkedHashMap<>(); - private static final int NULL_BACKGROUND_INDEX = 0; - private static final int COLOR_BACKGROUND_INDEX = 1; - private static final int TEXTURE_BACKGROUND_INDEX = 2; - private static final int PATTERN_BACKGROUND_INDEX = 3; - private static final int GRADIENT_BACKGROUND_INDEX = 4; - private static final int IMAGE_BACKGROUND_INDEX = 5; - static { registerUniversal(map); registerImageBackground(map); @@ -39,25 +32,25 @@ public class BackgroundFactory { private static void registerUniversal(Map, BackgroundUIWrapper> map) { map.put(null, BackgroundUIWrapper.create() - .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null")).setIndex(NULL_BACKGROUND_INDEX)); + .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null"))); map.put(ColorBackground.class, BackgroundUIWrapper.create() - .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color")).setIndex(COLOR_BACKGROUND_INDEX)); + .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color"))); map.put(TextureBackground.class, BackgroundUIWrapper.create() - .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture")).setIndex(TEXTURE_BACKGROUND_INDEX)); + .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture"))); map.put(PatternBackground.class, BackgroundUIWrapper.create() - .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern")).setIndex(PATTERN_BACKGROUND_INDEX)); + .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern"))); map.put(GradientBackground.class, BackgroundUIWrapper.create() - .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color")).setIndex(GRADIENT_BACKGROUND_INDEX)); + .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color"))); } private static void registerImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); + .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image"))); } private static void registerBrowserImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); + .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image"))); } private static void registerExtra(Map, BackgroundUIWrapper> map) { From aadeb1c0515a860e0cef3183a70dc1b564e71b7f Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Wed, 15 Jun 2016 01:01:47 +0800 Subject: [PATCH 03/37] rt --- .../design/designer/creator/XElementCase.java | 64 ++++++++++++++----- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 29310ca0c3..94f5eaffeb 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -1,5 +1,6 @@ package com.fr.design.designer.creator; +import com.fr.base.ConfigManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.properties.mobile.ElementCasePropertyUI; import com.fr.design.form.util.XCreatorConstants; @@ -9,7 +10,10 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.widget.editors.*; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.widget.editors.BooleanEditor; +import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; +import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; @@ -18,6 +22,8 @@ import com.fr.form.ui.ElementCaseEditor; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.core.PropertyChangeAdapter; +import com.fr.stable.fun.FitProvider; +import com.fr.stable.fun.ReportFitAttrProvider; import javax.swing.*; import java.awt.*; @@ -29,17 +35,21 @@ import java.beans.PropertyDescriptor; public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ private UILabel imageLable; private JPanel coverPanel; + private FormDesigner designer; public XElementCase(ElementCaseEditor widget, Dimension initSize) { super(widget, initSize); + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + } - + protected void initXCreatorProperties() { super.initXCreatorProperties(); + // 报表块初始化时要加载对应的borderStyle initBorderStyle(); } - + /** * 是否支持设置标题 * @return 是返回true @@ -78,13 +88,33 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme }; FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); - if (processor == null){ + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); + if (processor == null) { return propertyTableEditor; } - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); + //新建报表块的自适应属性和表单所设置的自适应属性保持一致 + if (this.toData().getReportFitAttr() == null) { + if (getFitAttrProvider().fitStateInPC() != 0) { + this.toData().setFitStateInPC(getFitAttrProvider().fitStateInPC()); + } else { + return propertyTableEditor; + } + } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } + //获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 + private ReportFitAttrProvider getFitAttrProvider () { + FitProvider wbTpl = (FitProvider) designer.getTarget(); + ReportFitAttrProvider globalFitAttr = ConfigManager.getProviderInstance().getFitAttrProvider(); + ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + if (fitAttr != null) { + return fitAttr; + } + return globalFitAttr; + + + } @Override protected String getIconName() { @@ -118,7 +148,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } return editor; } - + /** * 从data中获取到图片背景, 并设置到Label上 */ @@ -126,10 +156,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme UILabel imageLable = new UILabel(); BufferedImage image = toData().getECImage(); setLabelBackground(image, imageLable); - + return imageLable; } - + /** * 设置指定Label的背景 */ @@ -179,7 +209,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public boolean canEnterIntoParaPane(){ return false; } - + /** * 返回报表块对应的widget * @return 返回ElementCaseEditor @@ -187,11 +217,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public ElementCaseEditor toData() { return ((ElementCaseEditor) data); } - + public FormElementCaseProvider getElementCase() { return toData().getElementCase(); } - + public String getElementCaseContainerName() { return toData().getWidgetName(); } @@ -199,20 +229,20 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void setElementCase(FormElementCaseProvider el) { toData().setElementCase(el); } - + public void setBackground(BufferedImage image){ toData().setECImage(image); setEditorIcon(image); } - + private void setEditorIcon(BufferedImage image){ setLabelBackground(image, imageLable); } - + public Dimension getSize(){ return new Dimension(this.getWidth(), this.getHeight()); } - + /** * 响应点击事件 * @param editingMouseListener 事件处理器 @@ -222,8 +252,8 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme super.respondClick(editingMouseListener, e); switchTab(e,editingMouseListener); } - - + + private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ FormDesigner designer = editingMouseListener.getDesigner(); if (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR){ From 093339c75fb922fe158e124074b8d36a320aa0fe Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Wed, 15 Jun 2016 01:06:06 +0800 Subject: [PATCH 04/37] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 94f5eaffeb..1bc489353f 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -94,11 +94,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } //新建报表块的自适应属性和表单所设置的自适应属性保持一致 if (this.toData().getReportFitAttr() == null) { - if (getFitAttrProvider().fitStateInPC() != 0) { - this.toData().setFitStateInPC(getFitAttrProvider().fitStateInPC()); - } else { + if (getFitAttrProvider().fitStateInPC() == 0) { return propertyTableEditor; } + this.toData().setFitStateInPC(getFitAttrProvider().fitStateInPC()); } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } From e2fa9ed902c798a4133e7dbd0c0a6af82085283f Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Wed, 15 Jun 2016 01:15:05 +0800 Subject: [PATCH 05/37] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 1bc489353f..27405ab093 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -101,8 +101,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } - - //获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 + + /** + * 获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 + * @return 返回自适应属性 + */ private ReportFitAttrProvider getFitAttrProvider () { FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider globalFitAttr = ConfigManager.getProviderInstance().getFitAttrProvider(); From dfce694cb3cc0b1e0f002c1169561e83e498136b Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Wed, 15 Jun 2016 14:36:22 +0800 Subject: [PATCH 06/37] rt --- .../fr/design/designer/creator/XElementCase.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 27405ab093..a181ccbf70 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -39,7 +39,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public XElementCase(ElementCaseEditor widget, Dimension initSize) { super(widget, initSize); - this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + } @@ -88,20 +88,16 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme }; FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FitProvider wbTpl = (FitProvider) designer.getTarget(); + ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), fitAttr, this.toData()); if (processor == null) { return propertyTableEditor; } - //新建报表块的自适应属性和表单所设置的自适应属性保持一致 - if (this.toData().getReportFitAttr() == null) { - if (getFitAttrProvider().fitStateInPC() == 0) { - return propertyTableEditor; - } - this.toData().setFitStateInPC(getFitAttrProvider().fitStateInPC()); - } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } - + /** * 获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 * @return 返回自适应属性 From b79724e729118f010aafeb3bcaf51785d97271f5 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 01:09:47 +0800 Subject: [PATCH 07/37] rt --- .../fr/design/fun/FormElementCaseEditorProcessor.java | 6 +++++- .../impl/AbstractFormElementCaseEditorProcessor.java | 9 ++++++++- .../com/fr/design/designer/creator/XElementCase.java | 11 +++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java index 346fdb2b05..bece9e21ce 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -1,6 +1,7 @@ package com.fr.design.fun; import com.fr.stable.fun.Level; +import com.fr.stable.fun.ReportFitAttrProvider; import java.beans.PropertyDescriptor; @@ -19,6 +20,9 @@ public interface FormElementCaseEditorProcessor extends Level{ * @param temp 传入当前操作的class * @return 返回属性表 */ - PropertyDescriptor[] createPropertyDescriptor(Class temp); + PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr); + + int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index d528627d64..334b07a1ce 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -1,6 +1,7 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProcessor; +import com.fr.stable.fun.ReportFitAttrProvider; import java.beans.PropertyDescriptor; @@ -19,7 +20,13 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem * @param temp 传入当前操作的class * @return 返回属性表 */ - public PropertyDescriptor[] createPropertyDescriptor(Class temp){ + @Override + public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr) { return new PropertyDescriptor[0]; } + + @Override + public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + return 0; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index a181ccbf70..84ac74cf59 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -91,10 +91,13 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), fitAttr, this.toData()); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), fitAttr, this.toData().getReportFitAttr()); if (processor == null) { return propertyTableEditor; } + if (toData().getReportFitAttr() == null && processor.getFitStateInPC(fitAttr) != 0) { + toData().setFormFitAttr(getFitAttrProvider(fitAttr)); + } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } @@ -102,16 +105,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme * 获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 * @return 返回自适应属性 */ - private ReportFitAttrProvider getFitAttrProvider () { - FitProvider wbTpl = (FitProvider) designer.getTarget(); + private ReportFitAttrProvider getFitAttrProvider (ReportFitAttrProvider fitAttr) { ReportFitAttrProvider globalFitAttr = ConfigManager.getProviderInstance().getFitAttrProvider(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); if (fitAttr != null) { return fitAttr; } return globalFitAttr; - - } @Override From fd3059c963999acd2db3f67c5eadd61d51cee458 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 01:18:16 +0800 Subject: [PATCH 08/37] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 84ac74cf59..aa8dbb44a0 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -103,6 +103,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme /** * 获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 + * @param fitAttr 表单的自适应属性 * @return 返回自适应属性 */ private ReportFitAttrProvider getFitAttrProvider (ReportFitAttrProvider fitAttr) { From a7792aa6aede8a428b61d5b401c80d3678d0b8ed Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 01:24:26 +0800 Subject: [PATCH 09/37] rt --- .../fr/design/fun/FormElementCaseEditorProcessor.java | 7 +++++++ .../fun/impl/AbstractFormElementCaseEditorProcessor.java | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java index bece9e21ce..929350c157 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -18,10 +18,17 @@ public interface FormElementCaseEditorProcessor extends Level{ /** * 生成属性表 * @param temp 传入当前操作的class + * @param formFitAttr 表单自适应属性 + * @param elementcaseFitAttr 报表块自适应属性 * @return 返回属性表 */ PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr); + /** + * 返回pc自适应属性值 + * @param fitAttrProvider 传入的自适应属性 + * @return 返回pc自适应属性值 + */ int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index 334b07a1ce..f5e0c035b2 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -16,8 +16,10 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem /** - * 生成属性表 + * 返回pc自适应属性值 * @param temp 传入当前操作的class + * @param formFitAttr 表单自适应属性 + * @param elementcaseFitAttr 报表块自适应属性 * @return 返回属性表 */ @Override @@ -25,6 +27,11 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem return new PropertyDescriptor[0]; } + /** + * 生成属性表 + * @param fitAttrProvider 传入的自适应属性 + * @return 返回pc自适应属性值 + */ @Override public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { return 0; From b8b60ce4a4ebe52e4491c313b82462de79e2edf3 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 01:40:29 +0800 Subject: [PATCH 10/37] rt --- .../fun/impl/AbstractFormElementCaseEditorProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index f5e0c035b2..e9b1ac351e 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -16,7 +16,7 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem /** - * 返回pc自适应属性值 + * 生成属性表 * @param temp 传入当前操作的class * @param formFitAttr 表单自适应属性 * @param elementcaseFitAttr 报表块自适应属性 @@ -28,7 +28,7 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem } /** - * 生成属性表 + * 返回pc自适应属性值 * @param fitAttrProvider 传入的自适应属性 * @return 返回pc自适应属性值 */ From 074633c4df94d0798aa67a767934814edb589178 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 10:27:47 +0800 Subject: [PATCH 11/37] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index aa8dbb44a0..9054013c0a 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -91,12 +91,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), fitAttr, this.toData().getReportFitAttr()); + ElementCaseEditor editor = this.toData(); + ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? getFitAttrProvider(fitAttr) : editor.getReportFitAttr(); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (processor == null) { return propertyTableEditor; } - if (toData().getReportFitAttr() == null && processor.getFitStateInPC(fitAttr) != 0) { - toData().setFormFitAttr(getFitAttrProvider(fitAttr)); + if (editor.getReportFitAttr() == null) { + editor.setFormFitAttr(getFitAttrProvider(fitAttr)); } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } From ffcbea3199fd6553ec1b12b806a417485d7fa0b6 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 10:28:26 +0800 Subject: [PATCH 12/37] rt --- .../com/fr/design/fun/FormElementCaseEditorProcessor.java | 5 ++--- .../fun/impl/AbstractFormElementCaseEditorProcessor.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java index 929350c157..2db416d883 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -18,11 +18,10 @@ public interface FormElementCaseEditorProcessor extends Level{ /** * 生成属性表 * @param temp 传入当前操作的class - * @param formFitAttr 表单自适应属性 - * @param elementcaseFitAttr 报表块自适应属性 + * @param reportFitAttr 传入的自适应属性 * @return 返回属性表 */ - PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr); + PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr); /** * 返回pc自适应属性值 diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index e9b1ac351e..8d026bed75 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -18,12 +18,11 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem /** * 生成属性表 * @param temp 传入当前操作的class - * @param formFitAttr 表单自适应属性 - * @param elementcaseFitAttr 报表块自适应属性 + * @param reportFitAttr 传入的自适应属性 * @return 返回属性表 */ @Override - public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr) { + public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { return new PropertyDescriptor[0]; } From 30edd83e8f84197c0f8b8efd9ea5e2cfe6a45acb Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 16 Jun 2016 10:57:34 +0800 Subject: [PATCH 13/37] rt --- .../design/designer/creator/XElementCase.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 9054013c0a..0745478039 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -1,6 +1,5 @@ package com.fr.design.designer.creator; -import com.fr.base.ConfigManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.properties.mobile.ElementCasePropertyUI; import com.fr.design.form.util.XCreatorConstants; @@ -92,30 +91,17 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); ElementCaseEditor editor = this.toData(); - ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? getFitAttrProvider(fitAttr) : editor.getReportFitAttr(); + ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (processor == null) { return propertyTableEditor; } if (editor.getReportFitAttr() == null) { - editor.setFormFitAttr(getFitAttrProvider(fitAttr)); + editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } - /** - * 获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 - * @param fitAttr 表单的自适应属性 - * @return 返回自适应属性 - */ - private ReportFitAttrProvider getFitAttrProvider (ReportFitAttrProvider fitAttr) { - ReportFitAttrProvider globalFitAttr = ConfigManager.getProviderInstance().getFitAttrProvider(); - if (fitAttr != null) { - return fitAttr; - } - return globalFitAttr; - } - @Override protected String getIconName() { return "text_field_16.png"; From 4cd22d76c30cf76905a57bff202d534f561aa96d Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Fri, 17 Jun 2016 14:05:57 +0800 Subject: [PATCH 14/37] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 0745478039..3e8ea79654 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -87,15 +87,16 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme }; FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); + if (processor == null) { + return propertyTableEditor; + } this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); ElementCaseEditor editor = this.toData(); ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); - if (processor == null) { - return propertyTableEditor; - } + if (editor.getReportFitAttr() == null) { editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); } From bc36de71e74ee794eaef650b7f265f5f51f0ad2f Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 17 Jun 2016 15:24:05 +0800 Subject: [PATCH 15/37] =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XElementCase.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 67f66c5ba1..3e8ea79654 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -38,14 +38,17 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public XElementCase(ElementCaseEditor widget, Dimension initSize) { super(widget, initSize); + + } - + protected void initXCreatorProperties() { super.initXCreatorProperties(); + // 报表块初始化时要加载对应的borderStyle initBorderStyle(); } - + /** * 是否支持设置标题 * @return 是返回true @@ -93,13 +96,13 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme ElementCaseEditor editor = this.toData(); ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + if (editor.getReportFitAttr() == null) { editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } - @Override protected String getIconName() { return "text_field_16.png"; @@ -132,7 +135,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } return editor; } - + /** * 从data中获取到图片背景, 并设置到Label上 */ @@ -140,10 +143,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme UILabel imageLable = new UILabel(); BufferedImage image = toData().getECImage(); setLabelBackground(image, imageLable); - + return imageLable; } - + /** * 设置指定Label的背景 */ @@ -193,7 +196,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public boolean canEnterIntoParaPane(){ return false; } - + /** * 返回报表块对应的widget * @return 返回ElementCaseEditor @@ -201,11 +204,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public ElementCaseEditor toData() { return ((ElementCaseEditor) data); } - + public FormElementCaseProvider getElementCase() { return toData().getElementCase(); } - + public String getElementCaseContainerName() { return toData().getWidgetName(); } @@ -213,20 +216,20 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void setElementCase(FormElementCaseProvider el) { toData().setElementCase(el); } - + public void setBackground(BufferedImage image){ toData().setECImage(image); setEditorIcon(image); } - + private void setEditorIcon(BufferedImage image){ setLabelBackground(image, imageLable); } - + public Dimension getSize(){ return new Dimension(this.getWidth(), this.getHeight()); } - + /** * 响应点击事件 * @param editingMouseListener 事件处理器 @@ -236,8 +239,8 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme super.respondClick(editingMouseListener, e); switchTab(e,editingMouseListener); } - - + + private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ FormDesigner designer = editingMouseListener.getDesigner(); if (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR){ From bd74f8fd7fd63668e401413e8abbb400d5468b82 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Sat, 18 Jun 2016 15:52:44 +0800 Subject: [PATCH 16/37] rt --- .../src/com/fr/design/mainframe/JForm.java | 15 +++-- .../actions/TemplateParameterAction.java | 58 +++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index e7342fc875..0ab170429b 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -20,14 +20,12 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.xpane.FormHyperlinkGroupPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.actions.EmbeddedFormExportExportAction; +import com.fr.design.mainframe.actions.TemplateParameterAction; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; -import com.fr.design.menu.KeySetUtils; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; -import com.fr.design.menu.ToolBarDef; +import com.fr.design.menu.*; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.gui.LayoutUtils; import com.fr.file.FILE; @@ -378,8 +376,13 @@ public class JForm extends JTemplate implements BaseJForm { * @return 返回菜单 */ public ShortCut[] shortcut4TemplateMenu() { - return this.index == FORM_TAB ? new ShortCut[0] : - this.elementCaseDesign.shortcut4TemplateMenu(); + if (this.index == FORM_TAB) { + return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ + new TemplateParameterAction(this) + }, new ShortCut[0]); + } else { + return this.elementCaseDesign.shortcut4TemplateMenu(); + } } /** diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java new file mode 100644 index 0000000000..743059ab4d --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -0,0 +1,58 @@ +package com.fr.design.mainframe.actions; + +import com.fr.base.BaseUtils; +import com.fr.base.Parameter; +import com.fr.design.actions.JTemplateAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.mainframe.JForm; +import com.fr.design.menu.KeySetUtils; +import com.fr.design.parameter.ParameterArrayPane; +import com.fr.form.main.Form; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +/** + * Created by 夏翔 on 2016/6/18. + */ +public class TemplateParameterAction extends JTemplateAction { + public TemplateParameterAction(JForm jwb) { + super(jwb); + this.setMenuKeySet(KeySetUtils.REPORT_PARAMETER_ATTR); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + final JForm jwb = getEditingComponent(); + if (jwb == null) { + return; + } + final Form wbTpl = jwb.getTarget(); + + final ParameterArrayPane parameterArrayPane = new ParameterArrayPane(); + BasicDialog parameterArrayDialog = parameterArrayPane.showWindow(SwingUtilities.getWindowAncestor(jwb)); + parameterArrayDialog.setModal(true); + + final Parameter[] copyReportParameterAttr = (Parameter[]) wbTpl.getTemplateParameters(); + parameterArrayPane.populate(copyReportParameterAttr); + parameterArrayDialog.addDialogActionListener(new DialogActionAdapter() { + + @Override + public void doOk() { + wbTpl.clearParameters(); + Parameter[] parameters = parameterArrayPane.updateParameters(); + for (int i = 0; i < parameters.length; i++) { + wbTpl.addParameter(parameters[i]); + } + jwb.fireTargetModified(); + } + }); + parameterArrayDialog.setVisible(true); + + } + +} From d4945b4957f56b642227fd025e1369c9be359f40 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Sat, 18 Jun 2016 16:11:38 +0800 Subject: [PATCH 17/37] RT --- .../fr/design/mainframe/actions/TemplateParameterAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index 743059ab4d..f0385f5a5e 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -37,8 +37,8 @@ public class TemplateParameterAction extends JTemplateAction { BasicDialog parameterArrayDialog = parameterArrayPane.showWindow(SwingUtilities.getWindowAncestor(jwb)); parameterArrayDialog.setModal(true); - final Parameter[] copyReportParameterAttr = (Parameter[]) wbTpl.getTemplateParameters(); - parameterArrayPane.populate(copyReportParameterAttr); + final Parameter[] copyTemplateParameterAttr = (Parameter[]) wbTpl.getTemplateParameters(); + parameterArrayPane.populate(copyTemplateParameterAttr); parameterArrayDialog.addDialogActionListener(new DialogActionAdapter() { @Override From 7371feb14d452979e6d7dc4a00e62475c7d8f061 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Sun, 19 Jun 2016 23:59:57 +0800 Subject: [PATCH 18/37] rt --- .../fr/design/mainframe/actions/TemplateParameterAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index f0385f5a5e..199f0bc6ab 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -37,8 +37,8 @@ public class TemplateParameterAction extends JTemplateAction { BasicDialog parameterArrayDialog = parameterArrayPane.showWindow(SwingUtilities.getWindowAncestor(jwb)); parameterArrayDialog.setModal(true); - final Parameter[] copyTemplateParameterAttr = (Parameter[]) wbTpl.getTemplateParameters(); - parameterArrayPane.populate(copyTemplateParameterAttr); + final Parameter[] copyTemplateParameters = (Parameter[]) wbTpl.getTemplateParameters(); + parameterArrayPane.populate(copyTemplateParameters); parameterArrayDialog.addDialogActionListener(new DialogActionAdapter() { @Override From 8fad9d5bd02802f6d21db402763b4dd9eff87a36 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 12:51:35 +0800 Subject: [PATCH 19/37] rt --- .../actions/report/ReportParameterAction.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportParameterAction.java b/designer/src/com/fr/design/actions/report/ReportParameterAction.java index 61507ebfea..d11b41da62 100644 --- a/designer/src/com/fr/design/actions/report/ReportParameterAction.java +++ b/designer/src/com/fr/design/actions/report/ReportParameterAction.java @@ -3,21 +3,21 @@ */ package com.fr.design.actions.report; -import java.awt.event.ActionEvent; - -import javax.swing.SwingUtilities; - import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.design.actions.JWorkBookAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.parameter.ParameterPropertyPane; import com.fr.main.TemplateWorkBook; import com.fr.main.parameter.ReportParameterAttr; +import javax.swing.*; +import java.awt.event.ActionEvent; + /** * Report Parameter */ @@ -61,7 +61,7 @@ public class ReportParameterAction extends JWorkBookAction { } jwb.fireTargetModified(); jwb.updateReportParameterAttr(); - jwb.populateReportParameterAttr(); + ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(parameters); } }); parameterArrayDialog.setVisible(true); From 4b43ed96c52e4d5457750ada0d7d40f330c0b7fb Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 12:53:01 +0800 Subject: [PATCH 20/37] rt --- .../com/fr/design/mainframe/actions/TemplateParameterAction.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index 199f0bc6ab..b4933f22da 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -49,6 +49,7 @@ public class TemplateParameterAction extends JTemplateAction { wbTpl.addParameter(parameters[i]); } jwb.fireTargetModified(); + jwb.test(parameters); } }); parameterArrayDialog.setVisible(true); From 6cac742394e7cefa893719cbc57a0a04e0520461 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 12:55:06 +0800 Subject: [PATCH 21/37] rt --- .../com/fr/design/actions/report/ReportParameterAction.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportParameterAction.java b/designer/src/com/fr/design/actions/report/ReportParameterAction.java index d11b41da62..5efc98ea99 100644 --- a/designer/src/com/fr/design/actions/report/ReportParameterAction.java +++ b/designer/src/com/fr/design/actions/report/ReportParameterAction.java @@ -11,7 +11,6 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; -import com.fr.design.parameter.ParameterPropertyPane; import com.fr.main.TemplateWorkBook; import com.fr.main.parameter.ReportParameterAttr; @@ -61,7 +60,7 @@ public class ReportParameterAction extends JWorkBookAction { } jwb.fireTargetModified(); jwb.updateReportParameterAttr(); - ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(parameters); + jwb.populateReportParameterAttr(); } }); parameterArrayDialog.setVisible(true); From 12200b967a3b8dd4d00966a7f3143329f2e45bc3 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 13:49:44 +0800 Subject: [PATCH 22/37] rt --- .../design/actions/report/ReportParameterAction.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportParameterAction.java b/designer/src/com/fr/design/actions/report/ReportParameterAction.java index 5efc98ea99..61507ebfea 100644 --- a/designer/src/com/fr/design/actions/report/ReportParameterAction.java +++ b/designer/src/com/fr/design/actions/report/ReportParameterAction.java @@ -3,20 +3,21 @@ */ package com.fr.design.actions.report; +import java.awt.event.ActionEvent; + +import javax.swing.SwingUtilities; + import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.design.actions.JWorkBookAction; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.main.TemplateWorkBook; import com.fr.main.parameter.ReportParameterAttr; -import javax.swing.*; -import java.awt.event.ActionEvent; - /** * Report Parameter */ From 2c0ed8294e89bedcdd4cd47c2b7571e49d590946 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 13:50:21 +0800 Subject: [PATCH 23/37] rt --- .../fr/design/mainframe/actions/TemplateParameterAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index b4933f22da..ee8877084f 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -8,6 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JForm; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; +import com.fr.design.parameter.ParameterPropertyPane; import com.fr.form.main.Form; import javax.swing.*; @@ -49,7 +50,7 @@ public class TemplateParameterAction extends JTemplateAction { wbTpl.addParameter(parameters[i]); } jwb.fireTargetModified(); - jwb.test(parameters); + ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(parameters); } }); parameterArrayDialog.setVisible(true); From 0b70c36cddc7942ca896a153dee9b51e4e46256e Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 15:10:10 +0800 Subject: [PATCH 24/37] rt --- .../com/fr/design/mainframe/actions/TemplateParameterAction.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index ee8877084f..e8c780aa8c 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -50,6 +50,7 @@ public class TemplateParameterAction extends JTemplateAction { wbTpl.addParameter(parameters[i]); } jwb.fireTargetModified(); + jwb.getFormDesign().setParameterArray(parameters); ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(parameters); } }); From fba9bd9b8a1dd0c46f14b0d53361c08fc7345d1c Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 15:12:02 +0800 Subject: [PATCH 25/37] rt --- .../fr/design/mainframe/actions/TemplateParameterAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index e8c780aa8c..5eeda6a012 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -38,7 +38,7 @@ public class TemplateParameterAction extends JTemplateAction { BasicDialog parameterArrayDialog = parameterArrayPane.showWindow(SwingUtilities.getWindowAncestor(jwb)); parameterArrayDialog.setModal(true); - final Parameter[] copyTemplateParameters = (Parameter[]) wbTpl.getTemplateParameters(); + final Parameter[] copyTemplateParameters = wbTpl.getTemplateParameters(); parameterArrayPane.populate(copyTemplateParameters); parameterArrayDialog.addDialogActionListener(new DialogActionAdapter() { From cb12b1595d5300f1120d74ffd4be75b76cd1fd24 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 16:57:22 +0800 Subject: [PATCH 26/37] rt --- designer_form/src/com/fr/design/mainframe/FormDesigner.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 6312c5248a..c806e59f6a 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -340,6 +340,8 @@ public class FormDesigner extends TargetComponent
implements TreeSelection parameterArray = null; refreshParameter(); + //parameter多的时候,不刷新会出现横线 + refreshRoot(); //不知道为什么添加完参数后控件树只有一个label,这儿刷新一下控件树好了 EastRegionContainerPane.getInstance().refreshDownPane(); } From a6090c8cacde774ee6bc180b65e8073171d9d2d8 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 16:59:49 +0800 Subject: [PATCH 27/37] rt --- designer_form/src/com/fr/design/mainframe/FormDesigner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index c806e59f6a..1abf7ca9e3 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -340,7 +340,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection parameterArray = null; refreshParameter(); - //parameter多的时候,不刷新会出现横线 + //parameter多的时候,不刷新会出现控件边界交叉 refreshRoot(); //不知道为什么添加完参数后控件树只有一个label,这儿刷新一下控件树好了 EastRegionContainerPane.getInstance().refreshDownPane(); From d56355bd6b58d29f998336333bd57de3e64e8d7b Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 20 Jun 2016 17:11:35 +0800 Subject: [PATCH 28/37] rt --- .../src/com/fr/design/designer/creator/XWParameterLayout.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java index 1e59959be9..9f92b97861 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java @@ -56,9 +56,6 @@ public class XWParameterLayout extends XWAbsoluteLayout { .getLocText("FR-Designer_Form-Widget_Name")), new CRPropertyDescriptor("background", this.data.getClass()).setEditorClass(BackgroundEditor.class) .setRendererClass(BackgroundRenderer.class).setI18NName(Inter.getLocText("Background")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("display", this.data.getClass()).setEditorClass(BooleanEditor.class) - .setI18NName(Inter.getLocText("ParameterD-Show_Parameter_Window")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("delayDisplayContent", this.data.getClass()).setEditorClass(BooleanEditor.class) .setI18NName(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")) From 00311d96a0229d3a2233ab9e9a9c0090feab16d7 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 21 Jun 2016 09:46:10 +0800 Subject: [PATCH 29/37] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E9=9B=86=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormModelAdapter.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java b/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java index 1ec52ee76e..19daf31133 100644 --- a/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java +++ b/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java @@ -1,20 +1,16 @@ package com.fr.design.mainframe; -import java.util.ArrayList; -import java.util.List; - +import com.fr.base.Parameter; import com.fr.design.DesignModelAdapter; import com.fr.design.file.HistoryTemplateListPane; import com.fr.form.main.Form; import com.fr.form.main.WidgetGatherAdapter; -import com.fr.form.ui.ChartEditorProvider; -import com.fr.form.ui.DataControl; -import com.fr.form.ui.ElementCaseEditor; -import com.fr.form.ui.MultiFileEditor; -import com.fr.form.ui.Widget; -import com.fr.general.ComparatorUtils; +import com.fr.form.ui.*; import com.fr.stable.js.WidgetName; +import java.util.ArrayList; +import java.util.List; + public class FormModelAdapter extends DesignModelAdapter { public FormModelAdapter(BaseJForm jForm) { @@ -100,4 +96,9 @@ public class FormModelAdapter extends DesignModelAdapter { return linkAbleList.toArray(new Widget[linkAbleList.size()]); } + + @Override + public Parameter[] getParameters() { + return this.getBook().getParameters(); + } } \ No newline at end of file From 647ec075043bbd9de9b31fa124e98f82bf30faf3 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Tue, 21 Jun 2016 14:07:04 +0800 Subject: [PATCH 30/37] rt --- .../fr/design/mainframe/actions/TemplateParameterAction.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java index 5eeda6a012..59e08ae03b 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/TemplateParameterAction.java @@ -8,7 +8,6 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JForm; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; -import com.fr.design.parameter.ParameterPropertyPane; import com.fr.form.main.Form; import javax.swing.*; @@ -51,7 +50,7 @@ public class TemplateParameterAction extends JTemplateAction { } jwb.fireTargetModified(); jwb.getFormDesign().setParameterArray(parameters); - ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(parameters); + jwb.getFormDesign().refreshParameter(); } }); parameterArrayDialog.setVisible(true); From 95ec32998b13ac866d64ef3524fc0b96ba18932d Mon Sep 17 00:00:00 2001 From: richie Date: Tue, 21 Jun 2016 22:59:33 +0800 Subject: [PATCH 31/37] =?UTF-8?q?=E7=AE=80=E5=8C=96=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/module/DesignerModule.java | 4 ++- .../fr/design/gui/style/AlignmentPane.java | 4 +-- .../com/fr/design/style/AlignmentPane.java | 5 ++-- .../com/fr/design/mainframe/FormDesigner.java | 27 ------------------- 4 files changed, 8 insertions(+), 32 deletions(-) diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 276172536c..53c4cff0eb 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -54,7 +54,9 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; +import com.fr.stable.fun.LogProvider; import com.fr.stable.module.Module; +import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.script.ValueConverter; import com.fr.stable.xml.ObjectTokenizer; @@ -94,7 +96,7 @@ public class DesignerModule extends DesignModule { InformationCollector.getInstance().collectStartTime(); ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); - ExtraClassManager.getInstance().addLogProvider(DesignerLogImpl.getInstance()); + ExtraClassManager.getInstance().addMutable(LogProvider.MARK_STRING, DesignerLogImpl.getInstance(), PluginSimplify.NULL); } private void registerOtherPane() { diff --git a/designer_base/src/com/fr/design/gui/style/AlignmentPane.java b/designer_base/src/com/fr/design/gui/style/AlignmentPane.java index 1985960f18..ee0a5821e9 100644 --- a/designer_base/src/com/fr/design/gui/style/AlignmentPane.java +++ b/designer_base/src/com/fr/design/gui/style/AlignmentPane.java @@ -134,7 +134,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private void initTextRotationCombox(){ ArrayList selectOption = new ArrayList(); selectOption.add(Inter.getLocText("FR-Designer_Custom-Angle")); - VerticalTextProcessor processor = ExtraClassManager.getInstance().getVerticalTextProcessor(); + VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG); if (processor != null){ selectOption.addAll(Arrays.asList(processor.getComboxOption())); } @@ -241,7 +241,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO } else { this.textComboBox.setSelectedIndex(0); } - if (style.getVerticalText() == Style.VERTICALTEXT && ExtraClassManager.getInstance().getVerticalTextProcessor() != null) { + if (style.getVerticalText() == Style.VERTICALTEXT && ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) != null) { textRotationComboBox.setSelectedIndex(style.getTextDirection() == Style.LEFT_TO_RIGHT ? 1 : 2); } else { textRotationComboBox.setSelectedIndex(0); diff --git a/designer_base/src/com/fr/design/style/AlignmentPane.java b/designer_base/src/com/fr/design/style/AlignmentPane.java index 346465d052..d95d4bcea8 100644 --- a/designer_base/src/com/fr/design/style/AlignmentPane.java +++ b/designer_base/src/com/fr/design/style/AlignmentPane.java @@ -17,6 +17,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.ExtraClassManager; +import com.fr.report.fun.VerticalTextProcessor; import com.fr.stable.CoreConstants; import javax.swing.*; @@ -125,7 +126,7 @@ public class AlignmentPane extends BasicPane { directionBG.add(rightToLeftRB); rightToLeftRB.setSelected(true); - if (ExtraClassManager.getInstance().getVerticalTextProcessor() == null){ + if (ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) == null){ return; } isVerticalTextPanel.add(isVerticalTextCheckBox); @@ -301,7 +302,7 @@ public class AlignmentPane extends BasicPane { } private void populateVertical(Style style){ - if (ExtraClassManager.getInstance().getVerticalTextProcessor() == null){ + if (ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) == null){ return; } this.isVerticalTextCheckBox.setSelected(true); diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 1abf7ca9e3..19bf64c70f 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -740,9 +740,6 @@ public class FormDesigner extends TargetComponent implements TreeSelection public void refreshRoot() { // 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取 XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer()); - if(ExtraClassManager.getInstance().getDebugLogProviders().length != 0){ - formDesignerDebug(); - } // 布局默认都是1,底层的border改为0,不然没意义 this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0)); formLayoutContainer.setBorder(null); @@ -799,9 +796,6 @@ public class FormDesigner extends TargetComponent implements TreeSelection // 再次打开时,layout下root,有内边距的话组件加上 LayoutUtils.layoutContainer(centerContainer); formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); - if(ExtraClassManager.getInstance().getDebugLogProviders().length != 0){ - formDesignerDebug(); - } } @@ -1069,30 +1063,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection */ public void refreshDesignerUI() { LayoutUtils.layoutRootContainer(getRootComponent()); - if(ExtraClassManager.getInstance().getDebugLogProviders().length != 0){ - formDesignerDebug(); - } repaint(); } - private void formDesignerDebug() { - if(this.getTarget().getContainer() instanceof WBorderLayout){ - Widget widget= ((WBorderLayout) this.getTarget().getContainer()).getLayoutWidget(WBorderLayout.CENTER); - if(widget != null){ - ExtraClassManager.getInstance().sendDebugLog(widget.getClass().getName()+"@"+Integer.toHexString(widget.hashCode())); - } - else { - ExtraClassManager.getInstance().sendDebugLog("Target.center is null"); - } - } - if(this.getRootComponent() != null && this.getRootComponent().toData() != null){ - ExtraClassManager.getInstance().sendDebugLog(this.getRootComponent().toData().getClass().getName()+"@"+Integer.toHexString(this.getRootComponent().toData().getClass().hashCode())); - } - else { - ExtraClassManager.getInstance().sendDebugLog("RootComponent or rootComponent.data is null"); - } - } - /** * 返回复制粘贴删除等动作 * @return 同上 From 8861567dfdb7ea444ea01767b78d825307c85fb9 Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 23 Jun 2016 12:08:04 +0800 Subject: [PATCH 32/37] =?UTF-8?q?=20=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=8E=A5=E5=8F=A3=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/DeprecatedActionManager.java | 3 +- .../HighLightConditionAttributesPane.java | 3 +- .../com/fr/design/condition/PaddingPane.java | 2 +- .../fr/design/mainframe/ElementCasePane.java | 3 +- .../com/fr/design/mainframe/JWorkBook.java | 6 +- .../mainframe/cell/CellElementEditPane.java | 2 +- .../com/fr/design/module/DesignerModule.java | 13 +- .../com/fr/design/present/PresentPane.java | 3 +- .../design/report/ReportExportAttrPane.java | 5 +- .../fr/design/report/VerifierListPane.java | 2 +- .../com/fr/design/webattr/EditToolBar.java | 4 +- .../src/com/fr/design/widget/WidgetPane.java | 2 +- .../write/submit/SubmitVisitorListPane.java | 15 +- .../fr/design/ExtraDesignClassManager.java | 920 ++---------------- .../datapane/TableDataCreatorProducer.java | 4 - .../data/datapane/TableDataTreePane.java | 2 +- .../datapane/connect/ConnectionListPane.java | 14 +- .../tabledatapane/TableDataManagerPane.java | 2 +- .../tabledata/wrapper/TableDataFactory.java | 4 - .../com/fr/design/formula/FormulaFactory.java | 2 +- .../design/fun/BackgroundQuickUIProvider.java | 3 +- .../fr/design/fun/BackgroundUIProvider.java | 5 +- .../fr/design/fun/CellAttributeProvider.java | 4 +- .../design/fun/CellWidgetOptionProvider.java | 2 +- .../com/fr/design/fun/ConnectionProvider.java | 4 +- .../fr/design/fun/DesignerEnvProcessor.java | 4 +- .../com/fr/design/fun/ElementUIProvider.java | 4 +- .../fr/design/fun/ExportAttrTabProvider.java | 4 +- .../fr/design/fun/ExportToolBarProvider.java | 4 +- .../fun/FormElementCaseEditorProcessor.java | 4 +- .../design/fun/FormWidgetOptionProvider.java | 4 +- .../fr/design/fun/GlobalListenerProvider.java | 4 +- .../com/fr/design/fun/HighlightProvider.java | 3 +- .../com/fr/design/fun/HyperlinkProvider.java | 3 +- .../design/fun/IndentationUnitProcessor.java | 4 +- .../design/fun/JavaScriptActionProvider.java | 4 +- .../src/com/fr/design/fun/MenuHandler.java | 4 +- .../fun/ParameterWidgetOptionProvider.java | 4 +- .../fr/design/fun/PresentKindProvider.java | 4 +- .../com/fr/design/fun/PreviewProvider.java | 4 +- .../src/com/fr/design/fun/SubmitProvider.java | 4 +- .../design/fun/TableDataDefineProvider.java | 5 +- .../fr/design/fun/TableDataPaneProcessor.java | 4 +- .../fr/design/fun/TitlePlaceProcessor.java | 4 +- .../fr/design/fun/ToolbarItemProvider.java | 4 +- .../com/fr/design/fun/UIFormulaProcessor.java | 4 +- .../fr/design/fun/VerifyDefineProvider.java | 5 +- .../fr/design/fun/WidgetDesignHandler.java | 4 +- .../design/fun/WidgetPropertyUIProvider.java | 4 +- .../AbstractBackgroundQuickUIProvider.java | 2 + .../impl/AbstractBackgroundUIProvider.java | 2 + .../impl/AbstractCellAttributeProvider.java | 2 + .../AbstractCellWidgetOptionProvider.java | 10 +- .../fun/impl/AbstractConnectionProvider.java | 10 +- .../impl/AbstractDesignerEnvProcessor.java | 2 + .../fun/impl/AbstractElementUIProvider.java | 2 + .../impl/AbstractExportAttrTabProvider.java | 2 + ...bstractFormElementCaseEditorProcessor.java | 2 + .../AbstractFormWidgetOptionProvider.java | 9 +- .../impl/AbstractGlobalListenerProvider.java | 10 +- .../fun/impl/AbstractHighlightProvider.java | 9 +- .../fun/impl/AbstractHyperlinkProvider.java | 9 +- .../AbstractIndentationUnitProcessor.java | 2 + .../AbstractJavaScriptActionProvider.java | 9 +- .../design/fun/impl/AbstractMenuHandler.java | 2 + ...AbstractParameterWidgetOptionProvider.java | 9 +- .../fun/impl/AbstractPresentKindProvider.java | 10 +- .../fun/impl/AbstractPreviewProvider.java | 9 +- ...AbstractServerTableDataDefineProvider.java | 29 +- .../fun/impl/AbstractSubmitProvider.java | 10 +- .../fun/impl/AbstractTDPaneProcessor.java | 2 + .../impl/AbstractTableDataDefineProvider.java | 25 +- .../fun/impl/AbstractTitleProcessor.java | 2 + .../design/fun/impl/AbstractToolbarItem.java | 9 +- .../fun/impl/AbstractUIFormulaProcessor.java | 2 + .../impl/AbstractVerifyDefineProvider.java | 2 + .../fun/impl/AbstractWidgetDesignHandler.java | 7 + .../AbstractWidgetPropertyUIProvider.java | 2 + .../design/gui/frpane/HyperlinkGroupPane.java | 5 +- .../fr/design/gui/style/AlignmentPane.java | 2 +- .../fr/design/gui/style/BackgroundPane.java | 3 +- .../javascript/JavaScriptActionPane.java | 3 +- .../design/mainframe/AbstractAppProvider.java | 15 +- .../src/com/fr/design/mainframe/App.java | 5 +- .../fr/design/mainframe/DesignerFrame.java | 2 +- .../DesignerFrameFileDealerPane.java | 3 +- .../mainframe/toolbar/ToolBarMenuDock.java | 17 +- .../src/com/fr/design/menu/ShortCut.java | 16 +- .../com/fr/design/module/DesignModule.java | 5 +- .../style/background/BackgroundFactory.java | 4 +- .../src/com/fr/design/utils/DesignUtils.java | 2 +- designer_base/src/com/fr/env/RemoteEnv.java | 2 +- .../src/com/fr/start/BaseDesigner.java | 9 +- .../design/designer/creator/XElementCase.java | 2 +- .../design/mainframe/WidgetPropertyPane.java | 5 +- 95 files changed, 456 insertions(+), 971 deletions(-) diff --git a/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java b/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java index ccd39d838a..89bbd82bfb 100644 --- a/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java +++ b/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java @@ -34,6 +34,7 @@ import com.fr.report.cell.cellattr.BarcodePresent; import com.fr.report.cell.cellattr.CurrencyLinePresent; import javax.swing.*; +import java.util.Set; /** * peter: 这个方法只是临时放在这边的, 等插件系统全部完善后,立刻删除. @@ -131,7 +132,7 @@ public class DeprecatedActionManager { presentMenu.addShortCut(barcodeAction); presentMenu.addShortCut(currencyLineAction); - PresentKindProvider[] providers = ExtraDesignClassManager.getInstance().getPresentKindProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(PresentKindProvider.MARK_STRING); for (PresentKindProvider provider : providers) { NewPresentAction action = new NewPresentAction(ePane, provider.title(), provider.kindOfPresent().getName()); action.setMnemonic(provider.mnemonic()); diff --git a/designer/src/com/fr/design/condition/HighLightConditionAttributesPane.java b/designer/src/com/fr/design/condition/HighLightConditionAttributesPane.java index 5bdaeb8530..afcef383c5 100644 --- a/designer/src/com/fr/design/condition/HighLightConditionAttributesPane.java +++ b/designer/src/com/fr/design/condition/HighLightConditionAttributesPane.java @@ -9,6 +9,7 @@ import com.fr.report.cell.cellattr.highlight.*; import javax.swing.*; import java.awt.*; import java.util.Iterator; +import java.util.Set; public class HighLightConditionAttributesPane extends ConditionAttributesPane { @@ -48,7 +49,7 @@ public class HighLightConditionAttributesPane extends ConditionAttributesPane providers = ExtraDesignClassManager.getInstance().getArray(HighlightProvider.MARK_STRING); for (HighlightProvider provider : providers) { classPaneMap.put(provider.classForHighlightAction(), provider.appearanceForCondition(this)); } diff --git a/designer/src/com/fr/design/condition/PaddingPane.java b/designer/src/com/fr/design/condition/PaddingPane.java index 89f0dd1e02..935f71d39d 100644 --- a/designer/src/com/fr/design/condition/PaddingPane.java +++ b/designer/src/com/fr/design/condition/PaddingPane.java @@ -46,7 +46,7 @@ public class PaddingPane extends ConditionAttrSingleConditionPane extends Tar } private void addExtraCellEditor(Grid grid) { - ElementUIProvider[] providers = ExtraDesignClassManager.getInstance().getElementUIProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { CellEditor editor = null; Class clazz = provider.targetCellEditorClass(); diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 1455ee011f..1e27feeb58 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -69,6 +69,7 @@ import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Set; /** * JWorkBook used to edit WorkBook. @@ -660,9 +661,10 @@ public class JWorkBook extends JTemplate { * */ public PreviewProvider[] supportPreview() { - return (PreviewProvider[])ArrayUtils.addAll(new PreviewProvider[]{ + Set set = ExtraDesignClassManager.getInstance().getArray(PreviewProvider.MARK_STRING); + return ArrayUtils.addAll(new PreviewProvider[]{ new PagePreview(), new WritePreview(), new ViewPreview() - }, ExtraDesignClassManager.getInstance().getPreviewProviders()); + }, set.toArray(new PreviewProvider[set.size()])); } /** diff --git a/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java b/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java index 78e0c00b0e..3da7406c65 100644 --- a/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java +++ b/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java @@ -180,7 +180,7 @@ public class CellElementEditPane extends BasicPane { paneList.add(new CellPresentPane()); paneList.add(new CellOtherSetPane()); - cellAttributeProvider = ExtraDesignClassManager.getInstance().getCelllAttributeProvider(); + cellAttributeProvider = ExtraDesignClassManager.getInstance().getSingle(CellAttributeProvider.MARK_STRING); if (cellAttributeProvider != null){ paneList.add((AbstractCellAttrPane) cellAttributeProvider.createCellAttributePane()); } diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 53c4cff0eb..8ed444c191 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -71,6 +71,7 @@ import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Iterator; +import java.util.Set; public class DesignerModule extends DesignModule { @@ -120,7 +121,7 @@ public class DesignerModule extends DesignModule { ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.getInstance()); - ElementUIProvider[] providers = ExtraDesignClassManager.getInstance().getElementUIProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor()); } @@ -224,6 +225,16 @@ public class DesignerModule extends DesignModule { public JTemplate openTemplate(FILE tplFile) { return new JWorkBook(asIOFile(tplFile), tplFile); } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public void process() { + + } } @Override diff --git a/designer/src/com/fr/design/present/PresentPane.java b/designer/src/com/fr/design/present/PresentPane.java index 0360a813a0..043b069b0d 100644 --- a/designer/src/com/fr/design/present/PresentPane.java +++ b/designer/src/com/fr/design/present/PresentPane.java @@ -16,6 +16,7 @@ import com.fr.report.cell.cellattr.CurrencyLinePresent; import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * @author zhou @@ -86,7 +87,7 @@ public class PresentPane extends UIComboBoxPane { keys.add(CurrencyLinePresent.class.getName()); displays.add(currency.title4PopupWindow()); - PresentKindProvider[] providers = ExtraDesignClassManager.getInstance().getPresentKindProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(PresentKindProvider.MARK_STRING); for (PresentKindProvider provider : providers) { FurtherBasicBeanPane extra = provider.appearanceForPresent(); paneList.add(extra); diff --git a/designer/src/com/fr/design/report/ReportExportAttrPane.java b/designer/src/com/fr/design/report/ReportExportAttrPane.java index f3df79528e..33eb07519f 100644 --- a/designer/src/com/fr/design/report/ReportExportAttrPane.java +++ b/designer/src/com/fr/design/report/ReportExportAttrPane.java @@ -11,6 +11,7 @@ import com.fr.io.attr.ReportExportAttr; import java.util.ArrayList; import java.util.List; +import java.util.Set; public class ReportExportAttrPane extends BasicPane { @@ -29,8 +30,8 @@ public class ReportExportAttrPane extends BasicPane { uiTabbedPane.addTab("PDF", pdfExportPane); wordExportPane = new WordExportPane(); uiTabbedPane.addTab("Word", wordExportPane); - ExportAttrTabProvider[] providers = ExtraDesignClassManager.getInstance().getExportAttrTabProviders(); - paneList = new ArrayList(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG); + paneList = new ArrayList<>(); for (ExportAttrTabProvider provider : providers) { uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); paneList.add(provider.toExportPane()); diff --git a/designer/src/com/fr/design/report/VerifierListPane.java b/designer/src/com/fr/design/report/VerifierListPane.java index 9142612449..9bdedbd8a5 100644 --- a/designer/src/com/fr/design/report/VerifierListPane.java +++ b/designer/src/com/fr/design/report/VerifierListPane.java @@ -1 +1 @@ -package com.fr.design.report; import com.fr.data.Verifier; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.VerifyDefineProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.report.write.ReportWriteAttr; import com.fr.report.write.ValueVerifier; import com.fr.report.write.WClassVerifier; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; /** * 校验列表 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * * @return 选项 */ public NameableCreator[] createNameableCreators() { NameableCreator[] creators = new NameableCreator[]{ new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", ValueVerifier.class, BuildInVerifierPane.class) }; for (VerifyDefineProvider provider : ExtraDesignClassManager.getInstance().getVerifyDefineProviders()) { creators = ArrayUtils.add(creators, new NameObjectCreator( provider.nameForVerifier(), provider.iconPath(), provider.classForVerifier(), provider.appearanceForVerifier() ) { }); } creators = ArrayUtils.add(creators, new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", WClassVerifier.class, CustomVerifierPane.class)); return creators; } @Override protected String title4PopupWindow() { return "Verify Collections"; } public void populate(ReportWriteAttr reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List nameObjectList = new ArrayList<>(); int verifierCount = reportWriteAttr.getVerifierCount(); for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); nameObjectList.add(new NameObject(verifier.getName(), verifier)); } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); reportWriteAttr.clearVerifiers(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; if (nameObject.getObject() instanceof Verifier) { Verifier verifier = (Verifier) nameObject.getObject(); verifier.setName(nameObject.getName()); reportWriteAttr.addVerifier(verifier); } } } } \ No newline at end of file +package com.fr.design.report; import com.fr.data.Verifier; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.VerifyDefineProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.report.write.ReportWriteAttr; import com.fr.report.write.ValueVerifier; import com.fr.report.write.WClassVerifier; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.Set; /** * 校验列表 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * * @return 选项 */ public NameableCreator[] createNameableCreators() { NameableCreator[] creators = new NameableCreator[]{ new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", ValueVerifier.class, BuildInVerifierPane.class) }; Set set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING); for (VerifyDefineProvider provider : set) { creators = ArrayUtils.add(creators, new NameObjectCreator( provider.nameForVerifier(), provider.iconPath(), provider.classForVerifier(), provider.appearanceForVerifier() ) { }); } creators = ArrayUtils.add(creators, new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", WClassVerifier.class, CustomVerifierPane.class)); return creators; } @Override protected String title4PopupWindow() { return "Verify Collections"; } public void populate(ReportWriteAttr reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List nameObjectList = new ArrayList<>(); int verifierCount = reportWriteAttr.getVerifierCount(); for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); nameObjectList.add(new NameObject(verifier.getName(), verifier)); } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); reportWriteAttr.clearVerifiers(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; if (nameObject.getObject() instanceof Verifier) { Verifier verifier = (Verifier) nameObject.getObject(); verifier.setName(nameObject.getName()); reportWriteAttr.addVerifier(verifier); } } } } \ No newline at end of file diff --git a/designer/src/com/fr/design/webattr/EditToolBar.java b/designer/src/com/fr/design/webattr/EditToolBar.java index 7b64ca2712..c147b1b0f0 100644 --- a/designer/src/com/fr/design/webattr/EditToolBar.java +++ b/designer/src/com/fr/design/webattr/EditToolBar.java @@ -47,6 +47,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import java.util.Set; public class EditToolBar extends BasicPane { @@ -354,7 +355,8 @@ public class EditToolBar extends BasicPane { * 初始化元素 */ public void initComponents() { - exportToolBarProviders = ExtraDesignClassManager.getInstance().getExportToolBarProviders(); + Set set = ExtraDesignClassManager.getInstance().getArray(ExportToolBarProvider.XML_TAG); + exportToolBarProviders = set.toArray(new ExportToolBarProvider[set.size()]); this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane(); icon = new UICheckBox(Inter.getLocText("FR-Designer_Show_Icon")); diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index d14f2da946..4b5ca44332 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -69,7 +69,7 @@ public class WidgetPane extends BasicPane implements ItemListener { if (e.getStateChange() == ItemEvent.SELECTED) { Widget oldWidget = update(); Widget selectedItem = editorTypeComboBox.getCellWidget(); - WidgetDesignHandler handler = ExtraDesignClassManager.getInstance().getWidgetDesignHandler(); + WidgetDesignHandler handler = ExtraDesignClassManager.getInstance().getSingle(WidgetDesignHandler.XML_TAG); if (handler != null) { handler.transferWidgetProperties(oldWidget, selectedItem); } diff --git a/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java index 033a01e5e1..156af0f962 100644 --- a/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -21,7 +21,6 @@ import com.fr.report.write.BuiltInSQLSubmiter; import com.fr.report.write.ReportWriteAttr; import com.fr.report.write.SubmitVisitor; import com.fr.report.write.WClassSubmiter; -import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.write.BuiltInSQLSubmiterProvider; import com.fr.write.DBManipulation; @@ -31,10 +30,8 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.*; import java.util.List; -import java.util.Map; public class SubmitVisitorListPane extends ObjectJControlPane { @@ -172,17 +169,17 @@ public class SubmitVisitorListPane extends ObjectJControlPane { public CustomPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); - customSubmitPanes = new HashMap(); - comboItemsMap = new HashMap(); + customSubmitPanes = new HashMap<>(); + comboItemsMap = new HashMap<>(); - SubmitProvider[] providers = ExtraDesignClassManager.getInstance().getSubmitProviders(); - providers = (SubmitProvider[]) ArrayUtils.add(providers, new DefaultSubmit()); + Set providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING); + providers.add(new DefaultSubmit()); for (SubmitProvider provider : providers) { customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit()); comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit()); } - configTypes = new ArrayList(); + configTypes = new ArrayList<>(); for (Map.Entry entry : customSubmitPanes.entrySet()) { String key = entry.getKey(); configTypes.add(comboItemsMap.get(key)); diff --git a/designer_base/src/com/fr/design/ExtraDesignClassManager.java b/designer_base/src/com/fr/design/ExtraDesignClassManager.java index d8fae1dcf5..72c9028213 100644 --- a/designer_base/src/com/fr/design/ExtraDesignClassManager.java +++ b/designer_base/src/com/fr/design/ExtraDesignClassManager.java @@ -5,54 +5,33 @@ package com.fr.design; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.data.datapane.TableDataNameObjectCreator; -import com.fr.design.data.tabledata.wrapper.TableDataFactory; import com.fr.design.fun.*; -import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOptionFactory; -import com.fr.design.mainframe.App; -import com.fr.design.mainframe.DesignerFrame; -import com.fr.design.menu.ShortCut; import com.fr.design.widget.Appearance; -import com.fr.file.XMLFileManager; import com.fr.form.ui.Widget; -import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.GeneralUtils; -import com.fr.plugin.PluginCollector; -import com.fr.plugin.PluginInvalidLevelException; -import com.fr.plugin.PluginLicenseManager; -import com.fr.plugin.PluginMessage; +import com.fr.general.IOUtils; +import com.fr.plugin.ExtraXMLFileManager; import com.fr.stable.EnvChangedListener; -import com.fr.stable.StringUtils; -import com.fr.stable.fun.Authorize; -import com.fr.stable.fun.Level; import com.fr.stable.plugin.ExtraDesignClassManagerProvider; import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * @author : richie * @since : 8.0 * 用于设计器扩展的管理类 */ -public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesignClassManagerProvider { +public class ExtraDesignClassManager extends ExtraXMLFileManager implements ExtraDesignClassManagerProvider { private static final String XML_TAG = "ExtraDesignClassManager"; - private static final String TEMPLATE_TREE_TAG = "TemplateTreeShortCut"; - - private static ClassLoader loader = Thread.currentThread().getContextClassLoader(); private static ExtraDesignClassManager classManager; @@ -78,232 +57,11 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi classManager = null; } - private List reportTDCreators; - private List serverTDCreators; - - private List parameterWidgetOptions; - private Map, Class> parameterWidgetOptionsMap; - private List webWidgetOptions; - - private List formWidgetOptions; - private List formWidgetContainerOptions; - private Map, Class> formWidgetOptionsMap; - - private List cellWidgetOptions; - private Map, Appearance> cellWidgetOptionMap; - private List connectionCreators; - private Set previewProviders; - - private Set highlightProviders; - - private TableDataCreatorProvider tableDataCreatorProvider; - - private List menuHandlers; - - private UIFormulaProcessor uiFormulaProcessor; - - private List presentKindProviders; - - private List exportToolBarProviders; - - private Set templateTreeShortCutProviders; - - private List submitProviders; - - private List globalListenerProviders; - - private List javaScriptActionProviders; - - private TitlePlaceProcessor titlePlaceProcessor; - - private FormElementCaseEditorProcessor formElementCaseEditorProcessor; - - private IndentationUnitProcessor indentationUnitProcessor; - - private CellAttributeProvider cellAttributeProvider; - - private Set hyperlinkGroupProviders; - - private DesignerEnvProcessor envProcessor; - - private TableDataPaneProcessor tableDataPaneProcessor; - - private Set elementUIProviders; - - private Set verifyDefineProviders; - - private Set widgetAttrProviders; - - private Set exportAttrTabProviders; - - private WidgetDesignHandler widgetDesignHandler; - - private Set backgroundQuickUIProviders; - - private Set backgroundUIProviders; - - public WidgetDesignHandler getWidgetDesignHandler() { - return widgetDesignHandler; - } - - public void setWidgetDesignHandler(Level level, PluginSimplify simplify) throws Exception { - widgetDesignHandler = (WidgetDesignHandler) level; - } - - public TableDataPaneProcessor getTableDataPaneProcessor() { - return tableDataPaneProcessor; - } - - public void setTableDataPaneProcessor(Level level, PluginSimplify simplify) { - validAPILevel(level, TableDataPaneProcessor.CURRENT_LEVEL, simplify.getPluginName()); - tableDataPaneProcessor = (TableDataPaneProcessor) level; - } - - public DesignerEnvProcessor getEnvProcessor() { - return envProcessor; - } - - public void setEnvProcessor(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, DesignerEnvProcessor.CURRENT_LEVEL, simplify.getPluginName()); - envProcessor = (DesignerEnvProcessor) level; - } - - public void addSupportDesignApps(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, App.CURRENT_LEVEL, simplify.getPluginName()); - App provider = (App) level; - DesignerFrame.registApp(provider); - } - - private void validAPILevel(Level level, int targetLevel, String pluginName) { - if (PluginCollector.getCollector().isError(level, targetLevel, pluginName)) { - throw new PluginInvalidLevelException(pluginName, level.currentAPILevel()); - } - } - - public HyperlinkProvider[] getHyperlinkProvider() { - if (hyperlinkGroupProviders == null) { - return new HyperlinkProvider[0]; - } - return hyperlinkGroupProviders.toArray(new HyperlinkProvider[hyperlinkGroupProviders.size()]); - } - - public void addHyperlinkProvider(Level level, PluginSimplify simplify) throws Exception { - if (hyperlinkGroupProviders == null) { - hyperlinkGroupProviders = new HashSet(); - } - validAPILevel(level, HyperlinkProvider.CURRENT_LEVEL, simplify.getPluginName()); - HyperlinkProvider provider = (HyperlinkProvider) level; - hyperlinkGroupProviders.add(provider); - } - - public GlobalListenerProvider[] getGlobalListenerProvider() { - if (globalListenerProviders == null) { - return new GlobalListenerProvider[0]; - } - return globalListenerProviders.toArray(new GlobalListenerProvider[globalListenerProviders.size()]); - } - - /** - * 获取javaScriptPane - * - * @return javaScriptPane集合 - */ - public List getJavaScriptActionProvider() { - return javaScriptActionProviders; - } - - /** - * 添加一个javaScriptPane - */ - public void addJavaScriptActionProvider(Level level, PluginSimplify simplify) throws Exception { - if (javaScriptActionProviders == null) { - javaScriptActionProviders = new ArrayList(); - } - validAPILevel(level, JavaScriptActionProvider.CURRENT_LEVEL, simplify.getPluginName()); - JavaScriptActionProvider provider = (JavaScriptActionProvider) level; - if (!javaScriptActionProviders.contains(provider)) { - javaScriptActionProviders.add(provider); - } - } - - /** - * 添加全局监听 - */ - public void addGlobalListenerProvider(Level level, PluginSimplify simplify) throws Exception { - if (globalListenerProviders == null) { - globalListenerProviders = new ArrayList(); - } - validAPILevel(level, GlobalListenerProvider.CURRENT_LEVEL, simplify.getPluginName()); - GlobalListenerProvider provider = (GlobalListenerProvider) level; - if (!globalListenerProviders.contains(provider)) { - globalListenerProviders.add(provider); - } - } - - public TableDataCreatorProvider getTableDataCreatorProvider() { - return tableDataCreatorProvider; - } - public void setTableDataCreatorProvider(String className) { - if (StringUtils.isNotBlank(className)) { - try { - Class clazz = Class.forName(className); - tableDataCreatorProvider = (TableDataCreatorProvider) clazz.newInstance(); - } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); - } - } - } - public SubmitProvider[] getSubmitProviders() { - if (submitProviders == null) { - return new SubmitProvider[0]; - } - return submitProviders.toArray(new SubmitProvider[submitProviders.size()]); - } - - /** - * 添加提交接口 - */ - public void addSubmitProvider(Level level, PluginSimplify simplify) throws Exception { - if (submitProviders == null) { - submitProviders = new ArrayList(); - } - validAPILevel(level, SubmitProvider.CURRENT_LEVEL, simplify.getPluginName()); - SubmitProvider provider = (SubmitProvider) level; - if (!submitProviders.contains(provider)) { - submitProviders.add(provider); - } - } public TableDataNameObjectCreator[] getReportTableDataCreators() { - if (reportTDCreators == null) { - return new TableDataNameObjectCreator[0]; - } else { - return reportTDCreators.toArray(new TableDataNameObjectCreator[reportTDCreators.size()]); - } - } - - - /** - * 添加reportTDCreators - * - * @param className 类名 - */ - public void addTableDataNameObjectCreator(String className, PluginSimplify simplify) { - if (StringUtils.isNotBlank(className)) { - try { - if (reportTDCreators == null) { - reportTDCreators = new ArrayList(); - } - TableDataNameObjectCreator creator = createTableDataNameObjectCreator(className, simplify); - if (!reportTDCreators.contains(creator)) { - reportTDCreators.add(creator); - } - } catch (Exception e) { - PluginMessage.remindUpdate(className + e.getMessage()); - } - } + return getKindsOfTableDataCreators(TableDataDefineProvider.XML_TAG); } @@ -313,309 +71,141 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi * @return 类名 */ public TableDataNameObjectCreator[] getServerTableDataCreators() { - if (serverTDCreators == null) { - return new TableDataNameObjectCreator[0]; - } else { - return serverTDCreators.toArray(new TableDataNameObjectCreator[serverTDCreators.size()]); - } + return getKindsOfTableDataCreators(ServerTableDataDefineProvider.XML_TAG); } - /** - * 添加serverTDCreators - * - * @param className 类名 - */ - public void addServerTableDataNameObjectCreator(String className, PluginSimplify simplify) { - if (StringUtils.isNotBlank(className)) { - try { - if (serverTDCreators == null) { - serverTDCreators = new ArrayList(); - } - TableDataNameObjectCreator creator = createTableDataNameObjectCreator(className, simplify); - if (!serverTDCreators.contains(creator)) { - serverTDCreators.add(creator); - } - } catch (Exception e) { - PluginMessage.remindUpdate(className + e.getMessage()); - } + private TableDataNameObjectCreator[] getKindsOfTableDataCreators(String tag) { + Set set = getArray(tag); + if (set.isEmpty()) { + return new TableDataNameObjectCreator[0]; + } + List creators = new ArrayList<>(); + for (TableDataDefineProvider provider : set) { + TableDataNameObjectCreator creator = new TableDataNameObjectCreator( + provider.nameForTableData(), + provider.prefixForTableData(), + provider.iconPathForTableData(), + provider.classForTableData(), + provider.classForInitTableData(), + provider.appearanceForTableData() + ); + creators.add(creator); } + return creators.toArray(new TableDataNameObjectCreator[creators.size()]); } - private TableDataNameObjectCreator createTableDataNameObjectCreator(String className, PluginSimplify simplify) throws Exception { - Class clazz = loader.loadClass(className); - TableDataDefineProvider provider = (TableDataDefineProvider) clazz.newInstance(); - validAPILevel(provider, TableDataDefineProvider.CURRENT_LEVEL, simplify.getPluginName()); - TableDataNameObjectCreator creator = new TableDataNameObjectCreator( - provider.nameForTableData(), - provider.prefixForTableData(), - provider.iconPathForTableData(), - provider.classForTableData(), - provider.classForInitTableData(), - provider.appearanceForTableData() - ); - TableDataFactory.register(provider.classForTableData(), creator); - return creator; - } public Map, Class> getParameterWidgetOptionsMap() { - if (parameterWidgetOptionsMap == null) { - return new HashMap, Class>(); - } else { - return parameterWidgetOptionsMap; + Map, Class> map = new HashMap<>(); + Set set = getArray(ParameterWidgetOptionProvider.XML_TAG); + for (ParameterWidgetOptionProvider provider : set) { + map.put(provider.classForWidget(), provider.appearanceForWidget()); } + return map; } public WidgetOption[] getParameterWidgetOptions() { - if (parameterWidgetOptions == null) { + Set set = getArray(ParameterWidgetOptionProvider.XML_TAG); + if (set.isEmpty()) { return new WidgetOption[0]; - } else { - return parameterWidgetOptions.toArray(new WidgetOption[parameterWidgetOptions.size()]); } - } - - /** - * 添加parameterWidgetOptionsMap - */ - public void addParameterWidgetOption(Level level, PluginSimplify simplify) throws Exception { - if (parameterWidgetOptions == null) { - parameterWidgetOptions = new ArrayList(); - } - if (parameterWidgetOptionsMap == null) { - parameterWidgetOptionsMap = new HashMap, Class>(); + Set result = new HashSet<>(); + for (ParameterWidgetOptionProvider provider : set) { + WidgetOption option = WidgetOptionFactory.createByWidgetClass( + provider.nameForWidget(), + IOUtils.readIcon(provider.iconPathForWidget()), + provider.classForWidget() + ); + result.add(option); } - validAPILevel(level, ParameterWidgetOptionProvider.CURRENT_LEVEL, simplify.getPluginName()); - - ParameterWidgetOptionProvider provider = (ParameterWidgetOptionProvider) level; - WidgetOption option = WidgetOptionFactory.createByWidgetClass( - provider.nameForWidget(), - BaseUtils.readIcon(provider.iconPathForWidget()), - provider.classForWidget() - ); - parameterWidgetOptionsMap.put(provider.classForWidget(), provider.appearanceForWidget()); - parameterWidgetOptions.add(option); + return result.toArray(new WidgetOption[result.size()]); } - /** - * 添加 webWidgetOptions - * - * @return 返回 webWidgetOptions - */ - public void addWebWidgetOption(Level level, PluginSimplify simplify) throws Exception { - if (webWidgetOptions == null) { - webWidgetOptions = new ArrayList(); + + public WidgetOption[] getWebWidgetOptions() { + Set set = getArray(ToolbarItemProvider.XML_TAG); + if (set.isEmpty()) { + return new WidgetOption[0]; } - validAPILevel(level, ToolbarItemProvider.CURRENT_LEVEL, simplify.getPluginName()); - - ToolbarItemProvider provider = (ToolbarItemProvider) level; - WidgetOption option = WidgetOptionFactory.createByWidgetClass( - provider.nameForWidget(), - BaseUtils.readIcon(provider.iconPathForWidget()), - provider.classForWidget() - ); - if (!webWidgetOptions.contains(option)) { - webWidgetOptions.add(option); + List list = new ArrayList<>(); + for (ToolbarItemProvider provider : set) { + WidgetOption option = WidgetOptionFactory.createByWidgetClass( + provider.nameForWidget(), + IOUtils.readIcon(provider.iconPathForWidget()), + provider.classForWidget() + ); + list.add(option); } + return list.toArray(new WidgetOption[list.size()]); } + + public Map, Class> getFormWidgetOptionsMap() { - if (formWidgetOptionsMap == null) { - return new HashMap, Class>(); - } else { - return formWidgetOptionsMap; + Set set = getArray(FormWidgetOptionProvider.XML_TAG); + Map, Class> map = new HashMap<>(); + for (FormWidgetOptionProvider provider : set) { + map.put(provider.classForWidget(), provider.appearanceForWidget()); } + return map; } public WidgetOption[] getFormWidgetOptions() { - if (formWidgetOptions == null) { - return new WidgetOption[0]; - } else { - return formWidgetOptions.toArray(new WidgetOption[formWidgetOptions.size()]); - } - } - - public WidgetOption[] getWebWidgetOptions() { - if (webWidgetOptions == null) { - return new WidgetOption[0]; - } else { - return webWidgetOptions.toArray(new WidgetOption[webWidgetOptions.size()]); - } + return getFormUnits(false); } public WidgetOption[] getFormWidgetContainerOptions() { - if (formWidgetContainerOptions == null) { - return new WidgetOption[0]; - } else { - return formWidgetContainerOptions.toArray(new WidgetOption[formWidgetContainerOptions.size()]); - } - } - - /** - * 添加 formWidgetContainerOptions - */ - public void addFormWidgetOption(Level level, PluginSimplify simplify) throws Exception { - if (formWidgetOptions == null) { - formWidgetOptions = new ArrayList(); - } - if (formWidgetContainerOptions == null) { - formWidgetContainerOptions = new ArrayList(); - } - if (formWidgetOptionsMap == null) { - formWidgetOptionsMap = new HashMap, Class>(); - } - validAPILevel(level, FormWidgetOptionProvider.CURRENT_LEVEL, simplify.getPluginName()); - - FormWidgetOptionProvider provider = (FormWidgetOptionProvider) level; - WidgetOption option = WidgetOptionFactory.createByWidgetClass( - provider.nameForWidget(), - BaseUtils.readIcon(provider.iconPathForWidget()), - provider.classForWidget() - ); - formWidgetOptionsMap.put(provider.classForWidget(), provider.appearanceForWidget()); - if (provider.isContainer()) { - formWidgetContainerOptions.add(option); - } else { - formWidgetOptions.add(option); - } + return getFormUnits(true); } - public Map, Appearance> getCellWidgetOptionsMap() { - if (cellWidgetOptionMap == null) { - return new HashMap, Appearance>(); - } else { - return cellWidgetOptionMap; - } - } - - public WidgetOption[] getCellWidgetOptions() { - if (cellWidgetOptions == null) { + private WidgetOption[] getFormUnits(boolean isContainer) { + Set set = getArray(FormWidgetOptionProvider.XML_TAG); + if (set.isEmpty()) { return new WidgetOption[0]; - } else { - return cellWidgetOptions.toArray(new WidgetOption[cellWidgetOptions.size()]); } - } - - /** - * 添加cellWidgetOptionMap - */ - public void addCellWidgetOption(Level level, PluginSimplify simplify) throws Exception { - if (cellWidgetOptions == null) { - cellWidgetOptions = new ArrayList(); - } - if (cellWidgetOptionMap == null) { - cellWidgetOptionMap = new HashMap, Appearance>(); - } - validAPILevel(level, CellWidgetOptionProvider.CURRENT_LEVEL, simplify.getPluginName()); - - CellWidgetOptionProvider provider = (CellWidgetOptionProvider) level; - WidgetOption option = WidgetOptionFactory.createByWidgetClass( - provider.nameForWidget(), - BaseUtils.readIcon(provider.iconPathForWidget()), - provider.classForWidget() - ); - if (cellWidgetOptions.contains(option)) { - return; - } - cellWidgetOptionMap.put(provider.classForWidget(), new Appearance(provider.appearanceForWidget(), Appearance.P_MARK + cellWidgetOptionMap.size())); - cellWidgetOptions.add(option); - } - - - /** - * 添加 connectionCreators - * - * @param className 类名 - */ - public void addConnection(String className, PluginSimplify simplify) { - if (StringUtils.isNotBlank(className)) { - try { - Class clazz = Class.forName(className); - if (connectionCreators == null) { - connectionCreators = new ArrayList(); - } - ConnectionProvider provider = (ConnectionProvider) clazz.newInstance(); - validAPILevel(provider, ConnectionProvider.CURRENT_LEVEL, simplify.getPluginName()); - NameObjectCreator creator = new NameObjectCreator( - provider.nameForConnection(), - provider.iconPathForConnection(), - provider.classForConnection(), - provider.appearanceForConnection() + Set result = new HashSet<>(); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() == isContainer) { + WidgetOption option = WidgetOptionFactory.createByWidgetClass( + provider.nameForWidget(), + BaseUtils.readIcon(provider.iconPathForWidget()), + provider.classForWidget() ); - if (!connectionCreators.contains(creator)) { - connectionCreators.add(creator); - } - } catch (Exception e) { - PluginMessage.remindUpdate(className + e.getMessage()); + result.add(option); } } + return result.toArray(new WidgetOption[result.size()]); } - public NameObjectCreator[] getConnections() { - if (connectionCreators == null) { - return new NameObjectCreator[0]; - } else { - return connectionCreators.toArray(new NameObjectCreator[connectionCreators.size()]); - } - } - public PreviewProvider[] getPreviewProviders() { - if (previewProviders == null) { - return new PreviewProvider[0]; - } - return previewProviders.toArray(new PreviewProvider[previewProviders.size()]); - } - - /** - * 添加previewProviders - */ - public void addPreviewProvider(Level level, PluginSimplify simplify) throws Exception { - if (previewProviders == null) { - previewProviders = new HashSet(); - } - validAPILevel(level, PreviewProvider.CURRENT_LEVEL, simplify.getPluginName()); - PreviewProvider provider = (PreviewProvider) level; - if (!previewProviders.contains(provider)) { - previewProviders.add(provider); + public WidgetOption[] getCellWidgetOptions() { + Set set = getArray(CellWidgetOptionProvider.XML_TAG); + if (set.isEmpty()) { + return new WidgetOption[0]; } - } - - public HighlightProvider[] getHighlightProviders() { - if (highlightProviders == null) { - return new HighlightProvider[0]; + Set result = new HashSet<>(); + for (CellWidgetOptionProvider provider : set) { + WidgetOption option = WidgetOptionFactory.createByWidgetClass( + provider.nameForWidget(), + IOUtils.readIcon(provider.iconPathForWidget()), + provider.classForWidget() + ); + result.add(option); } - return highlightProviders.toArray(new HighlightProvider[highlightProviders.size()]); - } + return result.toArray(new WidgetOption[result.size()]); - /** - * 添加 highlightProviders - */ - public void addTemplateTreeShortCutProvider(Level level, PluginSimplify simplify) throws Exception { - if (templateTreeShortCutProviders == null) { - templateTreeShortCutProviders = new HashSet(); - } - validAPILevel(level, ShortCut.CURRENT_LEVEL, simplify.getPluginName()); - ShortCut provider = (ShortCut) level; - templateTreeShortCutProviders.add(provider); } - public ShortCut[] getTemplateTreeShortCutProviders() { - if (templateTreeShortCutProviders == null) { - return new ShortCut[0]; + public Map, Appearance> getCellWidgetOptionsMap() { + Set set = getArray(CellWidgetOptionProvider.XML_TAG); + Map, Appearance> map = new HashMap<>(); + for (CellWidgetOptionProvider provider : set) { + map.put(provider.classForWidget(), new Appearance(provider.appearanceForWidget(), Appearance.P_MARK + map.size())); } - return templateTreeShortCutProviders.toArray(new ShortCut[templateTreeShortCutProviders.size()]); + return map; } - /** - * 添加 highlightProviders - */ - public void addConditionProvider(Level level, PluginSimplify simplify) throws Exception { - if (highlightProviders == null) { - highlightProviders = new HashSet(); - } - validAPILevel(level, HighlightProvider.CURRENT_LEVEL, simplify.getPluginName()); - HighlightProvider provider = (HighlightProvider) level; - highlightProviders.add(provider); - } public Feedback getFeedback() { try { @@ -629,208 +219,6 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi return Feedback.EMPTY; } - public MenuHandler[] getMenuHandlers(String category) { - if (menuHandlers == null) { - return new MenuHandler[0]; - } - List handlers = new ArrayList(); - for (MenuHandler handler : menuHandlers) { - if (ComparatorUtils.equals(category, handler.category())) { - handlers.add(handler); - } - } - return handlers.toArray(new MenuHandler[handlers.size()]); - } - - /** - * 添加menuHandlers - */ - public void addMenuHandler(Level level, PluginSimplify simplify) throws Exception { - if (menuHandlers == null) { - menuHandlers = new ArrayList(); - } - validAPILevel(level, MenuHandler.CURRENT_LEVEL, simplify.getPluginName()); - MenuHandler handler = (MenuHandler) level; - if (!menuHandlers.contains(handler)) { - menuHandlers.add(handler); - } - } - - public UIFormulaProcessor getUIFormulaProcessor() { - return uiFormulaProcessor; - } - - public void setUIFormulaProcessor(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, UIFormulaProcessor.CURRENT_LEVEL, simplify.getPluginName()); - uiFormulaProcessor = (UIFormulaProcessor) level; - } - - public PresentKindProvider[] getPresentKindProviders() { - if (presentKindProviders == null) { - return new PresentKindProvider[0]; - } - return presentKindProviders.toArray(new PresentKindProvider[presentKindProviders.size()]); - } - - /** - * 添加presentKindProviders - */ - public void addPresentKindProvider(Level level, PluginSimplify simplify) throws Exception { - if (presentKindProviders == null) { - presentKindProviders = new ArrayList(); - } - validAPILevel(level, PresentKindProvider.CURRENT_LEVEL, simplify.getPluginName()); - PresentKindProvider provider = (PresentKindProvider) level; - presentKindProviders.add(provider); - } - - public ExportToolBarProvider[] getExportToolBarProviders() { - if (exportToolBarProviders == null) { - return new ExportToolBarProvider[0]; - } - return exportToolBarProviders.toArray(new ExportToolBarProvider[exportToolBarProviders.size()]); - } - - /** - * 添加exportToolBarProviders - */ - public void addExportToolBarProvider(Level level, PluginSimplify simplify) throws Exception { - if (exportToolBarProviders == null) { - exportToolBarProviders = new ArrayList(); - } - validAPILevel(level, ExportToolBarProvider.CURRENT_LEVEL, simplify.getPluginName()); - ExportToolBarProvider provider = (ExportToolBarProvider) level; - if (!exportToolBarProviders.contains(provider)) { - exportToolBarProviders.add(provider); - } - } - - public TitlePlaceProcessor getTitlePlaceProcessor() { - return titlePlaceProcessor; - } - - public void setTitlePlaceProcessor(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, TitlePlaceProcessor.CURRENT_LEVEL, simplify.getPluginName()); - titlePlaceProcessor = (TitlePlaceProcessor) level; - } - - public FormElementCaseEditorProcessor getPropertyTableEditor() { - return formElementCaseEditorProcessor; - } - - public void setPropertyTableEditor(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, FormElementCaseEditorProcessor.CURRENT_LEVEL, simplify.getPluginName()); - formElementCaseEditorProcessor = (FormElementCaseEditorProcessor) level; - } - - public IndentationUnitProcessor getIndentationUnitEditor() { - return indentationUnitProcessor; - } - - public void setIndentationUnitEditor(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, IndentationUnitProcessor.CURRENT_LEVEL, simplify.getPluginName()); - indentationUnitProcessor = (IndentationUnitProcessor) level; - } - - public CellAttributeProvider getCelllAttributeProvider() { - return cellAttributeProvider; - } - - public void setCellAttributeProvider(Level level, PluginSimplify simplify) throws Exception { - validAPILevel(level, CellAttributeProvider.CURRENT_LEVEL, simplify.getPluginName()); - cellAttributeProvider = (CellAttributeProvider) level; - } - - public ElementUIProvider[] getElementUIProviders() { - if (elementUIProviders == null) { - return new ElementUIProvider[0]; - } - return elementUIProviders.toArray(new ElementUIProvider[elementUIProviders.size()]); - } - - public void addElementUIProvider(Level level, PluginSimplify simplify) throws Exception { - if (elementUIProviders == null) { - elementUIProviders = new HashSet(); - } - validAPILevel(level, ElementUIProvider.CURRENT_LEVEL, simplify.getPluginName()); - elementUIProviders.add((ElementUIProvider) level); - } - - public WidgetPropertyUIProvider[] getWidgetAttrProviders() { - if (widgetAttrProviders == null) { - return new WidgetPropertyUIProvider[0]; - } - return widgetAttrProviders.toArray(new WidgetPropertyUIProvider[widgetAttrProviders.size()]); - } - - public void addWidgetAttrProvider(Level level, PluginSimplify simplify) throws Exception { - if (widgetAttrProviders == null) { - widgetAttrProviders = new HashSet(); - } - validAPILevel(level, WidgetPropertyUIProvider.CURRENT_LEVEL, simplify.getPluginName()); - widgetAttrProviders.add((WidgetPropertyUIProvider) level); - } - - public ExportAttrTabProvider[] getExportAttrTabProviders() { - if (exportAttrTabProviders == null) { - return new ExportAttrTabProvider[0]; - } - return exportAttrTabProviders.toArray(new ExportAttrTabProvider[exportAttrTabProviders.size()]); - } - - public void addExportAttrTabProvider(Level level, PluginSimplify simplify) throws Exception { - if (exportAttrTabProviders == null) { - exportAttrTabProviders = new HashSet(); - } - validAPILevel(level, ExportAttrTabProvider.CURRENT_LEVEL, simplify.getPluginName()); - exportAttrTabProviders.add((ExportAttrTabProvider) level); - } - - public BackgroundQuickUIProvider[] getBackgroundQuickUIProviders() { - if (backgroundQuickUIProviders == null) { - return new BackgroundQuickUIProvider[0]; - } - return backgroundQuickUIProviders.toArray(new BackgroundQuickUIProvider[backgroundQuickUIProviders.size()]); - } - - public void addBackgroundQuickUIProvider(Level level, PluginSimplify simplify) throws Exception { - if (backgroundQuickUIProviders == null) { - backgroundQuickUIProviders = new HashSet<>(); - } - validAPILevel(level, BackgroundQuickUIProvider.CURRENT_LEVEL, simplify.getPluginName()); - backgroundQuickUIProviders.add((BackgroundQuickUIProvider) level); - } - - public BackgroundUIProvider[] getBackgroundUIProviders() { - if (backgroundUIProviders == null) { - return new BackgroundUIProvider[0]; - } - return backgroundUIProviders.toArray(new BackgroundUIProvider[backgroundUIProviders.size()]); - } - - public void addBackgroundUIProvider(Level level, PluginSimplify simplify) throws Exception { - if (backgroundUIProviders == null) { - backgroundUIProviders = new HashSet<>(); - } - validAPILevel(level, BackgroundUIProvider.CURRENT_LEVEL, simplify.getPluginName()); - backgroundUIProviders.add((BackgroundUIProvider) level); - } - - public VerifyDefineProvider[] getVerifyDefineProviders() { - if (verifyDefineProviders == null) { - return new VerifyDefineProvider[0]; - } - return verifyDefineProviders.toArray(new VerifyDefineProvider[verifyDefineProviders.size()]); - } - - private void addVerifyDefineProvider(Level level, PluginSimplify simplify) throws Exception { - if (verifyDefineProviders == null) { - verifyDefineProviders = new HashSet<>(); - } - validAPILevel(level, VerifyDefineProvider.CURRENT_LEVEL, simplify.getPluginName()); - verifyDefineProviders.add((VerifyDefineProvider) level); - } - /** * 文件名 * @@ -850,128 +238,6 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi readXML(reader, null, PluginSimplify.NULL); } - /** - * 读xml - * - * @param reader xml对象 - * @param extraDesignInterfaceList 接口列表 - */ - @Override - public void readXML(XMLableReader reader, List extraDesignInterfaceList, PluginSimplify simplify) { - if (reader.isChildNode()) { - String tagName = reader.getTagName(); - if (extraDesignInterfaceList != null) { - extraDesignInterfaceList.add(tagName); - } - String className = reader.getAttrAsString("class", ""); - if (StringUtils.isEmpty(className)) { - return; - } - readLevelTag(tagName, className, simplify); - } - } - - private void readLevelTag(String tagName, String className, PluginSimplify simplify) { - try { - //实现了Level接口的, 可以直接newInstance子类的 - Class clazz = loader.loadClass(className); - Authorize authorize = clazz.getAnnotation(Authorize.class); - if (authorize != null) { - PluginLicenseManager.getInstance().registerPaid(authorize, simplify); - } - - Level impl = (Level) clazz.newInstance(); - //控件 - readWidgetRelated(tagName, impl, simplify); - //数据集, 数据连接 - readTableDataRelated(tagName, className, simplify); - // 样式相关的 - readStyleRelated(tagName, impl, simplify); - if (tagName.equals(ParameterWidgetOptionProvider.XML_TAG)) { - addParameterWidgetOption(impl, simplify); - } else if (tagName.equals(PreviewProvider.MARK_STRING)) { - addPreviewProvider(impl, simplify); - } else if (tagName.equals(HighlightProvider.MARK_STRING)) { - addConditionProvider(impl, simplify); - } else if (tagName.equals(MenuHandler.MARK_STRING)) { - addMenuHandler(impl, simplify); - } else if (tagName.equals(UIFormulaProcessor.MARK_STRING)) { - setUIFormulaProcessor(impl, simplify); - } else if (tagName.equals(PresentKindProvider.MARK_STRING)) { - addPresentKindProvider(impl, simplify); - } else if (tagName.equals(TEMPLATE_TREE_TAG)) { - addTemplateTreeShortCutProvider(impl, simplify); - } else if (tagName.equals(SubmitProvider.MARK_STRING)) { - addSubmitProvider(impl, simplify); - } else if (tagName.equals(GlobalListenerProvider.XML_TAG)) { - addGlobalListenerProvider(impl, simplify); - } else if (tagName.equals(JavaScriptActionProvider.XML_TAG)) { - addJavaScriptActionProvider(impl, simplify); - } else if (tagName.equals(TitlePlaceProcessor.MARK_STRING)) { - setTitlePlaceProcessor(impl, simplify); - } else if (tagName.equals(FormElementCaseEditorProcessor.MARK_STRING)) { - setPropertyTableEditor(impl, simplify); - } else if (tagName.equals(IndentationUnitProcessor.MARK_STRING)) { - setIndentationUnitEditor(impl, simplify); - } else if (tagName.equals(CellAttributeProvider.MARK_STRING)) { - setCellAttributeProvider(impl, simplify); - } else if (tagName.equals(HyperlinkProvider.XML_TAG)) { - addHyperlinkProvider(impl, simplify); - } else if (tagName.equals(App.MARK_STRING)) { - addSupportDesignApps(impl, simplify); - } else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) { - setEnvProcessor(impl, simplify); - } else if (tagName.equals(WidgetDesignHandler.XML_TAG)) { - setWidgetDesignHandler(impl, simplify); - } else if (tagName.equals(TableDataPaneProcessor.XML_TAG)) { - setTableDataPaneProcessor(impl, simplify); - } else if (tagName.equals(ElementUIProvider.MARK_STRING)) { - addElementUIProvider(impl, simplify); - } else if (tagName.equals(WidgetPropertyUIProvider.XML_TAG)) { - addWidgetAttrProvider(impl, simplify); - } else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) { - addExportAttrTabProvider(impl, simplify); - } else if (tagName.equals(VerifyDefineProvider.MARK_STRING)) { - addVerifyDefineProvider(impl, simplify); - } - } catch (PluginInvalidLevelException e) { - PluginMessage.remindUpdate(e.getMessage()); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage()); - } - } - - private void readTableDataRelated(String tagName, String className, PluginSimplify simplify) { - if (tagName.equals(TableDataCreatorProvider.XML_TAG)) { - setTableDataCreatorProvider(className); - } else if (tagName.equals(TableDataDefineProvider.XML_TAG)) { - addTableDataNameObjectCreator(className, simplify); - } else if (tagName.equals(ServerTableDataDefineProvider.XML_TAG)) { - addServerTableDataNameObjectCreator(className, simplify); - } else if (tagName.equals(ConnectionProvider.XML_TAG)) { - addConnection(className, simplify); - } - } - - private void readWidgetRelated(String tagName, Level impl, PluginSimplify simplify) throws Exception { - if (tagName.equals(FormWidgetOptionProvider.XML_TAG)) { - addFormWidgetOption(impl, simplify); - } else if (tagName.equals(ToolbarItemProvider.XML_TAG)) { - addWebWidgetOption(impl, simplify); - } else if (tagName.equals(ExportToolBarProvider.XML_TAG)) { - addExportToolBarProvider(impl, simplify); - } else if (tagName.equals(CellWidgetOptionProvider.XML_TAG)) { - addCellWidgetOption(impl, simplify); - } - } - - private void readStyleRelated(String tagName, Level impl, PluginSimplify simplify) throws Exception { - if (tagName.equals(BackgroundQuickUIProvider.MARK_STRING)) { - addBackgroundQuickUIProvider(impl, simplify); - } else if (tagName.equals(BackgroundUIProvider.MARK_STRING)) { - addBackgroundUIProvider(impl, simplify); - } - } /** * 写xml diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataCreatorProducer.java b/designer_base/src/com/fr/design/data/datapane/TableDataCreatorProducer.java index 5f60be6b94..5c98a0c9d1 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataCreatorProducer.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataCreatorProducer.java @@ -100,10 +100,6 @@ public class TableDataCreatorProducer { TableDataNameObjectCreator[] creators = new TableDataNameObjectCreator[]{dataBase, ds_Class, table, fileTable, storeProcedure, multiTable, treeTable}; - TableDataCreatorProvider creatorProvider = ExtraDesignClassManager.getInstance().getTableDataCreatorProvider(); - if (creatorProvider != null) { - return creatorProvider.produceServerTableDataCreator(creators); - } return merge(creators, ExtraDesignClassManager.getInstance().getServerTableDataCreators()); } diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index fcaa7c6e71..162957ebf4 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -47,7 +47,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { public synchronized static BasicTableDataTreePane getInstance(DesignModelAdapter tc) { - TableDataPaneProcessor treePaneProcessor = ExtraDesignClassManager.getInstance().getTableDataPaneProcessor(); + TableDataPaneProcessor treePaneProcessor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG); if (treePaneProcessor != null) { return treePaneProcessor.createTableDataTreePane(tc); } diff --git a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java index 725a65ad33..8d0f2aa392 100644 --- a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -4,6 +4,7 @@ import com.fr.data.impl.Connection; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.ConnectionProvider; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; @@ -107,9 +108,18 @@ public class ConnectionListPane extends JListControlPane { JNDIDatabaseConnection.class, DatabaseConnectionPane.JNDI.class )}; - NameObjectCreator[] pluginCreators = ExtraDesignClassManager.getInstance().getConnections(); + Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG); + for (ConnectionProvider provider : pluginCreators) { + NameObjectCreator creator = new NameObjectCreator( + provider.nameForConnection(), + provider.iconPathForConnection(), + provider.classForConnection(), + provider.appearanceForConnection() + ); + creators = ArrayUtils.add(creators, creator); + } - return (NameableCreator[]) ArrayUtils.addAll(creators, pluginCreators); + return creators; } @Override diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java index daf2ed1f5d..3251f738a5 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java @@ -40,7 +40,7 @@ public class TableDataManagerPane extends LoadingBasicPane { this.tableDataTextField = new UITextField(); tableDataPathPane.add(tableDataTextField, BorderLayout.CENTER); this.tableDataTextField.setEditable(false); - TableDataPaneProcessor paneProcessor = ExtraDesignClassManager.getInstance().getTableDataPaneProcessor(); + TableDataPaneProcessor paneProcessor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG); TableDataPaneController pane = null; if (paneProcessor != null) { pane = paneProcessor.createServerTableDataPane(DesignModelAdapter.getCurrentModelAdapter() diff --git a/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java b/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java index f3d2991c5e..bc414d1a9b 100644 --- a/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java +++ b/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java @@ -59,10 +59,6 @@ public abstract class TableDataFactory { } private static TableDataNameObjectCreator getTableDataNameObjectCreator(TableData tabledata) { - TableDataCreatorProvider creatorProvider = ExtraDesignClassManager.getInstance().getTableDataCreatorProvider(); - if (creatorProvider != null) { - map.putAll(creatorProvider.registerMap()); - } TableDataNameObjectCreator tableDataNameObjectCreator = map.get(tabledata.getClass().getName()); if (tableDataNameObjectCreator == null) { tableDataNameObjectCreator = map.get(tabledata.getClass().getSuperclass().getName()); diff --git a/designer_base/src/com/fr/design/formula/FormulaFactory.java b/designer_base/src/com/fr/design/formula/FormulaFactory.java index e0c19555aa..4e1026584f 100644 --- a/designer_base/src/com/fr/design/formula/FormulaFactory.java +++ b/designer_base/src/com/fr/design/formula/FormulaFactory.java @@ -20,7 +20,7 @@ public class FormulaFactory { } private static UIFormulaProcessor get() { - UIFormulaProcessor processor = ExtraDesignClassManager.getInstance().getUIFormulaProcessor(); + UIFormulaProcessor processor = ExtraDesignClassManager.getInstance().getSingle(UIFormulaProcessor.MARK_STRING); if (processor == null) { processor = new DefaultUIFormulaProcessor(); } diff --git a/designer_base/src/com/fr/design/fun/BackgroundQuickUIProvider.java b/designer_base/src/com/fr/design/fun/BackgroundQuickUIProvider.java index 257d257a3f..9a88175d82 100644 --- a/designer_base/src/com/fr/design/fun/BackgroundQuickUIProvider.java +++ b/designer_base/src/com/fr/design/fun/BackgroundQuickUIProvider.java @@ -3,12 +3,13 @@ package com.fr.design.fun; import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; import com.fr.stable.fun.Level; import com.fr.stable.fun.Provider; +import com.fr.stable.fun.mark.Mutable; /** * Created by richie on 16/5/18. * 背景设置界面接口,用于扩展设置更多类型的背景 */ -public interface BackgroundQuickUIProvider extends Level, Provider { +public interface BackgroundQuickUIProvider extends Mutable { String MARK_STRING = "BackgroundQuickUIProvider"; diff --git a/designer_base/src/com/fr/design/fun/BackgroundUIProvider.java b/designer_base/src/com/fr/design/fun/BackgroundUIProvider.java index 0ae87b9d7d..96808fdab4 100644 --- a/designer_base/src/com/fr/design/fun/BackgroundUIProvider.java +++ b/designer_base/src/com/fr/design/fun/BackgroundUIProvider.java @@ -2,13 +2,12 @@ package com.fr.design.fun; import com.fr.design.style.background.BackgroundDetailPane; import com.fr.general.Background; -import com.fr.stable.fun.Level; -import com.fr.stable.fun.Provider; +import com.fr.stable.fun.mark.Mutable; /** * Created by richie on 16/5/18. */ -public interface BackgroundUIProvider extends Level, Provider { +public interface BackgroundUIProvider extends Mutable { String MARK_STRING = "BackgroundUIProvider"; diff --git a/designer_base/src/com/fr/design/fun/CellAttributeProvider.java b/designer_base/src/com/fr/design/fun/CellAttributeProvider.java index d3822da437..52093ea491 100644 --- a/designer_base/src/com/fr/design/fun/CellAttributeProvider.java +++ b/designer_base/src/com/fr/design/fun/CellAttributeProvider.java @@ -1,12 +1,12 @@ package com.fr.design.fun; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; /** * Created by zhouping on 2015/11/11. */ -public interface CellAttributeProvider extends Level{ +public interface CellAttributeProvider extends Immutable{ String MARK_STRING = "CellAttributeProvider"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/CellWidgetOptionProvider.java b/designer_base/src/com/fr/design/fun/CellWidgetOptionProvider.java index 6fd51f71fd..1cb7869d78 100644 --- a/designer_base/src/com/fr/design/fun/CellWidgetOptionProvider.java +++ b/designer_base/src/com/fr/design/fun/CellWidgetOptionProvider.java @@ -10,7 +10,7 @@ import com.fr.stable.fun.Level; * @since 8.0 * 格子中的自定义控件接口 */ -public interface CellWidgetOptionProvider extends ParameterWidgetOptionProvider, Level { +public interface CellWidgetOptionProvider extends ParameterWidgetOptionProvider { String XML_TAG = "CellWidgetOptionProvider"; diff --git a/designer_base/src/com/fr/design/fun/ConnectionProvider.java b/designer_base/src/com/fr/design/fun/ConnectionProvider.java index 24c0f31c1e..c6bd2fca24 100644 --- a/designer_base/src/com/fr/design/fun/ConnectionProvider.java +++ b/designer_base/src/com/fr/design/fun/ConnectionProvider.java @@ -2,13 +2,13 @@ package com.fr.design.fun; import com.fr.data.impl.Connection; import com.fr.design.beans.BasicBeanPane; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * @author : richie * @since : 8.0 */ -public interface ConnectionProvider extends Level { +public interface ConnectionProvider extends Mutable { public static final String XML_TAG = "ConnectionProvider"; diff --git a/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java index a74c73f96d..80e979fc12 100644 --- a/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java +++ b/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; /** * 在env加载之前, 修改env参数的接口 @@ -9,7 +9,7 @@ import com.fr.stable.fun.Level; * * Created by Administrator on 2016/3/31/0031. */ -public interface DesignerEnvProcessor extends Level{ +public interface DesignerEnvProcessor extends Immutable{ String XML_TAG = "DesignerEnvProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/ElementUIProvider.java b/designer_base/src/com/fr/design/fun/ElementUIProvider.java index cb960564f5..9f93c21ed3 100644 --- a/designer_base/src/com/fr/design/fun/ElementUIProvider.java +++ b/designer_base/src/com/fr/design/fun/ElementUIProvider.java @@ -2,14 +2,14 @@ package com.fr.design.fun; import com.fr.design.actions.UpdateAction; import com.fr.design.selection.QuickEditor; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * Created by richie on 16/4/25. * 单元格元素和悬浮元素扩展,通过实现这个接口,可以在单元格中添加更多类型的元素. */ -public interface ElementUIProvider extends Level { +public interface ElementUIProvider extends Mutable { String MARK_STRING = "ElementUIProvider"; diff --git a/designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java b/designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java index a3573794c2..811d5e960b 100644 --- a/designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java +++ b/designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java @@ -1,7 +1,7 @@ package com.fr.design.fun; import com.fr.design.report.AbstractExportPane; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; import javax.swing.*; @@ -12,7 +12,7 @@ import javax.swing.*; /** * 导出属性Tab页的接口 */ -public interface ExportAttrTabProvider extends Level{ +public interface ExportAttrTabProvider extends Mutable { String XML_TAG = "ExportAttrTabProvider"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java b/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java index c2c560260e..7b2fd20886 100644 --- a/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java +++ b/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java @@ -1,13 +1,13 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; import javax.swing.*; /** * 导出菜单设计器端拓展,用于控制该菜单是否在web端显示 */ -public interface ExportToolBarProvider extends Level{ +public interface ExportToolBarProvider extends Mutable{ String XML_TAG = "ExportToolBarProvider"; diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java index 2db416d883..e887d389b6 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -1,14 +1,14 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.stable.fun.mark.Immutable; import java.beans.PropertyDescriptor; /** * Created by zhouping on 2015/9/10. */ -public interface FormElementCaseEditorProcessor extends Level{ +public interface FormElementCaseEditorProcessor extends Immutable { String MARK_STRING = "PropertyEditor"; diff --git a/designer_base/src/com/fr/design/fun/FormWidgetOptionProvider.java b/designer_base/src/com/fr/design/fun/FormWidgetOptionProvider.java index 24a32da000..bfc32f4e9e 100644 --- a/designer_base/src/com/fr/design/fun/FormWidgetOptionProvider.java +++ b/designer_base/src/com/fr/design/fun/FormWidgetOptionProvider.java @@ -1,14 +1,12 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; - /** * @author richie * @date 2015-03-23 * @since 8.0 * 表单控件 */ -public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider, Level { +public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider { String XML_TAG = "FormWidgetOptionProvider"; diff --git a/designer_base/src/com/fr/design/fun/GlobalListenerProvider.java b/designer_base/src/com/fr/design/fun/GlobalListenerProvider.java index 7fbd9b3716..ae2984853c 100644 --- a/designer_base/src/com/fr/design/fun/GlobalListenerProvider.java +++ b/designer_base/src/com/fr/design/fun/GlobalListenerProvider.java @@ -1,7 +1,7 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; import java.awt.event.AWTEventListener; @@ -9,7 +9,7 @@ import java.awt.event.AWTEventListener; * Created by zack on 2015/8/17. * 全局事件监听 */ -public interface GlobalListenerProvider extends Level{ +public interface GlobalListenerProvider extends Mutable{ String XML_TAG = "GlobalListenerProvider"; diff --git a/designer_base/src/com/fr/design/fun/HighlightProvider.java b/designer_base/src/com/fr/design/fun/HighlightProvider.java index ebee36932c..af232f4dad 100644 --- a/designer_base/src/com/fr/design/fun/HighlightProvider.java +++ b/designer_base/src/com/fr/design/fun/HighlightProvider.java @@ -3,11 +3,12 @@ package com.fr.design.fun; import com.fr.design.condition.ConditionAttrSingleConditionPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * 条件属性界面设计接口 */ -public interface HighlightProvider extends Level{ +public interface HighlightProvider extends Mutable{ String MARK_STRING = "HighlightProvider"; diff --git a/designer_base/src/com/fr/design/fun/HyperlinkProvider.java b/designer_base/src/com/fr/design/fun/HyperlinkProvider.java index 58d7a490ad..e6eccc8820 100644 --- a/designer_base/src/com/fr/design/fun/HyperlinkProvider.java +++ b/designer_base/src/com/fr/design/fun/HyperlinkProvider.java @@ -2,11 +2,12 @@ package com.fr.design.fun; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * Created by zack on 2016/1/20. */ -public interface HyperlinkProvider extends Level{ +public interface HyperlinkProvider extends Mutable { String XML_TAG = "HyperlinkProvider"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/IndentationUnitProcessor.java b/designer_base/src/com/fr/design/fun/IndentationUnitProcessor.java index 9c4a5c854b..e87037dbe2 100644 --- a/designer_base/src/com/fr/design/fun/IndentationUnitProcessor.java +++ b/designer_base/src/com/fr/design/fun/IndentationUnitProcessor.java @@ -1,11 +1,11 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; /** * Created by zhouping on 2015/9/20. */ -public interface IndentationUnitProcessor extends Level{ +public interface IndentationUnitProcessor extends Immutable { String MARK_STRING = "IndentationProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/JavaScriptActionProvider.java b/designer_base/src/com/fr/design/fun/JavaScriptActionProvider.java index e1c570d541..dfb4cdca09 100644 --- a/designer_base/src/com/fr/design/fun/JavaScriptActionProvider.java +++ b/designer_base/src/com/fr/design/fun/JavaScriptActionProvider.java @@ -2,12 +2,12 @@ package com.fr.design.fun; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.js.JavaScript; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * Created by zack on 2015/8/14. */ -public interface JavaScriptActionProvider extends Level{ +public interface JavaScriptActionProvider extends Mutable{ String XML_TAG = "JavaScriptActionProvider"; diff --git a/designer_base/src/com/fr/design/fun/MenuHandler.java b/designer_base/src/com/fr/design/fun/MenuHandler.java index 5b9dd179d5..740a7f6e8c 100644 --- a/designer_base/src/com/fr/design/fun/MenuHandler.java +++ b/designer_base/src/com/fr/design/fun/MenuHandler.java @@ -2,7 +2,7 @@ package com.fr.design.fun; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.ShortCut; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * @author richie @@ -10,7 +10,7 @@ import com.fr.stable.fun.Level; * @since 8.0 * 设计器菜单栏插件接口 */ -public interface MenuHandler extends Level { +public interface MenuHandler extends Mutable { String MARK_STRING = "MenuHandler"; diff --git a/designer_base/src/com/fr/design/fun/ParameterWidgetOptionProvider.java b/designer_base/src/com/fr/design/fun/ParameterWidgetOptionProvider.java index dfa0dda623..685c81a921 100644 --- a/designer_base/src/com/fr/design/fun/ParameterWidgetOptionProvider.java +++ b/designer_base/src/com/fr/design/fun/ParameterWidgetOptionProvider.java @@ -1,14 +1,14 @@ package com.fr.design.fun; import com.fr.form.ui.Widget; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * @author : richie * @since : 8.0 * 自定义参数界面控件 */ -public interface ParameterWidgetOptionProvider extends Level{ +public interface ParameterWidgetOptionProvider extends Mutable { String XML_TAG = "ParameterWidgetOptionProvider"; diff --git a/designer_base/src/com/fr/design/fun/PresentKindProvider.java b/designer_base/src/com/fr/design/fun/PresentKindProvider.java index 8e224e49cd..1e669e9941 100644 --- a/designer_base/src/com/fr/design/fun/PresentKindProvider.java +++ b/designer_base/src/com/fr/design/fun/PresentKindProvider.java @@ -2,7 +2,7 @@ package com.fr.design.fun; import com.fr.base.present.Present; import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * @author richie @@ -10,7 +10,7 @@ import com.fr.stable.fun.Level; * @since 8.0 * 形态类型接口 */ -public interface PresentKindProvider extends Level{ +public interface PresentKindProvider extends Mutable{ int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/PreviewProvider.java b/designer_base/src/com/fr/design/fun/PreviewProvider.java index 3536970b84..876c7d2028 100644 --- a/designer_base/src/com/fr/design/fun/PreviewProvider.java +++ b/designer_base/src/com/fr/design/fun/PreviewProvider.java @@ -1,7 +1,7 @@ package com.fr.design.fun; import com.fr.design.mainframe.JTemplate; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; import java.util.Map; @@ -11,7 +11,7 @@ import java.util.Map; * @since 8.0 * 自定义预览方式接口 */ -public interface PreviewProvider extends Level{ +public interface PreviewProvider extends Mutable{ String MARK_STRING = "PreviewProvider"; diff --git a/designer_base/src/com/fr/design/fun/SubmitProvider.java b/designer_base/src/com/fr/design/fun/SubmitProvider.java index e499689e01..729a0abe1f 100644 --- a/designer_base/src/com/fr/design/fun/SubmitProvider.java +++ b/designer_base/src/com/fr/design/fun/SubmitProvider.java @@ -1,12 +1,12 @@ package com.fr.design.fun; import com.fr.design.beans.BasicBeanPane; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * 自定义提交接口 */ -public interface SubmitProvider extends Level{ +public interface SubmitProvider extends Mutable{ String MARK_STRING = "SubmitProvider"; diff --git a/designer_base/src/com/fr/design/fun/TableDataDefineProvider.java b/designer_base/src/com/fr/design/fun/TableDataDefineProvider.java index 4ddfa9a951..4ca4f1bc0e 100644 --- a/designer_base/src/com/fr/design/fun/TableDataDefineProvider.java +++ b/designer_base/src/com/fr/design/fun/TableDataDefineProvider.java @@ -2,14 +2,15 @@ package com.fr.design.fun; import com.fr.base.TableData; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; +import com.fr.stable.fun.mark.Aftermath; /** * @author : richie * @since : 7.1.1 * 自定义报表数据集界面接口,单独存在的一个个数据集 */ -public interface TableDataDefineProvider extends Level { +public interface TableDataDefineProvider extends Mutable, Aftermath { String XML_TAG = "TableDataDefineProvider"; diff --git a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java index 06db5c974b..7704d6275b 100644 --- a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java +++ b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java @@ -4,7 +4,7 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.data.datapane.TableDataPaneController; import com.fr.design.menu.ShortCut; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; /** * 自定义的模板(服务器)数据集的树样式接口 el:分组样式 @@ -12,7 +12,7 @@ import com.fr.stable.fun.Level; * Date: 2016/4/18 * Time: 9:04 */ -public interface TableDataPaneProcessor extends Level { +public interface TableDataPaneProcessor extends Immutable { String XML_TAG = "TableDataPaneProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/TitlePlaceProcessor.java b/designer_base/src/com/fr/design/fun/TitlePlaceProcessor.java index ebe0eb4e94..f54b142b3e 100644 --- a/designer_base/src/com/fr/design/fun/TitlePlaceProcessor.java +++ b/designer_base/src/com/fr/design/fun/TitlePlaceProcessor.java @@ -1,10 +1,10 @@ package com.fr.design.fun; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; import java.awt.*; -public interface TitlePlaceProcessor extends Level{ +public interface TitlePlaceProcessor extends Immutable { String MARK_STRING = "TitlePlaceProcessor"; diff --git a/designer_base/src/com/fr/design/fun/ToolbarItemProvider.java b/designer_base/src/com/fr/design/fun/ToolbarItemProvider.java index f5d80e8c27..f4add0333d 100644 --- a/designer_base/src/com/fr/design/fun/ToolbarItemProvider.java +++ b/designer_base/src/com/fr/design/fun/ToolbarItemProvider.java @@ -1,14 +1,14 @@ package com.fr.design.fun; import com.fr.form.ui.Widget; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * @author : focus * @since : 8.0 * 自定义web工具栏菜单 */ -public interface ToolbarItemProvider extends Level{ +public interface ToolbarItemProvider extends Mutable { String XML_TAG = "ToolbarItemProvider"; diff --git a/designer_base/src/com/fr/design/fun/UIFormulaProcessor.java b/designer_base/src/com/fr/design/fun/UIFormulaProcessor.java index 32e6390ab6..4a5d8830b9 100644 --- a/designer_base/src/com/fr/design/fun/UIFormulaProcessor.java +++ b/designer_base/src/com/fr/design/fun/UIFormulaProcessor.java @@ -1,7 +1,7 @@ package com.fr.design.fun; import com.fr.design.formula.UIFormula; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; /** * @author richie @@ -9,7 +9,7 @@ import com.fr.stable.fun.Level; * @since 8.0 * 公式编辑器界面处理接口 */ -public interface UIFormulaProcessor extends Level{ +public interface UIFormulaProcessor extends Immutable{ String MARK_STRING = "UIFormulaProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java b/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java index 35384bf0a5..d81ff9dacd 100644 --- a/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java +++ b/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java @@ -2,13 +2,12 @@ package com.fr.design.fun; import com.fr.data.Verifier; import com.fr.design.beans.BasicBeanPane; -import com.fr.stable.fun.Level; -import com.fr.stable.fun.Provider; +import com.fr.stable.fun.mark.Mutable; /** * Created by richie on 16/6/8. */ -public interface VerifyDefineProvider extends Level, Provider { +public interface VerifyDefineProvider extends Mutable { String MARK_STRING = "VerifyDefineProvider"; diff --git a/designer_base/src/com/fr/design/fun/WidgetDesignHandler.java b/designer_base/src/com/fr/design/fun/WidgetDesignHandler.java index db8e568ed9..6350e4e047 100644 --- a/designer_base/src/com/fr/design/fun/WidgetDesignHandler.java +++ b/designer_base/src/com/fr/design/fun/WidgetDesignHandler.java @@ -1,14 +1,14 @@ package com.fr.design.fun; import com.fr.form.ui.Widget; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Immutable; /** * Coder: zack * Date: 2016/5/12 * Time: 10:37 */ -public interface WidgetDesignHandler extends Level { +public interface WidgetDesignHandler extends Immutable { String XML_TAG = "WidgetDesignHandler"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/WidgetPropertyUIProvider.java b/designer_base/src/com/fr/design/fun/WidgetPropertyUIProvider.java index c8a051315a..e823293269 100644 --- a/designer_base/src/com/fr/design/fun/WidgetPropertyUIProvider.java +++ b/designer_base/src/com/fr/design/fun/WidgetPropertyUIProvider.java @@ -1,13 +1,13 @@ package com.fr.design.fun; import com.fr.design.gui.itable.AbstractPropertyTable; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; /** * Created by vito on 16/4/27. */ -public interface WidgetPropertyUIProvider extends Level { +public interface WidgetPropertyUIProvider extends Mutable { String XML_TAG = "WidgetPropertyUIProvider"; int CURRENT_LEVEL = 1; diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundQuickUIProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundQuickUIProvider.java index 82da697c12..373fa27504 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundQuickUIProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundQuickUIProvider.java @@ -2,10 +2,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.BackgroundQuickUIProvider; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by richie on 16/5/18. */ +@API(level = BackgroundQuickUIProvider.CURRENT_LEVEL) public abstract class AbstractBackgroundQuickUIProvider extends AbstractProvider implements BackgroundQuickUIProvider { @Override diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundUIProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundUIProvider.java index ad95e3684f..85ab8ec1f0 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundUIProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractBackgroundUIProvider.java @@ -2,10 +2,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.BackgroundUIProvider; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by richie on 16/5/18. */ +@API(level = BackgroundUIProvider.CURRENT_LEVEL) public abstract class AbstractBackgroundUIProvider extends AbstractProvider implements BackgroundUIProvider { @Override diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java index e57fb65295..86c89d5b4f 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java @@ -1,10 +1,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.CellAttributeProvider; +import com.fr.stable.fun.mark.API; /** * Created by zhouping on 2015/11/11. */ +@API(level = CellAttributeProvider.CURRENT_LEVEL) public abstract class AbstractCellAttributeProvider implements CellAttributeProvider { public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractCellWidgetOptionProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractCellWidgetOptionProvider.java index eb1b5d7959..8e040bcd99 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractCellWidgetOptionProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractCellWidgetOptionProvider.java @@ -1,17 +1,23 @@ package com.fr.design.fun.impl; import com.fr.design.fun.CellWidgetOptionProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractCellWidgetOptionProvider implements CellWidgetOptionProvider { +@API(level = CellWidgetOptionProvider.CURRENT_LEVEL) +public abstract class AbstractCellWidgetOptionProvider extends AbstractProvider implements CellWidgetOptionProvider { public int currentAPILevel() { return CURRENT_LEVEL; } - + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractConnectionProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractConnectionProvider.java index 3f8044ae62..f20b644fae 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractConnectionProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractConnectionProvider.java @@ -1,16 +1,24 @@ package com.fr.design.fun.impl; import com.fr.design.fun.ConnectionProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractConnectionProvider implements ConnectionProvider { +@API(level = ConnectionProvider.CURRENT_LEVEL) +public abstract class AbstractConnectionProvider extends AbstractProvider implements ConnectionProvider { @Override public int currentAPILevel() { return CURRENT_LEVEL; } + + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java index 03a0b7f369..75dd0e2f99 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java @@ -1,10 +1,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.DesignerEnvProcessor; +import com.fr.stable.fun.mark.API; /** * Created by Administrator on 2016/3/31/0031. */ +@API(level = DesignerEnvProcessor.CURRENT_LEVEL) public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcessor { public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractElementUIProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractElementUIProvider.java index b764599287..c26fce8353 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractElementUIProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractElementUIProvider.java @@ -2,10 +2,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.ElementUIProvider; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by richie on 16/4/25. */ +@API(level = ElementUIProvider.CURRENT_LEVEL) public abstract class AbstractElementUIProvider extends AbstractProvider implements ElementUIProvider { @Override diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java index f1654ff6b5..2e526e6973 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java @@ -2,10 +2,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.ExportAttrTabProvider; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by vito on 16/5/5. */ +@API(level = ExportAttrTabProvider.CURRENT_LEVEL) public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider { @Override public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index 8d026bed75..ad65b2dbaa 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -2,12 +2,14 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProcessor; import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.stable.fun.mark.API; import java.beans.PropertyDescriptor; /** * Created by zhouping on 2015/9/10. */ +@API(level = FormElementCaseEditorProcessor.CURRENT_LEVEL) public abstract class AbstractFormElementCaseEditorProcessor implements FormElementCaseEditorProcessor { public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java index 563d544db2..43cab95143 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java @@ -1,18 +1,25 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormWidgetOptionProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractFormWidgetOptionProvider implements FormWidgetOptionProvider { +@API(level = FormWidgetOptionProvider.CURRENT_LEVEL) +public abstract class AbstractFormWidgetOptionProvider extends AbstractProvider implements FormWidgetOptionProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } @Override public boolean isContainer() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractGlobalListenerProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractGlobalListenerProvider.java index 2cf0232eb0..231e809371 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractGlobalListenerProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractGlobalListenerProvider.java @@ -1,15 +1,21 @@ package com.fr.design.fun.impl; import com.fr.design.fun.GlobalListenerProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by zack on 2015/8/17. */ -public abstract class AbstractGlobalListenerProvider implements GlobalListenerProvider { +@API(level = GlobalListenerProvider.CURRENT_LEVEL) +public abstract class AbstractGlobalListenerProvider extends AbstractProvider implements GlobalListenerProvider { public int currentAPILevel() { return CURRENT_LEVEL; } - + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractHighlightProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractHighlightProvider.java index db03239592..e8fc8bce14 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractHighlightProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractHighlightProvider.java @@ -1,16 +1,23 @@ package com.fr.design.fun.impl; import com.fr.design.fun.HighlightProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractHighlightProvider implements HighlightProvider { +@API(level = HighlightProvider.CURRENT_LEVEL) +public abstract class AbstractHighlightProvider extends AbstractProvider implements HighlightProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractHyperlinkProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractHyperlinkProvider.java index ebb193e5ff..24ce3ab97b 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractHyperlinkProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractHyperlinkProvider.java @@ -1,14 +1,21 @@ package com.fr.design.fun.impl; import com.fr.design.fun.HyperlinkProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by zack on 2016/1/18. */ -public abstract class AbstractHyperlinkProvider implements HyperlinkProvider { +@API(level = HyperlinkProvider.CURRENT_LEVEL) +public abstract class AbstractHyperlinkProvider extends AbstractProvider implements HyperlinkProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java index 7dbe61f76a..4ebf914dab 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java @@ -1,10 +1,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.IndentationUnitProcessor; +import com.fr.stable.fun.mark.API; /** * Created by zhouping on 2015/9/20. */ +@API(level = IndentationUnitProcessor.CURRENT_LEVEL) public class AbstractIndentationUnitProcessor implements IndentationUnitProcessor { private int indentationUnit = 1; diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java index 8074cdcc93..504a8b73ef 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java @@ -1,14 +1,21 @@ package com.fr.design.fun.impl; import com.fr.design.fun.JavaScriptActionProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by zack on 2015/8/20. */ -public abstract class AbstractJavaScriptActionProvider implements JavaScriptActionProvider { +@API(level = JavaScriptActionProvider.CURRENT_LEVEL) +public abstract class AbstractJavaScriptActionProvider extends AbstractProvider implements JavaScriptActionProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractMenuHandler.java b/designer_base/src/com/fr/design/fun/impl/AbstractMenuHandler.java index d62769a2db..b679f3ab9e 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractMenuHandler.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractMenuHandler.java @@ -4,12 +4,14 @@ import com.fr.design.fun.MenuHandler; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.ShortCut; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ +@API(level = MenuHandler.CURRENT_LEVEL) public abstract class AbstractMenuHandler extends AbstractProvider implements MenuHandler { public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractParameterWidgetOptionProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractParameterWidgetOptionProvider.java index da2ce5d28b..0c66aae116 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractParameterWidgetOptionProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractParameterWidgetOptionProvider.java @@ -1,16 +1,23 @@ package com.fr.design.fun.impl; import com.fr.design.fun.ParameterWidgetOptionProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractParameterWidgetOptionProvider implements ParameterWidgetOptionProvider { +@API(level = ParameterWidgetOptionProvider.CURRENT_LEVEL) +public abstract class AbstractParameterWidgetOptionProvider extends AbstractProvider implements ParameterWidgetOptionProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractPresentKindProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractPresentKindProvider.java index ebe28c7095..4f3a5c03c9 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractPresentKindProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractPresentKindProvider.java @@ -1,17 +1,23 @@ package com.fr.design.fun.impl; import com.fr.design.fun.PresentKindProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-22 * @since 8.0 */ -public abstract class AbstractPresentKindProvider implements PresentKindProvider { +@API(level = PresentKindProvider.CURRENT_LEVEL) +public abstract class AbstractPresentKindProvider extends AbstractProvider implements PresentKindProvider { public int currentAPILevel() { return CURRENT_LEVEL; } - + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractPreviewProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractPreviewProvider.java index d5a67a451f..3f824d4bb1 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractPreviewProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractPreviewProvider.java @@ -3,6 +3,8 @@ package com.fr.design.fun.impl; import com.fr.design.fun.PreviewProvider; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; import java.util.Collections; import java.util.Map; @@ -12,12 +14,17 @@ import java.util.Map; * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractPreviewProvider implements PreviewProvider { +@API(level = PreviewProvider.CURRENT_LEVEL) +public abstract class AbstractPreviewProvider extends AbstractProvider implements PreviewProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } @Override public void onClick(JTemplate jt) { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractServerTableDataDefineProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractServerTableDataDefineProvider.java index 57d1dffef6..de7be27508 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractServerTableDataDefineProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractServerTableDataDefineProvider.java @@ -1,12 +1,39 @@ package com.fr.design.fun.impl; +import com.fr.design.data.datapane.TableDataNameObjectCreator; +import com.fr.design.data.tabledata.wrapper.TableDataFactory; import com.fr.design.fun.ServerTableDataDefineProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractServerTableDataDefineProvider implements ServerTableDataDefineProvider { +@API(level = ServerTableDataDefineProvider.CURRENT_LEVEL) +public abstract class AbstractServerTableDataDefineProvider extends AbstractProvider implements ServerTableDataDefineProvider { + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public void process() { + TableDataNameObjectCreator creator = new TableDataNameObjectCreator( + nameForTableData(), + prefixForTableData(), + iconPathForTableData(), + classForTableData(), + classForInitTableData(), + appearanceForTableData() + ); + TableDataFactory.register(classForTableData(), creator); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractSubmitProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractSubmitProvider.java index 451526cfa4..0b26987227 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractSubmitProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractSubmitProvider.java @@ -1,12 +1,18 @@ package com.fr.design.fun.impl; import com.fr.design.fun.SubmitProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; -public abstract class AbstractSubmitProvider implements SubmitProvider { +@API(level = SubmitProvider.CURRENT_LEVEL) +public abstract class AbstractSubmitProvider extends AbstractProvider implements SubmitProvider { public int currentAPILevel() { return CURRENT_LEVEL; } - + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java index e5f591a65c..53da881a8e 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java @@ -1,12 +1,14 @@ package com.fr.design.fun.impl; import com.fr.design.fun.TableDataPaneProcessor; +import com.fr.stable.fun.mark.API; /** * Coder: zack * Date: 2016/4/18 * Time: 10:30 */ +@API(level = TableDataPaneProcessor.CURRENT_LEVEL) public abstract class AbstractTDPaneProcessor implements TableDataPaneProcessor { @Override public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTableDataDefineProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractTableDataDefineProvider.java index 62f77abd65..42433a68bf 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTableDataDefineProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTableDataDefineProvider.java @@ -1,16 +1,39 @@ package com.fr.design.fun.impl; +import com.fr.design.data.datapane.TableDataNameObjectCreator; +import com.fr.design.data.tabledata.wrapper.TableDataFactory; import com.fr.design.fun.TableDataDefineProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ -public abstract class AbstractTableDataDefineProvider implements TableDataDefineProvider { +@API(level = TableDataDefineProvider.CURRENT_LEVEL) +public abstract class AbstractTableDataDefineProvider extends AbstractProvider implements TableDataDefineProvider { @Override public int currentAPILevel() { return CURRENT_LEVEL; } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public void process() { + TableDataNameObjectCreator creator = new TableDataNameObjectCreator( + nameForTableData(), + prefixForTableData(), + iconPathForTableData(), + classForTableData(), + classForInitTableData(), + appearanceForTableData() + ); + TableDataFactory.register(classForTableData(), creator); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java index 455c7dc78f..5eaa7ba87e 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java @@ -1,7 +1,9 @@ package com.fr.design.fun.impl; import com.fr.design.fun.TitlePlaceProcessor; +import com.fr.stable.fun.mark.API; +@API(level = TitlePlaceProcessor.CURRENT_LEVEL) public abstract class AbstractTitleProcessor implements TitlePlaceProcessor { public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractToolbarItem.java b/designer_base/src/com/fr/design/fun/impl/AbstractToolbarItem.java index e60d35d3ba..ec3c47bc1e 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractToolbarItem.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractToolbarItem.java @@ -1,14 +1,21 @@ package com.fr.design.fun.impl; import com.fr.design.fun.ToolbarItemProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by richie on 15/12/1. */ -public abstract class AbstractToolbarItem implements ToolbarItemProvider { +@API(level = ToolbarItemProvider.CURRENT_LEVEL) +public abstract class AbstractToolbarItem extends AbstractProvider implements ToolbarItemProvider { public int currentAPILevel() { return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java index ce58a1a7f5..2b41444884 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java @@ -1,12 +1,14 @@ package com.fr.design.fun.impl; import com.fr.design.fun.UIFormulaProcessor; +import com.fr.stable.fun.mark.API; /** * @author richie * @date 2015-05-13 * @since 8.0 */ +@API(level = UIFormulaProcessor.CURRENT_LEVEL) public abstract class AbstractUIFormulaProcessor implements UIFormulaProcessor { public int currentAPILevel() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java index 04c6276104..f1ebfd296a 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java @@ -2,10 +2,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.VerifyDefineProvider; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by richie on 16/6/8. */ +@API(level = VerifyDefineProvider.CURRENT_LEVEL) public abstract class AbstractVerifyDefineProvider extends AbstractProvider implements VerifyDefineProvider { @Override diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java index 63659de215..17f6d8b4d2 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java @@ -1,11 +1,18 @@ package com.fr.design.fun.impl; import com.fr.design.fun.WidgetDesignHandler; +import com.fr.stable.fun.mark.API; /** * Coder: zack * Date: 2016/5/12 * Time: 10:41 */ +@API(level = WidgetDesignHandler.CURRENT_LEVEL) public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } } diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetPropertyUIProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetPropertyUIProvider.java index 0c6b898084..80eddae494 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetPropertyUIProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetPropertyUIProvider.java @@ -2,11 +2,13 @@ package com.fr.design.fun.impl; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by vito on 16/4/27. */ +@API(level = WidgetPropertyUIProvider.CURRENT_LEVEL) public abstract class AbstractWidgetPropertyUIProvider extends AbstractProvider implements WidgetPropertyUIProvider { @Override diff --git a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java index b7992e60e7..4d1028e784 100644 --- a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java @@ -18,6 +18,7 @@ import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * 超级链接 界面. @@ -43,13 +44,13 @@ public class HyperlinkGroupPane extends JListControlPane { for (int i = 0; i < templateArrayLisy.size(); i++) { pluginCreators[i] = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); } - HyperlinkProvider[] providers = ExtraDesignClassManager.getInstance().getHyperlinkProvider(); + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); List creatorList = new ArrayList(); for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); creatorList.add(nc); } - return (NameableCreator[]) ArrayUtils.addAll(creatorList.toArray(new NameableCreator[creatorList.size()]), ArrayUtils.addAll(creators, pluginCreators)); + return ArrayUtils.addAll(creatorList.toArray(new NameableCreator[creatorList.size()]), ArrayUtils.addAll(creators, pluginCreators)); } /** diff --git a/designer_base/src/com/fr/design/gui/style/AlignmentPane.java b/designer_base/src/com/fr/design/gui/style/AlignmentPane.java index ee0a5821e9..413ad70a40 100644 --- a/designer_base/src/com/fr/design/gui/style/AlignmentPane.java +++ b/designer_base/src/com/fr/design/gui/style/AlignmentPane.java @@ -95,7 +95,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO initOtherComponent(); initAllNames(); - indentationUnitProcessor = ExtraDesignClassManager.getInstance().getIndentationUnitEditor(); + indentationUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(IndentationUnitProcessor.MARK_STRING); if (null == indentationUnitProcessor){ indentationUnitProcessor = new DefaultIndentationUnitProcessor(); } diff --git a/designer_base/src/com/fr/design/gui/style/BackgroundPane.java b/designer_base/src/com/fr/design/gui/style/BackgroundPane.java index 1bf6d7e4b2..440d8fcef1 100644 --- a/designer_base/src/com/fr/design/gui/style/BackgroundPane.java +++ b/designer_base/src/com/fr/design/gui/style/BackgroundPane.java @@ -15,6 +15,7 @@ import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; +import java.util.Set; /** * @author zhou @@ -68,7 +69,7 @@ public class BackgroundPane extends AbstractBasicStylePane { kinds.add(new PatternBackgroundQuickPane()); kinds.add(new ImageBackgroundQuickPane()); kinds.add(new GradientBackgroundQuickPane()); - BackgroundQuickUIProvider[] providers = ExtraDesignClassManager.getInstance().getBackgroundQuickUIProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING); for (BackgroundQuickUIProvider provider : providers) { kinds.add(provider.appearanceForBackground()); diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptActionPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptActionPane.java index 66de7bf713..d293939443 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptActionPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptActionPane.java @@ -21,6 +21,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import java.util.Set; public abstract class JavaScriptActionPane extends UIComboBoxPane { @@ -52,7 +53,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane { } ); paneList.add(initEmaiPane()); - List javaScriptActionProviders = ExtraDesignClassManager.getInstance().getJavaScriptActionProvider(); + Set javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG); if (javaScriptActionProviders != null) { for (JavaScriptActionProvider jsp : javaScriptActionProviders) { paneList.add(jsp.getJavaScriptActionPane()); diff --git a/designer_base/src/com/fr/design/mainframe/AbstractAppProvider.java b/designer_base/src/com/fr/design/mainframe/AbstractAppProvider.java index f45d228a6e..f4f6bea978 100644 --- a/designer_base/src/com/fr/design/mainframe/AbstractAppProvider.java +++ b/designer_base/src/com/fr/design/mainframe/AbstractAppProvider.java @@ -1,13 +1,26 @@ package com.fr.design.mainframe; import com.fr.base.io.IOFile; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; /** * Created by Administrator on 2016/3/17/0017. */ -public abstract class AbstractAppProvider implements App{ +@API(level = App.CURRENT_LEVEL) +public abstract class AbstractAppProvider extends AbstractProvider implements App{ public int currentAPILevel() { return CURRENT_LEVEL; } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public void process() { + DesignerFrame.registApp(this); + } } diff --git a/designer_base/src/com/fr/design/mainframe/App.java b/designer_base/src/com/fr/design/mainframe/App.java index d6c376fa98..c657abdcd4 100644 --- a/designer_base/src/com/fr/design/mainframe/App.java +++ b/designer_base/src/com/fr/design/mainframe/App.java @@ -2,12 +2,13 @@ package com.fr.design.mainframe; import com.fr.base.io.IOFile; import com.fr.file.FILE; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.Mutable; +import com.fr.stable.fun.mark.Aftermath; /** * Created by Administrator on 2016/3/17/0017. */ -public interface App extends Level{ +public interface App extends Mutable, Aftermath { String MARK_STRING = "DesignerApp"; diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index 876bf3922f..a1f5f16a4b 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -263,7 +263,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { - TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getTitlePlaceProcessor(); + TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); if (processor == null) { processor = new DefaultTitlePlace(); } diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 8673401157..eb20ee9e7f 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -43,6 +43,7 @@ import java.awt.event.KeyEvent; import java.io.File; import java.util.HashMap; import java.util.Map; +import java.util.Set; public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarStateChangeListener, ResponseDataSourceChange { private static final String FILE = "file"; @@ -127,7 +128,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt toolbarDef.addShortCut(openFolderAction, renameAction); } toolbarDef.addShortCut(delFileAction); - ShortCut[] extraShortCuts = ExtraDesignClassManager.getInstance().getTemplateTreeShortCutProviders(); + Set extraShortCuts = ExtraDesignClassManager.getInstance().getArray(ShortCut.TEMPLATE_TREE); for (ShortCut shortCut : extraShortCuts){ toolbarDef.addShortCut(shortCut); } diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 4268f7ea1b..b372156d7f 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -55,9 +55,7 @@ import com.fr.stable.ProductConstants; import javax.swing.*; import java.awt.*; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Locale; +import java.util.*; /** * @author richer @@ -299,7 +297,7 @@ public abstract class ToolBarMenuDock { } private ShortCut createGlobalTDAction() { - TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getTableDataPaneProcessor(); + TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG); return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction(); } @@ -528,8 +526,15 @@ public abstract class ToolBarMenuDock { protected void insertMenu(MenuDef menuDef, String anchor, ShortCutMethodAction action) { // 下面是插件接口接入点 - MenuHandler[] menuHandlers = ExtraDesignClassManager.getInstance().getMenuHandlers(anchor); - for (MenuHandler handler : menuHandlers) { + Set set = ExtraDesignClassManager.getInstance().getArray(MenuHandler.MARK_STRING); + java.util.List target = new ArrayList<>(); + for (MenuHandler handler : set) { + if (ComparatorUtils.equals(handler.category(), anchor)) { + target.add(handler); + } + } + + for (MenuHandler handler : target) { int insertPosition = handler.insertPosition(menuDef.getShortCutCount()); ShortCut shortCut = action.methodAction(handler); if (shortCut == null){ diff --git a/designer_base/src/com/fr/design/menu/ShortCut.java b/designer_base/src/com/fr/design/menu/ShortCut.java index 7967246148..7f71d9a2c8 100644 --- a/designer_base/src/com/fr/design/menu/ShortCut.java +++ b/designer_base/src/com/fr/design/menu/ShortCut.java @@ -1,16 +1,20 @@ package com.fr.design.menu; -import com.fr.stable.fun.Level; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; +import com.fr.stable.fun.mark.Mutable; -import javax.swing.JPopupMenu; -import javax.swing.JToolBar; +import javax.swing.*; /** * 用来往MenuDef或是ToolBarDef里面加东西时用的接口 * august:ShortCut没有必要序列化和XMLabled * 原来那么多Menudef都提供持久化操作,太浪费资源 */ -public abstract class ShortCut implements Level{ +@API(level = ShortCut.CURRENT_LEVEL) +public abstract class ShortCut extends AbstractProvider implements Mutable { + + public static final String TEMPLATE_TREE = "TemplateTreeShortCut"; public static final int CURRENT_LEVEL = 1; @@ -18,6 +22,10 @@ public abstract class ShortCut implements Level{ return CURRENT_LEVEL; } + @Override + public String mark4Provider() { + return getClass().getName(); + } private MenuKeySet menuKeySet = null; diff --git a/designer_base/src/com/fr/design/module/DesignModule.java b/designer_base/src/com/fr/design/module/DesignModule.java index 74e8944a25..7dca3803ff 100644 --- a/designer_base/src/com/fr/design/module/DesignModule.java +++ b/designer_base/src/com/fr/design/module/DesignModule.java @@ -22,6 +22,7 @@ import com.fr.stable.plugin.ExtraDesignClassManagerProvider; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * Created by IntelliJ IDEA. @@ -66,7 +67,7 @@ public abstract class DesignModule extends TopModule { public Class[] actionsForInsertCellElement() { List> classes = new ArrayList<>(); - ElementUIProvider[] providers = ExtraDesignClassManager.getInstance().getElementUIProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { classes.add(provider.actionForInsertCellElement()); } @@ -75,7 +76,7 @@ public abstract class DesignModule extends TopModule { public Class[] actionsForInsertFloatElement() { List> classes = new ArrayList<>(); - ElementUIProvider[] providers = ExtraDesignClassManager.getInstance().getElementUIProviders(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { classes.add(provider.actionForInsertFloatElement()); } diff --git a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java index 6dd04773a2..25bf0b5b53 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java @@ -3,6 +3,7 @@ package com.fr.design.style.background; import com.fr.base.background.*; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.BackgroundQuickUIProvider; import com.fr.design.fun.BackgroundUIProvider; import com.fr.design.style.background.gradient.GradientBackgroundPane; import com.fr.design.style.background.impl.*; @@ -54,7 +55,8 @@ public class BackgroundFactory { } private static void registerExtra(Map, BackgroundUIWrapper> map) { - for (BackgroundUIProvider provider : ExtraDesignClassManager.getInstance().getBackgroundUIProviders()) { + Set set = ExtraDesignClassManager.getInstance().getArray(BackgroundUIProvider.MARK_STRING); + for (BackgroundUIProvider provider : set) { map.put(provider.targetClass(), BackgroundUIWrapper.create() .setType(provider.targetUIClass()).setTitle(provider.targetTitle())); } diff --git a/designer_base/src/com/fr/design/utils/DesignUtils.java b/designer_base/src/com/fr/design/utils/DesignUtils.java index 94db76af54..8ed8aa6175 100644 --- a/designer_base/src/com/fr/design/utils/DesignUtils.java +++ b/designer_base/src/com/fr/design/utils/DesignUtils.java @@ -324,7 +324,7 @@ public class DesignUtils { private static String getWebBrowserPath() { String urlPath = FRContext.getCurrentEnv().getPath(); - DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getEnvProcessor(); + DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); if (processor != null) { //cas访问的时候, url要处理下. urlPath = processor.getWebBrowserURL(urlPath); diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index dab9ec17e9..7cff11c37f 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -388,7 +388,7 @@ public class RemoteEnv implements Env { private void extraChangeEnvPara() { //在env连接之前, 加载一下不依赖env的插件. 看看需不需要改变参数. PluginLoader.init(); - DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getEnvProcessor(); + DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); if (envProcessor != null) { this.path = envProcessor.changeEnvPathBeforeConnect(user, password, path); } diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index 6d92b10673..470affb44f 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -39,6 +39,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.lang.reflect.Method; +import java.util.Set; /** * The main class of Report Designer. @@ -113,11 +114,9 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } private void bindGlobalListener() { - GlobalListenerProvider[] providers = ExtraDesignClassManager.getInstance().getGlobalListenerProvider(); - if (ArrayUtils.isNotEmpty(providers)) { - for (GlobalListenerProvider provider : providers) { - Toolkit.getDefaultToolkit().addAWTEventListener(provider.listener(), AWTEvent.KEY_EVENT_MASK); - } + Set providers = ExtraDesignClassManager.getInstance().getArray(GlobalListenerProvider.XML_TAG); + for (GlobalListenerProvider provider : providers) { + Toolkit.getDefaultToolkit().addAWTEventListener(provider.listener(), AWTEvent.KEY_EVENT_MASK); } } diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 3e8ea79654..3824016e50 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -86,7 +86,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme }; - FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); + FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); if (processor == null) { return propertyTableEditor; } diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 57087597e5..a385aed284 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -18,6 +18,7 @@ import javax.swing.*; import java.awt.*; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * 控件属性表Docking @@ -120,8 +121,8 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && selection.getSelectedCreator() != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); } - WidgetPropertyUIProvider[] widgetAttrProviders = ExtraDesignClassManager.getInstance().getWidgetAttrProviders(); - widgetAttrProviders = (WidgetPropertyUIProvider[]) ArrayUtils.addAll(embeddedPropertyUIProviders, widgetAttrProviders); + Set set = ExtraDesignClassManager.getInstance().getArray(WidgetPropertyUIProvider.XML_TAG); + WidgetPropertyUIProvider[] widgetAttrProviders = ArrayUtils.addAll(embeddedPropertyUIProviders, set.toArray(new WidgetPropertyUIProvider[set.size()])); return widgetAttrProviders; } From 0f795f2f26412204a01e2aedfb742b6a231dff84 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 24 Jun 2016 10:00:51 +0800 Subject: [PATCH 33/37] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E5=8F=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E7=B3=BB=E6=95=B0,=E7=94=A8=E4=BA=8E=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=8F=92=E4=BB=B6=E7=9A=84=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fun/impl/AbstractCellAttributeProvider.java | 4 ++++ .../fr/design/fun/impl/AbstractDesignerEnvProcessor.java | 4 ++++ .../fun/impl/AbstractFormElementCaseEditorProcessor.java | 4 ++++ .../design/fun/impl/AbstractIndentationUnitProcessor.java | 6 +++++- .../src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java | 4 ++++ .../src/com/fr/design/fun/impl/AbstractTitleProcessor.java | 4 ++++ .../com/fr/design/fun/impl/AbstractUIFormulaProcessor.java | 4 ++++ .../com/fr/design/fun/impl/AbstractWidgetDesignHandler.java | 4 ++++ 8 files changed, 33 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java index 86c89d5b4f..fd4b149d44 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java @@ -13,4 +13,8 @@ public abstract class AbstractCellAttributeProvider implements CellAttributeProv return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java index 75dd0e2f99..f80d219a3d 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java @@ -13,6 +13,10 @@ public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcess return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + public String changeEnvPathBeforeConnect(String userName, String password, String path){ return path; } diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index ad65b2dbaa..caafda0b84 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -16,6 +16,10 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + /** * 生成属性表 diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java index 4ebf914dab..0fcdcd3128 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java @@ -7,13 +7,17 @@ import com.fr.stable.fun.mark.API; * Created by zhouping on 2015/9/20. */ @API(level = IndentationUnitProcessor.CURRENT_LEVEL) -public class AbstractIndentationUnitProcessor implements IndentationUnitProcessor { +public abstract class AbstractIndentationUnitProcessor implements IndentationUnitProcessor { private int indentationUnit = 1; public int currentAPILevel() { return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + public void setIndentationUnit(int value){ this.indentationUnit = value; diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java index 53da881a8e..6a2d51b936 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java @@ -14,4 +14,8 @@ public abstract class AbstractTDPaneProcessor implements TableDataPaneProcessor public int currentAPILevel() { return CURRENT_LEVEL; } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } } diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java index 5eaa7ba87e..eb01bfa531 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java @@ -10,5 +10,9 @@ public abstract class AbstractTitleProcessor implements TitlePlaceProcessor { return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java index 2b41444884..445c2aa403 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java @@ -15,4 +15,8 @@ public abstract class AbstractUIFormulaProcessor implements UIFormulaProcessor { return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java index 17f6d8b4d2..4a7667ff0b 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java @@ -15,4 +15,8 @@ public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler public int currentAPILevel() { return CURRENT_LEVEL; } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } } From daad29bcc52c41995c85d585bb1a9680036de38f Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 27 Jun 2016 17:02:44 +0800 Subject: [PATCH 34/37] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 3824016e50..090561cf87 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -94,6 +94,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); ElementCaseEditor editor = this.toData(); + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); From 06145b11a9127c9bc37b94b64e5d034a6c5e8696 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 28 Jun 2016 10:21:29 +0800 Subject: [PATCH 35/37] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E8=A1=80?= =?UTF-8?q?=E7=BC=98=E5=85=B3=E7=B3=BB,=20=E8=87=AA=E5=AE=9A=E4=B9=89gridu?= =?UTF-8?q?i=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/grid/DefaultGridUIProcessor.java | 17 +++++++ designer/src/com/fr/grid/Grid.java | 26 +++++----- designer/src/com/fr/grid/GridUI.java | 49 +++++-------------- .../com/fr/design/fun/GridUIProcessor.java | 23 +++++++++ .../fun/impl/AbstractGridUIProcessor.java | 15 ++++++ .../mobile/ElementCasePropertyTable.java | 2 +- 6 files changed, 82 insertions(+), 50 deletions(-) create mode 100644 designer/src/com/fr/grid/DefaultGridUIProcessor.java create mode 100644 designer_base/src/com/fr/design/fun/GridUIProcessor.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java diff --git a/designer/src/com/fr/grid/DefaultGridUIProcessor.java b/designer/src/com/fr/grid/DefaultGridUIProcessor.java new file mode 100644 index 0000000000..65b6aa4569 --- /dev/null +++ b/designer/src/com/fr/grid/DefaultGridUIProcessor.java @@ -0,0 +1,17 @@ +package com.fr.grid; + +import com.fr.design.fun.impl.AbstractGridUIProcessor; + +import javax.swing.plaf.ComponentUI; + +/** + * Created by Administrator on 2016/6/28/0028. + */ +public class DefaultGridUIProcessor extends AbstractGridUIProcessor{ + + @Override + public ComponentUI appearanceForGrid(int resolution) { + return new GridUI(resolution); + } + +} diff --git a/designer/src/com/fr/grid/Grid.java b/designer/src/com/fr/grid/Grid.java index ec9ee49413..a259cf63b0 100644 --- a/designer/src/com/fr/grid/Grid.java +++ b/designer/src/com/fr/grid/Grid.java @@ -3,20 +3,11 @@ */ package com.fr.grid; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.geom.Point2D; -import java.util.Hashtable; -import java.util.Iterator; - import com.fr.base.DynamicUnitList; -import com.fr.design.cell.editor.CellEditor; -import com.fr.design.cell.editor.FloatEditor; -import com.fr.design.cell.editor.FormulaCellEditor; -import com.fr.design.cell.editor.GeneralCellEditor; -import com.fr.design.cell.editor.GeneralFloatEditor; -import com.fr.design.cell.editor.TextCellEditor; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.cell.editor.*; import com.fr.design.constants.UIConstants; +import com.fr.design.fun.GridUIProcessor; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.utils.gui.GUICoreUtils; @@ -40,6 +31,13 @@ import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.StringUtils; +import javax.swing.plaf.ComponentUI; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; +import java.util.Hashtable; +import java.util.Iterator; + /** * Grid used to paint and edit grid. * @@ -144,7 +142,9 @@ public class Grid extends BaseGridComponent { * */ public void updateUI() { - this.setUI(new GridUI(resolution)); + GridUIProcessor localGridUIProcessor = ExtraDesignClassManager.getInstance().getSingle(GridUIProcessor.MARK_STRING, new DefaultGridUIProcessor()); + ComponentUI localComponentUI = localGridUIProcessor.appearanceForGrid(this.resolution); + setUI(localComponentUI); } /** diff --git a/designer/src/com/fr/grid/GridUI.java b/designer/src/com/fr/grid/GridUI.java index e3d2a5efce..526f0f074b 100644 --- a/designer/src/com/fr/grid/GridUI.java +++ b/designer/src/com/fr/grid/GridUI.java @@ -1,38 +1,6 @@ package com.fr.grid; -import java.awt.AlphaComposite; -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Composite; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.Stroke; -import java.awt.geom.Area; -import java.awt.geom.GeneralPath; -import java.awt.geom.Line2D; -import java.awt.geom.Line2D.Double; -import java.awt.geom.Path2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.swing.JComponent; -import javax.swing.UIManager; -import javax.swing.plaf.ComponentUI; - -import com.fr.base.BaseUtils; -import com.fr.base.DynamicUnitList; -import com.fr.base.FRContext; -import com.fr.base.Formula; -import com.fr.base.GraphHelper; -import com.fr.base.Margin; -import com.fr.base.PaperSize; -import com.fr.base.Utils; +import com.fr.base.*; import com.fr.base.background.ColorBackground; import com.fr.base.background.ImageBackground; import com.fr.design.constants.UIConstants; @@ -70,6 +38,15 @@ import com.fr.stable.script.CalculatorUtils; import com.fr.stable.unit.FU; import com.fr.third.antlr.ANTLRException; +import javax.swing.*; +import javax.swing.plaf.ComponentUI; +import java.awt.*; +import java.awt.geom.*; +import java.awt.geom.Line2D.Double; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + public class GridUI extends ComponentUI { public static int INVALID_INTEGER = Integer.MIN_VALUE;// 作为不合法的数值. @@ -438,7 +415,7 @@ public class GridUI extends ComponentUI { paintDetailedCellElements(g2d, cells, tmpCellElement, reportPane, selectedCellElement, hideWidth, hideHeight, oldClip, report); paintBorder(g2d, tmpCellElement, report); - paintFatherLeft(g2d); + paintFatherLeft(g2d, selectedCellElement, report); } private void paintDetailedCellElements(Graphics2D g2d, Iterator cells, TemplateCellElement tmpCellElement, ElementCasePane reportPane, @@ -565,7 +542,7 @@ public class GridUI extends ComponentUI { } } - private void paintFatherLeft(Graphics2D g2d) { + protected void paintFatherLeft(Graphics2D g2d, CellElement selectedCellElement, TemplateElementCase report) { // 画左父格子. if (validate(this.left_col_row_rect) && this.left_col_row_rect.getHeight() > 5) { g2d.setPaint(Color.BLUE); @@ -827,7 +804,7 @@ public class GridUI extends ComponentUI { } } - private void paintFormulaCellArea(Graphics2D g2d, Area formulaCellArea, int i) { + protected void paintFormulaCellArea(Graphics2D g2d, Area formulaCellArea, int i) { // denny: 标记格子的边框 formulaCellArea = new Area(new Rectangle2D.Double(this.tmpRectangle.getX(), this.tmpRectangle.getY(), this.tmpRectangle.getWidth(), diff --git a/designer_base/src/com/fr/design/fun/GridUIProcessor.java b/designer_base/src/com/fr/design/fun/GridUIProcessor.java new file mode 100644 index 0000000000..d900d7cb51 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/GridUIProcessor.java @@ -0,0 +1,23 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.plaf.ComponentUI; + +/** + * Զ嵥Ԫuiӿ + * + * @return + */ +public interface GridUIProcessor extends Immutable { + + String MARK_STRING = "GridUIProcessor"; + int CURRENT_LEVEL = 1; + + /** + * Զgridui, ʵһЩԶĸӻ. + * + * @return Զgridui + */ + ComponentUI appearanceForGrid(int paramInt); +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java new file mode 100644 index 0000000000..b772d7b644 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java @@ -0,0 +1,15 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.GridUIProcessor; +import com.fr.stable.fun.mark.API; + +@API(level = GridUIProcessor.CURRENT_LEVEL) +public abstract class AbstractGridUIProcessor implements GridUIProcessor { + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java index c846d48f50..0519684594 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java @@ -10,7 +10,7 @@ import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.gui.xtable.ReportAppPropertyGroupModel; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetPropertyPane;; +import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; import com.fr.design.mainframe.widget.editors.RefinedDoubleEditor; import com.fr.form.ui.ElementCaseEditor; From 5d629a5b9c6874806375d762664c29df4f24bbd4 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 28 Jun 2016 10:23:42 +0800 Subject: [PATCH 36/37] 1 --- designer_base/src/com/fr/design/fun/GridUIProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/GridUIProcessor.java b/designer_base/src/com/fr/design/fun/GridUIProcessor.java index d900d7cb51..15dae93a22 100644 --- a/designer_base/src/com/fr/design/fun/GridUIProcessor.java +++ b/designer_base/src/com/fr/design/fun/GridUIProcessor.java @@ -5,7 +5,7 @@ import com.fr.stable.fun.mark.Immutable; import javax.swing.plaf.ComponentUI; /** - * Զ嵥Ԫuiӿ + * 自定义单元格ui接口 * * @return */ @@ -15,9 +15,9 @@ public interface GridUIProcessor extends Immutable { int CURRENT_LEVEL = 1; /** - * Զgridui, ʵһЩԶĸӻ. + * 自定义gridui, 用于实现一些自定义的格子绘制. * - * @return Զgridui + * @return 自定义gridui */ ComponentUI appearanceForGrid(int paramInt); } \ No newline at end of file From a371b8d62e6c550dbccfa80cc78ad0d33f034371 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 29 Jun 2016 15:01:53 +0800 Subject: [PATCH 37/37] module --- .../com/fr/design/module/DesignerModule.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 8ed444c191..13dc722dc8 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -14,15 +14,8 @@ import com.fr.design.actions.insert.flot.ImageFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.actions.server.StyleListAction; import com.fr.design.fun.ElementUIProvider; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.hyperlink.ReportletHyperlinkPane; -import com.fr.design.hyperlink.WebHyperlinkPane; -import com.fr.design.javascript.EmailPane; -import com.fr.design.javascript.JavaScriptImplPane; -import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.mainframe.*; import com.fr.design.mainframe.bbs.BBSGuestPane; @@ -38,7 +31,6 @@ import com.fr.general.*; import com.fr.general.xml.GeneralXMLTools; import com.fr.io.importer.Excel2007ReportImporter; import com.fr.io.importer.ExcelReportImporter; -import com.fr.js.*; import com.fr.main.impl.WorkBook; import com.fr.plugin.ExtraClassManager; import com.fr.quickeditor.ChartQuickEditor; @@ -55,10 +47,11 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.fun.LogProvider; -import com.fr.stable.module.Module; import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.script.ValueConverter; +import com.fr.stable.web.ServletContext; +import com.fr.stable.web.ServletContextAdapter; import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.start.BBSGuestPaneProvider; @@ -75,6 +68,15 @@ import java.util.Set; public class DesignerModule extends DesignModule { + static { + ServletContext.addServletContextListener(new ServletContextAdapter() { + + public void onServletStart() { + ModuleContext.startModule(DesignerModule.class.getName()); + } + }); + } + /** * 启动设计器模块 */