mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 13:20:53 +07:00
[search] restore the use of the editor selection in the Find in Files popup (IDEA-314095)
GitOrigin-RevId: 6bdcb21888dd863ab8e5c2f6a638f3350df08aff
This commit is contained in:
committed by
intellij-monorepo-bot
parent
89e3b09088
commit
4a89df730e
@@ -1,5 +1,5 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind = ''
|
||||
myStringToFind = null
|
||||
myStringToReplace = ''
|
||||
isReplaceState = false
|
||||
isWholeWordsOnly = false
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind = ''
|
||||
myStringToFind = null
|
||||
myStringToReplace = ''
|
||||
isReplaceState = false
|
||||
isWholeWordsOnly = false
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind = ''
|
||||
myStringToFind = null
|
||||
myStringToReplace = ''
|
||||
isReplaceState = false
|
||||
isWholeWordsOnly = false
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind = ''
|
||||
myStringToFind = null
|
||||
myStringToReplace = ''
|
||||
isReplaceState = false
|
||||
isWholeWordsOnly = false
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind = ''
|
||||
myStringToFind = null
|
||||
myStringToReplace = ''
|
||||
isReplaceState = false
|
||||
isWholeWordsOnly = false
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind = ''
|
||||
myStringToFind = null
|
||||
myStringToReplace = ''
|
||||
isReplaceState = false
|
||||
isWholeWordsOnly = false
|
||||
|
||||
@@ -54,7 +54,7 @@ public class FindModel extends UserDataHolderBase implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
private String myStringToFind = "";
|
||||
private String myStringToFind = null;
|
||||
private String myStringToReplace = "";
|
||||
private boolean isSearchHighlighters;
|
||||
private boolean isReplaceState;
|
||||
@@ -236,7 +236,11 @@ public class FindModel extends UserDataHolderBase implements Cloneable {
|
||||
*/
|
||||
@NotNull
|
||||
public String getStringToFind() {
|
||||
return myStringToFind;
|
||||
return (myStringToFind == null) ? "" : myStringToFind;
|
||||
}
|
||||
|
||||
public boolean hasStringToFind() {
|
||||
return myStringToFind != null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,7 +621,7 @@ public class FindModel extends UserDataHolderBase implements Cloneable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "--- FIND MODEL ---\n" +
|
||||
"myStringToFind = '" + myStringToFind + "'\n" +
|
||||
"myStringToFind = " + (myStringToFind == null ? "null\n" : "'" + myStringToFind + "'\n") +
|
||||
"myStringToReplace = '" + myStringToReplace + "'\n" +
|
||||
"isReplaceState = " + isReplaceState + "\n" +
|
||||
"isWholeWordsOnly = " + isWholeWordsOnly + "\n" +
|
||||
|
||||
@@ -1048,8 +1048,10 @@ public class FindPopupPanel extends JBPanel<FindPopupPanel> implements FindUI, D
|
||||
}
|
||||
header.fileMaskField.setEnabled(isThereFileFilter);
|
||||
FindInProjectSettings findInProjectSettings = FindInProjectSettings.getInstance(myProject);
|
||||
mySearchComponent.setText(findInProjectSettings.getMostRecentFindString());
|
||||
myReplaceComponent.setText(findInProjectSettings.getMostRecentReplaceString());
|
||||
String search = myModel.hasStringToFind() ? myModel.getStringToFind() : findInProjectSettings.getMostRecentFindString();
|
||||
mySearchComponent.setText(search);
|
||||
String replace = myModel.hasStringToFind() ? myModel.getStringToReplace() : findInProjectSettings.getMostRecentReplaceString();
|
||||
myReplaceComponent.setText(replace);
|
||||
updateControls();
|
||||
updateScopeDetailsPanel();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user