|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.fr.design.data.datapane; |
|
|
|
package com.fr.design.data.datapane; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.TableData; |
|
|
|
import com.fr.base.TableData; |
|
|
|
|
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
import com.fr.data.core.DataCoreUtils; |
|
|
|
import com.fr.data.core.DataCoreUtils; |
|
|
|
import com.fr.data.core.db.DBUtils; |
|
|
|
import com.fr.data.core.db.DBUtils; |
|
|
|
import com.fr.data.core.db.TableProcedure; |
|
|
|
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.datapane.preview.PreviewTablePane; |
|
|
|
import com.fr.design.data.tabledata.Prepare4DataSourceChange; |
|
|
|
import com.fr.design.data.tabledata.Prepare4DataSourceChange; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
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.FilterableComboBoxModel; |
|
|
|
|
|
|
|
import com.fr.design.gui.icombobox.SearchPreTaskTreeComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxEditor; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxEditor; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxRenderer; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxRenderer; |
|
|
@ -59,6 +60,10 @@ import java.util.Collection; |
|
|
|
import java.util.Enumeration; |
|
|
|
import java.util.Enumeration; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Set; |
|
|
|
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 |
|
|
|
* @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; |
|
|
|
private SwingWorker populateWorker; |
|
|
|
|
|
|
|
|
|
|
@ -88,12 +95,15 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void popupMenuWillBecomeVisible(PopupMenuEvent e) { |
|
|
|
public void popupMenuWillBecomeVisible(PopupMenuEvent e) { |
|
|
|
new Thread() { |
|
|
|
FutureTask<Void> task = new FutureTask<Void>(new Callable<Void>() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public Void call() throws Exception { |
|
|
|
calculateTableDataNames(); |
|
|
|
calculateTableDataNames(); |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
}.start(); |
|
|
|
}); |
|
|
|
|
|
|
|
tableNameComboBox.setPreSearchTask(task); |
|
|
|
|
|
|
|
SERVICE.submit(task); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -157,7 +167,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha |
|
|
|
schemaBox = new StringUIComboBox(); |
|
|
|
schemaBox = new StringUIComboBox(); |
|
|
|
schemaBox.setEditor(new ComboBoxEditor()); |
|
|
|
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.setEditable(true); |
|
|
|
tableNameComboBox.setRenderer(listCellRenderer); |
|
|
|
tableNameComboBox.setRenderer(listCellRenderer); |
|
|
|
registerDSChangeListener(); |
|
|
|
registerDSChangeListener(); |
|
|
|