|
|
|
@ -14,14 +14,13 @@ import com.fr.design.gui.ibutton.UIButton;
|
|
|
|
|
import com.fr.design.gui.ibutton.UILockButton; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.file.ConnectionConfig; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.report.LockItem; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.transaction.CallBackAdaptor; |
|
|
|
|
import com.fr.transaction.Configurations; |
|
|
|
|
import com.fr.transaction.WorkerFacade; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.server.connection.DBConnectAuth; |
|
|
|
|
import com.fr.report.LockItem; |
|
|
|
|
|
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
@ -103,6 +102,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
Connection connection = mgr.getConnection(conName); |
|
|
|
|
// nameList依赖items方法初始化,父类ItemEditableComboBoxPanel里异步执行item方法
|
|
|
|
|
filterConnection(connection, conName, nameList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -188,12 +188,10 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
|
|
|
|
|
} else { |
|
|
|
|
String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection(); |
|
|
|
|
if (StringUtils.isNotBlank(s)) { |
|
|
|
|
for (int i = 0; i < this.getConnectionSize(); i++) { |
|
|
|
|
String t = this.getConnection(i); |
|
|
|
|
if (ComparatorUtils.equals(s, t)) { |
|
|
|
|
this.setSelectedItem(s); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
// 之前的写法有多线程问题,nameList异步尚未初始化完成的时候,这里可能无法匹配设置数据连接名称,导致DBTableDataPane打开后连接面板空白
|
|
|
|
|
// 这里的需求无非是设置上一次使用的数据连接,做个简单检查这个连接是否存在即可,存在就设置
|
|
|
|
|
if (ConnectionConfig.getInstance().getConnection(s) != null) { |
|
|
|
|
this.setSelectedItem(s); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// alex:如果这个ComboBox还是没有选中,那么选中第一个
|
|
|
|
|