Browse Source

无JIRA任务 ServerConfig进一步拆分

master
ju 7 years ago
parent
commit
fc45e3d1de
  1. 4
      designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java
  2. 3
      designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java
  3. 5
      designer_base/src/com/fr/design/formula/VariableResolverAdapter.java
  4. 3
      designer_base/src/com/fr/design/parameter/ParameterArrayPane.java
  5. 12
      designer_base/src/com/fr/design/parameter/ParameterManagerPane.java
  6. 4
      designer_form/src/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java

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

@ -2,8 +2,8 @@ package com.fr.design.widget.ui;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -154,7 +154,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
} }
// 全局参数 // 全局参数
parameters = ServerConfig.getInstance().getGlobalParameters(); parameters = ParameterConfig.getInstance().getGlobalParameters();
if (!ArrayUtils.isEmpty(parameters)) { if (!ArrayUtils.isEmpty(parameters)) {
groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters)); groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters));
} }

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

@ -4,6 +4,7 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ParameterConfig;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.ServerConfig; import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
@ -47,7 +48,7 @@ public class GlobalParameterAction extends UpdateAction {
//marks:读取服务器配置信息 //marks:读取服务器配置信息
final ServerConfig configManager = ServerConfig.getInstance(); final ServerConfig configManager = ServerConfig.getInstance();
parameterManagerPane.populate(configManager.mirror()); parameterManagerPane.populate(ParameterConfig.getInstance().getGlobalParameters());
parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() { parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.update(new Worker() {

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

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

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

@ -1,6 +1,7 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.config.ServerConfig; import com.fr.config.ServerConfig;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
@ -31,7 +32,7 @@ public class ParameterArrayPane extends JListControlPane {
}); });
this.addEditingListner( new PropertyChangeAdapter() { this.addEditingListner( new PropertyChangeAdapter() {
public void propertyChange() { public void propertyChange() {
Parameter[] parameters = ServerConfig.getInstance().getGlobalParameters(); Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters();
String[] allListNames = nameableList.getAllNames(); String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName(); String tempName = getEditingName();

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

@ -1,6 +1,7 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.config.ServerConfig; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -36,16 +37,17 @@ public class ParameterManagerPane extends BasicPane {
return Inter.getLocText("M_Server-Global_Parameters"); return Inter.getLocText("M_Server-Global_Parameters");
} }
public void populate(ServerConfig configManager) { public void populate(Parameter[] parameters) {
//todo 原来界面上显示的xml路径 //todo 原来界面上显示的xml路径
// this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + // this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME + // ProjectConstants.RESOURCES_NAME +
// File.separator + configManager.fileName()); // File.separator + configManager.fileName());
this.parameterArrayPane.populate(configManager.getGlobalParameters()); this.parameterArrayPane.populate(parameters);
} }
public void update(ServerConfig configManager) { public void update() {
configManager.setGlobeParameters(parameterArrayPane.updateParameters());
ParameterConfig.getInstance().setGlobeParameters(parameterArrayPane.updateParameters());
} }
/** /**

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

@ -2,8 +2,8 @@ package com.fr.design.widget.ui.designer;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -152,7 +152,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
} }
// 全局参数 // 全局参数
parameters = ServerConfig.getInstance().getGlobalParameters(); parameters = ParameterConfig.getInstance().getGlobalParameters();
if (!ArrayUtils.isEmpty(parameters)) { if (!ArrayUtils.isEmpty(parameters)) {
groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters)); groupList.add(new ParameterGroup(Inter.getLocText("M_Server-Global_Parameters"), parameters));
} }

Loading…
Cancel
Save