@ -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.SearchPreTask TreeComboBox ;
import com.fr.design.gui.icombobox.FR TreeComboBox ;
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<DataBaseItems> implements Refresha
/ * *
* 表名
* /
protected SearchPreTask TreeComboBox tableNameComboBox ;
protected FR TreeComboBox 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 < Void > task = new FutureTask < Void > ( 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<DataBaseItems> implements Refresha
schemaBox = new StringUIComboBox ( ) ;
schemaBox . setEditor ( new ComboBoxEditor ( ) ) ;
tableNameComboBox = new SearchPreTask TreeComboBox( new JTree ( new DefaultMutableTreeNode ( ) ) , tableNameTreeRenderer , false ) ;
tableNameComboBox = new FR TreeComboBox( new JTree ( new DefaultMutableTreeNode ( ) ) , tableNameTreeRenderer , false ) ;
tableNameComboBox . setEditable ( true ) ;
tableNameComboBox . setRenderer ( listCellRenderer ) ;
registerDSChangeListener ( ) ;