2626import gr .sqlbrowserfx .nodes .ContextMenuOwner ;
2727import gr .sqlbrowserfx .nodes .InputMapOwner ;
2828import gr .sqlbrowserfx .nodes .SearchAndReplacePopOver ;
29- import gr .sqlbrowserfx .nodes .SearchInFilesPopOver ;
3029import gr .sqlbrowserfx .nodes .codeareas .sql .SimpleLineNumberFactory ;
3130import gr .sqlbrowserfx .utils .JavaFXUtils ;
3231import javafx .application .Platform ;
@@ -59,7 +58,6 @@ public abstract class AutoCompleteCodeArea<T extends CodeAreaSyntaxProvider> ext
5958 private ListView <Keyword > suggestionsList ;
6059 private Popup autoCompletePopup ;
6160 protected SearchAndReplacePopOver searchAndReplacePopOver ;
62- protected SearchInFilesPopOver searchInFilesPopOver ;
6361 private final SimpleBooleanProperty showLinesProperty = new SimpleBooleanProperty (true );
6462 private final SimpleBooleanProperty autoCompleteProperty = new SimpleBooleanProperty (true );
6563 private final SimpleBooleanProperty isTextSelectedProperty = new SimpleBooleanProperty (false );
@@ -110,10 +108,6 @@ protected Boolean isAutoCompletePopupShowing() {
110108 return this .autoCompletePopup != null && this .autoCompletePopup .isShowing ();
111109 }
112110
113- protected Boolean isSearchInFilesPopOverShowing () {
114- return this .searchInFilesPopOver != null && this .searchInFilesPopOver .isShowing ();
115- }
116-
117111 protected Boolean isSearchAndReplacePopOverShowing () {
118112 return this .searchAndReplacePopOver != null && this .searchAndReplacePopOver .isShowing ();
119113 }
@@ -124,10 +118,6 @@ protected void onMouseClicked() {
124118 hideAutocompletePopup ();
125119 }
126120
127- if (isSearchInFilesPopOverShowing ()) {
128- searchInFilesPopOver .hide ();
129- }
130-
131121 if (isSearchAndReplacePopOverShowing ()) {
132122 searchAndReplacePopOver .hide ();
133123 }
@@ -232,15 +222,11 @@ public void setInputMap() {
232222 action -> this .replaceSelection ("(" + getSelectedText () + ")" ));
233223
234224
235- var searchInFiles = InputMap .consume (
236- EventPattern .keyPressed (KeyCode .H , KeyCombination .CONTROL_DOWN , KeyCombination .SHIFT_DOWN ),
237- action -> this .showSearchInFilesPopup ());
238225
239226 Nodes .addFallbackInputMap (this , addTabs );
240227 Nodes .addFallbackInputMap (this , removeTabs );
241228 Nodes .addInputMap (this , autocomplete );
242229 Nodes .addInputMap (this , searchAndReplace );
243- Nodes .addInputMap (this , searchInFiles );
244230 Nodes .addInputMap (this , delete );
245231 Nodes .addInputMap (this , toUpper );
246232 Nodes .addInputMap (this , toLower );
@@ -267,25 +253,25 @@ private void setKeys() {
267253 // FIXME Desired behaviour can't be achieved with input map autocomplete popover
268254 // does not hide.
269255// Use traditional javafx way for this specific case
270- this .setOnKeyPressed (keyEvent -> {
271- if (keyEvent .isControlDown () && (keyEvent .getCode () == KeyCode .MINUS || keyEvent .getCode () == KeyCode .EQUALS )) {
272- // do not consume event to enable global zoom in/out (if applied)
273- return ;
274- }
275- if (keyEvent .getCode () == KeyCode .LEFT || keyEvent .getCode () == KeyCode .RIGHT ) {
276- this .hideAutocompletePopup ();
277- }
278- if (keyEvent .getCode () == KeyCode .BACK_SPACE ) {
279- this .hideAutocompletePopup ();
280- // uncomment this to activate autocomplete on backspace
281- // this.autoCompleteAction(keyEvent, auoCompletePopup);
282- }
283- // These keycodes must be excluded to delegate event to queries tab pane
284- if (keyEvent .getCode () != KeyCode .ESCAPE && keyEvent .getCode () != KeyCode .N
285- && keyEvent .getCode () != KeyCode .O ) {
286- keyEvent .consume ();
287- }
288- });
256+ // this.setOnKeyPressed(keyEvent -> {
257+ // if (keyEvent.isControlDown() && (keyEvent.getCode() == KeyCode.MINUS || keyEvent.getCode() == KeyCode.EQUALS)) {
258+ // // do not consume event to enable global zoom in/out (if applied)
259+ // return;
260+ // }
261+ // if (keyEvent.getCode() == KeyCode.LEFT || keyEvent.getCode() == KeyCode.RIGHT) {
262+ // this.hideAutocompletePopup();
263+ // }
264+ // if (keyEvent.getCode() == KeyCode.BACK_SPACE) {
265+ // this.hideAutocompletePopup();
266+ // // uncomment this to activate autocomplete on backspace
267+ //// this.autoCompleteAction(keyEvent, auoCompletePopup);
268+ // }
269+ // // These keycodes must be excluded to delegate event to queries tab pane
270+ // if (keyEvent.getCode() != KeyCode.ESCAPE && keyEvent.getCode() != KeyCode.N
271+ // && keyEvent.getCode() != KeyCode.O) {
272+ // keyEvent.consume();
273+ // }
274+ // });
289275 this .setOnKeyTyped (keyEvent -> {
290276 if (
291277 this .autoCompleteProperty .get () &&
@@ -323,14 +309,6 @@ protected void showSearchAndReplacePopup() {
323309 searchAndReplacePopOver .show (getParent (), boundsInScene .getMaxX () - 400 , boundsInScene .getMinY ());
324310 }
325311
326- protected void showSearchInFilesPopup () {
327- var boundsInScene = this .localToScreen (this .getBoundsInLocal ());
328- if (this .searchInFilesPopOver == null ) {
329- this .searchInFilesPopOver = new SearchInFilesPopOver ();
330- }
331- this .searchInFilesPopOver .show (getParent (), boundsInScene .getMinX (), boundsInScene .getMinY ());
332- }
333-
334312 // FIXME: we override copy method as it the default method seems broken for strings containing '{' or '}'
335313 @ Override
336314 public void copy () {
@@ -362,9 +340,6 @@ public ContextMenu createContextMenu() {
362340
363341 var menuItemSearchAndReplace = new MenuItem ("Search..." , JavaFXUtils .createIcon ("/icons/magnify.png" ));
364342 menuItemSearchAndReplace .setOnAction (action -> this .showSearchAndReplacePopup ());
365-
366- var menuItemSearchInFiles = new MenuItem ("Search In Files..." , JavaFXUtils .createIcon ("/icons/magnify.png" ));
367- menuItemSearchInFiles .setOnAction (action -> this .showSearchInFilesPopup ());
368343
369344 var menuItemUperCase = new MenuItem ("To Upper Case" , JavaFXUtils .createIcon ("/icons/uppercase.png" ));
370345 menuItemUperCase .setOnAction (action -> this .convertSelectedTextToUpperCase ());
@@ -418,7 +393,7 @@ public ContextMenu createContextMenu() {
418393 new SeparatorMenuItem (),
419394 menuItemFormat , menuItemFormat3 ,
420395 new SeparatorMenuItem (),
421- menuItemSearchAndReplace , menuItemSearchInFiles , menuItemGoToLine , menuItemSuggestions ,
396+ menuItemSearchAndReplace , menuItemGoToLine , menuItemSuggestions ,
422397 new SeparatorMenuItem (),
423398 menuItemSaveAs );
424399 return menu ;
0 commit comments