From: Alan E. <ez...@us...> - 2006-06-30 18:32:46
|
Update of /cvsroot/jedit/plugins/XSearch/xsearch In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5018/xsearch Modified Files: XSearchPanel.java Log Message: Got rid of those ugly focus hacks... Index: XSearchPanel.java =================================================================== RCS file: /cvsroot/jedit/plugins/XSearch/xsearch/XSearchPanel.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- XSearchPanel.java 29 Jun 2006 18:32:43 -0000 1.26 +++ XSearchPanel.java 30 Jun 2006 18:32:41 -0000 1.27 @@ -62,7 +62,7 @@ * version $Id$ */ -public class XSearchPanel extends JPanel implements EBComponent +public class XSearchPanel extends JPanel implements EBComponent, DefaultFocusComponent { // {{{ Constants /** @@ -329,14 +329,6 @@ EditBus.addToBus(this); - JComponent rootPane = getRootPane(); - if (rootPane != null) { - rootPane.setFocusable(true); - rootPane.addKeyListener(keyHandler); - setFocusable(true); - addKeyListener(keyHandler); - - } } // }}} @@ -349,13 +341,6 @@ panel.load(); panel.revalidatePanels(); - JComponent rootPane = panel.getRootPane(); - rootPane.setFocusable(true); - if (rootPane != null) - { - rootPane.setFocusable(true); - rootPane.addKeyListener(panel.keyHandler); - } return panel; } @@ -555,7 +540,6 @@ closeOrKeepDialog(); else { - requestFocus(); find.requestFocus(); } } @@ -581,21 +565,6 @@ // {{{ handleMessage() method public void handleMessage(EBMessage msg) { - if (msg instanceof DockableWindowUpdate) { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - find.requestFocusInWindow(); - find.requestFocus(); - /* - if (synchronize.isSelected()) { - synchronizeMultiFileSettings(); - } - */ - } - }); - } if (msg instanceof SearchSettingsChanged) { @@ -2625,4 +2594,10 @@ } } + public void focusOnDefaultComponent() + { + find.requestFocus(); + + } + } |