|
1 | 1 | package net.sourceforge.squirrel_sql.client.mainframe.action.findprefs; |
2 | 2 |
|
3 | | -import net.sourceforge.squirrel_sql.client.Main; |
4 | | -import net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrame; |
5 | | -import net.sourceforge.squirrel_sql.fw.gui.GUIUtils; |
6 | | -import net.sourceforge.squirrel_sql.fw.util.StringManager; |
7 | | -import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; |
8 | | -import net.sourceforge.squirrel_sql.fw.util.StringUtilities; |
9 | | -import org.apache.commons.lang3.StringUtils; |
10 | | - |
11 | | -import javax.swing.*; |
| 3 | +import java.awt.Rectangle; |
| 4 | +import java.awt.event.KeyAdapter; |
| 5 | +import java.awt.event.KeyEvent; |
| 6 | +import java.awt.event.MouseAdapter; |
| 7 | +import java.awt.event.MouseEvent; |
| 8 | +import java.util.List; |
| 9 | +import javax.swing.JMenuItem; |
| 10 | +import javax.swing.JPopupMenu; |
| 11 | +import javax.swing.SwingUtilities; |
12 | 12 | import javax.swing.event.DocumentEvent; |
13 | 13 | import javax.swing.event.DocumentListener; |
14 | 14 | import javax.swing.event.TreeSelectionEvent; |
15 | 15 | import javax.swing.tree.DefaultMutableTreeNode; |
16 | 16 | import javax.swing.tree.DefaultTreeModel; |
17 | 17 | import javax.swing.tree.TreePath; |
18 | 18 | import javax.swing.tree.TreeSelectionModel; |
19 | | -import java.awt.*; |
20 | | -import java.awt.event.KeyAdapter; |
21 | | -import java.awt.event.KeyEvent; |
22 | | -import java.awt.event.MouseAdapter; |
23 | | -import java.awt.event.MouseEvent; |
24 | | -import java.util.List; |
| 19 | + |
| 20 | +import net.sourceforge.squirrel_sql.client.Main; |
| 21 | +import net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrame; |
| 22 | +import net.sourceforge.squirrel_sql.fw.gui.GUIUtils; |
| 23 | +import net.sourceforge.squirrel_sql.fw.util.StringManager; |
| 24 | +import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; |
| 25 | +import net.sourceforge.squirrel_sql.fw.util.StringUtilities; |
| 26 | +import org.apache.commons.lang3.StringUtils; |
25 | 27 |
|
26 | 28 | public class FindInPreferencesCtrl |
27 | 29 | { |
@@ -123,7 +125,11 @@ private void onTreeClicked(MouseEvent me) |
123 | 125 |
|
124 | 126 | final GotoHandler gotoHandler = new GotoHandler(); |
125 | 127 |
|
126 | | - gotoHandler.gotoPath(componentPath, true); |
| 128 | + // The tree node has no kids probably because of the search criterion. |
| 129 | + // Hence, the double click has no nodes to expand or collapse. and we can allow the go to. |
| 130 | + boolean gotoLeafOnly = ! ((DefaultMutableTreeNode) selectionPath.getLastPathComponent()).isLeaf(); |
| 131 | + |
| 132 | + gotoHandler.gotoPath(componentPath, gotoLeafOnly); |
127 | 133 | } |
128 | 134 | } |
129 | 135 |
|
|
0 commit comments