Browse Source

Merge pull request #4177 in DESIGN/design from final/10.0 to persist/10.0

* commit '23f87c6700f9adc57768c327f3afa26ed00588e1':
  REPORT-51843 远程设计-服务器重启后,设计器配置工作目录,点击确定无效
  REPORT-50908 填报-填报属性设置-填报属性中对表查询定位的问题
  REPORT-50908 填报-填报属性设置-填报属性中对表查询定位的问题
  REPORT-51446 注册表启动设计器会报错并闪退
persist/10.0 10.0.15.2021.05.07
superman 4 years ago
parent
commit
77d6343ebc
  1. 22
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  2. 4
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  3. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java
  4. 14
      designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java
  5. 2
      designer-base/src/main/java/com/fr/start/BaseDesigner.java

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

@ -1,6 +1,7 @@
package com.fr.design.data.datapane;
import com.fr.base.TableData;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.TableProcedure;
@ -17,8 +18,8 @@ import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.icombobox.FilterableComboBoxModel;
import com.fr.design.gui.icombobox.SearchPreTaskTreeComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxEditor;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
@ -59,6 +60,10 @@ import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
/**
* @author zhou
@ -80,7 +85,9 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
/**
* 表名
*/
protected FRTreeComboBox tableNameComboBox;
protected SearchPreTaskTreeComboBox tableNameComboBox;
private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePane"));
private SwingWorker populateWorker;
@ -88,12 +95,15 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
new Thread() {
FutureTask<Void> task = new FutureTask<Void>(new Callable<Void>() {
@Override
public void run() {
public Void call() throws Exception {
calculateTableDataNames();
return null;
}
}.start();
});
tableNameComboBox.setPreSearchTask(task);
SERVICE.submit(task);
}
@Override
@ -157,7 +167,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
schemaBox = new StringUIComboBox();
schemaBox.setEditor(new ComboBoxEditor());
tableNameComboBox = new FRTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false);
tableNameComboBox = new SearchPreTaskTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false);
tableNameComboBox.setEditable(true);
tableNameComboBox.setRenderer(listCellRenderer);
registerDSChangeListener();

4
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -127,7 +127,9 @@ public class RemoteWorkspace implements Workspace {
@Override
public boolean equals(Object obj) {
return obj instanceof RemoteWorkspace && AssistUtils.equals(((RemoteWorkspace) obj).connection, this.connection);
return obj instanceof RemoteWorkspace
&& AssistUtils.equals(((RemoteWorkspace) obj).connection, this.connection)
&& AssistUtils.equals(((RemoteWorkspace) obj).client.getConnection(), this.client.getConnection());
}
public WorkspaceClient getClient(){

1
designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -626,6 +626,7 @@ public class FRTreeComboBox extends UIComboBox {
*/
protected void search() {
this.item = textField.getText();
tree.updateUI();
TreeNode root = (TreeNode) tree.getModel().getRoot();
TreePath parent = new TreePath(root);
TreeNode node = (TreeNode) parent.getLastPathComponent();

14
designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java

@ -1,6 +1,5 @@
package com.fr.design.gui.icombobox;
import com.fr.design.ui.util.UIUtil;
import com.fr.log.FineLoggerFactory;
import javax.swing.JTree;
@ -48,7 +47,6 @@ public class SearchPreTaskTreeComboBox extends FRTreeComboBox {
return;
}
setPopupVisible(true);
// 模糊搜索异步
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() {
@ -65,14 +63,14 @@ public class SearchPreTaskTreeComboBox extends FRTreeComboBox {
// 任务执行后置空,否则会被别的操作重复触发
setPreSearchTask(null);
}
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
search();
}
});
return null;
}
@Override
protected void done() {
// 模糊搜索
search();
}
}.execute();
}
}

2
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -155,7 +155,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
isException = true;//此时有文件nullpointer异常,执行打开空文件
}
}
if (file.exists() && !isException) {
if (file != null && file.exists() && !isException) {
df.openTemplate(file);
} else {
df.addAndActivateJTemplate();

Loading…
Cancel
Save