Browse Source

REPORT-6956 设计器适配10.0配置写法

master
kerry 7 years ago
parent
commit
e6cd7b892f
  1. 4
      designer_base/src/com/fr/design/data/datapane/ChoosePane.java
  2. 6
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java
  3. 8
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

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

@ -180,7 +180,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
dsNameComboBox.setRefreshingModel(true);
ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
@SuppressWarnings("unchecked")
Iterator<String> datasourceNameIterator = connectionConfig.getConnectionNameIterator();
Iterator<String> datasourceNameIterator = connectionConfig.getConnections().keySet().iterator();
List<String> dsList = new ArrayList<String>();
while (datasourceNameIterator.hasNext()) {
dsList.add((String) datasourceNameIterator.next());
@ -287,7 +287,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
}
ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
@SuppressWarnings("unchecked")
Iterator<String> datasourceNameIterator = connectionConfig.getConnectionNameIterator();
Iterator<String> datasourceNameIterator = connectionConfig.getConnections().keySet().iterator();
while (datasourceNameIterator.hasNext()) {
String datasourceName = datasourceNameIterator.next();
if (ComparatorUtils.equals(selectedDSName, datasourceName)) {

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

@ -133,7 +133,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
* @param connectionConfig the new datasourceManager.
*/
public void populate(ConnectionConfig connectionConfig) {
Iterator<String> nameIt = connectionConfig.getConnectionNameIterator();
Iterator<String> nameIt = connectionConfig.getConnections().keySet().iterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
@ -153,11 +153,11 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
connectionConfig.clearAllConnection();
connectionConfig.removeAllConnection();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
connectionConfig.putConnection(nameObject.getName(), (Connection) nameObject.getObject());
connectionConfig.addConnection(nameObject.getName(), (Connection) nameObject.getObject());
}
}
}

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

@ -1,17 +1,14 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.ConnectionConfig;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.HashMap;
public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane {
@ -49,8 +46,9 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
}
public void populate(ConnectionConfig datasourceManager) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName());
//todo 原来界面上显示的xml路径
// this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.connectionListPane.populate(datasourceManager);
}

Loading…
Cancel
Save