Skip to content

Commit 5cec309

Browse files
author
GWA
committed
Bug fix: Find in preferences/configurations dialog:
Double clicking any empty node now always shows the preference/configuration.
1 parent 3fa21d6 commit 5cec309

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

sql12/core/doc/changes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Table cell data popup now offers find, Xml/Json-reformatting and export function
5757

5858
Bug fixes:
5959

60+
Find in preferences/configurations dialog:
61+
Double clicking any empty node now always shows the preference/configuration.
62+
6063
SQL result table: Section count, position and sum were updated at the end of a selection only,
6164
not as the used to be during the selection, too.
6265

sql12/core/src/net/sourceforge/squirrel_sql/client/mainframe/action/findprefs/FindInPreferencesCtrl.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
package net.sourceforge.squirrel_sql.client.mainframe.action.findprefs;
22

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;
1212
import javax.swing.event.DocumentEvent;
1313
import javax.swing.event.DocumentListener;
1414
import javax.swing.event.TreeSelectionEvent;
1515
import javax.swing.tree.DefaultMutableTreeNode;
1616
import javax.swing.tree.DefaultTreeModel;
1717
import javax.swing.tree.TreePath;
1818
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;
2527

2628
public class FindInPreferencesCtrl
2729
{
@@ -123,7 +125,11 @@ private void onTreeClicked(MouseEvent me)
123125

124126
final GotoHandler gotoHandler = new GotoHandler();
125127

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);
127133
}
128134
}
129135

0 commit comments

Comments
 (0)