From b72d94b00377a0dfe844b2470e3127ecc525f3cf Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 21 Apr 2021 15:25:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-50908=20=E5=A1=AB=E6=8A=A5-=E5=A1=AB?= =?UTF-8?q?=E6=8A=A5=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-=E5=A1=AB?= =?UTF-8?q?=E6=8A=A5=E5=B1=9E=E6=80=A7=E4=B8=AD=E5=AF=B9=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/ChoosePane.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 6460cadb9..2a8446f89 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -1,7 +1,6 @@ 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; @@ -18,7 +17,7 @@ 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.SearchPreTaskTreeComboBox; +import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.icombobox.FilterableComboBoxModel; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxEditor; @@ -60,10 +59,6 @@ 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 @@ -85,25 +80,20 @@ public class ChoosePane extends BasicBeanPane implements Refresha /** * 表名 */ - protected SearchPreTaskTreeComboBox tableNameComboBox; + protected FRTreeComboBox tableNameComboBox; private SwingWorker populateWorker; - private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePaneThread")); - private PopupMenuListener popupMenuListener = new PopupMenuListener() { @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - FutureTask task = new FutureTask(new Callable() { + new Thread() { @Override - public Object call() { + public void run() { calculateTableDataNames(); - return null; } - }); - SERVICE.submit(task); - tableNameComboBox.setPreSearchTask(task); + }.start(); } @Override @@ -167,7 +157,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha schemaBox = new StringUIComboBox(); schemaBox.setEditor(new ComboBoxEditor()); - tableNameComboBox = new SearchPreTaskTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false); + tableNameComboBox = new FRTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false); tableNameComboBox.setEditable(true); tableNameComboBox.setRenderer(listCellRenderer); registerDSChangeListener();