|
|
@ -16,12 +16,13 @@ import com.fr.stable.StringUtils; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JTree; |
|
|
|
import javax.swing.JTree; |
|
|
|
import javax.swing.SwingWorker; |
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
|
|
|
import javax.swing.event.PopupMenuEvent; |
|
|
|
|
|
|
|
import javax.swing.event.PopupMenuListener; |
|
|
|
import javax.swing.tree.DefaultMutableTreeNode; |
|
|
|
import javax.swing.tree.DefaultMutableTreeNode; |
|
|
|
import javax.swing.tree.DefaultTreeModel; |
|
|
|
import javax.swing.tree.DefaultTreeModel; |
|
|
|
import javax.swing.tree.TreeCellRenderer; |
|
|
|
import javax.swing.tree.TreeCellRenderer; |
|
|
|
import javax.swing.tree.TreeNode; |
|
|
|
import javax.swing.tree.TreeNode; |
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.util.Enumeration; |
|
|
|
import java.util.Enumeration; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -40,7 +41,7 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { |
|
|
|
public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { |
|
|
|
public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { |
|
|
|
super(tree, renderer); |
|
|
|
super(tree, renderer); |
|
|
|
this.parent = parent; |
|
|
|
this.parent = parent; |
|
|
|
setUI(new TableSearchTreeComboBoxUI()); |
|
|
|
initPopupListener(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected UIComboBoxEditor createEditor() { |
|
|
|
protected UIComboBoxEditor createEditor() { |
|
|
@ -158,12 +159,6 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() { |
|
|
|
|
|
|
|
public boolean accept(TableProcedure procedure) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 表名模糊搜索实现 |
|
|
|
* 表名模糊搜索实现 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -184,15 +179,31 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() { |
|
|
|
* 重写FRTreeComboBoxUI,实现点击下拉时触发模糊搜索 |
|
|
|
public boolean accept(TableProcedure procedure) { |
|
|
|
*/ |
|
|
|
return true; |
|
|
|
private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI { |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initPopupListener() { |
|
|
|
|
|
|
|
// 点击下拉时触发模糊搜索
|
|
|
|
|
|
|
|
this.addPopupMenuListener(new PopupMenuListener() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
public void popupMenuWillBecomeVisible(PopupMenuEvent e) { |
|
|
|
searchExecute(); |
|
|
|
searchExecute(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void popupMenuCanceled(PopupMenuEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|