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