Browse Source

Merge pull request #1690 in BA/design from ~KERRY/design:feature/10.0 to feature/10.0

* commit '7a39519281c56eb47a09630e43cce973ba13f6c2':
  REPORT-6956 设计器适配10.0配置写法
  REPORT-6956  设计器适配10.0配置写法
master
superman 7 years ago
parent
commit
97ae06438b
  1. 12
      designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  2. 33
      designer/src/com/fr/design/actions/report/ReportWebAttrAction.java
  3. 32
      designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java
  4. 30
      designer/src/com/fr/design/actions/server/StyleListAction.java
  5. 16
      designer/src/com/fr/design/actions/server/StyleManagerPane.java
  6. 41
      designer/src/com/fr/design/actions/server/WidgetManagerAction.java
  7. 4
      designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java
  8. 22
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  9. 4
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  10. 2
      designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  11. 6
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  12. 6
      designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java
  13. 7
      designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java
  14. 4
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  15. 5
      designer/src/com/fr/design/module/DesignerModule.java
  16. 6
      designer/src/com/fr/design/present/StyleArrayPane.java
  17. 6
      designer/src/com/fr/design/report/ReportStylePane.java
  18. 13
      designer/src/com/fr/design/report/WriteShortCutsPane.java
  19. 6
      designer/src/com/fr/design/webattr/CommonPane.java
  20. 34
      designer/src/com/fr/design/webattr/EditReportServerParameterPane.java
  21. 4
      designer/src/com/fr/design/webattr/EditToolBar.java
  22. 34
      designer/src/com/fr/design/webattr/PageToolBarPane.java
  23. 6
      designer/src/com/fr/design/webattr/PageWebSettingPane.java
  24. 10
      designer/src/com/fr/design/webattr/ReportWebAttrPane.java
  25. 4
      designer/src/com/fr/design/webattr/ToolBarButton.java
  26. 37
      designer/src/com/fr/design/webattr/ViewToolBarPane.java
  27. 6
      designer/src/com/fr/design/webattr/ViewWebSettingPane.java
  28. 6
      designer/src/com/fr/design/webattr/WebCssPane.java
  29. 6
      designer/src/com/fr/design/webattr/WebJsPane.java
  30. 23
      designer/src/com/fr/design/webattr/WebSettingPane.java
  31. 13
      designer/src/com/fr/design/webattr/WidgetManagerPane.java
  32. 27
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  33. 6
      designer/src/com/fr/design/webattr/WriteWebSettingPane.java
  34. 6
      designer/src/com/fr/design/widget/WidgetConfigPane.java
  35. 2
      designer/src/com/fr/design/widget/WidgetPane.java
  36. 13
      designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java
  37. 6
      designer/src/com/fr/grid/selection/CellSelection.java
  38. 13
      designer_base/src/com/fr/design/actions/file/PreferencePane.java
  39. 173
      designer_base/src/com/fr/design/actions/server/ConnectionListAction.java
  40. 35
      designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java
  41. 44
      designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java
  42. 188
      designer_base/src/com/fr/design/actions/server/GlobalTableDataAction.java
  43. 34
      designer_base/src/com/fr/design/actions/server/ProcedureListAction.java
  44. 25
      designer_base/src/com/fr/design/bbs/BBSLoginUtils.java
  45. 16
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  46. 13
      designer_base/src/com/fr/design/data/datapane/ChoosePane.java
  47. 6
      designer_base/src/com/fr/design/data/datapane/TableDataPaneController.java
  48. 21
      designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java
  49. 7
      designer_base/src/com/fr/design/data/datapane/TreeTableDataComboBox.java
  50. 43
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  51. 16
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java
  52. 6
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java
  53. 6
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java
  54. 7
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DecoratedTableDataPane.java
  55. 4
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  56. 16
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureListPane.java
  57. 18
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureManagerPane.java
  58. 18
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java
  59. 8
      designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java
  60. 10
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  61. 6
      designer_base/src/com/fr/design/extra/PluginFromStorePane.java
  62. 4
      designer_base/src/com/fr/design/extra/PluginOperateUtils.java
  63. 6
      designer_base/src/com/fr/design/extra/PluginUpdatePane.java
  64. 11
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  65. 6
      designer_base/src/com/fr/design/formula/FunctionConstants.java
  66. 14
      designer_base/src/com/fr/design/formula/FunctionManagerPane.java
  67. 7
      designer_base/src/com/fr/design/formula/VariableResolverAdapter.java
  68. 2
      designer_base/src/com/fr/design/gui/core/WidgetOption.java
  69. 8
      designer_base/src/com/fr/design/gui/ilist/TableViewList.java
  70. 4
      designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  71. 6
      designer_base/src/com/fr/design/javascript/EmailPane.java
  72. 9
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  73. 4
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  74. 4
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java
  75. 12
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java
  76. 6
      designer_base/src/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java
  77. 8
      designer_base/src/com/fr/design/parameter/ParameterArrayPane.java
  78. 17
      designer_base/src/com/fr/design/parameter/ParameterManagerPane.java
  79. 8
      designer_base/src/com/fr/design/web/CustomIconPane.java
  80. 11
      designer_base/src/com/fr/design/widget/IconDefinePane.java
  81. 10
      designer_base/src/com/fr/env/RemoteEnv.java
  82. 3
      designer_chart/src/com/fr/plugin/chart/map/server/ChartMapEditorAction.java
  83. 2
      designer_form/src/com/fr/design/designer/creator/XNameWidget.java
  84. 2
      designer_form/src/com/fr/design/mainframe/FormEditToolBar.java
  85. 2
      designer_form/src/com/fr/design/mainframe/FormParaPane.java
  86. 2
      designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java
  87. 4
      designer_form/src/com/fr/design/mainframe/FormToolBarButton.java
  88. 5
      designer_form/src/com/fr/design/mainframe/widget/editors/NameWidgetComboboxEditor.java
  89. 13
      designer_form/src/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java

12
designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java

@ -5,25 +5,18 @@ package com.fr.design.actions.cell;
*/ */
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.design.actions.ElementCaseAction; import com.fr.config.ServerConfig;
import com.fr.design.actions.SelectionListenerAction; import com.fr.design.actions.SelectionListenerAction;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener; import com.fr.design.selection.SelectionListener;
import com.fr.design.style.StylePane; import com.fr.design.style.StylePane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.pinyin.PinyinHelper; import com.fr.stable.pinyin.PinyinHelper;
@ -79,8 +72,7 @@ public class GlobalStyleMenuDef extends MenuDef {
public void updateMenu() { public void updateMenu() {
UIMenu createdMenu = this.createJMenu(); UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll(); createdMenu.removeAll();
ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); Iterator iterator = ServerConfig.getInstance().getStyleNameIterator();
Iterator iterator = configManager.getStyleNameIterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
String name = (String) iterator.next(); String name = (String) iterator.next();
NameStyle nameStyle = NameStyle.getInstance(name); NameStyle nameStyle = NameStyle.getInstance(name);

33
designer/src/com/fr/design/actions/report/ReportWebAttrAction.java

@ -3,10 +3,7 @@
*/ */
package com.fr.design.actions.report; package com.fr.design.actions.report;
import com.fr.base.ConfigManager; import com.fr.config.Configuration;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.actions.JWorkBookAction; import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -16,6 +13,9 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.webattr.ReportWebAttrPane; import com.fr.design.webattr.ReportWebAttrPane;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook; import com.fr.main.TemplateWorkBook;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -46,7 +46,8 @@ public class ReportWebAttrAction extends JWorkBookAction {
final ReportWebAttrPane reportWebAttrPane = new ReportWebAttrPane() { final ReportWebAttrPane reportWebAttrPane = new ReportWebAttrPane() {
@Override @Override
public void complete() { public void complete() {
populate(wbTpl.getReportWebAttr()); ReportWebConfig config = wbTpl.getReportWebAttr();
populate((ReportWebConfig) config.clone());
} }
}; };
final BasicDialog dialog = reportWebAttrPane.showWindow( final BasicDialog dialog = reportWebAttrPane.showWindow(
@ -56,15 +57,19 @@ public class ReportWebAttrAction extends JWorkBookAction {
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
wbTpl.setReportWebAttr(reportWebAttrPane.update()); Configurations.update(new Worker() {
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); @Override
Env currentEnv = FRContext.getCurrentEnv(); public void run() {
try { wbTpl.setReportWebAttr(reportWebAttrPane.update());
currentEnv.writeResource(configManager); jwb.fireTargetModified();
} catch (Exception ex) { }
FRContext.getLogger().error(ex.getMessage(), ex);
} @Override
jwb.fireTargetModified(); public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
} }
}); });

32
designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -3,10 +3,8 @@
*/ */
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.ConfigManager; import com.fr.config.Configuration;
import com.fr.base.ConfigManagerProvider; import com.fr.config.ServerConfig;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -15,6 +13,9 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.EditReportServerParameterPane; import com.fr.design.webattr.EditReportServerParameterPane;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -36,11 +37,11 @@ public class ServerConfigManagerAction extends UpdateAction {
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); final ServerConfig config = ServerConfig.getInstance();
final EditReportServerParameterPane editReportServerParameterPane = new EditReportServerParameterPane() { final EditReportServerParameterPane editReportServerParameterPane = new EditReportServerParameterPane() {
@Override @Override
public void complete() { public void complete() {
populate(configManager); populate((ServerConfig)config.clone());
} }
}; };
@ -51,13 +52,18 @@ public class ServerConfigManagerAction extends UpdateAction {
editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() { editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
editReportServerParameterPane.update(configManager); Configurations.update(new Worker() {
Env currentEnv = FRContext.getCurrentEnv(); @Override
try { public void run() {
currentEnv.writeResource(configManager); editReportServerParameterPane.update(config);
} catch (Exception ex) { }
FRContext.getLogger().error(ex.getMessage(), ex);
} @Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class, ServerConfig.class};
}
});
} }
}); });
editReportServerParameterDialog.setVisible(true); editReportServerParameterDialog.setVisible(true);

30
designer/src/com/fr/design/actions/server/StyleListAction.java

@ -1,9 +1,7 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.config.Configuration;
import com.fr.base.ConfigManager; import com.fr.config.ServerConfig;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -12,6 +10,8 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -40,18 +40,22 @@ public class StyleListAction extends UpdateAction {
styleListDialog.addDialogActionListener(new DialogActionAdapter() { styleListDialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
styleListPane.update(ConfigManager.getProviderInstance()); Configurations.update(new Worker() {
//marks:保存数据 @Override
Env currentEnv = FRContext.getCurrentEnv(); public void run() {
try { styleListPane.update(ServerConfig.getInstance());
currentEnv.writeResource(ConfigManager.getProviderInstance()); }
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); @Override
} public Class<? extends Configuration>[] targets() {
return new Class[]{ServerConfig.class};
}
});
} }
}); });
styleListPane.populate(ConfigManager.getProviderInstance()); styleListPane.populate((ServerConfig) ServerConfig.getInstance().clone());
styleListDialog.setVisible(true); styleListDialog.setVisible(true);
} }

16
designer/src/com/fr/design/actions/server/StyleManagerPane.java

@ -1,18 +1,15 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.FRContext; import com.fr.config.ServerConfig;
import com.fr.base.ConfigManagerProvider;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.StyleArrayPane; import com.fr.design.present.StyleArrayPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.io.File;
public class StyleManagerPane extends BasicPane { public class StyleManagerPane extends BasicPane {
private UITextField StyleTextField; private UITextField StyleTextField;
@ -38,14 +35,15 @@ public class StyleManagerPane extends BasicPane {
return Inter.getLocText("ServerM-Predefined_Styles"); return Inter.getLocText("ServerM-Predefined_Styles");
} }
public void populate(ConfigManagerProvider configManager) { public void populate(ServerConfig configManager) {
this.StyleTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + //todo 原来界面上显示的xml路径
ProjectConstants.RESOURCES_NAME + // this.StyleTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
File.separator + configManager.fileName()); // ProjectConstants.RESOURCES_NAME +
// File.separator + configManager.fileName());
this.styleArrayPane.populate(configManager); this.styleArrayPane.populate(configManager);
} }
public void update(ConfigManagerProvider configManager) { public void update(ServerConfig configManager) {
this.styleArrayPane.update(configManager); this.styleArrayPane.update(configManager);
} }
} }

41
designer/src/com/fr/design/actions/server/WidgetManagerAction.java

@ -1,8 +1,7 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Env; import com.fr.config.Configuration;
import com.fr.base.FRContext;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -11,9 +10,10 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.WidgetManagerPane; import com.fr.design.webattr.WidgetManagerPane;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.form.ui.WidgetManagerProvider;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -32,32 +32,33 @@ public class WidgetManagerAction extends UpdateAction {
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final WidgetManagerProvider widgetManager = WidgetManager.getProviderInstance(); final WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance();
final WidgetManagerPane widgetManagerPane = new WidgetManagerPane() { final WidgetManagerPane widgetManagerPane = new WidgetManagerPane() {
@Override @Override
public void complete() { public void complete() {
populate(widgetManager); populate((WidgetInfoConfig)widgetManager.clone());
} }
}; };
BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame,new DialogActionAdapter() { BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame,new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
widgetManagerPane.update(widgetManager); Configurations.update(new Worker() {
@Override
public void run() {
widgetManagerPane.update(widgetManager);
DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.widgetConfigChanged();
}
designerFrame.getSelectedJTemplate().refreshToolArea();
}
Env currentEnv = FRContext.getCurrentEnv(); @Override
try { public Class<? extends Configuration>[] targets() {
currentEnv.writeResource(widgetManager); return new Class[]{WidgetInfoConfig.class};
//marks: 由于这个面板还改变权限相关的操作,所以这个时候还要操作权限配置 }
// currentEnv.writeResource(FRContext.getPrivilegeManager()); });
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.widgetConfigChanged();
}
designerFrame.getSelectedJTemplate().refreshToolArea();
} }
}); });

4
designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java

@ -1,5 +1,5 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.ConfigManager; import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
@ -101,7 +101,7 @@ public class ActiveKeyGenerator {
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("uuid", envManager.getUUID()); para.put("uuid", envManager.getUUID());
para.put("key", key); para.put("key", key);
para.put("username", ConfigManager.getProviderInstance().getBbsUsername()); para.put("username", ServerConfig.getInstance().getBbsUsername());
HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("verify.code"), para); HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("verify.code"), para);
if (timeout != -1) { if (timeout != -1) {
hc.setTimeout(timeout); hc.setTimeout(timeout);

22
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -1,7 +1,5 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -24,7 +22,7 @@ import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent; import com.fr.report.web.WebContent;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -36,7 +34,7 @@ import java.util.List;
* Date: 13-9-9 * Date: 13-9-9
* Time: 下午4:58 * Time: 下午4:58
*/ */
public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<ReportWebAttr> implements AuthorityEditToolBarComponent { public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<ReportWebConfig> implements AuthorityEditToolBarComponent {
private static final int SMALL_GAP = 13; private static final int SMALL_GAP = 13;
private static final int GAP = 25; private static final int GAP = 25;
private static final int PRE_GAP = 9; private static final int PRE_GAP = 9;
@ -195,7 +193,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
} }
private ReportWebAttr getReportWebAttr() { private ReportWebConfig getReportWebAttr() {
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (!editingTemplate.isJWorkBook()) { if (!editingTemplate.isJWorkBook()) {
return null; return null;
@ -215,9 +213,8 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
JWorkBook editingWorkBook = (JWorkBook) editingTemplate; JWorkBook editingWorkBook = (JWorkBook) editingTemplate;
TemplateWorkBook wbTpl = editingWorkBook.getTarget(); TemplateWorkBook wbTpl = editingWorkBook.getTarget();
ReportWebAttr rw = wbTpl.getReportWebAttr(); ReportWebConfig rw = wbTpl.getReportWebAttr();
ConfigManagerProvider cm = ConfigManager.getProviderInstance(); ReportWebConfig webAttr = ReportWebConfig.getInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
//wbTpl.clear先清空 //wbTpl.clear先清空
//再将所有的保存进去 //再将所有的保存进去
@ -264,7 +261,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
} }
public void populateBean(ReportWebAttr reportWebAttr) { public void populateBean(ReportWebConfig reportWebAttr) {
this.remove(title); this.remove(title);
// 如果是空值就说明采用服务器配置了 // 如果是空值就说明采用服务器配置了
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) { if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {
@ -280,7 +277,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
populate(webContent.getToolBarManagers()); populate(webContent.getToolBarManagers());
} }
public ReportWebAttr updateBean() { public ReportWebConfig updateBean() {
return null; return null;
} }
@ -318,8 +315,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
private void populateServerSettings() { private void populateServerSettings() {
ConfigManagerProvider cm = ConfigManager.getProviderInstance(); ReportWebConfig webAttr = (ReportWebConfig)ReportWebConfig.getInstance().clone();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
if (this.getWebContent(webAttr) != null) { if (this.getWebContent(webAttr) != null) {
populate(this.getWebContent(webAttr).getToolBarManagers()); populate(this.getWebContent(webAttr).getToolBarManagers());
} }
@ -330,7 +326,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
} }
private T getWebContent(ReportWebAttr reportWebAttr) { private T getWebContent(ReportWebConfig reportWebAttr) {
if (choseComboBox.getSelectedIndex() == 0) { if (choseComboBox.getSelectedIndex() == 0) {
return reportWebAttr == null ? null : (T) reportWebAttr.getWebPage(); return reportWebAttr == null ? null : (T) reportWebAttr.getWebPage();
} else if (choseComboBox.getSelectedIndex() == 1) { } else if (choseComboBox.getSelectedIndex() == 1) {

4
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.bulenkov.iconloader.IconLoader; import com.bulenkov.iconloader.IconLoader;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -775,7 +775,7 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void sendDataToServer(String searchKey, AlphaCellModel cellModel) { private void sendDataToServer(String searchKey, AlphaCellModel cellModel) {
if (cellModel.isNeedToSendToServer()) { if (cellModel.isNeedToSendToServer()) {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ServerConfig.getInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID(); String uuid = DesignerEnvManager.getEnvManager().getUUID();
String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey();
String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime());

2
designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -1,7 +1,5 @@
package com.fr.design.mainframe.bbs; package com.fr.design.mainframe.bbs;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;

6
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -3,8 +3,8 @@
*/ */
package com.fr.design.mainframe.bbs; package com.fr.design.mainframe.bbs;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.extra.LoginContextListener; import com.fr.design.extra.LoginContextListener;
@ -95,7 +95,7 @@ public class UserInfoLabel extends UILabel {
private void init(UserInfoPane userInfoPane) { private void init(UserInfoPane userInfoPane) {
this.userInfoPane = userInfoPane; this.userInfoPane = userInfoPane;
String userName = ConfigManager.getProviderInstance().getBbsUsername(); String userName = ServerConfig.getInstance().getBbsUsername();
this.addMouseListener(userInfoAdapter); this.addMouseListener(userInfoAdapter);
this.setHorizontalAlignment(SwingConstants.CENTER); this.setHorizontalAlignment(SwingConstants.CENTER);
this.setText(userName); this.setText(userName);
@ -240,7 +240,7 @@ public class UserInfoLabel extends UILabel {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
userName = ConfigManager.getProviderInstance().getBbsUsername(); userName = ServerConfig.getInstance().getBbsUsername();
if (StringUtils.isNotEmpty(userName)) { if (StringUtils.isNotEmpty(userName)) {
UIPopupMenu menu = new UIPopupMenu(); UIPopupMenu menu = new UIPopupMenu();
menu.setOnlyText(true); menu.setOnlyText(true);

6
designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java

@ -3,8 +3,8 @@
*/ */
package com.fr.design.mainframe.bbs; package com.fr.design.mainframe.bbs;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -78,7 +78,7 @@ public class UserInfoPane extends BasicPane{
GeneralContext.addEnvChangedListener(new EnvChangedListener() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override @Override
public void envChanged() { public void envChanged() {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ServerConfig.getInstance().getBbsUsername();
if (StringUtils.isEmpty(username)){ if (StringUtils.isEmpty(username)){
markUnSignIn(); markUnSignIn();
} else { } else {
@ -133,7 +133,7 @@ public class UserInfoPane extends BasicPane{
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
String userName = ConfigManager.getProviderInstance().getBbsUsername(); String userName = ServerConfig.getInstance().getBbsUsername();
if(StringUtils.isNotEmpty(userName)){ if(StringUtils.isNotEmpty(userName)){
return; return;
} }

7
designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java

@ -1,11 +1,10 @@
package com.fr.design.mainframe.cell.settingpane.style; package com.fr.design.mainframe.cell.settingpane.style;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.config.ServerConfig;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerBean; import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -143,8 +142,8 @@ public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> impleme
*/ */
public void refreshBeanElement() { public void refreshBeanElement() {
defaultListModel.removeAllElements(); defaultListModel.removeAllElements();
if (ConfigManager.getProviderInstance().hasStyle()) { if (ServerConfig.getInstance().hasStyle()) {
Iterator iterato = ConfigManager.getProviderInstance().getStyleNameIterator(); Iterator iterato = ServerConfig.getInstance().getStyleNameIterator();
while (iterato.hasNext()) { while (iterato.hasNext()) {
String name = (String) iterato.next(); String name = (String) iterato.next();
NameStyle nameStyle = NameStyle.getInstance(name); NameStyle nameStyle = NameStyle.getInstance(name);

4
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -1,9 +1,9 @@
package com.fr.design.mainframe.errorinfo; package com.fr.design.mainframe.errorinfo;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.io.IOFile; import com.fr.base.io.IOFile;
import com.fr.base.io.XMLReadHelper; import com.fr.base.io.XMLReadHelper;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.general.FRLogLevel; import com.fr.general.FRLogLevel;
import com.fr.general.FRLogManager; import com.fr.general.FRLogManager;
@ -39,7 +39,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
this.layout = new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"); this.layout = new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n");
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
this.username = ConfigManager.getProviderInstance().getBbsUsername(); this.username = ServerConfig.getInstance().getBbsUsername();
this.uuid = envManager.getUUID(); this.uuid = envManager.getUUID();
this.activekey = envManager.getActivationKey(); this.activekey = envManager.getActivationKey();
} }

5
designer/src/com/fr/design/module/DesignerModule.java

@ -2,7 +2,6 @@ package com.fr.design.module;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.base.MultiFieldParameter; import com.fr.base.MultiFieldParameter;
@ -11,6 +10,7 @@ import com.fr.base.TempNameStyle;
import com.fr.base.io.XMLEncryptUtils; import com.fr.base.io.XMLEncryptUtils;
import com.fr.base.process.ProcessOperator; import com.fr.base.process.ProcessOperator;
import com.fr.base.remote.RemoteDeziConstants; import com.fr.base.remote.RemoteDeziConstants;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
@ -395,8 +395,7 @@ public class DesignerModule extends DesignModule {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
for (int i = 0; i < namelist.size(); i++) { for (int i = 0; i < namelist.size(); i++) {
ConfigManager.getProviderInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); ServerConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} }
} catch (Exception ex) { } catch (Exception ex) {
FRLogger.getLogger().error(ex.getMessage()); FRLogger.getLogger().error(ex.getMessage());

6
designer/src/com/fr/design/present/StyleArrayPane.java

@ -1,6 +1,7 @@
package com.fr.design.present; package com.fr.design.present;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.config.ServerConfig;
import com.fr.design.gui.controlpane.AbstractNameableCreator; import com.fr.design.gui.controlpane.AbstractNameableCreator;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
@ -11,7 +12,6 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.StylePane; import com.fr.design.style.StylePane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
@ -64,7 +64,7 @@ public class StyleArrayPane extends JListControlPane {
/** /**
* Populate * Populate
*/ */
public void populate(ConfigManagerProvider configManager) { public void populate(ServerConfig configManager) {
if (configManager == null) { if (configManager == null) {
return; return;
} }
@ -90,7 +90,7 @@ public class StyleArrayPane extends JListControlPane {
/** /**
* Update. * Update.
*/ */
public void update(ConfigManagerProvider configManager) { public void update(ServerConfig configManager) {
configManager.clearAllStyle(); configManager.clearAllStyle();
// Nameable[]居然不能强转成Parameter[],一定要这么写... // Nameable[]居然不能强转成Parameter[],一定要这么写...

6
designer/src/com/fr/design/report/ReportStylePane.java

@ -1,6 +1,6 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.base.ConfigManager; import com.fr.config.ServerConfig;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.style.StylePane; import com.fr.design.style.StylePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -35,8 +35,8 @@ public class ReportStylePane extends StylePane {
if (ComparatorUtils.equals(name, "")) { if (ComparatorUtils.equals(name, "")) {
return; return;
} }
if (ConfigManager.getProviderInstance().getStyle(name) == null) { if (ServerConfig.getInstance().getStyle(name) == null) {
ConfigManager.getProviderInstance().putStyle(name, ReportStylePane.this.updateBean()); ServerConfig.getInstance().putStyle(name, ReportStylePane.this.updateBean());
} else { } else {
JOptionPane.showMessageDialog(getParent(), Inter.getLocText("FR-Designer_This_Name_Has_Exsit") + "!", Inter.getLocText("FR-Designer_Warning"), JOptionPane.WARNING_MESSAGE); JOptionPane.showMessageDialog(getParent(), Inter.getLocText("FR-Designer_This_Name_Has_Exsit") + "!", Inter.getLocText("FR-Designer_Warning"), JOptionPane.WARNING_MESSAGE);
} }

13
designer/src/com/fr/design/report/WriteShortCutsPane.java

@ -2,8 +2,8 @@ package com.fr.design.report;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -29,7 +29,7 @@ public class WriteShortCutsPane extends JPanel{
this.add(getFeatureNamePane()); this.add(getFeatureNamePane());
this.add(getHintsPane()); this.add(getHintsPane());
if(!ConfigManager.getProviderInstance().isWriteShortCuts()){ if(!ServerConfig.getInstance().isWriteShortCuts()){
nextColString = "Enter"; nextColString = "Enter";
nextRowString = "Tab"; nextRowString = "Tab";
switchColRow(); switchColRow();
@ -104,13 +104,8 @@ public class WriteShortCutsPane extends JPanel{
nextColString = nextRowString; nextColString = nextRowString;
nextRowString = temp; nextRowString = temp;
switchColRow(); switchColRow();
ConfigManager.getProviderInstance().setWriteShortCuts(ComparatorUtils.equals(nextColString, "Tab")); ServerConfig.getInstance().setWriteShortCuts(ComparatorUtils.equals(nextColString, "Tab"));
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage());
}
} }
}; };

6
designer/src/com/fr/design/webattr/CommonPane.java

@ -17,7 +17,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.editor.editor.LongEditor; import com.fr.design.editor.editor.LongEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
public class CommonPane extends JPanel { public class CommonPane extends JPanel {
private UITextField titleTextField; private UITextField titleTextField;
@ -53,7 +53,7 @@ public class CommonPane extends JPanel {
BorderLayout.CENTER); BorderLayout.CENTER);
} }
public void populate(ReportWebAttr reportWebAttr) { public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr.getTitle() != null && reportWebAttr.getTitle().length() > 0) { if (reportWebAttr.getTitle() != null && reportWebAttr.getTitle().length() > 0) {
this.titleTextField.setText(reportWebAttr.getTitle()); this.titleTextField.setText(reportWebAttr.getTitle());
} }
@ -61,7 +61,7 @@ public class CommonPane extends JPanel {
this.cacheValidateTimeEditor.setValue(Long.valueOf(reportWebAttr.getCacheValidateTime())); this.cacheValidateTimeEditor.setValue(Long.valueOf(reportWebAttr.getCacheValidateTime()));
} }
public void update(ReportWebAttr reportWebAttr) { public void update(ReportWebConfig reportWebAttr) {
if (!StringUtils.isEmpty(this.titleTextField.getText())) { if (!StringUtils.isEmpty(this.titleTextField.getText())) {
reportWebAttr.setTitle(this.titleTextField.getText()); reportWebAttr.setTitle(this.titleTextField.getText());
} else { } else {

34
designer/src/com/fr/design/webattr/EditReportServerParameterPane.java

@ -3,9 +3,8 @@
*/ */
package com.fr.design.webattr; package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -13,12 +12,10 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants; import com.fr.web.attr.ReportWebConfig;
import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.io.File;
/** /**
* Edit Report Server Parameter. * Edit Report Server Parameter.
@ -33,7 +30,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
//TODO 表单 //TODO 表单
// private FormToolBarPane formPane; // private FormToolBarPane formPane;
private WriteToolBarPane writePane; private WriteToolBarPane writePane;
private ReportWebAttr webAttr; private ReportWebConfig webAttr;
private WebCssPane cssPane; private WebCssPane cssPane;
@ -75,12 +72,13 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
return Inter.getLocText("ReportServerP-Report_server_parameter"); return Inter.getLocText("ReportServerP-Report_server_parameter");
} }
public void populate(ConfigManagerProvider reportServerConfigManager) { public void populate(ServerConfig reportServerConfig) {
this.configFileTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + //todo 原来界面上显示的xml路径
ProjectConstants.RESOURCES_NAME + // this.configFileTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
File.separator + ConfigManager.getProviderInstance().fileName()); // ProjectConstants.RESOURCES_NAME +
// File.separator + reportServerConfig.fileName());
webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); webAttr = (ReportWebConfig) ReportWebConfig.getInstance().clone();
if (webAttr != null) { if (webAttr != null) {
pagePane.populateBean(webAttr.getWebPage()); pagePane.populateBean(webAttr.getWebPage());
viewPane.populateBean(webAttr.getWebView()); viewPane.populateBean(webAttr.getWebView());
@ -90,18 +88,14 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
jsPane.populate(webAttr); jsPane.populate(webAttr);
} }
this.errorTemplatePane.populateBean(reportServerConfigManager.getErrorTemplate()); this.errorTemplatePane.populateBean(reportServerConfig.getErrorTemplate());
} }
/** /**
* Update. * Update.
*/ */
public void update(ConfigManagerProvider reportServerConfigManager) { public void update(ServerConfig reportServerConfig) {
ReportWebAttr webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); ReportWebConfig webAttr = ReportWebConfig.getInstance();
if (webAttr == null) {
webAttr = new ReportWebAttr();
reportServerConfigManager.putGlobalAttribute(ReportWebAttr.class, webAttr);
}
webAttr.setWebPage(pagePane.updateBean()); webAttr.setWebPage(pagePane.updateBean());
webAttr.setWebView(viewPane.updateBean()); webAttr.setWebView(viewPane.updateBean());
webAttr.setWebWrite(writePane.updateBean()); webAttr.setWebWrite(writePane.updateBean());
@ -109,7 +103,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
cssPane.update(webAttr); cssPane.update(webAttr);
jsPane.update(webAttr); jsPane.update(webAttr);
reportServerConfigManager.setErrorTemplate(this.errorTemplatePane.updateBean()); reportServerConfig.setErrorTemplate(this.errorTemplatePane.updateBean());
} }
} }

4
designer/src/com/fr/design/webattr/EditToolBar.java

@ -27,7 +27,7 @@ import com.fr.design.widget.IconDefinePane;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.CustomToolBarButton; import com.fr.form.ui.CustomToolBarButton;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.web.button.Export; import com.fr.report.web.button.Export;
@ -201,7 +201,7 @@ public class EditToolBar extends BasicPane {
if (widget instanceof Button) { if (widget instanceof Button) {
String iconname = ((Button) widget).getIconName(); String iconname = ((Button) widget).getIconName();
if (StringUtils.isNotBlank(iconname)) { if (StringUtils.isNotBlank(iconname)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname); Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname);
toolBarButton.setIcon(new ImageIcon(iimage)); toolBarButton.setIcon(new ImageIcon(iimage));
} }
} }

34
designer/src/com/fr/design/webattr/PageToolBarPane.java

@ -1,6 +1,6 @@
package com.fr.design.webattr; 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.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
@ -16,7 +16,9 @@ import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent; import com.fr.report.web.WebContent;
import com.fr.report.web.WebPage; import com.fr.report.web.WebPage;
import com.fr.web.attr.ReportWebAttr; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -142,11 +144,10 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public WebPage updateBean() { public WebPage updateBean() {
WebPage webPage = new WebPage(); WebPage webPage = new WebPage();
if (isUseToolBarCheckBox.isSelected()) {
if (this.isUseToolBarCheckBox.isSelected()) { webPage.setToolBarManagers(toolBarManagers);
webPage.setToolBarManagers(this.toolBarManagers);
}else { }else {
webPage.setToolBarManagers(new ToolBarManager[0]); webPage.setToolBarManagers(new ToolBarManager[0]);
} }
for (int i = 0; i < eventPane.update().size(); i++) { for (int i = 0; i < eventPane.update().size(); i++) {
Listener listener = eventPane.update().get(i); Listener listener = eventPane.update().get(i);
@ -165,7 +166,7 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void editServerToolBarPane() { public void editServerToolBarPane() {
final PageToolBarPane serverPageToolBarPane = new PageToolBarPane(); final PageToolBarPane serverPageToolBarPane = new PageToolBarPane();
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
if (reportWebAttr != null) { if (reportWebAttr != null) {
serverPageToolBarPane.populateBean(reportWebAttr.getWebPage()); serverPageToolBarPane.populateBean(reportWebAttr.getWebPage());
} }
@ -174,12 +175,19 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void doOk() { public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); Configurations.update(new Worker() {
if (reportWebAttr == null) { @Override
reportWebAttr = new ReportWebAttr(); public void run() {
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
} reportWebAttr.setWebPage(serverPageToolBarPane.updateBean());
reportWebAttr.setWebPage(serverPageToolBarPane.updateBean()); }
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
} }
}); });
serverPageDialog.setVisible(true); serverPageDialog.setVisible(true);

6
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.general.Inter;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebPage; import com.fr.report.web.WebPage;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
public class PageWebSettingPane extends WebSettingPane<WebPage> { public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UIRadioButton centerRadioButton; private UIRadioButton centerRadioButton;
@ -119,7 +119,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
} }
@Override @Override
protected WebPage getWebContent(ReportWebAttr reportWebAttr) { protected WebPage getWebContent(ReportWebConfig reportWebAttr) {
return reportWebAttr == null ? null :reportWebAttr.getWebPage(); return reportWebAttr == null ? null :reportWebAttr.getWebPage();
} }
@ -129,7 +129,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
} }
@Override @Override
protected void setWebContent(ReportWebAttr reportWebAttr,WebPage webContent) { protected void setWebContent(ReportWebConfig reportWebAttr,WebPage webContent) {
reportWebAttr.setWebPage(webContent); reportWebAttr.setWebPage(webContent);
} }
} }

10
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.BackgroundPane;
import com.fr.design.style.background.BackgroundPane4Browser; import com.fr.design.style.background.BackgroundPane4Browser;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -18,7 +18,7 @@ import java.awt.*;
* ReportWebAttr Dialog * ReportWebAttr Dialog
*/ */
public class ReportWebAttrPane extends LoadingBasicPane { public class ReportWebAttrPane extends LoadingBasicPane {
private ReportWebAttr reportWebAttr; private ReportWebConfig reportWebAttr;
private UITabbedPane tabbedPane; private UITabbedPane tabbedPane;
private CommonPane commonPane; private CommonPane commonPane;
@ -60,9 +60,9 @@ public class ReportWebAttrPane extends LoadingBasicPane {
return Inter.getLocText("FR-Designer_Template_Web_Attributes"); return Inter.getLocText("FR-Designer_Template_Web_Attributes");
} }
public void populate(ReportWebAttr reportWebAttr) { public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) { if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr(); reportWebAttr = ReportWebConfig.getInstance();
} }
this.reportWebAttr = reportWebAttr; this.reportWebAttr = reportWebAttr;
@ -79,7 +79,7 @@ public class ReportWebAttrPane extends LoadingBasicPane {
} }
public ReportWebAttr update() { public ReportWebConfig update() {
reportWebAttr.setPrinter(this.serverPrintPane.update()); reportWebAttr.setPrinter(this.serverPrintPane.update());
pageWeb.update(reportWebAttr); pageWeb.update(reportWebAttr);
writeWeb.update(reportWebAttr); writeWeb.update(reportWebAttr);

4
designer/src/com/fr/design/webattr/ToolBarButton.java

@ -7,7 +7,7 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -30,7 +30,7 @@ public class ToolBarButton extends UIButton implements MouseListener {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
String iconName = button.getIconName(); String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) { if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconName); Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) { if (iimage != null) {
setIcon(new ImageIcon(iimage)); setIcon(new ImageIcon(iimage));
} }

37
designer/src/com/fr/design/webattr/ViewToolBarPane.java

@ -1,6 +1,6 @@
package com.fr.design.webattr; 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.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
@ -15,7 +15,9 @@ import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent; import com.fr.report.web.WebContent;
import com.fr.report.web.WebView; import com.fr.report.web.WebView;
import com.fr.web.attr.ReportWebAttr; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -113,14 +115,14 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public WebView updateBean() { public WebView updateBean() {
WebView webView = new WebView(); WebView webView = new WebView();
if (this.isUseToolBarCheckBox.isSelected()) { if (isUseToolBarCheckBox.isSelected()) {
webView.setToolBarManagers(this.toolBarManagers); webView.setToolBarManagers(toolBarManagers);
} else { } else {
webView.setToolBarManagers(new ToolBarManager[0]); webView.setToolBarManagers(new ToolBarManager[0]);
} }
webView.setSortFuncCheck(this.sortCheckBox.isSelected()); webView.setSortFuncCheck(sortCheckBox.isSelected());
webView.setConditionFuncCheck(this.conditonFilterBox.isSelected()); webView.setConditionFuncCheck(conditonFilterBox.isSelected());
webView.setListFuncCheck(this.listFilterBox.isSelected()); webView.setListFuncCheck(listFilterBox.isSelected());
for (int i = 0; i < eventPane.update().size(); i++) { for (int i = 0; i < eventPane.update().size(); i++) {
Listener listener = eventPane.update().get(i); Listener listener = eventPane.update().get(i);
webView.addListener(listener); webView.addListener(listener);
@ -134,7 +136,7 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void editServerToolBarPane() { public void editServerToolBarPane() {
final ViewToolBarPane serverPageToolBarPane = new ViewToolBarPane(); final ViewToolBarPane serverPageToolBarPane = new ViewToolBarPane();
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
if (reportWebAttr != null) { if (reportWebAttr != null) {
serverPageToolBarPane.populateBean(reportWebAttr.getWebView()); serverPageToolBarPane.populateBean(reportWebAttr.getWebView());
} }
@ -143,12 +145,19 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void doOk() { public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); Configurations.update(new Worker() {
if (reportWebAttr == null) { @Override
reportWebAttr = new ReportWebAttr(); public void run() {
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
} reportWebAttr.setWebView(serverPageToolBarPane.updateBean());
reportWebAttr.setWebView(serverPageToolBarPane.updateBean()); }
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
} }
}); });
serverPageDialog.setVisible(true); serverPageDialog.setVisible(true);

6
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.general.Inter;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebView; import com.fr.report.web.WebView;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -73,7 +73,7 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
} }
@Override @Override
protected WebView getWebContent(ReportWebAttr reportWebAttr) { protected WebView getWebContent(ReportWebConfig reportWebAttr) {
return reportWebAttr == null ? null : reportWebAttr.getWebView(); return reportWebAttr == null ? null : reportWebAttr.getWebView();
} }
@ -83,7 +83,7 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
} }
@Override @Override
protected void setWebContent(ReportWebAttr reportWebAttr, WebView webContent) { protected void setWebContent(ReportWebConfig reportWebAttr, WebView webContent) {
reportWebAttr.setWebView(webContent); reportWebAttr.setWebView(webContent);
} }
@Override @Override

6
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.general.Inter;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
public class WebCssPane extends BasicPane { public class WebCssPane extends BasicPane {
private UITextField localText; private UITextField localText;
@ -98,7 +98,7 @@ public class WebCssPane extends BasicPane {
return Inter.getLocText("ReportServerP-Import_Css"); return Inter.getLocText("ReportServerP-Import_Css");
} }
public void populate(ReportWebAttr reportWebAttr) { public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) { if (reportWebAttr == null) {
centerPane.populateBean(new ArrayList<String>()); centerPane.populateBean(new ArrayList<String>());
return; return;
@ -113,7 +113,7 @@ public class WebCssPane extends BasicPane {
centerPane.populateBean(list); centerPane.populateBean(list);
} }
public void update(ReportWebAttr reportWebAttr) { public void update(ReportWebConfig reportWebAttr) {
List<String> valueList = centerPane.updateBean(); List<String> valueList = centerPane.updateBean();
reportWebAttr.clearCSSImportList(); reportWebAttr.clearCSSImportList();
for (int i = 0; i < valueList.size(); i++) { for (int i = 0; i < valueList.size(); i++) {

6
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.general.Inter;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
public class WebJsPane extends BasicPane { public class WebJsPane extends BasicPane {
private UITextField localText; private UITextField localText;
@ -260,7 +260,7 @@ public class WebJsPane extends BasicPane {
chooseFile.setEnabled(false); chooseFile.setEnabled(false);
} }
public void populate(ReportWebAttr reportWebAttr) { public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) { if (reportWebAttr == null) {
editingPane.populateBean(new ArrayList<String>()); editingPane.populateBean(new ArrayList<String>());
return; return;
@ -274,7 +274,7 @@ public class WebJsPane extends BasicPane {
editingPane.populateBean(list); editingPane.populateBean(list);
} }
public void update(ReportWebAttr reportWebAttr) { public void update(ReportWebConfig reportWebAttr) {
List<String> valueList = editingPane.updateBean(); List<String> valueList = editingPane.updateBean();
reportWebAttr.clearJSImportList(); reportWebAttr.clearJSImportList();
for (int i = 0; i < valueList.size(); i++) { for (int i = 0; i < valueList.size(); i++) {

23
designer/src/com/fr/design/webattr/WebSettingPane.java

@ -1,6 +1,5 @@
package com.fr.design.webattr; package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -13,9 +12,8 @@ import com.fr.form.event.Listener;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent; import com.fr.report.web.WebContent;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -24,7 +22,7 @@ import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane<ReportWebAttr> { public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane<ReportWebConfig> {
private static final String[] CHOOSEITEM = new String[] { private static final String[] CHOOSEITEM = new String[] {
Inter.getLocText("FR-Designer_I_Want_To_Set_Single"), Inter.getLocText("FR-Designer_I_Want_To_Set_Single"),
Inter.getLocText("FR-Designer_Using_Server_Report_View_Settings") Inter.getLocText("FR-Designer_Using_Server_Report_View_Settings")
@ -119,7 +117,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
protected abstract String[] getEventNames(); protected abstract String[] getEventNames();
@Override @Override
public void populateBean(ReportWebAttr reportWebAttr) { public void populateBean(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {// 如果是空值就说明采用服务器配置了 if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {// 如果是空值就说明采用服务器配置了
choseComboBox.removeItemListener(itemListener); choseComboBox.removeItemListener(itemListener);
choseComboBox.setSelectedIndex(SERVER_SET); choseComboBox.setSelectedIndex(SERVER_SET);
@ -147,7 +145,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
} }
public void update(ReportWebAttr reportWebAttr) { public void update(ReportWebConfig reportWebAttr) {
if (this.choseComboBox.getSelectedIndex() == SERVER_SET) { if (this.choseComboBox.getSelectedIndex() == SERVER_SET) {
setWebContent(reportWebAttr, null); setWebContent(reportWebAttr, null);
reportWebAttr = is_Null_ReportWebAttr(reportWebAttr) ? null : reportWebAttr; reportWebAttr = is_Null_ReportWebAttr(reportWebAttr) ? null : reportWebAttr;
@ -157,11 +155,11 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
} }
@Override @Override
public ReportWebAttr updateBean() { public ReportWebConfig updateBean() {
return null; return null;
} }
private ReportWebAttr TemplateupdateBean(ReportWebAttr reportWebAttr) { private ReportWebConfig TemplateupdateBean(ReportWebConfig reportWebAttr) {
T webContent = updateSubWebSettingBean(); T webContent = updateSubWebSettingBean();
ToolBarManager[] toolBarManagers = dragToolBarPane.updateBean(); ToolBarManager[] toolBarManagers = dragToolBarPane.updateBean();
webContent.setToolBarManagers(toolBarManagers); webContent.setToolBarManagers(toolBarManagers);
@ -173,13 +171,13 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
return reportWebAttr; return reportWebAttr;
} }
protected abstract T getWebContent(ReportWebAttr reportWebAttr); protected abstract T getWebContent(ReportWebConfig reportWebAttr);
protected abstract void populateSubWebSettingrBean(T ob); protected abstract void populateSubWebSettingrBean(T ob);
protected abstract T updateSubWebSettingBean(); protected abstract T updateSubWebSettingBean();
protected abstract void setWebContent(ReportWebAttr reportWebAttr, T ob); protected abstract void setWebContent(ReportWebConfig reportWebAttr, T ob);
protected abstract WidgetOption[] getToolBarInstance(); protected abstract WidgetOption[] getToolBarInstance();
@ -191,8 +189,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
} }
private void populateServerSettings() { private void populateServerSettings() {
ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
ReportWebAttr reportWebAttr = ((ReportWebAttr)configManager.getGlobalAttribute(ReportWebAttr.class));
T webContent = this.getWebContent(reportWebAttr); T webContent = this.getWebContent(reportWebAttr);
if(webContent == null){ if(webContent == null){
return; return;
@ -217,7 +214,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
* *
* @return 模板web属性书否为空 * @return 模板web属性书否为空
*/ */
public static boolean is_Null_ReportWebAttr(ReportWebAttr reportWebAttr) { public static boolean is_Null_ReportWebAttr(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) { if (reportWebAttr == null) {
return true; return true;
} }

13
designer/src/com/fr/design/webattr/WidgetManagerPane.java

@ -6,7 +6,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.WidgetConfigPane; import com.fr.design.widget.WidgetConfigPane;
import com.fr.form.ui.WidgetManagerProvider; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -40,14 +40,15 @@ public class WidgetManagerPane extends LoadingBasicPane {
return Inter.getLocText("ServerM-Widget_Manager"); return Inter.getLocText("ServerM-Widget_Manager");
} }
public void populate(WidgetManagerProvider widgetManager) { public void populate(WidgetInfoConfig widgetManager) {
this.widgetTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + //todo 原来界面上显示的xml路径
ProjectConstants.RESOURCES_NAME + // this.widgetTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
File.separator + widgetManager.fileName()); // ProjectConstants.RESOURCES_NAME +
// File.separator + widgetManager.fileName());
this.widgetConfigPane.populate(widgetManager); this.widgetConfigPane.populate(widgetManager);
} }
public void update(WidgetManagerProvider widgetManager) { public void update(WidgetInfoConfig widgetManager) {
this.widgetConfigPane.update(widgetManager); this.widgetConfigPane.update(widgetManager);
} }
} }

27
designer/src/com/fr/design/webattr/WriteToolBarPane.java

@ -1,7 +1,7 @@
package com.fr.design.webattr; package com.fr.design.webattr;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager; import com.fr.config.Configuration;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -20,7 +20,9 @@ import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent; import com.fr.report.web.WebContent;
import com.fr.report.web.WebWrite; import com.fr.report.web.WebWrite;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
@ -251,7 +253,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void editServerToolBarPane() { public void editServerToolBarPane() {
final WriteToolBarPane serverPageToolBarPane = new WriteToolBarPane(); final WriteToolBarPane serverPageToolBarPane = new WriteToolBarPane();
ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
if (reportWebAttr != null) { if (reportWebAttr != null) {
serverPageToolBarPane.populateBean(reportWebAttr.getWebWrite()); serverPageToolBarPane.populateBean(reportWebAttr.getWebWrite());
} }
@ -260,12 +262,19 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void doOk() { public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); Configurations.update(new Worker() {
if (reportWebAttr == null) { @Override
reportWebAttr = new ReportWebAttr(); public void run() {
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr); ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
} reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean());
reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean()); }
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
} }
}); });
serverPageDialog.setVisible(true); serverPageDialog.setVisible(true);

6
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.ToolBarManager;
import com.fr.report.web.WebWrite; import com.fr.report.web.WebWrite;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebConfig;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -180,7 +180,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
} }
@Override @Override
protected WebWrite getWebContent(ReportWebAttr reportWebAttr) { protected WebWrite getWebContent(ReportWebConfig reportWebAttr) {
return reportWebAttr == null ? null : reportWebAttr.getWebWrite(); return reportWebAttr == null ? null : reportWebAttr.getWebWrite();
} }
@ -190,7 +190,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
} }
@Override @Override
protected void setWebContent(ReportWebAttr reportWebAttr, WebWrite webContent) { protected void setWebContent(ReportWebConfig reportWebAttr, WebWrite webContent) {
reportWebAttr.setWebWrite(webContent); reportWebAttr.setWebWrite(webContent);
} }

6
designer/src/com/fr/design/widget/WidgetConfigPane.java

@ -6,7 +6,7 @@ import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.core.WidgetConstants; import com.fr.design.gui.core.WidgetConstants;
import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.UserDefinedWidgetConfig;
import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetConfig;
import com.fr.form.ui.WidgetManagerProvider; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
@ -36,7 +36,7 @@ public class WidgetConfigPane extends JListControlPane {
return "config"; return "config";
} }
public void populate(WidgetManagerProvider widgetManager){ public void populate(WidgetInfoConfig widgetManager){
Iterator<String> nameIt = widgetManager.getWidgetConfigNameIterator(); Iterator<String> nameIt = widgetManager.getWidgetConfigNameIterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
@ -46,7 +46,7 @@ public class WidgetConfigPane extends JListControlPane {
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
} }
public void update(WidgetManagerProvider widgetManager){ public void update(WidgetInfoConfig widgetManager){
Nameable[] res = this.update(); Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length]; NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array); java.util.Arrays.asList(res).toArray(res_array);

2
designer/src/com/fr/design/widget/WidgetPane.java

@ -225,7 +225,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
for (int i = 0, l = reportWidgetInstance.length; i < l; i++) { for (int i = 0, l = reportWidgetInstance.length; i < l; i++) {
items.add(new Item(reportWidgetInstance[i].optionName(), i)); items.add(new Item(reportWidgetInstance[i].optionName(), i));
} }
WidgetManagerProvider manager = WidgetManager.getProviderInstance(); WidgetInfoConfig manager = WidgetInfoConfig.getInstance();
java.util.Iterator<String> nameIt = manager.getWidgetConfigNameIterator(); java.util.Iterator<String> nameIt = manager.getWidgetConfigNameIterator();
if (userDefined && nameIt.hasNext()) { if (userDefined && nameIt.hasNext()) {
items.add(item); items.add(item);

13
designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java

@ -1,15 +1,14 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.parameter.ParameterGroup; import com.fr.design.parameter.ParameterGroup;
import com.fr.file.DatasourceManager; import com.fr.file.TableDataConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.script.Calculator; import com.fr.script.Calculator;
@ -155,17 +154,17 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
} }
// 全局参数 // 全局参数
parameters = ConfigManager.getProviderInstance().getGlobal_Parameters(); parameters = ServerConfig.getInstance().getGlobeParameters();
if (!ArrayUtils.isEmpty(parameters)) { if (!ArrayUtils.isEmpty(parameters)) {
groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters)); groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters));
} }
// 全局数据源参数 // 全局数据源参数
parameters = new Parameter[0]; parameters = new Parameter[0];
Calculator c = Calculator.createCalculator(); Calculator c = Calculator.createCalculator();
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); TableDataConfig tableDataConfig = TableDataConfig.getInstance();
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator(); Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
TableData tableData = datasourceManager.getTableData(nameIt.next()); TableData tableData = tableDataConfig.getTableData(nameIt.next());
ParameterProvider[] ps = tableData.getParameters(c); ParameterProvider[] ps = tableData.getParameters(c);
if (!ArrayUtils.isEmpty(ps)) { if (!ArrayUtils.isEmpty(ps)) {
parameters = (Parameter[])ArrayUtils.addAll(parameters, ps); parameters = (Parameter[])ArrayUtils.addAll(parameters, ps);

6
designer/src/com/fr/grid/selection/CellSelection.java

@ -2,10 +2,10 @@ package com.fr.grid.selection;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.cache.list.IntList; import com.fr.cache.list.IntList;
import com.fr.config.ServerConfig;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction; import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction; import com.fr.design.actions.cell.CellExpandAttrAction;
@ -456,10 +456,10 @@ public class CellSelection extends Selection {
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu()); popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
// richer:add global style menu // richer:add global style menu
popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(new CellExpandAttrAction().createMenuItem());
if (!ConfigManager.getProviderInstance().hasStyle()) { if (!ServerConfig.getInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName()); UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png")); styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
Iterator iterato = ConfigManager.getProviderInstance().getStyleNameIterator(); Iterator iterato = ServerConfig.getInstance().getStyleNameIterator();
while (iterato.hasNext()) { while (iterato.hasNext()) {
String name = (String) iterato.next(); String name = (String) iterato.next();
name = GlobalStyleMenuDef.judgeChina(name); name = GlobalStyleMenuDef.judgeChina(name);

13
designer_base/src/com/fr/design/actions/file/PreferencePane.java

@ -1,8 +1,8 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -371,7 +371,7 @@ public class PreferencePane extends BasicPane {
logLevelPane.add(logLevelComboBox); logLevelPane.add(logLevelComboBox);
logLevelComboBox.addActionListener(new ActionListener() { logLevelComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
ConfigManager.getProviderInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel()); ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel());
} }
}); });
} }
@ -551,7 +551,7 @@ public class PreferencePane extends BasicPane {
this.logExportDirectoryField.setText(designerEnvManager.getLogLocation()); this.logExportDirectoryField.setText(designerEnvManager.getLogLocation());
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(ConfigManager.getProviderInstance().getServerLogLevel())); this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(ServerConfig.getInstance().getServerLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage())); this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage()));
designerEnvLanguageIndex = designerEnvManager.getLanguage(); designerEnvLanguageIndex = designerEnvManager.getLanguage();
@ -631,12 +631,7 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);
} }
ConfigManager.getProviderInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel()); ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel());
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
} }

173
designer_base/src/com/fr/design/actions/server/ConnectionListAction.java

@ -1,10 +1,7 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.Env;
import com.fr.base.FRContext; import com.fr.config.Configuration;
import com.fr.base.ModifiedTable;
import com.fr.data.impl.Connection;
import com.fr.dav.LocalEnv;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane; import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.data.datapane.connect.ConnectionShowPane; import com.fr.design.data.datapane.connect.ConnectionShowPane;
@ -14,14 +11,16 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager; import com.fr.file.ConnectionConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.ListMap;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.HashMap;
/** /**
* DatasourceList Action * DatasourceList Action
@ -60,118 +59,126 @@ public class ConnectionListAction extends UpdateAction {
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); final ConnectionConfig datasourceManager = ConnectionConfig.getInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() { final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
public void complete() { public void complete() {
populate(datasourceManager); populate(datasourceManager);
} }
protected void renameConnection(String oldName, String newName) { protected void renameConnection(String oldName, String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName); datasourceManager.renameConnection(oldName, newName);
} }
}; };
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null); final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() { databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
if (!databaseManagerPane.isNamePermitted()) { Configurations.update(new Worker() {
databaseListDialog.setDoOKSucceed(false); @Override
return; public void run() {
} if (!databaseManagerPane.isNamePermitted()) {
if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) { databaseListDialog.setDoOKSucceed(false);
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 return;
return; }
} if (!doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog)) {
// marks:保存数据 //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
writeFile(datasourceManager); return;
} }
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
public void doCancel() {
datasourceManager.synchronizedWithServer();
} }
}); });
databaseListDialog.setVisible(true); databaseListDialog.setVisible(true);
} }
/**
* @param datasourceManager
*/
public static void writeFile(DatasourceManagerProvider datasourceManager) {
Env currentEnv = FRContext.getCurrentEnv();
try {
boolean isSuccess = currentEnv.writeResource(datasourceManager);
if (!isSuccess) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
} catch (Exception e) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
/** /**
* 更新datasourceManager * 更新datasourceManager
* *
* @param datasourceManager datasource管理对象 * @param datasourceManager datasource管理对象
* @param backupManager datasource管理对象备份
* @param connectionShowPane datasource面板 * @param connectionShowPane datasource面板
* @param databaseListDialog datasource管理对话框 * @param databaseListDialog datasource管理对话框
* @return boolean 是否更新成功 * @return boolean 是否更新成功
*/ */
public static boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager public static boolean doWithDatasourceManager(ConnectionConfig datasourceManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) {
backupManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) { // HashMap<String, Connection> modifyDetails = datasourceManager.getConnectionModifyDetails();
connectionShowPane.update(datasourceManager); // modifyDetails.clear();
HashMap<String, Connection> modifyDetails = datasourceManager.getConnectionModifyDetails(); // Env currentEnv = FRContext.getCurrentEnv();
modifyDetails.clear(); // ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID());
Env currentEnv = FRContext.getCurrentEnv();
ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID());
boolean isFailed = false; boolean isFailed = false;
if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) { // if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
//如果是本地,并且有远程用户时则更新自己的修改表 // //如果是本地,并且有远程用户时则更新自己的修改表
datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER); // datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
} else { // } else {
if (!currentEnv.isSupportLocalFileOperate()) { // if (!currentEnv.isSupportLocalFileOperate()) {
//如果是远程,则去取服务器的最新的修改表,检查有没有冲突 // //如果是远程,则去取服务器的最新的修改表,检查有没有冲突
ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION); // ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION);
if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) { // if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
//有冲突,进行提示 // //有冲突,进行提示
String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"}); // String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"});
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); // int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) { // if (returnVal == JOptionPane.YES_OPTION) {
//点击是,进行相应刷新去冲突 // //点击是,进行相应刷新去冲突
datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION); // datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION);
//要是有重命名冲突的,则对详细的修改表先进行修改 // //要是有重命名冲突的,则对详细的修改表先进行修改
datasourceManager.doWithConnectionConflict(localModifiedTable); // datasourceManager.doWithConnectionConflict(localModifiedTable);
localModifiedTable.removeConfilct(); // localModifiedTable.removeConfilct();
modifyDetails.clear(); // modifyDetails.clear();
//更新面板 // //更新面板
connectionShowPane.populate(datasourceManager); // connectionShowPane.populate(datasourceManager);
} else { // } else {
//更新失败,继续停留页面 // //更新失败,继续停留页面
isFailed = true; // isFailed = true;
} // }
//
} // }
} // }
} // }
//存在请重命名则不能更新 //存在请重命名则不能更新
int index = datasourceManager.isConnectionMapContainsRename(); int index = isConnectionMapContainsRename(datasourceManager);
if (index != -1) { if (index != -1) {
isFailed = true; isFailed = true;
connectionShowPane.setSelectedIndex(index); connectionShowPane.setSelectedIndex(index);
} }
databaseListDialog.setDoOKSucceed(!isFailed); databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表 // //如果修改成功,则去远程端增量修改修改表
if (!isFailed && !currentEnv.isSupportLocalFileOperate()) { // if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION); // currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION);
localModifiedTable.clear(); // localModifiedTable.clear();
modifyDetails.clear(); // modifyDetails.clear();
} // }
return !isFailed; return !isFailed;
} }
/**
* 是否包含重命名key
*
* @return 包含则返回序列 ,若返回-1则说明不包含重命名key
*/
public static int isConnectionMapContainsRename(ConnectionConfig datasourceManager) {
ListMap tableDataMap = (ListMap) datasourceManager.getConnections();
String rename = InterProviderFactory.getProvider().getLocText("FR-Engine_Please_Rename") + "!";
if (tableDataMap.containsKey(rename)) {
return tableDataMap.indexOf(rename);
}
//todo 这边同上面和远程修改数据集属性有关先屏蔽
// for (int i = tableDataRenameIndex; i >= 1; i--) {
// rename = InterProviderFactory.getProvider().getLocText("FR-Engine_Please_Rename") + i + "!";
// if (nameTableDataMap.map.containsKey(rename)) {
// return nameTableDataMap.map.indexOf(rename);
// }
// }
return -1;
}
public void update() { public void update() {
this.setEnabled(true); this.setEnabled(true);
} }

35
designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java

@ -3,19 +3,19 @@
*/ */
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.Env; import com.fr.config.Configuration;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FunctionManagerPane; import com.fr.design.formula.FunctionManagerPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.file.FunctionManager; import com.fr.file.FunctionConfig;
import com.fr.file.FunctionManagerProvider;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -42,19 +42,24 @@ public class FunctionManagerAction extends UpdateAction {
BasicDialog functionManagerDialog = BasicDialog functionManagerDialog =
functionManagerPane.showWindow( functionManagerPane.showWindow(
DesignerContext.getDesignerFrame(),null); DesignerContext.getDesignerFrame(),null);
final FunctionManagerProvider functionManager = FunctionManager.getProviderInstance(); final FunctionConfig functionManager = FunctionConfig.getInstance();
functionManagerDialog.addDialogActionListener(new DialogActionAdapter() { functionManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
functionManagerPane.update(functionManager); Configurations.update(new Worker() {
Env currentEnv = FRContext.getCurrentEnv(); @Override
try { public void run() {
currentEnv.writeResource(functionManager); functionManagerPane.update(functionManager);
} catch (Exception e) { }
FRContext.getLogger().error(e.getMessage(), e);
} @Override
} public Class<? extends Configuration>[] targets() {
return new Class[]{FunctionConfig.class};
}
});
}
}); });
functionManagerPane.populate(functionManager); functionManagerPane.populate((FunctionConfig) functionManager.clone());
functionManagerDialog.setVisible(true); functionManagerDialog.setVisible(true);
} }

44
designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java

@ -4,9 +4,8 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager; import com.fr.config.Configuration;
import com.fr.base.Env; import com.fr.config.ServerConfig;
import com.fr.base.FRContext;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -16,7 +15,8 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.parameter.ParameterManagerPane; import com.fr.design.parameter.ParameterManagerPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -45,25 +45,29 @@ public class GlobalParameterAction extends UpdateAction {
final BasicDialog parameterManagerDialog = parameterManagerPane.showWindow(designerFrame); final BasicDialog parameterManagerDialog = parameterManagerPane.showWindow(designerFrame);
//marks:读取服务器配置信息 //marks:读取服务器配置信息
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); final ServerConfig configManager = ServerConfig.getInstance();
parameterManagerPane.populate(configManager); parameterManagerPane.populate((ServerConfig) configManager.clone());
parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() { parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
//apply new parameter list. Configurations.update(new Worker() {
parameterManagerPane.update(configManager); @Override
//marks:保存数据 public void run() {
Env currentEnv = FRContext.getCurrentEnv(); //apply new parameter list.
try { parameterManagerPane.update(configManager);
currentEnv.writeResource(configManager); DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter();
} catch (Exception ex) { if (model != null) {
FRContext.getLogger().error(ex.getMessage(), ex); model.parameterChanged();
} }
DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter(); parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename());
if (model != null) { }
model.parameterChanged();
} @Override
parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename()); public Class<? extends Configuration>[] targets() {
return new Class[]{ServerConfig.class};
}
});
} }
}); });
parameterManagerDialog.setModal(true); parameterManagerDialog.setModal(true);

188
designer_base/src/com/fr/design/actions/server/GlobalTableDataAction.java

@ -3,8 +3,8 @@
*/ */
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.*; import com.fr.base.BaseUtils;
import com.fr.dav.LocalEnv; import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -16,9 +16,13 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager; import com.fr.file.ProcedureConfig;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.TableDataConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.ListMap;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -61,15 +65,24 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); final TableDataConfig tableDataConfig = TableDataConfig.getInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() { public void complete() {
populate(datasourceManager); populate((TableDataConfig) tableDataConfig.clone());
} }
protected void renameConnection(String oldName, String newName) { protected void renameConnection(final String oldName, final String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName); Configurations.update(new Worker() {
@Override
public void run() {
tableDataConfig.renameTableData(oldName, newName);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{TableDataConfig.class, ProcedureConfig.class};
}
});
} }
}; };
final BasicDialog globalTableDataDialog = globalTableDataPane.showLargeWindow(designerFrame, null); final BasicDialog globalTableDataDialog = globalTableDataPane.showLargeWindow(designerFrame, null);
@ -78,102 +91,113 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
@Override @Override
public void doOk() { public void doOk() {
if (!globalTableDataPane.isNamePermitted()) { Configurations.update(new Worker() {
globalTableDataDialog.setDoOKSucceed(false); @Override
return; public void run() {
} if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
DesignTableDataManager.clearGlobalDs(); return;
globalTableDataPane.update(datasourceManager); }
if (!doWithDatasourceManager(datasourceManager, backupManager, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 DesignTableDataManager.clearGlobalDs();
return; globalTableDataPane.update(tableDataConfig);
} if (!doWithDatasourceManager(tableDataConfig, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
writeFile(datasourceManager); return;
// 刷新共有数据集 }
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); // 刷新共有数据集
fireDSChanged(globalTableDataPane.getDsChangedNameMap()); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
} fireDSChanged(globalTableDataPane.getDsChangedNameMap());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{TableDataConfig.class};
}
});
public void doCancel() {
datasourceManager.synchronizedWithServer();
} }
}); });
globalTableDataDialog.setVisible(true); globalTableDataDialog.setVisible(true);
} }
private void writeFile(DatasourceManagerProvider datasourceManager) {
Env currentEnv = FRContext.getCurrentEnv();
try {
boolean isSuccess = currentEnv.writeResource(datasourceManager);
if (!isSuccess) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
} catch (Exception e) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
}
/** /**
* 是否正常更新完datasourceManager * 是否正常更新完datasourceManager
* *
* @param datasourceManager * @param datasourceManager
* @param databaseManagerPane * @param tableDataManagerPane
* @param databaseListDialog
* @return * @return
*/ */
private boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager backupManager, private boolean doWithDatasourceManager(TableDataConfig datasourceManager, TableDataManagerPane tableDataManagerPane, BasicDialog databaseListDialog) {
TableDataManagerPane tableDataManagerPane, BasicDialog databaseListDialog) { // HashMap<String, TableData> modifyDetails = datasourceManager.getTableDataModifyDetails();
HashMap<String, TableData> modifyDetails = datasourceManager.getTableDataModifyDetails(); // modifyDetails.clear();
modifyDetails.clear(); // Env currentEnv = FRContext.getCurrentEnv();
Env currentEnv = FRContext.getCurrentEnv(); // ModifiedTable localModifiedTable = datasourceManager.checkTableDataModifyTable(backupManager, currentEnv.getUserID());
ModifiedTable localModifiedTable = datasourceManager.checkTableDataModifyTable(backupManager, currentEnv.getUserID());
boolean isFailed = false; boolean isFailed = false;
if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) { // if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
//如果是本地,并且有远程用户时则更新自己的修改表 // //如果是本地,并且有远程用户时则更新自己的修改表
datasourceManager.updateSelfTableDataTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER); // datasourceManager.updateSelfTableDataTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
} else { // } else {
if (!currentEnv.isSupportLocalFileOperate()) { // if (!currentEnv.isSupportLocalFileOperate()) {
//如果是远程,则去取服务器的最新的修改表,检查有没有冲突 // //如果是远程,则去取服务器的最新的修改表,检查有没有冲突
ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.TABLEDATA); // ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.TABLEDATA);
if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) { // if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
//有冲突,进行提示 // //有冲突,进行提示
String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"}); // String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"});
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); // int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) { // if (returnVal == JOptionPane.YES_OPTION) {
//点击是,进行相应刷新去冲突 // //点击是,进行相应刷新去冲突
datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.TABLEDATA); // datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.TABLEDATA);
//要是有重命名冲突的,则对详细的修改表先进行修改 // //要是有重命名冲突的,则对详细的修改表先进行修改
datasourceManager.doWithTableDataConfilct(localModifiedTable); // datasourceManager.doWithTableDataConfilct(localModifiedTable);
localModifiedTable.removeConfilct(); // localModifiedTable.removeConfilct();
modifyDetails.clear(); // modifyDetails.clear();
//更新面板 // //更新面板
tableDataManagerPane.populate(datasourceManager); // tableDataManagerPane.populate(datasourceManager);
} else { // } else {
//更新失败,继续停留页面 // //更新失败,继续停留页面
isFailed = true; // isFailed = true;
} // }
} // }
} // }
} // }
//存在请重命名则不能更新 //存在请重命名则不能更新
int index = datasourceManager.isTableDataMapContainsRename(); int index = isTableDataMapContainsRename(datasourceManager);
if (index != -1) { if (index != -1) {
isFailed = true; isFailed = true;
tableDataManagerPane.setSelectedIndex(index); tableDataManagerPane.setSelectedIndex(index);
} }
databaseListDialog.setDoOKSucceed(!isFailed); databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表 //如果修改成功,则去远程端增量修改修改表
if (!isFailed && !currentEnv.isSupportLocalFileOperate()) { // if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.TABLEDATA); // currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.TABLEDATA);
localModifiedTable.clear(); // localModifiedTable.clear();
modifyDetails.clear(); // modifyDetails.clear();
} // }
return !isFailed; return !isFailed;
} }
/**
* 是否包含重命名key
*
* @return 包含则返回序列 ,若返回-1则说明不包含重命名key
*/
public int isTableDataMapContainsRename(TableDataConfig datasourceManager) {
ListMap tableDataMap = (ListMap) datasourceManager.getTableDatas();
String rename = InterProviderFactory.getProvider().getLocText("FR-Engine_Please_Rename") + "!";
if (tableDataMap.containsKey(rename)) {
return tableDataMap.indexOf(rename);
}
//todo 这边同上面和远程修改数据集属性有关先屏蔽
// for (int i = tableDataRenameIndex; i >= 1; i--) {
// rename = InterProviderFactory.getProvider().getLocText("FR-Engine_Please_Rename") + i + "!";
// if (nameTableDataMap.map.containsKey(rename)) {
// return nameTableDataMap.map.indexOf(rename);
// }
// }
return -1;
}
public void update() { public void update() {
this.setEnabled(true); this.setEnabled(true);

34
designer_base/src/com/fr/design/actions/server/ProcedureListAction.java

@ -2,6 +2,7 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -11,9 +12,10 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.DatasourceManager; import com.fr.file.ProcedureConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -33,25 +35,29 @@ public class ProcedureListAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); final ProcedureConfig procedureConfig = ProcedureConfig.getInstance();
final ProcedureManagerPane databaseManagerPane = new ProcedureManagerPane() { final ProcedureManagerPane databaseManagerPane = new ProcedureManagerPane() {
public void complete() { public void complete() {
populate(datasourceManager); populate((ProcedureConfig)procedureConfig.clone());
} }
}; };
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame,null); BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame,null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() { databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
DesignTableDataManager.clearGlobalDs(); Configurations.update(new Worker() {
databaseManagerPane.update(datasourceManager); @Override
public void run() {
// marks:保存数据 DesignTableDataManager.clearGlobalDs();
try { databaseManagerPane.update(procedureConfig);
FRContext.getCurrentEnv().writeResource(datasourceManager); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
} catch (Exception e) { }
FRContext.getLogger().error(e.getMessage());
} @Override
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); public Class<? extends Configuration>[] targets() {
return new Class[]{ProcedureConfig.class};
}
});
} }
}); });
databaseListDialog.setVisible(true); databaseListDialog.setVisible(true);

25
designer_base/src/com/fr/design/bbs/BBSLoginUtils.java

@ -1,7 +1,7 @@
package com.fr.design.bbs; package com.fr.design.bbs;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.util.List; import java.util.List;
@ -13,9 +13,8 @@ public class BBSLoginUtils {
public static void bbsLogin(String username, String password){ public static void bbsLogin(String username, String password){
try{ try{
ConfigManager.getProviderInstance().setBbsUsername(username); ServerConfig.getInstance().setBbsUsername(username);
ConfigManager.getProviderInstance().setBbsPassword(password); ServerConfig.getInstance().setBbsPassword(password);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
}catch (Exception e){ }catch (Exception e){
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
@ -26,11 +25,10 @@ public class BBSLoginUtils {
String uid = list.get(0); String uid = list.get(0);
String username = list.get(1); String username = list.get(1);
String password = list.get(2); String password = list.get(2);
ConfigManager.getProviderInstance().setBbsUsername(username); ServerConfig.getInstance().setBbsUsername(username);
ConfigManager.getProviderInstance().setBbsPassword(password); ServerConfig.getInstance().setBbsPassword(password);
ConfigManager.getProviderInstance().setBbsUid(Integer.parseInt(uid)); ServerConfig.getInstance().setBbsUid(Integer.parseInt(uid));
ConfigManager.getProviderInstance().setInShowBBsName(username); ServerConfig.getInstance().setInShowBBsName(username);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
}catch (Exception e){ }catch (Exception e){
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
@ -38,11 +36,10 @@ public class BBSLoginUtils {
public static void bbsLogout(){ public static void bbsLogout(){
try{ try{
ConfigManager.getProviderInstance().setBbsUsername(StringUtils.EMPTY); ServerConfig.getInstance().setBbsUsername(StringUtils.EMPTY);
ConfigManager.getProviderInstance().setBbsPassword(StringUtils.EMPTY); ServerConfig.getInstance().setBbsPassword(StringUtils.EMPTY);
ConfigManager.getProviderInstance().setBbsUid(0); ServerConfig.getInstance().setBbsUid(0);
ConfigManager.getProviderInstance().setInShowBBsName(StringUtils.EMPTY); ServerConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
}catch (Exception e){ }catch (Exception e){
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }

16
designer_base/src/com/fr/design/data/DesignTableDataManager.java

@ -24,8 +24,8 @@ import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.parameter.ParameterInputPane; import com.fr.design.parameter.ParameterInputPane;
import com.fr.file.DatasourceManager; import com.fr.file.ProcedureConfig;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.data.DataModel; import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException; import com.fr.general.data.TableDataException;
@ -317,13 +317,13 @@ public abstract class DesignTableDataManager {
} }
private static void addServerData(java.util.Map<String, TableDataWrapper> resMap) { private static void addServerData(java.util.Map<String, TableDataWrapper> resMap) {
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); TableDataConfig tableDataConfig = TableDataConfig.getInstance();
String[] namearray = TableDataFactory.getSortOfChineseNameOfServerData(mgr); String[] namearray = TableDataFactory.getSortOfChineseNameOfServerData(tableDataConfig);
for (String name : namearray) { for (String name : namearray) {
if (globalDsCache.containsKey(name)) { if (globalDsCache.containsKey(name)) {
resMap.put(name, globalDsCache.get(name)); resMap.put(name, globalDsCache.get(name));
} else { } else {
TableDataWrapper tdw = new ServerTableDataWrapper(mgr.getTableData(name), name); TableDataWrapper tdw = new ServerTableDataWrapper(tableDataConfig.getTableData(name), name);
resMap.put(name, tdw); resMap.put(name, tdw);
globalDsCache.put(name, tdw); globalDsCache.put(name, tdw);
} }
@ -332,17 +332,17 @@ public abstract class DesignTableDataManager {
private static void addStoreProcedureData(java.util.Map<String, TableDataWrapper> resMap) { private static void addStoreProcedureData(java.util.Map<String, TableDataWrapper> resMap) {
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); ProcedureConfig procedureConfig = ProcedureConfig.getInstance();
String[] namearray = new String[0]; String[] namearray = new String[0];
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
java.util.Iterator<String> nameIt = mgr.getProcedureNameIterator(); java.util.Iterator<String> nameIt = procedureConfig.getProcedures().keySet().iterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
namearray = (String[]) ArrayUtils.add(namearray, nameIt.next()); namearray = (String[]) ArrayUtils.add(namearray, nameIt.next());
} }
Arrays.sort(namearray, Collator.getInstance(java.util.Locale.CHINA)); Arrays.sort(namearray, Collator.getInstance(java.util.Locale.CHINA));
for (String name : namearray) { for (String name : namearray) {
StoreProcedure storeProcedure = mgr.getProcedure(name); StoreProcedure storeProcedure = procedureConfig.getProcedure(name);
if (globalDsCache.containsKey(name)) { if (globalDsCache.containsKey(name)) {
resMap.put(name, globalDsCache.get(name)); resMap.put(name, globalDsCache.get(name));
} else { } else {

13
designer_base/src/com/fr/design/data/datapane/ChoosePane.java

@ -26,8 +26,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.DatasourceManager; import com.fr.file.ConnectionConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -179,9 +178,9 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
protected void initDsNameComboBox() { protected void initDsNameComboBox() {
dsNameComboBox.setRefreshingModel(true); dsNameComboBox.setRefreshingModel(true);
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Iterator<String> datasourceNameIterator = datasourceManager.getConnectionNameIterator(); Iterator<String> datasourceNameIterator = connectionConfig.getConnectionNameIterator();
List<String> dsList = new ArrayList<String>(); List<String> dsList = new ArrayList<String>();
while (datasourceNameIterator.hasNext()) { while (datasourceNameIterator.hasNext()) {
dsList.add((String) datasourceNameIterator.next()); dsList.add((String) datasourceNameIterator.next());
@ -286,13 +285,13 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
if (StringUtils.isEmpty(selectedDSName)) { if (StringUtils.isEmpty(selectedDSName)) {
return null; // peter:选中了当前的零长度的节点,直接返回. return null; // peter:选中了当前的零长度的节点,直接返回.
} }
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Iterator<String> datasourceNameIterator = datasourceManager.getConnectionNameIterator(); Iterator<String> datasourceNameIterator = connectionConfig.getConnectionNameIterator();
while (datasourceNameIterator.hasNext()) { while (datasourceNameIterator.hasNext()) {
String datasourceName = datasourceNameIterator.next(); String datasourceName = datasourceNameIterator.next();
if (ComparatorUtils.equals(selectedDSName, datasourceName)) { if (ComparatorUtils.equals(selectedDSName, datasourceName)) {
return datasourceManager.getConnection(datasourceName); return connectionConfig.getConnection(datasourceName);
} }
} }
return null; return null;

6
designer_base/src/com/fr/design/data/datapane/TableDataPaneController.java

@ -1,7 +1,7 @@
package com.fr.design.data.datapane; package com.fr.design.data.datapane;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.TableDataConfig;
import javax.swing.*; import javax.swing.*;
import java.util.Map; import java.util.Map;
@ -39,9 +39,9 @@ public interface TableDataPaneController {
*/ */
boolean isNamePermitted(); boolean isNamePermitted();
void populate(DatasourceManagerProvider datasourceManagerProvider); void populate(TableDataConfig tableDataConfig);
void update(DatasourceManagerProvider datasourceManagerProvider); void update(TableDataConfig tableDataConfig);
void populate(TableDataSource datasourceManagerProvider); void populate(TableDataSource datasourceManagerProvider);

21
designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -7,7 +7,8 @@ import com.fr.design.data.DesignTableDataManager;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
@ -191,30 +192,30 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
* Populate. * Populate.
*/ */
@Override @Override
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(TableDataConfig tableDataConfig) {
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator(); Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
Iterator<String> procedurenameIt = datasourceManager.getProcedureNameIterator(); Iterator<String> procedurenameIt = ProcedureConfig.getInstance().getProcedures().keySet().iterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getTableData(name))); nameObjectList.add(new NameObject(name, tableDataConfig.getTableData(name)));
} }
while (procedurenameIt.hasNext()) { while (procedurenameIt.hasNext()) {
String name = procedurenameIt.next(); String name = procedurenameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getProcedureByName(name))); nameObjectList.add(new NameObject(name, ProcedureConfig.getInstance().getProcedure(name)));
} }
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
} }
@Override @Override
public void update(DatasourceManagerProvider datasourceManager) { public void update(TableDataConfig tableDataConfig) {
datasourceManager.clearAllTableData(); tableDataConfig.removeAllTableData();
datasourceManager.clearAllProcedure(); ProcedureConfig.getInstance().removeAllProcedure();
Nameable[] tableDataArray = this.update(); Nameable[] tableDataArray = this.update();
for (int i = 0; i < tableDataArray.length; i++) { for (int i = 0; i < tableDataArray.length; i++) {
NameObject nameObject = (NameObject) tableDataArray[i]; NameObject nameObject = (NameObject) tableDataArray[i];
datasourceManager.putTableData(nameObject.getName(), (TableData) nameObject.getObject()); tableDataConfig.addTableData(nameObject.getName(), (TableData) nameObject.getObject());
} }
} }

7
designer_base/src/com/fr/design/data/datapane/TreeTableDataComboBox.java

@ -7,8 +7,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.file.DatasourceManager; import com.fr.file.TableDataConfig;
import com.fr.file.DatasourceManagerProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -58,8 +57,8 @@ public class TreeTableDataComboBox extends UIComboBox {
} }
// 全局数据集 // 全局数据集
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); TableDataConfig mgr = TableDataConfig.getInstance();
nameIt = mgr.getTableDataNameIterator(); nameIt = mgr.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();
if(mgr.getTableData(name) instanceof RecursionTableData) { if(mgr.getTableData(name) instanceof RecursionTableData) {

43
designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -1,6 +1,7 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
@ -8,10 +9,12 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.server.ConnectionListAction; import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.DatasourceManager; import com.fr.design.mainframe.DesignerContext;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -57,8 +60,8 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
protected Iterator<String> items() { protected Iterator<String> items() {
nameList = new ArrayList<String>(); nameList = new ArrayList<String>();
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); ConnectionConfig mgr = ConnectionConfig.getInstance();
Iterator<String> nameIt = mgr.getConnectionNameIterator(); Iterator<String> nameIt = mgr.getConnections().keySet().iterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String conName = nameIt.next(); String conName = nameIt.next();
Connection connection = mgr.getConnection(conName); Connection connection = mgr.getConnection(conName);
@ -85,9 +88,8 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
*/ */
protected void editItems() { protected void editItems() {
final ConnectionListPane connectionListPane = new ConnectionListPane(); final ConnectionListPane connectionListPane = new ConnectionListPane();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager(); connectionListPane.populate((ConnectionConfig) connectionConfig.clone());
connectionListPane.populate(datasourceManager);
final BasicDialog connectionListDialog = connectionListPane.showLargeWindow( final BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null); SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null);
connectionListDialog.addDialogActionListener(new DialogActionAdapter() { connectionListDialog.addDialogActionListener(new DialogActionAdapter() {
@ -96,17 +98,24 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connectionListDialog.setDoOKSucceed(false); connectionListDialog.setDoOKSucceed(false);
return; return;
} }
if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane, Configurations.update(new Worker() {
connectionListDialog)) { @Override
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 public void run() {
return; if (!ConnectionListAction.doWithDatasourceManager(connectionConfig, connectionListPane,
} connectionListDialog)) {
// marks:保存数据 //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
ConnectionListAction.writeFile(datasourceManager); return;
} }
connectionListPane.update(connectionConfig);
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
public void doCancel() {
datasourceManager.synchronizedWithServer();
} }
}); });
connectionListDialog.setVisible(true); connectionListDialog.setVisible(true);

16
designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -8,7 +8,7 @@ import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
@ -130,15 +130,15 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/** /**
* Populate. * Populate.
* *
* @param datasourceManager the new datasourceManager. * @param connectionConfig the new datasourceManager.
*/ */
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(ConnectionConfig connectionConfig) {
Iterator<String> nameIt = datasourceManager.getConnectionNameIterator(); Iterator<String> nameIt = connectionConfig.getConnectionNameIterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getConnection(name))); nameObjectList.add(new NameObject(name, connectionConfig.getConnection(name)));
} }
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
@ -147,17 +147,17 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/** /**
* Update. * Update.
*/ */
public void update(DatasourceManagerProvider datasourceManager) { public void update(ConnectionConfig connectionConfig) {
// Nameable[]居然不能强转成NameObject[],一定要这么写... // Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update(); Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length]; NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array); java.util.Arrays.asList(res).toArray(res_array);
datasourceManager.clearAllConnection(); connectionConfig.clearAllConnection();
for (int i = 0; i < res_array.length; i++) { for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i]; NameObject nameObject = res_array[i];
datasourceManager.putConnection(nameObject.getName(), (Connection) nameObject.getObject()); connectionConfig.putConnection(nameObject.getName(), (Connection) nameObject.getObject());
} }
} }
} }

6
designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -5,7 +5,7 @@ import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ConnectionConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -48,13 +48,13 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
return connectionListPane.getRenameMap(); return connectionListPane.getRenameMap();
} }
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(ConnectionConfig datasourceManager) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName()); + File.separator + datasourceManager.fileName());
this.connectionListPane.populate(datasourceManager); this.connectionListPane.populate(datasourceManager);
} }
public void update(DatasourceManagerProvider datasourceManager) { public void update(ConnectionConfig datasourceManager) {
this.connectionListPane.update(datasourceManager); this.connectionListPane.update(datasourceManager);
} }

6
designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java

@ -1,15 +1,15 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ConnectionConfig;
/** /**
* Created by yaoh.wu on 2017/4/22. * Created by yaoh.wu on 2017/4/22.
* 数据链接显示面板 * 数据链接显示面板
*/ */
public interface ConnectionShowPane { public interface ConnectionShowPane {
void update(DatasourceManagerProvider datasourceManager); void update(ConnectionConfig connectionConfig);
void populate(DatasourceManagerProvider datasourceManager); void populate(ConnectionConfig connectionConfig);
void setSelectedIndex(int index); void setSelectedIndex(int index);
} }

7
designer_base/src/com/fr/design/data/tabledata/tabledatapane/DecoratedTableDataPane.java

@ -6,8 +6,7 @@ import com.fr.design.condition.DSColumnLiteConditionPane;
import com.fr.design.gui.ilist.CheckBoxList; import com.fr.design.gui.ilist.CheckBoxList;
import com.fr.design.gui.ilist.CheckBoxList.CheckBoxListSelectionChangeListener; import com.fr.design.gui.ilist.CheckBoxList.CheckBoxListSelectionChangeListener;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManager; import com.fr.file.TableDataConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.data.DataModel; import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException; import com.fr.general.data.TableDataException;
@ -22,8 +21,8 @@ public class DecoratedTableDataPane extends AbstractTableDataPane<DecoratedTable
public DecoratedTableDataPane() { public DecoratedTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); TableDataConfig tableDataConfig = TableDataConfig.getInstance();
java.util.Iterator serverTableDataNameIterator = mgr.getTableDataNameIterator(); java.util.Iterator serverTableDataNameIterator = tableDataConfig.getTableDatas().keySet().iterator();
java.util.List<String> tableDataNameList = new java.util.ArrayList<String>(); java.util.List<String> tableDataNameList = new java.util.ArrayList<String>();
while (serverTableDataNameIterator.hasNext()) { while (serverTableDataNameIterator.hasNext()) {
tableDataNameList.add((String)serverTableDataNameIterator.next()); tableDataNameList.add((String)serverTableDataNameIterator.next());

4
designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -40,7 +40,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.DatasourceManager; import com.fr.file.ConnectionConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -167,7 +167,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
} }
private boolean isAutoParameterDatabase() { private boolean isAutoParameterDatabase() {
Connection connection = DatasourceManager.getProviderInstance().getConnection(connectionTableProcedurePane.getSelectedDatabaseConnnectonName()); Connection connection = ConnectionConfig.getInstance().getConnection(connectionTableProcedurePane.getSelectedDatabaseConnnectonName());
return connection == null ? false : ArrayUtils.contains(DRIVERS, connection.getDriver()); return connection == null ? false : ArrayUtils.contains(DRIVERS, connection.getDriver());
} }

16
designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureListPane.java

@ -7,7 +7,7 @@ import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ProcedureConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
@ -113,16 +113,16 @@ public class ProcedureListPane extends JListControlPane {
/** /**
* Populate. * Populate.
* *
* @param datasourceManager * @param procedureConfig
* the new datasourceManager. * the new datasourceManager.
*/ */
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(ProcedureConfig procedureConfig) {
Iterator<String> nameIt = datasourceManager.getProcedureNameIterator(); Iterator<String> nameIt = procedureConfig.getProcedures().keySet().iterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getProcedure(name))); nameObjectList.add(new NameObject(name, procedureConfig.getProcedure(name)));
} }
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
@ -131,17 +131,17 @@ public class ProcedureListPane extends JListControlPane {
/** /**
* Update. * Update.
*/ */
public void update(DatasourceManagerProvider datasourceManager) { public void update(ProcedureConfig procedureConfig) {
// Nameable[]居然不能强转成NameObject[],一定要这么写... // Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update(); Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length]; NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array); java.util.Arrays.asList(res).toArray(res_array);
datasourceManager.clearAllProcedure(); procedureConfig.removeAllProcedure();
for (int i = 0; i < res_array.length; i++) { for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i]; NameObject nameObject = res_array[i];
datasourceManager.putProcedure(nameObject.getName(), (StoreProcedure) nameObject.getObject()); procedureConfig.addProcedure(nameObject.getName(), (StoreProcedure) nameObject.getObject());
} }
} }

18
designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureManagerPane.java

@ -1,17 +1,14 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.ProcedureConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.io.File;
public class ProcedureManagerPane extends LoadingBasicPane { public class ProcedureManagerPane extends LoadingBasicPane {
private UITextField connectionTextField; private UITextField connectionTextField;
@ -38,14 +35,15 @@ public class ProcedureManagerPane extends LoadingBasicPane {
return Inter.getLocText("Datasource-Stored_Procedure"); return Inter.getLocText("Datasource-Stored_Procedure");
} }
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(ProcedureConfig procedureConfig) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME //todo 原来界面上显示的xml路径
+ File.separator + datasourceManager.fileName()); // this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
this.procedureListPane.populate(datasourceManager); // + File.separator + datasourceManager.fileName());
this.procedureListPane.populate(procedureConfig);
} }
public void update(DatasourceManagerProvider datasourceManager) { public void update(ProcedureConfig procedureConfig) {
this.procedureListPane.update(datasourceManager); this.procedureListPane.update(procedureConfig);
} }
} }

18
designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java

@ -1,6 +1,5 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.FRContext;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.datapane.TableDataPaneController; import com.fr.design.data.datapane.TableDataPaneController;
@ -10,13 +9,11 @@ import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.TableDataConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.io.File;
import java.util.Map; import java.util.Map;
public class TableDataManagerPane extends LoadingBasicPane { public class TableDataManagerPane extends LoadingBasicPane {
@ -77,14 +74,15 @@ public class TableDataManagerPane extends LoadingBasicPane {
return Inter.getLocText("DS-Server_TableData"); return Inter.getLocText("DS-Server_TableData");
} }
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(TableDataConfig tableDataConfig) {
this.tableDataTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME //todo 原来界面上显示的xml路径
+ File.separator + datasourceManager.fileName()); // this.tableDataTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
this.tableDataPane.populate(datasourceManager); // + File.separator + datasourceManager.fileName());
this.tableDataPane.populate(tableDataConfig);
} }
public void update(DatasourceManagerProvider datasourceManager) { public void update(TableDataConfig tableDataConfig) {
this.tableDataPane.update(datasourceManager); this.tableDataPane.update(tableDataConfig);
} }
public Map<String, String> getDsChangedNameMap () { public Map<String, String> getDsChangedNameMap () {

8
designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java

@ -7,7 +7,7 @@ import com.fr.data.impl.*;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.data.datapane.TableDataNameObjectCreator; import com.fr.design.data.datapane.TableDataNameObjectCreator;
import com.fr.design.data.tabledata.tabledatapane.*; import com.fr.design.data.tabledata.tabledatapane.*;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -153,12 +153,12 @@ public abstract class TableDataFactory {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static String[] getSortOfChineseNameOfServerData(DatasourceManagerProvider mgr) { public static String[] getSortOfChineseNameOfServerData(TableDataConfig tableDataConfig) {
clearAll(); clearAll();
java.util.Iterator<String> nameIt = mgr.getTableDataNameIterator(); java.util.Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();
TableData td = mgr.getTableData(name); TableData td = TableDataConfig.getInstance().getTableData(name);
addName(name, td); addName(name, td);
} }
return getSortedNameArray(); return getSortedNameArray();

10
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -1,7 +1,7 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.exe.PluginLoginExecutor;
@ -125,16 +125,16 @@ public class LoginWebBridge {
*/ */
public void setMessageCount(int count) { public void setMessageCount(int count) {
if (count == MIN_MESSAGE_COUNT) { if (count == MIN_MESSAGE_COUNT) {
uiLabel.setText(ConfigManager.getProviderInstance().getBbsUsername()); uiLabel.setText(ServerConfig.getInstance().getBbsUsername());
ConfigManager.getProviderInstance().setInShowBBsName(ConfigManager.getProviderInstance().getBbsUsername()); ServerConfig.getInstance().setInShowBBsName(ServerConfig.getInstance().getBbsUsername());
return; return;
} }
this.messageCount = count; this.messageCount = count;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(StringUtils.BLANK).append(ConfigManager.getProviderInstance().getBbsUsername()) sb.append(StringUtils.BLANK).append(ServerConfig.getInstance().getBbsUsername())
.append("(").append(this.messageCount) .append("(").append(this.messageCount)
.append(")").append(StringUtils.BLANK); .append(")").append(StringUtils.BLANK);
ConfigManager.getProviderInstance().setInShowBBsName(sb.toString()); ServerConfig.getInstance().setInShowBBsName(sb.toString());
uiLabel.setText(sb.toString()); uiLabel.setText(sb.toString());
} }

6
designer_base/src/com/fr/design/extra/PluginFromStorePane.java

@ -1,7 +1,7 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.extra.tradition.callback.UpdateOnlineCallback; import com.fr.design.extra.tradition.callback.UpdateOnlineCallback;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -188,10 +188,10 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane<List<Plug
} }
private void doUpdateOnline(final PluginStatusCheckCompletePane pane) { private void doUpdateOnline(final PluginStatusCheckCompletePane pane) {
if (!StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) { if (!StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
LoginCheckContext.fireLoginCheckListener(); LoginCheckContext.fireLoginCheckListener();
} }
if (StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) { if (StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
PluginView plugin = controlPane.getSelectedPlugin(); PluginView plugin = controlPane.getSelectedPlugin();
String id = null; String id = null;
if (plugin != null) { if (plugin != null) {

4
designer_base/src/com/fr/design/extra/PluginOperateUtils.java

@ -1,7 +1,7 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.extra.exe.callback.InstallFromDiskCallback; import com.fr.design.extra.exe.callback.InstallFromDiskCallback;
import com.fr.design.extra.exe.callback.InstallOnlineCallback; import com.fr.design.extra.exe.callback.InstallOnlineCallback;
import com.fr.design.extra.exe.callback.JSCallback; import com.fr.design.extra.exe.callback.JSCallback;
@ -167,7 +167,7 @@ public class PluginOperateUtils {
} }
public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) { public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ServerConfig.getInstance().getBbsUsername();
if (StringUtils.isEmpty(username)) { if (StringUtils.isEmpty(username)) {
jsCallback.execute(StringUtils.EMPTY); jsCallback.execute(StringUtils.EMPTY);
uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn"));

6
designer_base/src/com/fr/design/extra/PluginUpdatePane.java

@ -1,6 +1,6 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.ConfigManager; import com.fr.config.ServerConfig;
import com.fr.design.extra.tradition.callback.UpdateOnlineCallback; import com.fr.design.extra.tradition.callback.UpdateOnlineCallback;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -171,10 +171,10 @@ public class PluginUpdatePane extends PluginAbstractLoadingViewPane<List<PluginV
} }
private void doUpdateOnline(final PluginStatusCheckCompletePane pane) { private void doUpdateOnline(final PluginStatusCheckCompletePane pane) {
if (!StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) { if (!StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
LoginCheckContext.fireLoginCheckListener(); LoginCheckContext.fireLoginCheckListener();
} }
if (StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) { if (StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
try{ try{
PluginView plugin = controlPane.getSelectedPlugin(); PluginView plugin = controlPane.getSelectedPlugin();
PluginMarker pluginMarker = PluginMarker.create(plugin.getID(), plugin.getVersion()); PluginMarker pluginMarker = PluginMarker.create(plugin.getID(), plugin.getVersion());

11
designer_base/src/com/fr/design/extra/PluginWebBridge.java

@ -1,7 +1,7 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -422,7 +422,7 @@ public class PluginWebBridge {
*/ */
public String getLoginInfo(final JSObject callback) { public String getLoginInfo(final JSObject callback) {
registerLoginInfo(callback); registerLoginInfo(callback);
return ConfigManager.getProviderInstance().getBbsUsername(); return ServerConfig.getInstance().getBbsUsername();
} }
/** /**
@ -550,11 +550,6 @@ public class PluginWebBridge {
* 通过QQ登录后通知登录 * 通过QQ登录后通知登录
*/ */
public void ucsynLogin(long uid, String username, String password, final JSONObject callback) { public void ucsynLogin(long uid, String username, String password, final JSONObject callback) {
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
uiLabel.setText(username); uiLabel.setText(username);
} }
@ -562,7 +557,7 @@ public class PluginWebBridge {
* 清除用户信息 * 清除用户信息
*/ */
public void clearUserInfo() { public void clearUserInfo() {
ConfigManager.getProviderInstance().setInShowBBsName(StringUtils.EMPTY); ServerConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
BBSLoginUtils.bbsLogout(); BBSLoginUtils.bbsLogout();
uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn"));
} }

6
designer_base/src/com/fr/design/formula/FunctionConstants.java

@ -1,9 +1,7 @@
package com.fr.design.formula; package com.fr.design.formula;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.file.FunctionManager; import com.fr.file.FunctionConfig;
import com.fr.file.FunctionManagerProvider;
import com.fr.function.*;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
@ -94,7 +92,7 @@ public abstract class FunctionConstants {
@Override @Override
public NameAndDescription[] getDescriptions() { public NameAndDescription[] getDescriptions() {
FunctionManagerProvider funtionManager = FunctionManager.getProviderInstance(); FunctionConfig funtionManager = FunctionConfig.getInstance();
if (funtionManager != null) { if (funtionManager != null) {
int functionDefCount = funtionManager.getFunctionDefCount(); int functionDefCount = funtionManager.getFunctionDefCount();

14
designer_base/src/com/fr/design/formula/FunctionManagerPane.java

@ -16,11 +16,10 @@ import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FunctionManagerProvider; import com.fr.file.FunctionConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.ProductConstants;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.script.FunctionDef; import com.fr.stable.script.FunctionDef;
@ -63,10 +62,11 @@ public class FunctionManagerPane extends BasicPane {
/** /**
* Populate. * Populate.
*/ */
public void populate(FunctionManagerProvider functionManager) { public void populate(FunctionConfig functionManager) {
this.functionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator //todo 原来界面上显示的xml路径
+ ProjectConstants.RESOURCES_NAME // this.functionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator
+ File.separator + functionManager.fileName()); // + ProjectConstants.RESOURCES_NAME
// + File.separator + functionManager.fileName());
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
for (int i = 0; i < functionManager.getFunctionDefCount(); i++) { for (int i = 0; i < functionManager.getFunctionDefCount(); i++) {
@ -80,7 +80,7 @@ public class FunctionManagerPane extends BasicPane {
/** /**
* Update. * Update.
*/ */
public void update(FunctionManagerProvider functionManager) { public void update(FunctionConfig functionManager) {
// Nameable[]居然不能强转成NameObject[],一定要这么写... // Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.functionControlPane.update(); Nameable[] res = this.functionControlPane.update();
NameObject[] res_array = new NameObject[res.length]; NameObject[] res_array = new NameObject[res.length];

7
designer_base/src/com/fr/design/formula/VariableResolverAdapter.java

@ -1,9 +1,8 @@
package com.fr.design.formula; package com.fr.design.formula;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.base.ConfigManagerProvider;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
import com.fr.script.ScriptConstants; import com.fr.script.ScriptConstants;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -94,8 +93,8 @@ public abstract class VariableResolverAdapter implements VariableResolver {
*/ */
public String[] resolveGlobalParameterVariables() { public String[] resolveGlobalParameterVariables() {
// 加上全局的参数 // 加上全局的参数
ConfigManagerProvider reportServerManager = ConfigManager.getProviderInstance(); ServerConfig reportServerManager = ServerConfig.getInstance();
Parameter[] globalParameters = reportServerManager.getGlobal_Parameters(); Parameter[] globalParameters = reportServerManager.getGlobeParameters();
List<String> variablesList = new ArrayList<String>(); List<String> variablesList = new ArrayList<String>();
for (int i = 0; i < (globalParameters == null ? 0 : globalParameters.length); i++) { for (int i = 0; i < (globalParameters == null ? 0 : globalParameters.length); i++) {

2
designer_base/src/com/fr/design/gui/core/WidgetOption.java

@ -84,7 +84,7 @@ public abstract class WidgetOption implements Serializable {
*/ */
public static WidgetOption[] getPredefinedWidget() { public static WidgetOption[] getPredefinedWidget() {
java.util.List<WidgetOption> list = new ArrayList<WidgetOption>(); java.util.List<WidgetOption> list = new ArrayList<WidgetOption>();
WidgetManagerProvider mgr = WidgetManager.getProviderInstance(); WidgetInfoConfig mgr = WidgetInfoConfig.getInstance();
java.util.Iterator<String> nameIt = mgr.getWidgetConfigNameIterator(); java.util.Iterator<String> nameIt = mgr.getWidgetConfigNameIterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();

8
designer_base/src/com/fr/design/gui/ilist/TableViewList.java

@ -10,8 +10,7 @@ import com.fr.data.impl.Connection;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.dnd.SerializableTransferable; import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.file.DatasourceManager; import com.fr.file.ConnectionConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -86,7 +85,7 @@ public class TableViewList extends UIList {
@Override @Override
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
Connection datasource = DatasourceManager.getProviderInstance().getConnection(databaseName); Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName);
boolean status = false; boolean status = false;
int count = 3; int count = 3;
//总共给3次连接的机会 //总共给3次连接的机会
@ -127,8 +126,7 @@ public class TableViewList extends UIList {
*/ */
private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception { private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception {
DefaultListModel defaultListModel = new DefaultListModel(); DefaultListModel defaultListModel = new DefaultListModel();
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName);
Connection datasource = datasourceManager.getConnection(databaseName);
if (datasource == null) { if (datasource == null) {
return defaultListModel; return defaultListModel;
} }

4
designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java

@ -1,6 +1,6 @@
package com.fr.design.hyperlink; package com.fr.design.hyperlink;
import com.fr.base.ConfigManager; import com.fr.config.ServerConfig;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -80,7 +80,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
protected void populateSubHyperlinkBean(WebHyperlink link) { protected void populateSubHyperlinkBean(WebHyperlink link) {
String url = link.getURL(); String url = link.getURL();
if (StringUtils.isBlank(url)) { if (StringUtils.isBlank(url)) {
url = ConfigManager.getProviderInstance().getHyperlinkAddress(); url = ServerConfig.getInstance().getHyperlinkAddress();
} }
this.urlTextField.setText(url); this.urlTextField.setText(url);
if (itemNameTextField != null) { if (itemNameTextField != null) {

6
designer_base/src/com/fr/design/javascript/EmailPane.java

@ -1,6 +1,6 @@
package com.fr.design.javascript; package com.fr.design.javascript;
import com.fr.base.ConfigManager; import com.fr.config.EmailConfig;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -51,7 +51,7 @@ public class EmailPane extends FurtherBasicBeanPane<EmailJavaScript> {
initCenterPane(mainTextLabel, scrollPane, fill, preferred); initCenterPane(mainTextLabel, scrollPane, fill, preferred);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
mainTextEditor.setAutoscrolls(true); mainTextEditor.setAutoscrolls(true);
checkEmailConfig(ConfigManager.getProviderInstance().getEmailManager().isEmailConfigValid()); checkEmailConfig(EmailConfig.getInstance().isEmailConfigValid());
} }
/** /**
@ -113,7 +113,7 @@ public class EmailPane extends FurtherBasicBeanPane<EmailJavaScript> {
if (showTplContent != null) { if (showTplContent != null) {
showTplContent.setSelected(ob ==null ? false: ob.isShowTplContent()); showTplContent.setSelected(ob ==null ? false: ob.isShowTplContent());
} }
checkEmailConfig(ConfigManager.getProviderInstance().getEmailManager().isEmailConfigValid()); checkEmailConfig(EmailConfig.getInstance().isEmailConfigValid());
} }
@Override @Override

9
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -618,15 +618,6 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
return false; return false;
} }
if (BaseUtils.isAuthorityEditing()) {
//触发保存服务器工具栏
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage());
}
}
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE);

4
designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe.loghandler; package com.fr.design.mainframe.loghandler;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -129,7 +129,7 @@ public class DesignerLogHandler {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
JPopupMenu showsetPopup = new JPopupMenu(); JPopupMenu showsetPopup = new JPopupMenu();
int logLevelvalue = ConfigManager.getProviderInstance().getServerLogLevel().intValue(); int logLevelvalue = ServerConfig.getInstance().getServerLogLevel().intValue();
if (logLevelvalue <= INFO_INT) { if (logLevelvalue <= INFO_INT) {
showsetPopup.add(showInfo); showsetPopup.add(showInfo);
showsetPopup.add(showError); showsetPopup.add(showError);

4
designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe.templateinfo; package com.fr.design.mainframe.templateinfo;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.io.IOFile; import com.fr.base.io.IOFile;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -238,7 +238,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable, XM
private HashMap<String, Object> getNewConsumingMap(String templateID, long openTime, long timeConsume) { private HashMap<String, Object> getNewConsumingMap(String templateID, long openTime, long timeConsume) {
HashMap<String, Object> consumingMap = new HashMap<>(); HashMap<String, Object> consumingMap = new HashMap<>();
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ServerConfig.getInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID(); String uuid = DesignerEnvManager.getEnvManager().getUUID();
String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); String activitykey = DesignerEnvManager.getEnvManager().getActivationKey();
String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime());

12
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java

@ -1,7 +1,5 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.IconCellRenderer; import com.fr.design.mainframe.widget.renderer.IconCellRenderer;
@ -9,10 +7,7 @@ import com.fr.design.mainframe.widget.wrappers.IconWrapper;
import com.fr.design.web.CustomIconPane; import com.fr.design.web.CustomIconPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.form.ui.WidgetManager;
import javax.swing.*;
import java.awt.*;
public class AccessibleIconEditor extends UneditableAccessibleEditor { public class AccessibleIconEditor extends UneditableAccessibleEditor {
@ -39,13 +34,6 @@ public class AccessibleIconEditor extends UneditableAccessibleEditor {
public void doOk() { public void doOk() {
setValue(customIconPane.update()); setValue(customIconPane.update());
fireStateChanged(); fireStateChanged();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(WidgetManager.getProviderInstance());
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
} }
}); });
customIconPane.populate((String) this.getValue()); customIconPane.populate((String) this.getValue());

6
designer_base/src/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java

@ -5,9 +5,7 @@ import java.awt.*;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Icon; import com.fr.base.Icon;
import com.fr.base.IconManager; import com.fr.base.IconManager;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import javax.swing.*;
public class IconCellRenderer extends GenericCellRenderer { public class IconCellRenderer extends GenericCellRenderer {
private Image img; private Image img;
@ -20,7 +18,7 @@ public class IconCellRenderer extends GenericCellRenderer {
@Override @Override
public void setValue(Object v) { public void setValue(Object v) {
try { try {
Icon icon = WidgetManager.getProviderInstance().getIconManager().getIcon(v); Icon icon = WidgetInfoConfig.getInstance().getIconManager().getIcon(v);
this.setImage(icon == null ? null : icon.getImage()); this.setImage(icon == null ? null : icon.getImage());
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
this.setImage(null); this.setImage(null);

8
designer_base/src/com/fr/design/parameter/ParameterArrayPane.java

@ -1,7 +1,7 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.config.ServerConfig;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.NameableSelfCreator; import com.fr.design.gui.controlpane.NameableSelfCreator;
@ -9,7 +9,6 @@ import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ModNameActionListener; import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -30,10 +29,9 @@ public class ParameterArrayPane extends JListControlPane {
} }
}); });
this.addEditingListner(new PropertyChangeAdapter() { this.addEditingListner( new PropertyChangeAdapter() {
public void propertyChange() { public void propertyChange() {
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); Parameter[] parameters = ServerConfig.getInstance().getGlobeParameters();
Parameter[] parameters = configManager.getGlobal_Parameters();
String[] allListNames = nameableList.getAllNames(); String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName(); String tempName = getEditingName();

17
designer_base/src/com/fr/design/parameter/ParameterManagerPane.java

@ -1,12 +1,12 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
@ -39,15 +39,16 @@ public class ParameterManagerPane extends BasicPane {
return Inter.getLocText("M_Server-Global_Parameters"); return Inter.getLocText("M_Server-Global_Parameters");
} }
public void populate(ConfigManagerProvider configManager) { public void populate(ServerConfig configManager) {
this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + //todo 原来界面上显示的xml路径
ProjectConstants.RESOURCES_NAME + // this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
File.separator + configManager.fileName()); // ProjectConstants.RESOURCES_NAME +
this.parameterArrayPane.populate(configManager.getGlobal_Parameters()); // File.separator + configManager.fileName());
this.parameterArrayPane.populate(configManager.getGlobeParameters());
} }
public void update(ConfigManagerProvider configManager) { public void update(ServerConfig configManager) {
configManager.setGlobal_Parameters(parameterArrayPane.updateParameters()); configManager.setGlobeParameters(parameterArrayPane.updateParameters());
} }
/** /**

8
designer_base/src/com/fr/design/web/CustomIconPane.java

@ -18,7 +18,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -106,7 +106,7 @@ public class CustomIconPane extends BasicPane {
private void initIcons() { private void initIcons() {
iconButtonMap = new ListMap(); iconButtonMap = new ListMap();
iconManager = WidgetManager.getProviderInstance().getIconManager(); iconManager = WidgetInfoConfig.getInstance().getIconManager();
bg = new ButtonGroup(); bg = new ButtonGroup();
Object[] names = iconManager.getIconNames(); Object[] names = iconManager.getIconNames();
Object name = null; Object name = null;
@ -315,7 +315,7 @@ public class CustomIconPane extends BasicPane {
this.addActionListener(this); this.addActionListener(this);
this.setCursor(new Cursor(Cursor.HAND_CURSOR)); this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.setBorder(null); this.setBorder(null);
this.iconImage = WidgetManager.getProviderInstance().getIconManager().getIconImage(name); this.iconImage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(name);
this.setToolTipText(iconName); this.setToolTipText(iconName);
} }
@ -408,7 +408,7 @@ public class CustomIconPane extends BasicPane {
if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) { if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) {
return; return;
} }
if (WidgetManager.getProviderInstance().getIconManager().contains(nameTextField.getText())) { if (WidgetInfoConfig.getInstance().getIconManager().contains(nameTextField.getText())) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Custom_Icon_Message3"), Inter.getLocText("FR-Designer_Custom_Icon_Message3"),
Inter.getLocText("FR-Designer_Tooltips"), Inter.getLocText("FR-Designer_Tooltips"),

11
designer_base/src/com/fr/design/widget/IconDefinePane.java

@ -10,7 +10,7 @@ import com.fr.design.web.CustomIconPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
@ -49,13 +49,6 @@ public class IconDefinePane extends BasicPane {
curIconName = cip.update(); curIconName = cip.update();
setShowIconImage(); setShowIconImage();
IconDefinePane.this.repaint(); IconDefinePane.this.repaint();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(WidgetManager.getProviderInstance());
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
} }
}); });
editDialog.setVisible(true); editDialog.setVisible(true);
@ -82,7 +75,7 @@ public class IconDefinePane extends BasicPane {
} }
private void setShowIconImage() { private void setShowIconImage() {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(curIconName); Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(curIconName);
if (iimage != null) { if (iimage != null) {
showIconImageLable.setIcon(new ImageIcon(iimage)); showIconImageLable.setIcon(new ImageIcon(iimage));
} else { } else {

10
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -26,8 +26,8 @@ import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.file.CacheManager; import com.fr.file.CacheManager;
import com.fr.file.DatasourceManager; import com.fr.file.ConnectionConfig;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.TableDataConfig;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.*; import com.fr.general.*;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
@ -1060,7 +1060,7 @@ public class RemoteEnv extends AbstractEnv {
* DataSource中去除当前角色没有权限访问的数据源 * DataSource中去除当前角色没有权限访问的数据源
*/ */
public void removeNoPrivilegeConnection() { public void removeNoPrivilegeConnection() {
DatasourceManagerProvider dm = DatasourceManager.getProviderInstance(); TableDataConfig dm = TableDataConfig.getInstance();
try { try {
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
@ -1075,8 +1075,8 @@ public class RemoteEnv extends AbstractEnv {
ArrayList<String> toBeRemoveTDName = new ArrayList<String>(); ArrayList<String> toBeRemoveTDName = new ArrayList<String>();
for (int i = 0; i < ja.length(); i++) { for (int i = 0; i < ja.length(); i++) {
String toBeRemoveConnName = (String) ((JSONObject) ja.get(i)).get("name"); String toBeRemoveConnName = (String) ((JSONObject) ja.get(i)).get("name");
dm.removeConnection(toBeRemoveConnName); ConnectionConfig.getInstance().removeConnection(toBeRemoveConnName);
Iterator it = dm.getTableDataNameIterator(); Iterator it = dm.getTableDatas().keySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
String tdName = (String) it.next(); String tdName = (String) it.next();
TableData td = dm.getTableData(tdName); TableData td = dm.getTableData(tdName);

3
designer_chart/src/com/fr/plugin/chart/map/server/ChartMapEditorAction.java

@ -2,6 +2,7 @@ package com.fr.plugin.chart.map.server;
import com.fr.base.Env; import com.fr.base.Env;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -24,7 +25,7 @@ public class ChartMapEditorAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
int port = DesignerEnvManager.getEnvManager().getJettyServerPort(); int port = DesignerEnvManager.getEnvManager().getJettyServerPort();
String web = GeneralContext.getCurrentAppNameOfEnv(); String web = GeneralContext.getCurrentAppNameOfEnv();
String serverlet = com.fr.base.ConfigManager.getProviderInstance().getServletMapping(); String serverlet = ServerConfig.getInstance().getServletMapping();
Env env = FRContext.getCurrentEnv(); Env env = FRContext.getCurrentEnv();
StartServer.browserURLWithLocalEnv(env.isLocalEnv() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : env.getPath() + "?op=map"); StartServer.browserURLWithLocalEnv(env.isLocalEnv() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : env.getPath() + "?op=map");
} }

2
designer_form/src/com/fr/design/designer/creator/XNameWidget.java

@ -62,7 +62,7 @@ public class XNameWidget extends XWidgetCreator {
protected JComponent initEditor() { protected JComponent initEditor() {
if (editor == null) { if (editor == null) {
WidgetManagerProvider widgetManager = WidgetManager.getProviderInstance(); WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance();
WidgetConfig wc = widgetManager.getWidgetConfig(toData().getName()); WidgetConfig wc = widgetManager.getWidgetConfig(toData().getName());
Widget widget; Widget widget;
if (wc != null && (widget= wc.toWidget()) != null) { if (wc != null && (widget= wc.toWidget()) != null) {

2
designer_form/src/com/fr/design/mainframe/FormEditToolBar.java

@ -186,7 +186,7 @@ public class FormEditToolBar extends BasicPane {
if (widget instanceof Button) { if (widget instanceof Button) {
String iconname = ((Button) widget).getIconName(); String iconname = ((Button) widget).getIconName();
if (StringUtils.isNotBlank(iconname)) { if (StringUtils.isNotBlank(iconname)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname); Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname);
toolBarButton.setIcon(new ImageIcon(iimage)); toolBarButton.setIcon(new ImageIcon(iimage));
} }
} }

2
designer_form/src/com/fr/design/mainframe/FormParaPane.java

@ -138,7 +138,7 @@ public class FormParaPane extends JPanel {
predifinedwidgeList.add(designerPre[i]); predifinedwidgeList.add(designerPre[i]);
} }
} }
WidgetManagerProvider mgr = WidgetManager.getProviderInstance(); WidgetInfoConfig mgr = WidgetInfoConfig.getInstance();
Iterator<String> nameIt = mgr.getWidgetConfigNameIterator(); Iterator<String> nameIt = mgr.getWidgetConfigNameIterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();

2
designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java

@ -227,7 +227,7 @@ public class FormParaWidgetPane extends JPanel {
predifinedwidgeList.add(designerPre[i]); predifinedwidgeList.add(designerPre[i]);
} }
} }
WidgetManagerProvider mgr = WidgetManager.getProviderInstance(); WidgetInfoConfig mgr = WidgetInfoConfig.getInstance();
Iterator<String> nameIt = mgr.getWidgetConfigNameIterator(); Iterator<String> nameIt = mgr.getWidgetConfigNameIterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();

4
designer_form/src/com/fr/design/mainframe/FormToolBarButton.java

@ -7,7 +7,7 @@ import com.fr.design.gui.core.WidgetOption;
import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -36,7 +36,7 @@ public class FormToolBarButton extends JButton implements MouseListener {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
String iconName = button.getIconName(); String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) { if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconName); Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) { if (iimage != null) {
setIcon(new ImageIcon(iimage)); setIcon(new ImageIcon(iimage));
} }

5
designer_form/src/com/fr/design/mainframe/widget/editors/NameWidgetComboboxEditor.java

@ -2,8 +2,7 @@ package com.fr.design.mainframe.widget.editors;
import com.fr.design.Exception.ValidationException; import com.fr.design.Exception.ValidationException;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.form.ui.WidgetManagerProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -18,7 +17,7 @@ public class NameWidgetComboboxEditor extends AbstractPropertyEditor {
public NameWidgetComboboxEditor() { public NameWidgetComboboxEditor() {
Vector<String> items = new Vector<String>(); Vector<String> items = new Vector<String>();
WidgetManagerProvider manager = WidgetManager.getProviderInstance(); WidgetInfoConfig manager = WidgetInfoConfig.getInstance();
java.util.Iterator<String> nameIt = manager.getWidgetConfigNameIterator(); java.util.Iterator<String> nameIt = manager.getWidgetConfigNameIterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
String name = nameIt.next(); String name = nameIt.next();

13
designer_form/src/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java

@ -1,15 +1,14 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.parameter.ParameterGroup; import com.fr.design.parameter.ParameterGroup;
import com.fr.file.DatasourceManager; import com.fr.file.TableDataConfig;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.script.Calculator; import com.fr.script.Calculator;
@ -153,17 +152,17 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
} }
// 全局参数 // 全局参数
parameters = ConfigManager.getProviderInstance().getGlobal_Parameters(); parameters = ServerConfig.getInstance().getGlobeParameters();
if (!ArrayUtils.isEmpty(parameters)) { if (!ArrayUtils.isEmpty(parameters)) {
groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters)); groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters));
} }
// 全局数据源参数 // 全局数据源参数
parameters = new Parameter[0]; parameters = new Parameter[0];
Calculator c = Calculator.createCalculator(); Calculator c = Calculator.createCalculator();
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); TableDataConfig tableDataConfig = TableDataConfig.getInstance();
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator(); Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) { while (nameIt.hasNext()) {
TableData tableData = datasourceManager.getTableData(nameIt.next()); TableData tableData = tableDataConfig.getTableData(nameIt.next());
ParameterProvider[] ps = tableData.getParameters(c); ParameterProvider[] ps = tableData.getParameters(c);
if (!ArrayUtils.isEmpty(ps)) { if (!ArrayUtils.isEmpty(ps)) {
parameters = (Parameter[])ArrayUtils.addAll(parameters, ps); parameters = (Parameter[])ArrayUtils.addAll(parameters, ps);

Loading…
Cancel
Save