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.ConfigManager;
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.TemplateComponentAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.design.style.StylePane;
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.pinyin.PinyinHelper;
@ -79,8 +72,7 @@ public class GlobalStyleMenuDef extends MenuDef {
public void updateMenu() {
UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll();
ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
Iterator iterator = configManager.getStyleNameIterator();
Iterator iterator = ServerConfig.getInstance().getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
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;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
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.general.IOUtils;
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;
@ -46,7 +46,8 @@ public class ReportWebAttrAction extends JWorkBookAction {
final ReportWebAttrPane reportWebAttrPane = new ReportWebAttrPane() {
@Override
public void complete() {
populate(wbTpl.getReportWebAttr());
ReportWebConfig config = wbTpl.getReportWebAttr();
populate((ReportWebConfig) config.clone());
}
};
final BasicDialog dialog = reportWebAttrPane.showWindow(
@ -56,15 +57,19 @@ public class ReportWebAttrAction extends JWorkBookAction {
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setReportWebAttr(reportWebAttrPane.update());
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
jwb.fireTargetModified();
Configurations.update(new Worker() {
@Override
public void run() {
wbTpl.setReportWebAttr(reportWebAttrPane.update());
jwb.fireTargetModified();
}
@Override
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;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.config.ServerConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
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.general.IOUtils;
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 java.awt.event.ActionEvent;
@ -36,11 +37,11 @@ public class ServerConfigManagerAction extends UpdateAction {
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
final ServerConfig config = ServerConfig.getInstance();
final EditReportServerParameterPane editReportServerParameterPane = new EditReportServerParameterPane() {
@Override
public void complete() {
populate(configManager);
populate((ServerConfig)config.clone());
}
};
@ -51,13 +52,18 @@ public class ServerConfigManagerAction extends UpdateAction {
editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
editReportServerParameterPane.update(configManager);
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
Configurations.update(new Worker() {
@Override
public void run() {
editReportServerParameterPane.update(config);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class, ServerConfig.class};
}
});
}
});
editReportServerParameterDialog.setVisible(true);

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

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

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

@ -1,18 +1,15 @@
package com.fr.design.actions.server;
import com.fr.base.FRContext;
import com.fr.base.ConfigManagerProvider;
import com.fr.config.ServerConfig;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.StyleArrayPane;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import java.awt.*;
import java.io.File;
public class StyleManagerPane extends BasicPane {
private UITextField StyleTextField;
@ -38,14 +35,15 @@ public class StyleManagerPane extends BasicPane {
return Inter.getLocText("ServerM-Predefined_Styles");
}
public void populate(ConfigManagerProvider configManager) {
this.StyleTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
ProjectConstants.RESOURCES_NAME +
File.separator + configManager.fileName());
public void populate(ServerConfig configManager) {
//todo 原来界面上显示的xml路径
// this.StyleTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + configManager.fileName());
this.styleArrayPane.populate(configManager);
}
public void update(ConfigManagerProvider configManager) {
public void update(ServerConfig 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;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
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.menu.MenuKeySet;
import com.fr.design.webattr.WidgetManagerPane;
import com.fr.form.ui.WidgetManager;
import com.fr.form.ui.WidgetManagerProvider;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -32,32 +32,33 @@ public class WidgetManagerAction extends UpdateAction {
*/
public void actionPerformed(ActionEvent e) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final WidgetManagerProvider widgetManager = WidgetManager.getProviderInstance();
final WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance();
final WidgetManagerPane widgetManagerPane = new WidgetManagerPane() {
@Override
public void complete() {
populate(widgetManager);
populate((WidgetInfoConfig)widgetManager.clone());
}
};
BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame,new DialogActionAdapter() {
@Override
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();
try {
currentEnv.writeResource(widgetManager);
//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();
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{WidgetInfoConfig.class};
}
});
}
});

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

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

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

@ -1,7 +1,5 @@
package com.fr.design.mainframe;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.FRContext;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.beans.BasicBeanPane;
@ -24,7 +22,7 @@ import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent;
import com.fr.stable.ArrayUtils;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -36,7 +34,7 @@ import java.util.List;
* Date: 13-9-9
* 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 GAP = 25;
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();
if (!editingTemplate.isJWorkBook()) {
return null;
@ -215,9 +213,8 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
JWorkBook editingWorkBook = (JWorkBook) editingTemplate;
TemplateWorkBook wbTpl = editingWorkBook.getTarget();
ReportWebAttr rw = wbTpl.getReportWebAttr();
ConfigManagerProvider cm = ConfigManager.getProviderInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
ReportWebConfig rw = wbTpl.getReportWebAttr();
ReportWebConfig webAttr = ReportWebConfig.getInstance();
//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);
// 如果是空值就说明采用服务器配置了
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {
@ -280,7 +277,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
populate(webContent.getToolBarManagers());
}
public ReportWebAttr updateBean() {
public ReportWebConfig updateBean() {
return null;
}
@ -318,8 +315,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
private void populateServerSettings() {
ConfigManagerProvider cm = ConfigManager.getProviderInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
ReportWebConfig webAttr = (ReportWebConfig)ReportWebConfig.getInstance().clone();
if (this.getWebContent(webAttr) != null) {
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) {
return reportWebAttr == null ? null : (T) reportWebAttr.getWebPage();
} 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;
import com.bulenkov.iconloader.IconLoader;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.dialog.UIDialog;
@ -775,7 +775,7 @@ public class AlphaFineDialog extends UIDialog {
*/
private void sendDataToServer(String searchKey, AlphaCellModel cellModel) {
if (cellModel.isNeedToSendToServer()) {
String username = ConfigManager.getProviderInstance().getBbsUsername();
String username = ServerConfig.getInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID();
String activityKey = DesignerEnvManager.getEnvManager().getActivationKey();
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;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog;
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;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.extra.LoginContextListener;
@ -95,7 +95,7 @@ public class UserInfoLabel extends UILabel {
private void init(UserInfoPane userInfoPane) {
this.userInfoPane = userInfoPane;
String userName = ConfigManager.getProviderInstance().getBbsUsername();
String userName = ServerConfig.getInstance().getBbsUsername();
this.addMouseListener(userInfoAdapter);
this.setHorizontalAlignment(SwingConstants.CENTER);
this.setText(userName);
@ -240,7 +240,7 @@ public class UserInfoLabel extends UILabel {
@Override
public void mouseClicked(MouseEvent e) {
userName = ConfigManager.getProviderInstance().getBbsUsername();
userName = ServerConfig.getInstance().getBbsUsername();
if (StringUtils.isNotEmpty(userName)) {
UIPopupMenu menu = new UIPopupMenu();
menu.setOnlyText(true);

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

@ -3,8 +3,8 @@
*/
package com.fr.design.mainframe.bbs;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
@ -78,7 +78,7 @@ public class UserInfoPane extends BasicPane{
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override
public void envChanged() {
String username = ConfigManager.getProviderInstance().getBbsUsername();
String username = ServerConfig.getInstance().getBbsUsername();
if (StringUtils.isEmpty(username)){
markUnSignIn();
} else {
@ -133,7 +133,7 @@ public class UserInfoPane extends BasicPane{
FRContext.getLogger().error(e.getMessage());
}
String userName = ConfigManager.getProviderInstance().getBbsUsername();
String userName = ServerConfig.getInstance().getBbsUsername();
if(StringUtils.isNotEmpty(userName)){
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;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.config.ServerConfig;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext;
@ -143,8 +142,8 @@ public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> impleme
*/
public void refreshBeanElement() {
defaultListModel.removeAllElements();
if (ConfigManager.getProviderInstance().hasStyle()) {
Iterator iterato = ConfigManager.getProviderInstance().getStyleNameIterator();
if (ServerConfig.getInstance().hasStyle()) {
Iterator iterato = ServerConfig.getInstance().getStyleNameIterator();
while (iterato.hasNext()) {
String name = (String) iterato.next();
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;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.base.io.IOFile;
import com.fr.base.io.XMLReadHelper;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.general.FRLogLevel;
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");
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
this.username = ConfigManager.getProviderInstance().getBbsUsername();
this.username = ServerConfig.getInstance().getBbsUsername();
this.uuid = envManager.getUUID();
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.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.base.Formula;
import com.fr.base.MultiFieldParameter;
@ -11,6 +10,7 @@ import com.fr.base.TempNameStyle;
import com.fr.base.io.XMLEncryptUtils;
import com.fr.base.process.ProcessOperator;
import com.fr.base.remote.RemoteDeziConstants;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory;
@ -395,8 +395,7 @@ public class DesignerModule extends DesignModule {
public void actionPerformed(ActionEvent e) {
try {
for (int i = 0; i < namelist.size(); i++) {
ConfigManager.getProviderInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
ServerConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE);
}
} catch (Exception ex) {
FRLogger.getLogger().error(ex.getMessage());

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

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

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

@ -1,6 +1,6 @@
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.style.StylePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -35,8 +35,8 @@ public class ReportStylePane extends StylePane {
if (ComparatorUtils.equals(name, "")) {
return;
}
if (ConfigManager.getProviderInstance().getStyle(name) == null) {
ConfigManager.getProviderInstance().putStyle(name, ReportStylePane.this.updateBean());
if (ServerConfig.getInstance().getStyle(name) == null) {
ServerConfig.getInstance().putStyle(name, ReportStylePane.this.updateBean());
} else {
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.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -29,7 +29,7 @@ public class WriteShortCutsPane extends JPanel{
this.add(getFeatureNamePane());
this.add(getHintsPane());
if(!ConfigManager.getProviderInstance().isWriteShortCuts()){
if(!ServerConfig.getInstance().isWriteShortCuts()){
nextColString = "Enter";
nextRowString = "Tab";
switchColRow();
@ -104,13 +104,8 @@ public class WriteShortCutsPane extends JPanel{
nextColString = nextRowString;
nextRowString = temp;
switchColRow();
ConfigManager.getProviderInstance().setWriteShortCuts(ComparatorUtils.equals(nextColString, "Tab"));
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage());
}
ServerConfig.getInstance().setWriteShortCuts(ComparatorUtils.equals(nextColString, "Tab"));
}
};

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

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

@ -3,9 +3,8 @@
*/
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
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.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
import java.io.File;
/**
* Edit Report Server Parameter.
@ -33,7 +30,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
//TODO 表单
// private FormToolBarPane formPane;
private WriteToolBarPane writePane;
private ReportWebAttr webAttr;
private ReportWebConfig webAttr;
private WebCssPane cssPane;
@ -75,12 +72,13 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
return Inter.getLocText("ReportServerP-Report_server_parameter");
}
public void populate(ConfigManagerProvider reportServerConfigManager) {
this.configFileTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
ProjectConstants.RESOURCES_NAME +
File.separator + ConfigManager.getProviderInstance().fileName());
public void populate(ServerConfig reportServerConfig) {
//todo 原来界面上显示的xml路径
// this.configFileTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + reportServerConfig.fileName());
webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
webAttr = (ReportWebConfig) ReportWebConfig.getInstance().clone();
if (webAttr != null) {
pagePane.populateBean(webAttr.getWebPage());
viewPane.populateBean(webAttr.getWebView());
@ -90,18 +88,14 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
jsPane.populate(webAttr);
}
this.errorTemplatePane.populateBean(reportServerConfigManager.getErrorTemplate());
this.errorTemplatePane.populateBean(reportServerConfig.getErrorTemplate());
}
/**
* Update.
*/
public void update(ConfigManagerProvider reportServerConfigManager) {
ReportWebAttr webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (webAttr == null) {
webAttr = new ReportWebAttr();
reportServerConfigManager.putGlobalAttribute(ReportWebAttr.class, webAttr);
}
public void update(ServerConfig reportServerConfig) {
ReportWebConfig webAttr = ReportWebConfig.getInstance();
webAttr.setWebPage(pagePane.updateBean());
webAttr.setWebView(viewPane.updateBean());
webAttr.setWebWrite(writePane.updateBean());
@ -109,7 +103,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
cssPane.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.CustomToolBarButton;
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.Inter;
import com.fr.report.web.button.Export;
@ -201,7 +201,7 @@ public class EditToolBar extends BasicPane {
if (widget instanceof Button) {
String iconname = ((Button) widget).getIconName();
if (StringUtils.isNotBlank(iconname)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname);
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname);
toolBarButton.setIcon(new ImageIcon(iimage));
}
}

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

@ -1,6 +1,6 @@
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
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.WebContent;
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 java.awt.*;
@ -142,11 +144,10 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override
public WebPage updateBean() {
WebPage webPage = new WebPage();
if (this.isUseToolBarCheckBox.isSelected()) {
webPage.setToolBarManagers(this.toolBarManagers);
if (isUseToolBarCheckBox.isSelected()) {
webPage.setToolBarManagers(toolBarManagers);
}else {
webPage.setToolBarManagers(new ToolBarManager[0]);
webPage.setToolBarManagers(new ToolBarManager[0]);
}
for (int i = 0; i < eventPane.update().size(); i++) {
Listener listener = eventPane.update().get(i);
@ -165,7 +166,7 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override
public void editServerToolBarPane() {
final PageToolBarPane serverPageToolBarPane = new PageToolBarPane();
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
if (reportWebAttr != null) {
serverPageToolBarPane.populateBean(reportWebAttr.getWebPage());
}
@ -174,12 +175,19 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override
public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebPage(serverPageToolBarPane.updateBean());
Configurations.update(new Worker() {
@Override
public void run() {
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
reportWebAttr.setWebPage(serverPageToolBarPane.updateBean());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
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.report.web.ToolBarManager;
import com.fr.report.web.WebPage;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UIRadioButton centerRadioButton;
@ -119,7 +119,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
}
@Override
protected WebPage getWebContent(ReportWebAttr reportWebAttr) {
protected WebPage getWebContent(ReportWebConfig reportWebAttr) {
return reportWebAttr == null ? null :reportWebAttr.getWebPage();
}
@ -129,7 +129,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
}
@Override
protected void setWebContent(ReportWebAttr reportWebAttr,WebPage webContent) {
protected void setWebContent(ReportWebConfig reportWebAttr,WebPage 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.BackgroundPane4Browser;
import com.fr.general.Inter;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -18,7 +18,7 @@ import java.awt.*;
* ReportWebAttr Dialog
*/
public class ReportWebAttrPane extends LoadingBasicPane {
private ReportWebAttr reportWebAttr;
private ReportWebConfig reportWebAttr;
private UITabbedPane tabbedPane;
private CommonPane commonPane;
@ -60,9 +60,9 @@ public class ReportWebAttrPane extends LoadingBasicPane {
return Inter.getLocText("FR-Designer_Template_Web_Attributes");
}
public void populate(ReportWebAttr reportWebAttr) {
public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
reportWebAttr = ReportWebConfig.getInstance();
}
this.reportWebAttr = reportWebAttr;
@ -79,7 +79,7 @@ public class ReportWebAttrPane extends LoadingBasicPane {
}
public ReportWebAttr update() {
public ReportWebConfig update() {
reportWebAttr.setPrinter(this.serverPrintPane.update());
pageWeb.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.gui.core.WidgetOption;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetManager;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.stable.StringUtils;
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;
String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconName);
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
setIcon(new ImageIcon(iimage));
}

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

@ -1,6 +1,6 @@
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
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.WebContent;
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 java.awt.*;
@ -113,14 +115,14 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override
public WebView updateBean() {
WebView webView = new WebView();
if (this.isUseToolBarCheckBox.isSelected()) {
webView.setToolBarManagers(this.toolBarManagers);
if (isUseToolBarCheckBox.isSelected()) {
webView.setToolBarManagers(toolBarManagers);
} else {
webView.setToolBarManagers(new ToolBarManager[0]);
}
webView.setSortFuncCheck(this.sortCheckBox.isSelected());
webView.setConditionFuncCheck(this.conditonFilterBox.isSelected());
webView.setListFuncCheck(this.listFilterBox.isSelected());
webView.setSortFuncCheck(sortCheckBox.isSelected());
webView.setConditionFuncCheck(conditonFilterBox.isSelected());
webView.setListFuncCheck(listFilterBox.isSelected());
for (int i = 0; i < eventPane.update().size(); i++) {
Listener listener = eventPane.update().get(i);
webView.addListener(listener);
@ -134,7 +136,7 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override
public void editServerToolBarPane() {
final ViewToolBarPane serverPageToolBarPane = new ViewToolBarPane();
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
if (reportWebAttr != null) {
serverPageToolBarPane.populateBean(reportWebAttr.getWebView());
}
@ -143,12 +145,19 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override
public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebView(serverPageToolBarPane.updateBean());
Configurations.update(new Worker() {
@Override
public void run() {
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
reportWebAttr.setWebView(serverPageToolBarPane.updateBean());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
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.report.web.ToolBarManager;
import com.fr.report.web.WebView;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -73,7 +73,7 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
}
@Override
protected WebView getWebContent(ReportWebAttr reportWebAttr) {
protected WebView getWebContent(ReportWebConfig reportWebAttr) {
return reportWebAttr == null ? null : reportWebAttr.getWebView();
}
@ -83,7 +83,7 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
}
@Override
protected void setWebContent(ReportWebAttr reportWebAttr, WebView webContent) {
protected void setWebContent(ReportWebConfig reportWebAttr, WebView webContent) {
reportWebAttr.setWebView(webContent);
}
@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.stable.CoreConstants;
import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
public class WebCssPane extends BasicPane {
private UITextField localText;
@ -98,7 +98,7 @@ public class WebCssPane extends BasicPane {
return Inter.getLocText("ReportServerP-Import_Css");
}
public void populate(ReportWebAttr reportWebAttr) {
public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) {
centerPane.populateBean(new ArrayList<String>());
return;
@ -113,7 +113,7 @@ public class WebCssPane extends BasicPane {
centerPane.populateBean(list);
}
public void update(ReportWebAttr reportWebAttr) {
public void update(ReportWebConfig reportWebAttr) {
List<String> valueList = centerPane.updateBean();
reportWebAttr.clearCSSImportList();
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.stable.CoreConstants;
import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
public class WebJsPane extends BasicPane {
private UITextField localText;
@ -260,7 +260,7 @@ public class WebJsPane extends BasicPane {
chooseFile.setEnabled(false);
}
public void populate(ReportWebAttr reportWebAttr) {
public void populate(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) {
editingPane.populateBean(new ArrayList<String>());
return;
@ -274,7 +274,7 @@ public class WebJsPane extends BasicPane {
editingPane.populateBean(list);
}
public void update(ReportWebAttr reportWebAttr) {
public void update(ReportWebConfig reportWebAttr) {
List<String> valueList = editingPane.updateBean();
reportWebAttr.clearJSImportList();
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;
import com.fr.base.ConfigManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.icombobox.UIComboBox;
@ -13,9 +12,8 @@ import com.fr.form.event.Listener;
import com.fr.general.Inter;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -24,7 +22,7 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
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[] {
Inter.getLocText("FR-Designer_I_Want_To_Set_Single"),
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();
@Override
public void populateBean(ReportWebAttr reportWebAttr) {
public void populateBean(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {// 如果是空值就说明采用服务器配置了
choseComboBox.removeItemListener(itemListener);
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) {
setWebContent(reportWebAttr, null);
reportWebAttr = is_Null_ReportWebAttr(reportWebAttr) ? null : reportWebAttr;
@ -157,11 +155,11 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
}
@Override
public ReportWebAttr updateBean() {
public ReportWebConfig updateBean() {
return null;
}
private ReportWebAttr TemplateupdateBean(ReportWebAttr reportWebAttr) {
private ReportWebConfig TemplateupdateBean(ReportWebConfig reportWebAttr) {
T webContent = updateSubWebSettingBean();
ToolBarManager[] toolBarManagers = dragToolBarPane.updateBean();
webContent.setToolBarManagers(toolBarManagers);
@ -173,13 +171,13 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
return reportWebAttr;
}
protected abstract T getWebContent(ReportWebAttr reportWebAttr);
protected abstract T getWebContent(ReportWebConfig reportWebAttr);
protected abstract void populateSubWebSettingrBean(T ob);
protected abstract T updateSubWebSettingBean();
protected abstract void setWebContent(ReportWebAttr reportWebAttr, T ob);
protected abstract void setWebContent(ReportWebConfig reportWebAttr, T ob);
protected abstract WidgetOption[] getToolBarInstance();
@ -191,8 +189,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
}
private void populateServerSettings() {
ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
ReportWebAttr reportWebAttr = ((ReportWebAttr)configManager.getGlobalAttribute(ReportWebAttr.class));
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
T webContent = this.getWebContent(reportWebAttr);
if(webContent == null){
return;
@ -217,7 +214,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
*
* @return 模板web属性书否为空
*/
public static boolean is_Null_ReportWebAttr(ReportWebAttr reportWebAttr) {
public static boolean is_Null_ReportWebAttr(ReportWebConfig reportWebAttr) {
if (reportWebAttr == null) {
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.layout.FRGUIPaneFactory;
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.stable.project.ProjectConstants;
@ -40,14 +40,15 @@ public class WidgetManagerPane extends LoadingBasicPane {
return Inter.getLocText("ServerM-Widget_Manager");
}
public void populate(WidgetManagerProvider widgetManager) {
this.widgetTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
ProjectConstants.RESOURCES_NAME +
File.separator + widgetManager.fileName());
public void populate(WidgetInfoConfig widgetManager) {
//todo 原来界面上显示的xml路径
// this.widgetTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + widgetManager.fileName());
this.widgetConfigPane.populate(widgetManager);
}
public void update(WidgetManagerProvider widgetManager) {
public void update(WidgetInfoConfig widgetManager) {
this.widgetConfigPane.update(widgetManager);
}
}

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

@ -1,7 +1,7 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicDialog;
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.WebWrite;
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.*;
@ -251,7 +253,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
@Override
public void editServerToolBarPane() {
final WriteToolBarPane serverPageToolBarPane = new WriteToolBarPane();
ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
if (reportWebAttr != null) {
serverPageToolBarPane.populateBean(reportWebAttr.getWebWrite());
}
@ -260,12 +262,19 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
@Override
public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean());
Configurations.update(new Worker() {
@Override
public void run() {
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance();
reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
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.WebWrite;
import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -180,7 +180,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
}
@Override
protected WebWrite getWebContent(ReportWebAttr reportWebAttr) {
protected WebWrite getWebContent(ReportWebConfig reportWebAttr) {
return reportWebAttr == null ? null : reportWebAttr.getWebWrite();
}
@ -190,7 +190,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
}
@Override
protected void setWebContent(ReportWebAttr reportWebAttr, WebWrite webContent) {
protected void setWebContent(ReportWebConfig reportWebAttr, WebWrite 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.form.ui.UserDefinedWidgetConfig;
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.stable.Nameable;
@ -36,7 +36,7 @@ public class WidgetConfigPane extends JListControlPane {
return "config";
}
public void populate(WidgetManagerProvider widgetManager){
public void populate(WidgetInfoConfig widgetManager){
Iterator<String> nameIt = widgetManager.getWidgetConfigNameIterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
@ -46,7 +46,7 @@ public class WidgetConfigPane extends JListControlPane {
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
public void update(WidgetManagerProvider widgetManager){
public void update(WidgetInfoConfig widgetManager){
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
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++) {
items.add(new Item(reportWidgetInstance[i].optionName(), i));
}
WidgetManagerProvider manager = WidgetManager.getProviderInstance();
WidgetInfoConfig manager = WidgetInfoConfig.getInstance();
java.util.Iterator<String> nameIt = manager.getWidgetConfigNameIterator();
if (userDefined && nameIt.hasNext()) {
items.add(item);

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

@ -1,15 +1,14 @@
package com.fr.design.widget.ui;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter;
import com.fr.base.TableData;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.parameter.ParameterGroup;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
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)) {
groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters));
}
// 全局数据源参数
parameters = new Parameter[0];
Calculator c = Calculator.createCalculator();
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator();
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
TableData tableData = datasourceManager.getTableData(nameIt.next());
TableData tableData = tableDataConfig.getTableData(nameIt.next());
ParameterProvider[] ps = tableData.getParameters(c);
if (!ArrayUtils.isEmpty(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.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle;
import com.fr.base.Utils;
import com.fr.cache.list.IntList;
import com.fr.config.ServerConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
@ -456,10 +456,10 @@ public class CellSelection extends Selection {
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
// richer:add global style menu
popup.add(new CellExpandAttrAction().createMenuItem());
if (!ConfigManager.getProviderInstance().hasStyle()) {
if (!ServerConfig.getInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
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()) {
String name = (String) iterato.next();
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;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog;
@ -371,7 +371,7 @@ public class PreferencePane extends BasicPane {
logLevelPane.add(logLevelComboBox);
logLevelComboBox.addActionListener(new ActionListener() {
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.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(ConfigManager.getProviderInstance().getServerLogLevel()));
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(ServerConfig.getInstance().getServerLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage()));
designerEnvLanguageIndex = designerEnvManager.getLanguage();
@ -631,12 +631,7 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);
}
ConfigManager.getProviderInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel());
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel());
}

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

@ -1,10 +1,7 @@
package com.fr.design.actions.server;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.ModifiedTable;
import com.fr.data.impl.Connection;
import com.fr.dav.LocalEnv;
import com.fr.config.Configuration;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
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.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ConnectionConfig;
import com.fr.general.IOUtils;
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 java.awt.event.ActionEvent;
import java.util.HashMap;
/**
* DatasourceList Action
@ -60,118 +59,126 @@ public class ConnectionListAction extends UpdateAction {
*/
public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
final ConnectionConfig datasourceManager = ConnectionConfig.getInstance();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
public void complete() {
populate(datasourceManager);
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName);
datasourceManager.renameConnection(oldName, newName);
}
};
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
writeFile(datasourceManager);
}
Configurations.update(new Worker() {
@Override
public void run() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
public void doCancel() {
datasourceManager.synchronizedWithServer();
}
});
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
*
* @param datasourceManager datasource管理对象
* @param backupManager datasource管理对象备份
* @param connectionShowPane datasource面板
* @param databaseListDialog datasource管理对话框
* @return boolean 是否更新成功
*/
public static boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager
backupManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) {
connectionShowPane.update(datasourceManager);
HashMap<String, Connection> modifyDetails = datasourceManager.getConnectionModifyDetails();
modifyDetails.clear();
Env currentEnv = FRContext.getCurrentEnv();
ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID());
public static boolean doWithDatasourceManager(ConnectionConfig datasourceManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) {
// HashMap<String, Connection> modifyDetails = datasourceManager.getConnectionModifyDetails();
// modifyDetails.clear();
// Env currentEnv = FRContext.getCurrentEnv();
// ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID());
boolean isFailed = false;
if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
//如果是本地,并且有远程用户时则更新自己的修改表
datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
} else {
if (!currentEnv.isSupportLocalFileOperate()) {
//如果是远程,则去取服务器的最新的修改表,检查有没有冲突
ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION);
if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
//有冲突,进行提示
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);
if (returnVal == JOptionPane.YES_OPTION) {
//点击是,进行相应刷新去冲突
datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION);
//要是有重命名冲突的,则对详细的修改表先进行修改
datasourceManager.doWithConnectionConflict(localModifiedTable);
localModifiedTable.removeConfilct();
modifyDetails.clear();
//更新面板
connectionShowPane.populate(datasourceManager);
} else {
//更新失败,继续停留页面
isFailed = true;
}
}
}
}
// if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
// //如果是本地,并且有远程用户时则更新自己的修改表
// datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
// } else {
// if (!currentEnv.isSupportLocalFileOperate()) {
// //如果是远程,则去取服务器的最新的修改表,检查有没有冲突
// ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION);
// if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
// //有冲突,进行提示
// 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);
// if (returnVal == JOptionPane.YES_OPTION) {
// //点击是,进行相应刷新去冲突
// datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION);
// //要是有重命名冲突的,则对详细的修改表先进行修改
// datasourceManager.doWithConnectionConflict(localModifiedTable);
// localModifiedTable.removeConfilct();
// modifyDetails.clear();
// //更新面板
// connectionShowPane.populate(datasourceManager);
// } else {
// //更新失败,继续停留页面
// isFailed = true;
// }
//
// }
// }
// }
//存在请重命名则不能更新
int index = datasourceManager.isConnectionMapContainsRename();
int index = isConnectionMapContainsRename(datasourceManager);
if (index != -1) {
isFailed = true;
connectionShowPane.setSelectedIndex(index);
}
databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表
if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION);
localModifiedTable.clear();
modifyDetails.clear();
}
// //如果修改成功,则去远程端增量修改修改表
// if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
// currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION);
// localModifiedTable.clear();
// modifyDetails.clear();
// }
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() {
this.setEnabled(true);
}

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

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

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

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

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

@ -3,8 +3,8 @@
*/
package com.fr.design.actions.server;
import com.fr.base.*;
import com.fr.dav.LocalEnv;
import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
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.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig;
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 java.awt.event.ActionEvent;
@ -61,15 +65,24 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
*/
public void actionPerformed(ActionEvent evt) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
final TableDataConfig tableDataConfig = TableDataConfig.getInstance();
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() {
populate(datasourceManager);
populate((TableDataConfig) tableDataConfig.clone());
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName);
protected void renameConnection(final String oldName, final String 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);
@ -78,102 +91,113 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
@Override
public void doOk() {
if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
globalTableDataPane.update(datasourceManager);
if (!doWithDatasourceManager(datasourceManager, backupManager, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
writeFile(datasourceManager);
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
}
Configurations.update(new Worker() {
@Override
public void run() {
if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
globalTableDataPane.update(tableDataConfig);
if (!doWithDatasourceManager(tableDataConfig, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// 刷新共有数据集
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);
}
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
*
* @param datasourceManager
* @param databaseManagerPane
* @param tableDataManagerPane
* @param databaseListDialog
* @return
*/
private boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager backupManager,
TableDataManagerPane tableDataManagerPane, BasicDialog databaseListDialog) {
HashMap<String, TableData> modifyDetails = datasourceManager.getTableDataModifyDetails();
modifyDetails.clear();
Env currentEnv = FRContext.getCurrentEnv();
ModifiedTable localModifiedTable = datasourceManager.checkTableDataModifyTable(backupManager, currentEnv.getUserID());
private boolean doWithDatasourceManager(TableDataConfig datasourceManager, TableDataManagerPane tableDataManagerPane, BasicDialog databaseListDialog) {
// HashMap<String, TableData> modifyDetails = datasourceManager.getTableDataModifyDetails();
// modifyDetails.clear();
// Env currentEnv = FRContext.getCurrentEnv();
// ModifiedTable localModifiedTable = datasourceManager.checkTableDataModifyTable(backupManager, currentEnv.getUserID());
boolean isFailed = false;
if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
//如果是本地,并且有远程用户时则更新自己的修改表
datasourceManager.updateSelfTableDataTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
} else {
if (!currentEnv.isSupportLocalFileOperate()) {
//如果是远程,则去取服务器的最新的修改表,检查有没有冲突
ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.TABLEDATA);
if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
//有冲突,进行提示
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);
if (returnVal == JOptionPane.YES_OPTION) {
//点击是,进行相应刷新去冲突
datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.TABLEDATA);
//要是有重命名冲突的,则对详细的修改表先进行修改
datasourceManager.doWithTableDataConfilct(localModifiedTable);
localModifiedTable.removeConfilct();
modifyDetails.clear();
//更新面板
tableDataManagerPane.populate(datasourceManager);
} else {
//更新失败,继续停留页面
isFailed = true;
}
}
}
}
// if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
// //如果是本地,并且有远程用户时则更新自己的修改表
// datasourceManager.updateSelfTableDataTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
// } else {
// if (!currentEnv.isSupportLocalFileOperate()) {
// //如果是远程,则去取服务器的最新的修改表,检查有没有冲突
// ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.TABLEDATA);
// if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
// //有冲突,进行提示
// 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);
// if (returnVal == JOptionPane.YES_OPTION) {
// //点击是,进行相应刷新去冲突
// datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.TABLEDATA);
// //要是有重命名冲突的,则对详细的修改表先进行修改
// datasourceManager.doWithTableDataConfilct(localModifiedTable);
// localModifiedTable.removeConfilct();
// modifyDetails.clear();
// //更新面板
// tableDataManagerPane.populate(datasourceManager);
// } else {
// //更新失败,继续停留页面
// isFailed = true;
// }
// }
// }
// }
//存在请重命名则不能更新
int index = datasourceManager.isTableDataMapContainsRename();
int index = isTableDataMapContainsRename(datasourceManager);
if (index != -1) {
isFailed = true;
tableDataManagerPane.setSelectedIndex(index);
}
databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表
if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.TABLEDATA);
localModifiedTable.clear();
modifyDetails.clear();
}
// if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
// currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.TABLEDATA);
// localModifiedTable.clear();
// modifyDetails.clear();
// }
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() {
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.FRContext;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
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.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ProcedureConfig;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.awt.event.ActionEvent;
@ -33,25 +35,29 @@ public class ProcedureListAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final ProcedureConfig procedureConfig = ProcedureConfig.getInstance();
final ProcedureManagerPane databaseManagerPane = new ProcedureManagerPane() {
public void complete() {
populate(datasourceManager);
populate((ProcedureConfig)procedureConfig.clone());
}
};
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame,null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(datasourceManager);
// marks:保存数据
try {
FRContext.getCurrentEnv().writeResource(datasourceManager);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
Configurations.update(new Worker() {
@Override
public void run() {
DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(procedureConfig);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ProcedureConfig.class};
}
});
}
});
databaseListDialog.setVisible(true);

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

@ -1,7 +1,7 @@
package com.fr.design.bbs;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.stable.StringUtils;
import java.util.List;
@ -13,9 +13,8 @@ public class BBSLoginUtils {
public static void bbsLogin(String username, String password){
try{
ConfigManager.getProviderInstance().setBbsUsername(username);
ConfigManager.getProviderInstance().setBbsPassword(password);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
ServerConfig.getInstance().setBbsUsername(username);
ServerConfig.getInstance().setBbsPassword(password);
}catch (Exception e){
FRContext.getLogger().error(e.getMessage());
}
@ -26,11 +25,10 @@ public class BBSLoginUtils {
String uid = list.get(0);
String username = list.get(1);
String password = list.get(2);
ConfigManager.getProviderInstance().setBbsUsername(username);
ConfigManager.getProviderInstance().setBbsPassword(password);
ConfigManager.getProviderInstance().setBbsUid(Integer.parseInt(uid));
ConfigManager.getProviderInstance().setInShowBBsName(username);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
ServerConfig.getInstance().setBbsUsername(username);
ServerConfig.getInstance().setBbsPassword(password);
ServerConfig.getInstance().setBbsUid(Integer.parseInt(uid));
ServerConfig.getInstance().setInShowBBsName(username);
}catch (Exception e){
FRContext.getLogger().error(e.getMessage());
}
@ -38,11 +36,10 @@ public class BBSLoginUtils {
public static void bbsLogout(){
try{
ConfigManager.getProviderInstance().setBbsUsername(StringUtils.EMPTY);
ConfigManager.getProviderInstance().setBbsPassword(StringUtils.EMPTY);
ConfigManager.getProviderInstance().setBbsUid(0);
ConfigManager.getProviderInstance().setInShowBBsName(StringUtils.EMPTY);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
ServerConfig.getInstance().setBbsUsername(StringUtils.EMPTY);
ServerConfig.getInstance().setBbsPassword(StringUtils.EMPTY);
ServerConfig.getInstance().setBbsUid(0);
ServerConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
}catch (Exception e){
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.JTemplate;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
@ -317,13 +317,13 @@ public abstract class DesignTableDataManager {
}
private static void addServerData(java.util.Map<String, TableDataWrapper> resMap) {
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
String[] namearray = TableDataFactory.getSortOfChineseNameOfServerData(mgr);
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
String[] namearray = TableDataFactory.getSortOfChineseNameOfServerData(tableDataConfig);
for (String name : namearray) {
if (globalDsCache.containsKey(name)) {
resMap.put(name, globalDsCache.get(name));
} else {
TableDataWrapper tdw = new ServerTableDataWrapper(mgr.getTableData(name), name);
TableDataWrapper tdw = new ServerTableDataWrapper(tableDataConfig.getTableData(name), name);
resMap.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) {
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
ProcedureConfig procedureConfig = ProcedureConfig.getInstance();
String[] namearray = new String[0];
@SuppressWarnings("unchecked")
java.util.Iterator<String> nameIt = mgr.getProcedureNameIterator();
java.util.Iterator<String> nameIt = procedureConfig.getProcedures().keySet().iterator();
while (nameIt.hasNext()) {
namearray = (String[]) ArrayUtils.add(namearray, nameIt.next());
}
Arrays.sort(namearray, Collator.getInstance(java.util.Locale.CHINA));
for (String name : namearray) {
StoreProcedure storeProcedure = mgr.getProcedure(name);
StoreProcedure storeProcedure = procedureConfig.getProcedure(name);
if (globalDsCache.containsKey(name)) {
resMap.put(name, globalDsCache.get(name));
} 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.DesignerFrame;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
@ -179,9 +178,9 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
protected void initDsNameComboBox() {
dsNameComboBox.setRefreshingModel(true);
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
@SuppressWarnings("unchecked")
Iterator<String> datasourceNameIterator = datasourceManager.getConnectionNameIterator();
Iterator<String> datasourceNameIterator = connectionConfig.getConnectionNameIterator();
List<String> dsList = new ArrayList<String>();
while (datasourceNameIterator.hasNext()) {
dsList.add((String) datasourceNameIterator.next());
@ -286,13 +285,13 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
if (StringUtils.isEmpty(selectedDSName)) {
return null; // peter:选中了当前的零长度的节点,直接返回.
}
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
@SuppressWarnings("unchecked")
Iterator<String> datasourceNameIterator = datasourceManager.getConnectionNameIterator();
Iterator<String> datasourceNameIterator = connectionConfig.getConnectionNameIterator();
while (datasourceNameIterator.hasNext()) {
String datasourceName = datasourceNameIterator.next();
if (ComparatorUtils.equals(selectedDSName, datasourceName)) {
return datasourceManager.getConnection(datasourceName);
return connectionConfig.getConnection(datasourceName);
}
}
return null;

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

@ -1,7 +1,7 @@
package com.fr.design.data.datapane;
import com.fr.data.TableDataSource;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import javax.swing.*;
import java.util.Map;
@ -39,9 +39,9 @@ public interface TableDataPaneController {
*/
boolean isNamePermitted();
void populate(DatasourceManagerProvider datasourceManagerProvider);
void populate(TableDataConfig tableDataConfig);
void update(DatasourceManagerProvider datasourceManagerProvider);
void update(TableDataConfig tableDataConfig);
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.NameableCreator;
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.Inter;
import com.fr.general.NameObject;
@ -191,30 +192,30 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
* Populate.
*/
@Override
public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator();
Iterator<String> procedurenameIt = datasourceManager.getProcedureNameIterator();
public void populate(TableDataConfig tableDataConfig) {
Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
Iterator<String> procedurenameIt = ProcedureConfig.getInstance().getProcedures().keySet().iterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
String name = nameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getTableData(name)));
nameObjectList.add(new NameObject(name, tableDataConfig.getTableData(name)));
}
while (procedurenameIt.hasNext()) {
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()]));
}
@Override
public void update(DatasourceManagerProvider datasourceManager) {
datasourceManager.clearAllTableData();
datasourceManager.clearAllProcedure();
public void update(TableDataConfig tableDataConfig) {
tableDataConfig.removeAllTableData();
ProcedureConfig.getInstance().removeAllProcedure();
Nameable[] tableDataArray = this.update();
for (int i = 0; i < tableDataArray.length; 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.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import javax.swing.*;
import java.awt.*;
@ -58,8 +57,8 @@ public class TreeTableDataComboBox extends UIComboBox {
}
// 全局数据集
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
nameIt = mgr.getTableDataNameIterator();
TableDataConfig mgr = TableDataConfig.getInstance();
nameIt = mgr.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
String name = nameIt.next();
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;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
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.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.design.mainframe.DesignerContext;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ItemEvent;
@ -57,8 +60,8 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
protected Iterator<String> items() {
nameList = new ArrayList<String>();
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
Iterator<String> nameIt = mgr.getConnectionNameIterator();
ConnectionConfig mgr = ConnectionConfig.getInstance();
Iterator<String> nameIt = mgr.getConnections().keySet().iterator();
while (nameIt.hasNext()) {
String conName = nameIt.next();
Connection connection = mgr.getConnection(conName);
@ -85,9 +88,8 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
*/
protected void editItems() {
final ConnectionListPane connectionListPane = new ConnectionListPane();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
connectionListPane.populate(datasourceManager);
final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
connectionListPane.populate((ConnectionConfig) connectionConfig.clone());
final BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null);
connectionListDialog.addDialogActionListener(new DialogActionAdapter() {
@ -96,17 +98,24 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connectionListDialog.setDoOKSucceed(false);
return;
}
if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
ConnectionListAction.writeFile(datasourceManager);
}
Configurations.update(new Worker() {
@Override
public void run() {
if (!ConnectionListAction.doWithDatasourceManager(connectionConfig, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
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);

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.NameObjectCreator;
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.Inter;
import com.fr.general.NameObject;
@ -130,15 +130,15 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/**
* Populate.
*
* @param datasourceManager the new datasourceManager.
* @param connectionConfig the new datasourceManager.
*/
public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getConnectionNameIterator();
public void populate(ConnectionConfig connectionConfig) {
Iterator<String> nameIt = connectionConfig.getConnectionNameIterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
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()]));
@ -147,17 +147,17 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/**
* Update.
*/
public void update(DatasourceManagerProvider datasourceManager) {
public void update(ConnectionConfig connectionConfig) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
datasourceManager.clearAllConnection();
connectionConfig.clearAllConnection();
for (int i = 0; i < res_array.length; 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.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ConnectionConfig;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
@ -48,13 +48,13 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
return connectionListPane.getRenameMap();
}
public void populate(DatasourceManagerProvider datasourceManager) {
public void populate(ConnectionConfig datasourceManager) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName());
this.connectionListPane.populate(datasourceManager);
}
public void update(DatasourceManagerProvider datasourceManager) {
public void update(ConnectionConfig 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;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ConnectionConfig;
/**
* Created by yaoh.wu on 2017/4/22.
* 数据链接显示面板
*/
public interface ConnectionShowPane {
void update(DatasourceManagerProvider datasourceManager);
void update(ConnectionConfig connectionConfig);
void populate(DatasourceManagerProvider datasourceManager);
void populate(ConnectionConfig connectionConfig);
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.CheckBoxListSelectionChangeListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import com.fr.general.Inter;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
@ -22,8 +21,8 @@ public class DecoratedTableDataPane extends AbstractTableDataPane<DecoratedTable
public DecoratedTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
java.util.Iterator serverTableDataNameIterator = mgr.getTableDataNameIterator();
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
java.util.Iterator serverTableDataNameIterator = tableDataConfig.getTableDatas().keySet().iterator();
java.util.List<String> tableDataNameList = new java.util.ArrayList<String>();
while (serverTableDataNameIterator.hasNext()) {
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.ToolBarDef;
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.script.Calculator;
import com.fr.stable.ArrayUtils;
@ -167,7 +167,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
}
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());
}

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.NameableCreator;
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.NameObject;
import com.fr.stable.Nameable;
@ -113,16 +113,16 @@ public class ProcedureListPane extends JListControlPane {
/**
* Populate.
*
* @param datasourceManager
* @param procedureConfig
* the new datasourceManager.
*/
public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getProcedureNameIterator();
public void populate(ProcedureConfig procedureConfig) {
Iterator<String> nameIt = procedureConfig.getProcedures().keySet().iterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
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()]));
@ -131,17 +131,17 @@ public class ProcedureListPane extends JListControlPane {
/**
* Update.
*/
public void update(DatasourceManagerProvider datasourceManager) {
public void update(ProcedureConfig procedureConfig) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
datasourceManager.clearAllProcedure();
procedureConfig.removeAllProcedure();
for (int i = 0; i < res_array.length; 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;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ProcedureConfig;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import java.awt.*;
import java.io.File;
public class ProcedureManagerPane extends LoadingBasicPane {
private UITextField connectionTextField;
@ -38,14 +35,15 @@ public class ProcedureManagerPane extends LoadingBasicPane {
return Inter.getLocText("Datasource-Stored_Procedure");
}
public void populate(DatasourceManagerProvider datasourceManager) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName());
this.procedureListPane.populate(datasourceManager);
public void populate(ProcedureConfig procedureConfig) {
//todo 原来界面上显示的xml路径
// this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.procedureListPane.populate(procedureConfig);
}
public void update(DatasourceManagerProvider datasourceManager) {
this.procedureListPane.update(datasourceManager);
public void update(ProcedureConfig procedureConfig) {
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;
import com.fr.base.FRContext;
import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
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.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.Map;
public class TableDataManagerPane extends LoadingBasicPane {
@ -77,14 +74,15 @@ public class TableDataManagerPane extends LoadingBasicPane {
return Inter.getLocText("DS-Server_TableData");
}
public void populate(DatasourceManagerProvider datasourceManager) {
this.tableDataTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName());
this.tableDataPane.populate(datasourceManager);
public void populate(TableDataConfig tableDataConfig) {
//todo 原来界面上显示的xml路径
// this.tableDataTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.tableDataPane.populate(tableDataConfig);
}
public void update(DatasourceManagerProvider datasourceManager) {
this.tableDataPane.update(datasourceManager);
public void update(TableDataConfig tableDataConfig) {
this.tableDataPane.update(tableDataConfig);
}
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.design.data.datapane.TableDataNameObjectCreator;
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.stable.ArrayUtils;
import com.fr.stable.StringUtils;
@ -153,12 +153,12 @@ public abstract class TableDataFactory {
}
@SuppressWarnings("unchecked")
public static String[] getSortOfChineseNameOfServerData(DatasourceManagerProvider mgr) {
public static String[] getSortOfChineseNameOfServerData(TableDataConfig tableDataConfig) {
clearAll();
java.util.Iterator<String> nameIt = mgr.getTableDataNameIterator();
java.util.Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
String name = nameIt.next();
TableData td = mgr.getTableData(name);
TableData td = TableDataConfig.getInstance().getTableData(name);
addName(name, td);
}
return getSortedNameArray();

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

@ -1,7 +1,7 @@
package com.fr.design.extra;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.exe.PluginLoginExecutor;
@ -125,16 +125,16 @@ public class LoginWebBridge {
*/
public void setMessageCount(int count) {
if (count == MIN_MESSAGE_COUNT) {
uiLabel.setText(ConfigManager.getProviderInstance().getBbsUsername());
ConfigManager.getProviderInstance().setInShowBBsName(ConfigManager.getProviderInstance().getBbsUsername());
uiLabel.setText(ServerConfig.getInstance().getBbsUsername());
ServerConfig.getInstance().setInShowBBsName(ServerConfig.getInstance().getBbsUsername());
return;
}
this.messageCount = count;
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(StringUtils.BLANK);
ConfigManager.getProviderInstance().setInShowBBsName(sb.toString());
ServerConfig.getInstance().setInShowBBsName(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;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.extra.tradition.callback.UpdateOnlineCallback;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
@ -188,10 +188,10 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane<List<Plug
}
private void doUpdateOnline(final PluginStatusCheckCompletePane pane) {
if (!StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) {
if (!StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
LoginCheckContext.fireLoginCheckListener();
}
if (StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) {
if (StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
PluginView plugin = controlPane.getSelectedPlugin();
String id = null;
if (plugin != null) {

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

@ -1,7 +1,7 @@
package com.fr.design.extra;
import com.fr.base.ConfigManager;
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.InstallOnlineCallback;
import com.fr.design.extra.exe.callback.JSCallback;
@ -167,7 +167,7 @@ public class PluginOperateUtils {
}
public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) {
String username = ConfigManager.getProviderInstance().getBbsUsername();
String username = ServerConfig.getInstance().getBbsUsername();
if (StringUtils.isEmpty(username)) {
jsCallback.execute(StringUtils.EMPTY);
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;
import com.fr.base.ConfigManager;
import com.fr.config.ServerConfig;
import com.fr.design.extra.tradition.callback.UpdateOnlineCallback;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
@ -171,10 +171,10 @@ public class PluginUpdatePane extends PluginAbstractLoadingViewPane<List<PluginV
}
private void doUpdateOnline(final PluginStatusCheckCompletePane pane) {
if (!StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) {
if (!StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
LoginCheckContext.fireLoginCheckListener();
}
if (StringUtils.isNotEmpty(ConfigManager.getProviderInstance().getBbsUsername())) {
if (StringUtils.isNotEmpty(ServerConfig.getInstance().getBbsUsername())) {
try{
PluginView plugin = controlPane.getSelectedPlugin();
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;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.RestartHelper;
import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog;
@ -422,7 +422,7 @@ public class PluginWebBridge {
*/
public String getLoginInfo(final JSObject callback) {
registerLoginInfo(callback);
return ConfigManager.getProviderInstance().getBbsUsername();
return ServerConfig.getInstance().getBbsUsername();
}
/**
@ -550,11 +550,6 @@ public class PluginWebBridge {
* 通过QQ登录后通知登录
*/
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);
}
@ -562,7 +557,7 @@ public class PluginWebBridge {
* 清除用户信息
*/
public void clearUserInfo() {
ConfigManager.getProviderInstance().setInShowBBsName(StringUtils.EMPTY);
ServerConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
BBSLoginUtils.bbsLogout();
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;
import com.fr.base.FRContext;
import com.fr.file.FunctionManager;
import com.fr.file.FunctionManagerProvider;
import com.fr.function.*;
import com.fr.file.FunctionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
@ -94,7 +92,7 @@ public abstract class FunctionConstants {
@Override
public NameAndDescription[] getDescriptions() {
FunctionManagerProvider funtionManager = FunctionManager.getProviderInstance();
FunctionConfig funtionManager = FunctionConfig.getInstance();
if (funtionManager != null) {
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.layout.FRGUIPaneFactory;
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.NameObject;
import com.fr.stable.Nameable;
import com.fr.stable.ProductConstants;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.script.FunctionDef;
@ -63,10 +62,11 @@ public class FunctionManagerPane extends BasicPane {
/**
* Populate.
*/
public void populate(FunctionManagerProvider functionManager) {
this.functionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator
+ ProjectConstants.RESOURCES_NAME
+ File.separator + functionManager.fileName());
public void populate(FunctionConfig functionManager) {
//todo 原来界面上显示的xml路径
// this.functionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator
// + ProjectConstants.RESOURCES_NAME
// + File.separator + functionManager.fileName());
List<NameObject> nameObjectList = new ArrayList<NameObject>();
for (int i = 0; i < functionManager.getFunctionDefCount(); i++) {
@ -80,7 +80,7 @@ public class FunctionManagerPane extends BasicPane {
/**
* Update.
*/
public void update(FunctionManagerProvider functionManager) {
public void update(FunctionConfig functionManager) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.functionControlPane.update();
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;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.base.ConfigManagerProvider;
import com.fr.plugin.ExtraClassManager;
import com.fr.script.ScriptConstants;
import com.fr.stable.ArrayUtils;
@ -94,8 +93,8 @@ public abstract class VariableResolverAdapter implements VariableResolver {
*/
public String[] resolveGlobalParameterVariables() {
// 加上全局的参数
ConfigManagerProvider reportServerManager = ConfigManager.getProviderInstance();
Parameter[] globalParameters = reportServerManager.getGlobal_Parameters();
ServerConfig reportServerManager = ServerConfig.getInstance();
Parameter[] globalParameters = reportServerManager.getGlobeParameters();
List<String> variablesList = new ArrayList<String>();
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() {
java.util.List<WidgetOption> list = new ArrayList<WidgetOption>();
WidgetManagerProvider mgr = WidgetManager.getProviderInstance();
WidgetInfoConfig mgr = WidgetInfoConfig.getInstance();
java.util.Iterator<String> nameIt = mgr.getWidgetConfigNameIterator();
while (nameIt.hasNext()) {
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.constants.UIConstants;
import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
@ -86,7 +85,7 @@ public class TableViewList extends UIList {
@Override
protected Void doInBackground() throws Exception {
Connection datasource = DatasourceManager.getProviderInstance().getConnection(databaseName);
Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName);
boolean status = false;
int count = 3;
//总共给3次连接的机会
@ -127,8 +126,7 @@ public class TableViewList extends UIList {
*/
private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception {
DefaultListModel defaultListModel = new DefaultListModel();
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
Connection datasource = datasourceManager.getConnection(databaseName);
Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName);
if (datasource == null) {
return defaultListModel;
}

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

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

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

@ -1,6 +1,6 @@
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.constants.UIConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -51,7 +51,7 @@ public class EmailPane extends FurtherBasicBeanPane<EmailJavaScript> {
initCenterPane(mainTextLabel, scrollPane, fill, preferred);
this.add(centerPane, BorderLayout.CENTER);
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) {
showTplContent.setSelected(ob ==null ? false: ob.isShowTplContent());
}
checkEmailConfig(ConfigManager.getProviderInstance().getEmailManager().isEmailConfigValid());
checkEmailConfig(EmailConfig.getInstance().isEmailConfigValid());
}
@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;
}
if (BaseUtils.isAuthorityEditing()) {
//触发保存服务器工具栏
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage());
}
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
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;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory;
@ -129,7 +129,7 @@ public class DesignerLogHandler {
@Override
public void actionPerformed(ActionEvent e) {
JPopupMenu showsetPopup = new JPopupMenu();
int logLevelvalue = ConfigManager.getProviderInstance().getServerLogLevel().intValue();
int logLevelvalue = ServerConfig.getInstance().getServerLogLevel().intValue();
if (logLevelvalue <= INFO_INT) {
showsetPopup.add(showInfo);
showsetPopup.add(showError);

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

@ -1,8 +1,8 @@
package com.fr.design.mainframe.templateinfo;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.base.io.IOFile;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
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) {
HashMap<String, Object> consumingMap = new HashMap<>();
String username = ConfigManager.getProviderInstance().getBbsUsername();
String username = ServerConfig.getInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID();
String activitykey = DesignerEnvManager.getEnvManager().getActivationKey();
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;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.widget.editors.ITextComponent;
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.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.form.ui.WidgetManager;
import javax.swing.*;
import java.awt.*;
public class AccessibleIconEditor extends UneditableAccessibleEditor {
@ -39,13 +34,6 @@ public class AccessibleIconEditor extends UneditableAccessibleEditor {
public void doOk() {
setValue(customIconPane.update());
fireStateChanged();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(WidgetManager.getProviderInstance());
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
}
});
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.Icon;
import com.fr.base.IconManager;
import com.fr.form.ui.WidgetManager;
import javax.swing.*;
import com.fr.form.ui.WidgetInfoConfig;
public class IconCellRenderer extends GenericCellRenderer {
private Image img;
@ -20,7 +18,7 @@ public class IconCellRenderer extends GenericCellRenderer {
@Override
public void setValue(Object v) {
try {
Icon icon = WidgetManager.getProviderInstance().getIconManager().getIcon(v);
Icon icon = WidgetInfoConfig.getInstance().getIconManager().getIcon(v);
this.setImage(icon == null ? null : icon.getImage());
} catch (CloneNotSupportedException e) {
this.setImage(null);

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

@ -1,7 +1,7 @@
package com.fr.design.parameter;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter;
import com.fr.config.ServerConfig;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
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.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
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() {
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
Parameter[] parameters = configManager.getGlobal_Parameters();
Parameter[] parameters = ServerConfig.getInstance().getGlobeParameters();
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();

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

@ -1,12 +1,12 @@
package com.fr.design.parameter;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
@ -39,15 +39,16 @@ public class ParameterManagerPane extends BasicPane {
return Inter.getLocText("M_Server-Global_Parameters");
}
public void populate(ConfigManagerProvider configManager) {
this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
ProjectConstants.RESOURCES_NAME +
File.separator + configManager.fileName());
this.parameterArrayPane.populate(configManager.getGlobal_Parameters());
public void populate(ServerConfig configManager) {
//todo 原来界面上显示的xml路径
// this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + configManager.fileName());
this.parameterArrayPane.populate(configManager.getGlobeParameters());
}
public void update(ConfigManagerProvider configManager) {
configManager.setGlobal_Parameters(parameterArrayPane.updateParameters());
public void update(ServerConfig configManager) {
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.mainframe.DesignerContext;
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.Inter;
import com.fr.stable.Constants;
@ -106,7 +106,7 @@ public class CustomIconPane extends BasicPane {
private void initIcons() {
iconButtonMap = new ListMap();
iconManager = WidgetManager.getProviderInstance().getIconManager();
iconManager = WidgetInfoConfig.getInstance().getIconManager();
bg = new ButtonGroup();
Object[] names = iconManager.getIconNames();
Object name = null;
@ -315,7 +315,7 @@ public class CustomIconPane extends BasicPane {
this.addActionListener(this);
this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.setBorder(null);
this.iconImage = WidgetManager.getProviderInstance().getIconManager().getIconImage(name);
this.iconImage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(name);
this.setToolTipText(iconName);
}
@ -408,7 +408,7 @@ public class CustomIconPane extends BasicPane {
if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) {
return;
}
if (WidgetManager.getProviderInstance().getIconManager().contains(nameTextField.getText())) {
if (WidgetInfoConfig.getInstance().getIconManager().contains(nameTextField.getText())) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Custom_Icon_Message3"),
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.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.form.ui.WidgetManager;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter;
import javax.swing.*;
@ -49,13 +49,6 @@ public class IconDefinePane extends BasicPane {
curIconName = cip.update();
setShowIconImage();
IconDefinePane.this.repaint();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(WidgetManager.getProviderInstance());
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
}
});
editDialog.setVisible(true);
@ -82,7 +75,7 @@ public class IconDefinePane extends BasicPane {
}
private void setShowIconImage() {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(curIconName);
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(curIconName);
if (iimage != null) {
showIconImageLable.setIcon(new ImageIcon(iimage));
} 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.DesignerFrameFileDealerPane;
import com.fr.file.CacheManager;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ConnectionConfig;
import com.fr.file.TableDataConfig;
import com.fr.file.filetree.FileNode;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
@ -1060,7 +1060,7 @@ public class RemoteEnv extends AbstractEnv {
* DataSource中去除当前角色没有权限访问的数据源
*/
public void removeNoPrivilegeConnection() {
DatasourceManagerProvider dm = DatasourceManager.getProviderInstance();
TableDataConfig dm = TableDataConfig.getInstance();
try {
HashMap<String, String> para = new HashMap<String, String>();
@ -1075,8 +1075,8 @@ public class RemoteEnv extends AbstractEnv {
ArrayList<String> toBeRemoveTDName = new ArrayList<String>();
for (int i = 0; i < ja.length(); i++) {
String toBeRemoveConnName = (String) ((JSONObject) ja.get(i)).get("name");
dm.removeConnection(toBeRemoveConnName);
Iterator it = dm.getTableDataNameIterator();
ConnectionConfig.getInstance().removeConnection(toBeRemoveConnName);
Iterator it = dm.getTableDatas().keySet().iterator();
while (it.hasNext()) {
String tdName = (String) it.next();
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.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.general.GeneralContext;
@ -24,7 +25,7 @@ public class ChartMapEditorAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) {
int port = DesignerEnvManager.getEnvManager().getJettyServerPort();
String web = GeneralContext.getCurrentAppNameOfEnv();
String serverlet = com.fr.base.ConfigManager.getProviderInstance().getServletMapping();
String serverlet = ServerConfig.getInstance().getServletMapping();
Env env = FRContext.getCurrentEnv();
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() {
if (editor == null) {
WidgetManagerProvider widgetManager = WidgetManager.getProviderInstance();
WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance();
WidgetConfig wc = widgetManager.getWidgetConfig(toData().getName());
Widget widget;
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) {
String iconname = ((Button) widget).getIconName();
if (StringUtils.isNotBlank(iconname)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname);
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname);
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]);
}
}
WidgetManagerProvider mgr = WidgetManager.getProviderInstance();
WidgetInfoConfig mgr = WidgetInfoConfig.getInstance();
Iterator<String> nameIt = mgr.getWidgetConfigNameIterator();
while (nameIt.hasNext()) {
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]);
}
}
WidgetManagerProvider mgr = WidgetManager.getProviderInstance();
WidgetInfoConfig mgr = WidgetInfoConfig.getInstance();
Iterator<String> nameIt = mgr.getWidgetConfigNameIterator();
while (nameIt.hasNext()) {
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.utils.gui.GUIPaintUtils;
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.StringUtils;
@ -36,7 +36,7 @@ public class FormToolBarButton extends JButton implements MouseListener {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconName);
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
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.gui.icombobox.UIComboBox;
import com.fr.form.ui.WidgetManager;
import com.fr.form.ui.WidgetManagerProvider;
import com.fr.form.ui.WidgetInfoConfig;
import javax.swing.*;
import java.awt.*;
@ -18,7 +17,7 @@ public class NameWidgetComboboxEditor extends AbstractPropertyEditor {
public NameWidgetComboboxEditor() {
Vector<String> items = new Vector<String>();
WidgetManagerProvider manager = WidgetManager.getProviderInstance();
WidgetInfoConfig manager = WidgetInfoConfig.getInstance();
java.util.Iterator<String> nameIt = manager.getWidgetConfigNameIterator();
while (nameIt.hasNext()) {
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;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.Parameter;
import com.fr.base.TableData;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.parameter.ParameterGroup;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
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)) {
groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters));
}
// 全局数据源参数
parameters = new Parameter[0];
Calculator c = Calculator.createCalculator();
DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator();
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
TableData tableData = datasourceManager.getTableData(nameIt.next());
TableData tableData = tableDataConfig.getTableData(nameIt.next());
ParameterProvider[] ps = tableData.getParameters(c);
if (!ArrayUtils.isEmpty(ps)) {
parameters = (Parameter[])ArrayUtils.addAll(parameters, ps);

Loading…
Cancel
Save