Browse Source

Pull request #12431: REPORT-100195 数据连接信息配置更新

Merge in DESIGN/design from ~BRYANT/design:research/11.0 to research/11.0

* commit 'ead037e0b962908ca7d2d5e56f3816c1ea757a27':
  REPORT-100195 数据连接信息配置更新
research/11.0
Bryant-赵东升 1 year ago
parent
commit
0affb4fb31
  1. 42
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  2. 9
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  3. 6
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneController.java
  4. 16
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  5. 17
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java
  6. 7
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DecoratedTableDataPane.java
  7. 10
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java
  8. 6
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java
  9. 4
      designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java
  10. 11
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java
  11. 9
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java
  12. 9
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java
  13. 10
      designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java

42
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -1,8 +1,6 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.server;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.TableData;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
@ -14,7 +12,6 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.editlock.ServerTableDataLockChangeChecker;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.imenu.UILockMenuItem;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.mainframe.DesignerContext;
@ -23,7 +20,6 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.file.TableDataConfig;
import com.fr.report.LockItem;
@ -79,12 +75,10 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
}
// 锁定成功,执行后续操作
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final TableDataConfig tableDataConfig = TableDataConfig.getInstance();
final Map<String, TableData> tableDataMap = TableDataConfigProviderFactory.getInstance().getTableDatas();
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() {
TableDataConfig mirror = tableDataConfig.mirror();
populate(mirror);
populate(tableDataMap);
}
protected void renameConnection(final String oldName, final String newName) {
@ -102,10 +96,10 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
globalTableDataDialog.setDoOKSucceed(false);
return;
}
globalTableDataPane.update(tableDataConfig);
globalTableDataPane.update(tableDataMap);
DesignTableDataManager.clearGlobalDs();
// 保存时 移除服务器数据集列名缓存
for (String name : tableDataConfig.getTableDatas().keySet()) {
for (String name : tableDataMap.keySet()) {
DesignTableDataManager.removeSelectedColumnNames(name);
}
// 刷新共有数据集
@ -125,32 +119,6 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
globalTableDataDialog.setVisible(true);
}
private boolean doWithDatasourceManager(TableDataConfig datasourceManager, TableDataManagerPane tableDataManagerPane, BasicDialog databaseListDialog) {
boolean isFailed = false;
//
//存在请重命名则不能更新
int index = isTableDataMapContainsRename(datasourceManager);
if (index != -1) {
isFailed = true;
tableDataManagerPane.setSelectedIndex(index);
}
databaseListDialog.setDoOKSucceed(!isFailed);
return !isFailed;
}
/**
* 是否包含重命名key
*
* @return 包含则返回序列 ,若返回-1则说明不包含重命名key
*/
public int isTableDataMapContainsRename(TableDataConfig datasourceManager) {
Map<String, TableData> tableDataMap = datasourceManager.getTableDatas();
if (tableDataMap.containsKey(NameInspector.ILLEGAL_NAME_HOLDER)) {
return datasourceManager.getTableDataIndex(NameInspector.ILLEGAL_NAME_HOLDER);
}
return -1;
}
public void update() {
this.setEnabled(true);
}

9
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -1,5 +1,6 @@
package com.fr.design.data;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.StoreProcedureParameter;
import com.fr.base.TableData;
import com.fr.concurrent.NamedThreadFactory;
@ -28,7 +29,6 @@ import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.parameter.ParameterInputPane;
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;
@ -310,7 +310,7 @@ public abstract class DesignTableDataManager {
names.add(entry.getKey());
}
//服务器数据集
Map<String, TableData> tableDatas = TableDataConfig.getInstance().getTableDatas();
Map<String, TableData> tableDatas = TableDataConfigProviderFactory.getInstance().getTableDatas();
for (Map.Entry<String, TableData> entry : tableDatas.entrySet()) {
names.add(entry.getKey());
}
@ -442,13 +442,12 @@ public abstract class DesignTableDataManager {
}
private static void addServerData(java.util.Map<String, TableDataWrapper> resMap) {
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
String[] namearray = TableDataFactory.getSortOfChineseNameOfServerData(tableDataConfig);
String[] namearray = TableDataFactory.getSortOfChineseNameOfServerData();
for (String name : namearray) {
if (globalDsCache.containsKey(name)) {
resMap.put(name, globalDsCache.get(name));
} else {
TableDataWrapper tdw = new ServerTableDataWrapper(tableDataConfig.getTableData(name), name);
TableDataWrapper tdw = new ServerTableDataWrapper(TableDataConfigProviderFactory.getInstance().getTableData(name), name);
resMap.put(name, tdw);
globalDsCache.put(name, tdw);
}

6
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneController.java

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

16
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -2,7 +2,6 @@ package com.fr.design.data.datapane;
import com.fr.base.TableData;
import com.fr.base.TableDataBean;
import com.fr.config.remote.RemoteConfigEvent;
import com.fr.data.MultiResultTableData;
import com.fr.data.TableDataSource;
import com.fr.design.data.BasicTableDataUtils;
@ -12,9 +11,7 @@ import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher;
import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig;
import com.fr.file.TableDataOperator;
import com.fr.file.TableDataOperatorImpl;
import com.fr.general.ComparatorUtils;
@ -218,13 +215,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
* Populate.
*/
@Override
public void populate(TableDataConfig tableDataConfig) {
Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
public void populate(Map<String, TableData> tableDataMap) {
Iterator<String> nameIt = tableDataMap.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, tableDataConfig.getTableData(name)));
nameObjectList.add(new NameObject(name, tableDataMap.get(name)));
}
while (procedurenameIt.hasNext()) {
String name = procedurenameIt.next();
@ -235,7 +232,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}
@Override
public void update(TableDataConfig tableDataConfig) {
public void update(Map<String, TableData> tableDataMap) {
Nameable[] tableDataArray = this.update();
List<TableDataBean> tableDataBeans = new ArrayList<>();
Map<String, String> map = MapUtils.invertMap(getDsNameChangedMap());
@ -254,10 +251,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
// 走老的方式
return saveByOldWay(tableDataBeans);
}
}).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans);
if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace());
}
}).saveTableData(new ArrayList<>(tableDataMap.keySet()), tableDataBeans);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

17
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java

@ -1,5 +1,7 @@
package com.fr.design.data.datapane;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.RecursionTableData;
import com.fr.design.data.DesignTableDataManager;
@ -8,11 +10,11 @@ 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.TableDataConfig;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.util.Map;
public class TreeTableDataComboBox extends UIComboBox {
private static final long serialVersionUID = 1L;
@ -59,14 +61,13 @@ public class TreeTableDataComboBox extends UIComboBox {
}
// 全局数据集
TableDataConfig mgr = TableDataConfig.getInstance();
nameIt = mgr.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
String name = nameIt.next();
if(mgr.getTableData(name) instanceof RecursionTableData) {
ServerTableDataWrapper serverTableDataWrappe = new ServerTableDataWrapper(mgr.getTableData(name), name);
Map<String, TableData> map = TableDataConfigProviderFactory.getInstance().getTableDatas();
for (Map.Entry<String, TableData> entry : map.entrySet()) {
TableData tableData = entry.getValue();
if (tableData instanceof RecursionTableData) {
ServerTableDataWrapper serverTableDataWrappe = new ServerTableDataWrapper(tableData, entry.getKey());
model.addElement(serverTableDataWrappe);
res_map.put(name, serverTableDataWrappe);
res_map.put(entry.getKey(), serverTableDataWrappe);
}
}
}

7
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DecoratedTableDataPane.java

@ -1,11 +1,11 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.data.impl.DecoratedTableData;
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.TableDataConfig;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.log.FineLoggerFactory;
@ -19,9 +19,8 @@ public class DecoratedTableDataPane extends AbstractTableDataPane<DecoratedTable
public DecoratedTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
java.util.Iterator serverTableDataNameIterator = tableDataConfig.getTableDatas().keySet().iterator();
java.util.Iterator serverTableDataNameIterator = TableDataConfigProviderFactory.getInstance().getTableDatas().keySet().iterator();
java.util.List<String> tableDataNameList = new java.util.ArrayList<String>();
while (serverTableDataNameIterator.hasNext()) {
tableDataNameList.add((String)serverTableDataNameIterator.next());

10
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.TableData;
import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.datapane.TableDataPaneController;
@ -7,7 +8,6 @@ import com.fr.design.data.datapane.TableDataPaneListPane;
import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.TableDataConfig;
import javax.swing.*;
@ -70,15 +70,15 @@ public class TableDataManagerPane extends LoadingBasicPane {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData");
}
public void populate(TableDataConfig tableDataConfig) {
public void populate(Map<String, TableData> tableDataMap) {
//todo 原来界面上显示的xml路径
// this.tableDataTextField.setText(WorkContext.getCurrent().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.tableDataPane.populate(tableDataConfig);
this.tableDataPane.populate(tableDataMap);
}
public void update(TableDataConfig tableDataConfig) {
this.tableDataPane.update(tableDataConfig);
public void update(Map<String, TableData> tableDataMap) {
this.tableDataPane.update(tableDataMap);
}
public Map<String, String> getDsChangedNameMap () {

6
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.wrapper;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.ClassTableData;
@ -21,7 +22,6 @@ import com.fr.design.data.tabledata.tabledatapane.FileTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.ProcedureDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -174,14 +174,14 @@ public abstract class TableDataFactory {
}
@SuppressWarnings("unchecked")
public static String[] getSortOfChineseNameOfServerData(TableDataConfig tableDataConfig) {
public static String[] getSortOfChineseNameOfServerData() {
clearAll();
try {
UserAuthority userAuthority = WorkContext.getCurrent().get(UserAuthority.class);
Iterator<String> nameIt = userAuthority.getAuthServerDataSetNames().iterator();
while (nameIt.hasNext()) {
String name = nameIt.next();
addName(name, tableDataConfig.getTableData(name));
addName(name, TableDataConfigProviderFactory.getInstance().getTableData(name));
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

4
designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java

@ -2,13 +2,13 @@ package com.fr.design.mainframe.authority;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.CloneCollector;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.TableDataConfig;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.WorkContext;
@ -47,7 +47,7 @@ public class JTemplateAuthorityChecker {
private void initAuthNames() {
allDatasetNames = new HashSet<>();
for (String authServerDataSetName : TableDataConfig.getInstance().getTableDatas().keySet()) {
for (String authServerDataSetName : TableDataConfigProviderFactory.getInstance().getTableDatas().keySet()) {
allDatasetNames.add(authServerDataSetName);
}

11
designer-form/src/main/java/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.designer;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.BaseUtils;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
@ -8,7 +9,6 @@ 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.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.script.Calculator;
@ -24,8 +24,8 @@ import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 控件设置面板的控件名下拉框里面是所有参数的名字
@ -159,10 +159,9 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
// 全局数据源参数
parameters = new Parameter[0];
Calculator c = Calculator.createCalculator();
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
TableData tableData = tableDataConfig.getTableData(nameIt.next());
Map<String, TableData> tableDataMap = TableDataConfigProviderFactory.getInstance().getTableDatas();
for (Map.Entry<String, TableData> entry : tableDataMap.entrySet()) {
TableData tableData = entry.getValue();
ParameterProvider[] ps = tableData.getParameters(c);
if (!ArrayUtils.isEmpty(ps)) {
parameters = (Parameter[])ArrayUtils.addAll(parameters, ps);

9
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.replace.action.content.formula.data;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.data.TableDataSource;
import com.fr.design.actions.replace.action.content.formula.SearchFormula;
import com.fr.design.actions.replace.info.FormulaInfo;
@ -7,7 +8,6 @@ import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.data.tabledata.wrapper.TableDataFactory;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.TableDataConfig;
import java.util.Iterator;
import java.util.List;
@ -36,8 +36,7 @@ public class SearchDataFormulaAction implements SearchFormula {
}
private void dealServerData(List<FormulaInfo> fomulaInfos) {
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
String[] nameArray = TableDataFactory.getSortOfChineseNameOfServerData(tableDataConfig);
String[] nameArray = TableDataFactory.getSortOfChineseNameOfServerData();
for (String dataName : nameArray) {
ITContent content = new ITContent();
content.addOtherPos(
@ -46,9 +45,9 @@ public class SearchDataFormulaAction implements SearchFormula {
);
content.setJumpAble(false);
content.setShowObject(Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData"));
DataType dataType = DataType.match(tableDataConfig.getTableData(dataName).getClass().getSimpleName());
DataType dataType = DataType.match(TableDataConfigProviderFactory.getInstance().getTableData(dataName).getClass().getSimpleName());
if (dataType != null) {
dataType.searchFormula(tableDataConfig.getTableData(dataName), content, fomulaInfos);
dataType.searchFormula(TableDataConfigProviderFactory.getInstance().getTableData(dataName), content, fomulaInfos);
}
}
}

9
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.replace.action.content.sql;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.data.TableDataSource;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.replace.action.SearchAction;
@ -9,7 +10,6 @@ import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.data.tabledata.wrapper.TableDataFactory;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.TableDataConfig;
import com.fr.stable.AssistUtils;
import java.util.ArrayList;
@ -49,17 +49,16 @@ public class SearchSQLAction implements SearchAction {
* @param sqlInfos
*/
private void addServerDataInfos2Array(ITContent content, List<SQLInfo> sqlInfos) {
TableDataConfig tableDataConfig = TableDataConfig.getInstance();
String[] nameArray = TableDataFactory.getSortOfChineseNameOfServerData(tableDataConfig);
String[] nameArray = TableDataFactory.getSortOfChineseNameOfServerData();
for (String dataName : nameArray) {
if (tableDataConfig.getTableData(dataName) instanceof DBTableData) {
if (TableDataConfigProviderFactory.getInstance().getTableData(dataName) instanceof DBTableData) {
ITContent newContent = ITContent.copy(content);
newContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData"),
dataName
);
newContent.setShowObject(Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData"));
newContent.setReplaceObject(tableDataConfig.getTableData(dataName));
newContent.setReplaceObject(TableDataConfigProviderFactory.getInstance().getTableData(dataName));
sqlInfos.add(new SQLInfo(newContent));
}

10
designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.BaseUtils;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
@ -8,7 +9,6 @@ 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.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.script.Calculator;
@ -27,6 +27,7 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 控件设置面板的控件名下拉框里面是所有参数的名字
@ -161,10 +162,9 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
// 全局数据源参数
parameters = new Parameter[0];
Calculator c = Calculator.createCalculator();
TableDataConfig tableDataConfig = TableDataConfig.getInstance().mirror();
Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
while (nameIt.hasNext()) {
TableData tableData = tableDataConfig.getTableData(nameIt.next());
Map<String, TableData> tableDataMap = TableDataConfigProviderFactory.getInstance().getTableDatas();
for (Map.Entry<String, TableData> entry : tableDataMap.entrySet()) {
TableData tableData = entry.getValue();
ParameterProvider[] ps = tableData.getParameters(c);
if (!ArrayUtils.isEmpty(ps)) {
parameters = (Parameter[])ArrayUtils.addAll(parameters, ps);

Loading…
Cancel
Save