mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-173487 New "Find in Path" dialog loses "File mask" dropdown history
Now completion popup with history is being shown when the field gets focus (after-review)
This commit is contained in:
@@ -57,11 +57,17 @@ public class AutoPopupController implements Disposable {
|
||||
*/
|
||||
public static final Key<Boolean> ALWAYS_AUTO_POPUP = Key.create("Always Show Completion Auto-Popup");
|
||||
/**
|
||||
* If editor has Boolean.TRUE by this key completion popup would be shown every time when editor gets focus
|
||||
* and the popup wouldn't have advertising text in bottom.
|
||||
* For example this key can be used for TextFieldWithAutoCompletion. (It looks like usual JTextField and completion shortcut is not obvious to be active.)
|
||||
* If editor has Boolean.TRUE by this key completion popup would be shown without advertising text at the bottom.
|
||||
*/
|
||||
public static final Key<Boolean> ALWAYS_AUTO_POPUP_NO_ADS = Key.create("Always Show Completion Auto-Popup");
|
||||
public static final Key<Boolean> NO_ADS = Key.create("Show Completion Auto-Popup without Ads");
|
||||
|
||||
/**
|
||||
* If editor has Boolean.TRUE by this key completion popup would be shown every time when editor gets focus.
|
||||
* For example this key can be used for TextFieldWithAutoCompletion.
|
||||
* (TextFieldWithAutoCompletion looks like standard JTextField and completion shortcut is not obvious to be active)
|
||||
*/
|
||||
public static final Key<Boolean> AUTO_POPUP_ON_FOCUS_GAINED = Key.create("Show Completion Auto-Popup On Focus Gained");
|
||||
|
||||
|
||||
private final Project myProject;
|
||||
private final Alarm myAlarm = new Alarm();
|
||||
@@ -109,7 +115,7 @@ public class AutoPopupController implements Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean alwaysAutoPopup = editor != null && (Boolean.TRUE.equals(editor.getUserData(ALWAYS_AUTO_POPUP)) || Boolean.TRUE.equals(editor.getUserData(ALWAYS_AUTO_POPUP_NO_ADS)));
|
||||
boolean alwaysAutoPopup = editor != null && Boolean.TRUE.equals(editor.getUserData(ALWAYS_AUTO_POPUP));
|
||||
if (!CodeInsightSettings.getInstance().AUTO_POPUP_COMPLETION_LOOKUP && !alwaysAutoPopup) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
|
||||
}
|
||||
|
||||
myAdComponent.showRandomText();
|
||||
if (Boolean.TRUE.equals(myEditor.getUserData(AutoPopupController.ALWAYS_AUTO_POPUP_NO_ADS))) {
|
||||
if (Boolean.TRUE.equals(myEditor.getUserData(AutoPopupController.NO_ADS))) {
|
||||
myAdComponent.clearAdvertisements();
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,9 @@ public class FindPopupPanel extends JBPanel implements FindUI, DataProvider {
|
||||
@Override
|
||||
protected EditorEx createEditor() {
|
||||
EditorEx editor = super.createEditor();
|
||||
editor.putUserData(AutoPopupController.ALWAYS_AUTO_POPUP_NO_ADS, Boolean.TRUE);
|
||||
editor.putUserData(AutoPopupController.ALWAYS_AUTO_POPUP, Boolean.TRUE);
|
||||
editor.putUserData(AutoPopupController.NO_ADS, Boolean.TRUE);
|
||||
editor.putUserData(AutoPopupController.AUTO_POPUP_ON_FOCUS_GAINED, Boolean.TRUE);
|
||||
return editor;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ public class TextCompletionUtil {
|
||||
editor.addFocusListener(new FocusChangeListener() {
|
||||
@Override
|
||||
public void focusGained(final Editor editor) {
|
||||
if (Boolean.TRUE.equals(editor.getUserData(AutoPopupController.ALWAYS_AUTO_POPUP_NO_ADS))) {
|
||||
if (Boolean.TRUE.equals(editor.getUserData(AutoPopupController.AUTO_POPUP_ON_FOCUS_GAINED))) {
|
||||
AutoPopupController.getInstance(editor.getProject()).scheduleAutoPopup(editor);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user