File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
src/the/bytecode/club/bytecodeviewer/gui Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
1
/bin /
2
2
.classpath
3
- .project
3
+ .project
4
+ * .iml
5
+ .idea /
Original file line number Diff line number Diff line change 48
48
*
49
49
* @author Konloch
50
50
* @author WaterWolf
51
+ * @author afffsdd
51
52
*
52
53
*/
53
54
@@ -64,6 +65,7 @@ public class FileNavigationPane extends VisibleComponent implements
64
65
MyTree tree = new MyTree (treeRoot );
65
66
final String quickSearchText = "Quick file search (no file extension)" ;
66
67
final JTextField quickSearch = new JTextField (quickSearchText );
68
+ boolean cancel = false ;
67
69
68
70
public KeyAdapter search = new KeyAdapter () {
69
71
@ Override
@@ -191,6 +193,10 @@ public void mousePressed(MouseEvent e) {
191
193
this .tree .addTreeSelectionListener (new TreeSelectionListener () {
192
194
@ Override
193
195
public void valueChanged (final TreeSelectionEvent arg0 ) {
196
+ if (cancel ) {
197
+ cancel = false ;
198
+ return ;
199
+ }
194
200
openPath (arg0 .getPath ());
195
201
}
196
202
});
@@ -203,11 +209,24 @@ public void keyReleased(KeyEvent arg0) {
203
209
MyTree tree = (MyTree ) arg0 .getSource ();
204
210
openPath (tree .getSelectionPath ());
205
211
}
212
+ } else {
213
+ cancel = true ;
206
214
}
207
215
}
208
216
209
- @ Override public void keyPressed (KeyEvent arg0 ) { }
210
- @ Override public void keyTyped (KeyEvent arg0 ) { }
217
+ @ Override
218
+ public void keyTyped (KeyEvent e ) {
219
+ quickSearch .grabFocus ();
220
+ quickSearch .setText ("" + e .getKeyChar ()); // fuck
221
+ cancel = true ;
222
+ }
223
+
224
+ @ Override
225
+ public void keyPressed (KeyEvent e ) {
226
+ quickSearch .grabFocus ();
227
+ quickSearch .setText ("" + e .getKeyChar ()); // fuck
228
+ cancel = true ;
229
+ }
211
230
});
212
231
213
232
quickSearch .addKeyListener (search );
You can’t perform that action at this time.
0 commit comments