Browse Source

Merge pull request #8985 in DESIGN/design from feature/10.0 to feature/big-screen

* commit '10effddc73c9334f5b748c434bff17e00771391a':
  REPORT-71890 重新加上 使用refresh模式
  REPORT-71890 填报-填报属性设置-填报属性的数据库保存后打开,不显示了
feature/big-screen
superman 3 years ago
parent
commit
0da16a380d
  1. 39
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

39
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

@ -649,14 +649,51 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
*/
@Override
public void registerDSChangeListener() {
// 还是需要保留 恶心
// 1. 切换工作目录需要依赖这个监听 切换工作目录没有一个数据连接的刷新触发 就很坑
// 2. DesignerContext.getDesignerBean("databasename").refreshBeanElement()有坑 a.调用不全 b.某些场景下 因为注册覆盖 会失效
// 监听内容变成刷新模式 不会覆盖 populate填充内容
this.addAncestorListener(new ManageDsListenerRegisterListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
initDsNameComboBox();
refreshDsNameComboBox();
}
}));
}
@SuppressWarnings("unchecked")
private void refreshDsNameComboBox() {
if (initWorker != null && !initWorker.isDone()) {
initWorker.cancel(true);
}
dsNameComboBox.setRefreshingModel(true);
initWorker = new SwingWorker<List<String>, Void>() {
@Override
protected List<String> doInBackground() throws Exception {
return getHasAuthConnections();
}
@Override
protected void done() {
try {
FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(get());
String selected = dsNameComboBox.getSelectedItem();
dsNameComboBox.setModel(dsNameComboBoxModel);
dsNameComboBox.setRefreshingModel(true);
dsNameComboBox.setSelectedItem(selected);
dsNameComboBox.setRefreshingModel(false);
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
};
initWorker.execute();
}
/**
* 数据集选择面板里的生成sql语句的接口
*/

Loading…
Cancel
Save