From e6cd7b892fa51f1ad0e2a6b5b29ddc78157108de Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 5 Mar 2018 09:49:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-6956=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E9=80=82=E9=85=8D10.0=E9=85=8D=E7=BD=AE=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/data/datapane/ChoosePane.java | 4 ++-- .../design/data/datapane/connect/ConnectionListPane.java | 6 +++--- .../data/datapane/connect/ConnectionManagerPane.java | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/design/data/datapane/ChoosePane.java b/designer_base/src/com/fr/design/data/datapane/ChoosePane.java index d7707a3b94..6d6bce0e50 100644 --- a/designer_base/src/com/fr/design/data/datapane/ChoosePane.java +++ b/designer_base/src/com/fr/design/data/datapane/ChoosePane.java @@ -180,7 +180,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha dsNameComboBox.setRefreshingModel(true); ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); @SuppressWarnings("unchecked") - Iterator datasourceNameIterator = connectionConfig.getConnectionNameIterator(); + Iterator datasourceNameIterator = connectionConfig.getConnections().keySet().iterator(); List dsList = new ArrayList(); while (datasourceNameIterator.hasNext()) { dsList.add((String) datasourceNameIterator.next()); @@ -287,7 +287,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha } ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); @SuppressWarnings("unchecked") - Iterator datasourceNameIterator = connectionConfig.getConnectionNameIterator(); + Iterator datasourceNameIterator = connectionConfig.getConnections().keySet().iterator(); while (datasourceNameIterator.hasNext()) { String datasourceName = datasourceNameIterator.next(); if (ComparatorUtils.equals(selectedDSName, datasourceName)) { 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 010227c92e..7cb3b5df3f 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 @@ -133,7 +133,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh * @param connectionConfig the new datasourceManager. */ public void populate(ConnectionConfig connectionConfig) { - Iterator nameIt = connectionConfig.getConnectionNameIterator(); + Iterator nameIt = connectionConfig.getConnections().keySet().iterator(); List nameObjectList = new ArrayList(); while (nameIt.hasNext()) { @@ -153,11 +153,11 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); - connectionConfig.clearAllConnection(); + connectionConfig.removeAllConnection(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; - connectionConfig.putConnection(nameObject.getName(), (Connection) nameObject.getObject()); + connectionConfig.addConnection(nameObject.getName(), (Connection) nameObject.getObject()); } } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index 6278348206..f91b16d7eb 100644 --- a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -1,17 +1,14 @@ package com.fr.design.data.datapane.connect; -import com.fr.base.FRContext; import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.file.ConnectionConfig; import com.fr.general.Inter; -import com.fr.stable.project.ProjectConstants; import javax.swing.*; import java.awt.*; -import java.io.File; import java.util.HashMap; public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane { @@ -49,8 +46,9 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio } public void populate(ConnectionConfig datasourceManager) { - this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME - + File.separator + datasourceManager.fileName()); + //todo 原来界面上显示的xml路径 +// this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME +// + File.separator + datasourceManager.fileName()); this.connectionListPane.populate(datasourceManager); } From a6f6fefb47992e2dc25c7f9df29c3b48b1ccd5ef Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 5 Mar 2018 10:27:27 +0800 Subject: [PATCH 2/3] wu --- .../src/com/fr/design/formula/FunctionConstants.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer_base/src/com/fr/design/formula/FunctionConstants.java b/designer_base/src/com/fr/design/formula/FunctionConstants.java index 2df91fa464..7b826bc08f 100644 --- a/designer_base/src/com/fr/design/formula/FunctionConstants.java +++ b/designer_base/src/com/fr/design/formula/FunctionConstants.java @@ -2,6 +2,15 @@ package com.fr.design.formula; import com.fr.base.FRContext; import com.fr.file.FunctionConfig; +import com.fr.function.AVERAGE; +import com.fr.function.CHAR; +import com.fr.function.COUNT; +import com.fr.function.DATE; +import com.fr.function.MAX; +import com.fr.function.MIN; +import com.fr.function.RANGE; +import com.fr.function.SUM; +import com.fr.function.TIME; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.ExtraClassManager; From 39a28c729bb172c0c2491b3f86dc6e35f21ffd23 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 5 Mar 2018 10:43:08 +0800 Subject: [PATCH 3/3] wu --- .../actions/report/ReportWebAttrAction.java | 7 +++--- .../server/ServerConfigManagerAction.java | 4 +-- .../mainframe/AuthorityToolBarPane.java | 22 +++++++++------- .../src/com/fr/design/webattr/CommonPane.java | 16 ++++++------ .../EditReportServerParameterPane.java | 13 +++++++--- .../fr/design/webattr/PageToolBarPane.java | 13 +++++++--- .../fr/design/webattr/PageWebSettingPane.java | 6 ++--- .../fr/design/webattr/ReportWebAttrPane.java | 10 ++++---- .../fr/design/webattr/ViewToolBarPane.java | 13 +++++++--- .../fr/design/webattr/ViewWebSettingPane.java | 6 ++--- .../src/com/fr/design/webattr/WebCssPane.java | 6 ++--- .../src/com/fr/design/webattr/WebJsPane.java | 6 ++--- .../com/fr/design/webattr/WebSettingPane.java | 25 +++++++++++-------- .../fr/design/webattr/WriteToolBarPane.java | 13 +++++++--- .../design/webattr/WriteWebSettingPane.java | 6 ++--- 15 files changed, 96 insertions(+), 70 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportWebAttrAction.java b/designer/src/com/fr/design/actions/report/ReportWebAttrAction.java index 46364c9584..fda6622433 100644 --- a/designer/src/com/fr/design/actions/report/ReportWebAttrAction.java +++ b/designer/src/com/fr/design/actions/report/ReportWebAttrAction.java @@ -15,7 +15,7 @@ import com.fr.general.IOUtils; import com.fr.main.TemplateWorkBook; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import java.awt.event.ActionEvent; @@ -46,8 +46,7 @@ public class ReportWebAttrAction extends JWorkBookAction { final ReportWebAttrPane reportWebAttrPane = new ReportWebAttrPane() { @Override public void complete() { - ReportWebConfig config = wbTpl.getReportWebAttr(); - populate((ReportWebConfig) config.clone()); + populate(wbTpl.getReportWebAttr()); } }; final BasicDialog dialog = reportWebAttrPane.showWindow( @@ -66,7 +65,7 @@ public class ReportWebAttrAction extends JWorkBookAction { @Override public Class[] targets() { - return new Class[]{ReportWebConfig.class}; + return new Class[]{ReportWebAttr.class}; } }); diff --git a/designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java b/designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java index ad1aad61e0..5cf98c70fb 100644 --- a/designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java +++ b/designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java @@ -15,7 +15,7 @@ import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.event.ActionEvent; @@ -60,7 +60,7 @@ public class ServerConfigManagerAction extends UpdateAction { @Override public Class[] targets() { - return new Class[]{ReportWebConfig.class, ServerConfig.class}; + return new Class[]{ReportWebAttr.class, ServerConfig.class}; } }); diff --git a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java index 29978d1579..23e4622e1d 100644 --- a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java +++ b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe; +import com.fr.base.ConfigManager; +import com.fr.base.ConfigManagerProvider; import com.fr.base.FRContext; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.beans.BasicBeanPane; @@ -22,7 +24,7 @@ import com.fr.report.web.Location; import com.fr.report.web.ToolBarManager; import com.fr.report.web.WebContent; import com.fr.stable.ArrayUtils; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -34,7 +36,7 @@ import java.util.List; * Date: 13-9-9 * Time: 下午4:58 */ -public class AuthorityToolBarPane extends BasicBeanPane implements AuthorityEditToolBarComponent { +public class AuthorityToolBarPane extends BasicBeanPane implements AuthorityEditToolBarComponent { private static final int SMALL_GAP = 13; private static final int GAP = 25; private static final int PRE_GAP = 9; @@ -193,7 +195,7 @@ public class AuthorityToolBarPane extends BasicBeanPane extends BasicBeanPane extends BasicBeanPane extends BasicBeanPane extends BasicBeanPane extends BasicBeanPane 0) { this.titleTextField.setText(reportWebAttr.getTitle()); } - + this.cacheValidateTimeEditor.setValue(Long.valueOf(reportWebAttr.getCacheValidateTime())); } - public void update(ReportWebConfig reportWebAttr) { + public void update(ReportWebAttr reportWebAttr) { if (!StringUtils.isEmpty(this.titleTextField.getText())) { reportWebAttr.setTitle(this.titleTextField.getText()); } else { diff --git a/designer/src/com/fr/design/webattr/EditReportServerParameterPane.java b/designer/src/com/fr/design/webattr/EditReportServerParameterPane.java index 49a004d04b..4eaf6b60bd 100644 --- a/designer/src/com/fr/design/webattr/EditReportServerParameterPane.java +++ b/designer/src/com/fr/design/webattr/EditReportServerParameterPane.java @@ -3,6 +3,7 @@ */ package com.fr.design.webattr; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.config.ServerConfig; import com.fr.design.gui.frpane.LoadingBasicPane; @@ -12,7 +13,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -30,7 +31,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane { //TODO 表单 // private FormToolBarPane formPane; private WriteToolBarPane writePane; - private ReportWebConfig webAttr; + private ReportWebAttr webAttr; private WebCssPane cssPane; @@ -78,7 +79,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane { // ProjectConstants.RESOURCES_NAME + // File.separator + reportServerConfig.fileName()); - webAttr = (ReportWebConfig) ReportWebConfig.getInstance().clone(); + webAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); if (webAttr != null) { pagePane.populateBean(webAttr.getWebPage()); viewPane.populateBean(webAttr.getWebView()); @@ -95,7 +96,11 @@ public class EditReportServerParameterPane extends LoadingBasicPane { * Update. */ public void update(ServerConfig reportServerConfig) { - ReportWebConfig webAttr = ReportWebConfig.getInstance(); + ReportWebAttr webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); + if (webAttr == null) { + webAttr = new ReportWebAttr(); + ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, webAttr); + } webAttr.setWebPage(pagePane.updateBean()); webAttr.setWebView(viewPane.updateBean()); webAttr.setWebWrite(writePane.updateBean()); diff --git a/designer/src/com/fr/design/webattr/PageToolBarPane.java b/designer/src/com/fr/design/webattr/PageToolBarPane.java index d17ecc1bbe..00fabc103b 100644 --- a/designer/src/com/fr/design/webattr/PageToolBarPane.java +++ b/designer/src/com/fr/design/webattr/PageToolBarPane.java @@ -1,5 +1,6 @@ package com.fr.design.webattr; +import com.fr.base.ConfigManager; import com.fr.config.Configuration; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -18,7 +19,7 @@ import com.fr.report.web.WebContent; import com.fr.report.web.WebPage; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -166,7 +167,7 @@ public class PageToolBarPane extends AbstractEditToolBarPane { @Override public void editServerToolBarPane() { final PageToolBarPane serverPageToolBarPane = new PageToolBarPane(); - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); if (reportWebAttr != null) { serverPageToolBarPane.populateBean(reportWebAttr.getWebPage()); } @@ -178,13 +179,17 @@ public class PageToolBarPane extends AbstractEditToolBarPane { Configurations.update(new Worker() { @Override public void run() { - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); + if (reportWebAttr == null) { + reportWebAttr = new ReportWebAttr(); + ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr); + } reportWebAttr.setWebPage(serverPageToolBarPane.updateBean()); } @Override public Class[] targets() { - return new Class[]{ReportWebConfig.class}; + return new Class[]{ReportWebAttr.class}; } }); diff --git a/designer/src/com/fr/design/webattr/PageWebSettingPane.java b/designer/src/com/fr/design/webattr/PageWebSettingPane.java index c563a25f17..ee415da68c 100644 --- a/designer/src/com/fr/design/webattr/PageWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/PageWebSettingPane.java @@ -21,7 +21,7 @@ import com.fr.design.gui.core.WidgetOption; import com.fr.general.Inter; import com.fr.report.web.ToolBarManager; import com.fr.report.web.WebPage; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; public class PageWebSettingPane extends WebSettingPane { private UIRadioButton centerRadioButton; @@ -119,7 +119,7 @@ public class PageWebSettingPane extends WebSettingPane { } @Override - protected WebPage getWebContent(ReportWebConfig reportWebAttr) { + protected WebPage getWebContent(ReportWebAttr reportWebAttr) { return reportWebAttr == null ? null :reportWebAttr.getWebPage(); } @@ -129,7 +129,7 @@ public class PageWebSettingPane extends WebSettingPane { } @Override - protected void setWebContent(ReportWebConfig reportWebAttr,WebPage webContent) { + protected void setWebContent(ReportWebAttr reportWebAttr,WebPage webContent) { reportWebAttr.setWebPage(webContent); } } \ No newline at end of file diff --git a/designer/src/com/fr/design/webattr/ReportWebAttrPane.java b/designer/src/com/fr/design/webattr/ReportWebAttrPane.java index 244d74acc6..8577e0e3e4 100644 --- a/designer/src/com/fr/design/webattr/ReportWebAttrPane.java +++ b/designer/src/com/fr/design/webattr/ReportWebAttrPane.java @@ -9,7 +9,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.BackgroundPane; import com.fr.design.style.background.BackgroundPane4Browser; import com.fr.general.Inter; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -18,7 +18,7 @@ import java.awt.*; * ReportWebAttr Dialog */ public class ReportWebAttrPane extends LoadingBasicPane { - private ReportWebConfig reportWebAttr; + private ReportWebAttr reportWebAttr; private UITabbedPane tabbedPane; private CommonPane commonPane; @@ -60,9 +60,9 @@ public class ReportWebAttrPane extends LoadingBasicPane { return Inter.getLocText("FR-Designer_Template_Web_Attributes"); } - public void populate(ReportWebConfig reportWebAttr) { + public void populate(ReportWebAttr reportWebAttr) { if (reportWebAttr == null) { - reportWebAttr = ReportWebConfig.getInstance(); + reportWebAttr = new ReportWebAttr(); } this.reportWebAttr = reportWebAttr; @@ -79,7 +79,7 @@ public class ReportWebAttrPane extends LoadingBasicPane { } - public ReportWebConfig update() { + public ReportWebAttr update() { reportWebAttr.setPrinter(this.serverPrintPane.update()); pageWeb.update(reportWebAttr); writeWeb.update(reportWebAttr); diff --git a/designer/src/com/fr/design/webattr/ViewToolBarPane.java b/designer/src/com/fr/design/webattr/ViewToolBarPane.java index 1982d50c67..6011d8f7de 100644 --- a/designer/src/com/fr/design/webattr/ViewToolBarPane.java +++ b/designer/src/com/fr/design/webattr/ViewToolBarPane.java @@ -1,5 +1,6 @@ package com.fr.design.webattr; +import com.fr.base.ConfigManager; import com.fr.config.Configuration; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -17,7 +18,7 @@ import com.fr.report.web.WebContent; import com.fr.report.web.WebView; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -136,7 +137,7 @@ public class ViewToolBarPane extends AbstractEditToolBarPane { @Override public void editServerToolBarPane() { final ViewToolBarPane serverPageToolBarPane = new ViewToolBarPane(); - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); if (reportWebAttr != null) { serverPageToolBarPane.populateBean(reportWebAttr.getWebView()); } @@ -148,13 +149,17 @@ public class ViewToolBarPane extends AbstractEditToolBarPane { Configurations.update(new Worker() { @Override public void run() { - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); + if (reportWebAttr == null) { + reportWebAttr = new ReportWebAttr(); + ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr); + } reportWebAttr.setWebView(serverPageToolBarPane.updateBean()); } @Override public Class[] targets() { - return new Class[]{ReportWebConfig.class}; + return new Class[]{ReportWebAttr.class}; } }); diff --git a/designer/src/com/fr/design/webattr/ViewWebSettingPane.java b/designer/src/com/fr/design/webattr/ViewWebSettingPane.java index 17d42f7fe8..c18e22ca41 100644 --- a/designer/src/com/fr/design/webattr/ViewWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/ViewWebSettingPane.java @@ -8,7 +8,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.report.web.ToolBarManager; import com.fr.report.web.WebView; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -73,7 +73,7 @@ public class ViewWebSettingPane extends WebSettingPane { } @Override - protected WebView getWebContent(ReportWebConfig reportWebAttr) { + protected WebView getWebContent(ReportWebAttr reportWebAttr) { return reportWebAttr == null ? null : reportWebAttr.getWebView(); } @@ -83,7 +83,7 @@ public class ViewWebSettingPane extends WebSettingPane { } @Override - protected void setWebContent(ReportWebConfig reportWebAttr, WebView webContent) { + protected void setWebContent(ReportWebAttr reportWebAttr, WebView webContent) { reportWebAttr.setWebView(webContent); } @Override diff --git a/designer/src/com/fr/design/webattr/WebCssPane.java b/designer/src/com/fr/design/webattr/WebCssPane.java index 916ef45148..8c3851e3b5 100644 --- a/designer/src/com/fr/design/webattr/WebCssPane.java +++ b/designer/src/com/fr/design/webattr/WebCssPane.java @@ -24,7 +24,7 @@ import com.fr.file.filter.ChooseFileFilter; import com.fr.general.Inter; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; public class WebCssPane extends BasicPane { private UITextField localText; @@ -98,7 +98,7 @@ public class WebCssPane extends BasicPane { return Inter.getLocText("ReportServerP-Import_Css"); } - public void populate(ReportWebConfig reportWebAttr) { + public void populate(ReportWebAttr reportWebAttr) { if (reportWebAttr == null) { centerPane.populateBean(new ArrayList()); return; @@ -113,7 +113,7 @@ public class WebCssPane extends BasicPane { centerPane.populateBean(list); } - public void update(ReportWebConfig reportWebAttr) { + public void update(ReportWebAttr reportWebAttr) { List valueList = centerPane.updateBean(); reportWebAttr.clearCSSImportList(); for (int i = 0; i < valueList.size(); i++) { diff --git a/designer/src/com/fr/design/webattr/WebJsPane.java b/designer/src/com/fr/design/webattr/WebJsPane.java index bea7804ba0..93208ad8e3 100644 --- a/designer/src/com/fr/design/webattr/WebJsPane.java +++ b/designer/src/com/fr/design/webattr/WebJsPane.java @@ -33,7 +33,7 @@ import com.fr.file.filter.ChooseFileFilter; import com.fr.general.Inter; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; public class WebJsPane extends BasicPane { private UITextField localText; @@ -260,7 +260,7 @@ public class WebJsPane extends BasicPane { chooseFile.setEnabled(false); } - public void populate(ReportWebConfig reportWebAttr) { + public void populate(ReportWebAttr reportWebAttr) { if (reportWebAttr == null) { editingPane.populateBean(new ArrayList()); return; @@ -274,7 +274,7 @@ public class WebJsPane extends BasicPane { editingPane.populateBean(list); } - public void update(ReportWebConfig reportWebAttr) { + public void update(ReportWebAttr reportWebAttr) { List valueList = editingPane.updateBean(); reportWebAttr.clearJSImportList(); for (int i = 0; i < valueList.size(); i++) { diff --git a/designer/src/com/fr/design/webattr/WebSettingPane.java b/designer/src/com/fr/design/webattr/WebSettingPane.java index fe151ea5b5..be8790a92d 100644 --- a/designer/src/com/fr/design/webattr/WebSettingPane.java +++ b/designer/src/com/fr/design/webattr/WebSettingPane.java @@ -1,5 +1,6 @@ package com.fr.design.webattr; +import com.fr.base.ConfigManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.icombobox.UIComboBox; @@ -12,8 +13,9 @@ import com.fr.form.event.Listener; import com.fr.general.Inter; import com.fr.report.web.ToolBarManager; import com.fr.report.web.WebContent; +import com.fr.base.ConfigManagerProvider; import com.fr.stable.StringUtils; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -22,7 +24,7 @@ import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.List; -public abstract class WebSettingPane extends BasicBeanPane { +public abstract class WebSettingPane extends BasicBeanPane { private static final String[] CHOOSEITEM = new String[] { Inter.getLocText("FR-Designer_I_Want_To_Set_Single"), Inter.getLocText("FR-Designer_Using_Server_Report_View_Settings") @@ -31,7 +33,7 @@ public abstract class WebSettingPane extends BasicBeanPane private EventPane eventPane; private ToolBarDragPane dragToolBarPane; private UIComboBox choseComboBox; - + private static final int SINGLE_SET = 0; private static final int SERVER_SET = 1; private static final int ZERO = 0; @@ -117,7 +119,7 @@ public abstract class WebSettingPane extends BasicBeanPane protected abstract String[] getEventNames(); @Override - public void populateBean(ReportWebConfig reportWebAttr) { + public void populateBean(ReportWebAttr reportWebAttr) { if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {// 如果是空值就说明采用服务器配置了 choseComboBox.removeItemListener(itemListener); choseComboBox.setSelectedIndex(SERVER_SET); @@ -145,7 +147,7 @@ public abstract class WebSettingPane extends BasicBeanPane } - public void update(ReportWebConfig reportWebAttr) { + public void update(ReportWebAttr reportWebAttr) { if (this.choseComboBox.getSelectedIndex() == SERVER_SET) { setWebContent(reportWebAttr, null); reportWebAttr = is_Null_ReportWebAttr(reportWebAttr) ? null : reportWebAttr; @@ -155,11 +157,11 @@ public abstract class WebSettingPane extends BasicBeanPane } @Override - public ReportWebConfig updateBean() { + public ReportWebAttr updateBean() { return null; } - private ReportWebConfig TemplateupdateBean(ReportWebConfig reportWebAttr) { + private ReportWebAttr TemplateupdateBean(ReportWebAttr reportWebAttr) { T webContent = updateSubWebSettingBean(); ToolBarManager[] toolBarManagers = dragToolBarPane.updateBean(); webContent.setToolBarManagers(toolBarManagers); @@ -171,13 +173,13 @@ public abstract class WebSettingPane extends BasicBeanPane return reportWebAttr; } - protected abstract T getWebContent(ReportWebConfig reportWebAttr); + protected abstract T getWebContent(ReportWebAttr reportWebAttr); protected abstract void populateSubWebSettingrBean(T ob); protected abstract T updateSubWebSettingBean(); - protected abstract void setWebContent(ReportWebConfig reportWebAttr, T ob); + protected abstract void setWebContent(ReportWebAttr reportWebAttr, T ob); protected abstract WidgetOption[] getToolBarInstance(); @@ -189,7 +191,8 @@ public abstract class WebSettingPane extends BasicBeanPane } private void populateServerSettings() { - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr)configManager.getGlobalAttribute(ReportWebAttr.class)); T webContent = this.getWebContent(reportWebAttr); if(webContent == null){ return; @@ -214,7 +217,7 @@ public abstract class WebSettingPane extends BasicBeanPane * * @return 模板web属性书否为空 */ - public static boolean is_Null_ReportWebAttr(ReportWebConfig reportWebAttr) { + public static boolean is_Null_ReportWebAttr(ReportWebAttr reportWebAttr) { if (reportWebAttr == null) { return true; } diff --git a/designer/src/com/fr/design/webattr/WriteToolBarPane.java b/designer/src/com/fr/design/webattr/WriteToolBarPane.java index 933f3934b4..0dbb260261 100644 --- a/designer/src/com/fr/design/webattr/WriteToolBarPane.java +++ b/designer/src/com/fr/design/webattr/WriteToolBarPane.java @@ -1,6 +1,7 @@ package com.fr.design.webattr; import com.fr.base.BaseUtils; +import com.fr.base.ConfigManager; import com.fr.config.Configuration; import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.BasicDialog; @@ -22,7 +23,7 @@ import com.fr.report.web.WebWrite; import com.fr.stable.Constants; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; @@ -253,7 +254,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { @Override public void editServerToolBarPane() { final WriteToolBarPane serverPageToolBarPane = new WriteToolBarPane(); - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); if (reportWebAttr != null) { serverPageToolBarPane.populateBean(reportWebAttr.getWebWrite()); } @@ -265,13 +266,17 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { Configurations.update(new Worker() { @Override public void run() { - ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); + ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); + if (reportWebAttr == null) { + reportWebAttr = new ReportWebAttr(); + ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr); + } reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean()); } @Override public Class[] targets() { - return new Class[]{ReportWebConfig.class}; + return new Class[]{ReportWebAttr.class}; } }); diff --git a/designer/src/com/fr/design/webattr/WriteWebSettingPane.java b/designer/src/com/fr/design/webattr/WriteWebSettingPane.java index 36dd4b50c7..92b26b0d59 100644 --- a/designer/src/com/fr/design/webattr/WriteWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/WriteWebSettingPane.java @@ -13,7 +13,7 @@ import com.fr.general.Inter; import com.fr.report.web.ToolBarManager; import com.fr.report.web.WebWrite; import com.fr.stable.Constants; -import com.fr.web.attr.ReportWebConfig; +import com.fr.web.attr.ReportWebAttr; import javax.swing.*; import java.awt.*; @@ -180,7 +180,7 @@ public class WriteWebSettingPane extends WebSettingPane { } @Override - protected WebWrite getWebContent(ReportWebConfig reportWebAttr) { + protected WebWrite getWebContent(ReportWebAttr reportWebAttr) { return reportWebAttr == null ? null : reportWebAttr.getWebWrite(); } @@ -190,7 +190,7 @@ public class WriteWebSettingPane extends WebSettingPane { } @Override - protected void setWebContent(ReportWebConfig reportWebAttr, WebWrite webContent) { + protected void setWebContent(ReportWebAttr reportWebAttr, WebWrite webContent) { reportWebAttr.setWebWrite(webContent); }