mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
close choose by name popup by Shift-Enter, allow to check if it was closed this way
This commit is contained in:
@@ -127,6 +127,8 @@ public abstract class ChooseByNameBase {
|
||||
protected JBPopup myTextPopup;
|
||||
protected JBPopup myDropdownPopup;
|
||||
|
||||
private boolean myClosedByShiftEnter = false;
|
||||
|
||||
private static class MatchesComparator implements Comparator<String> {
|
||||
private final String myOriginalPattern;
|
||||
|
||||
@@ -175,6 +177,10 @@ public abstract class ChooseByNameBase {
|
||||
mySearchInAnyPlace = searchInAnyPlace;
|
||||
}
|
||||
|
||||
public boolean isClosedByShiftEnter() {
|
||||
return myClosedByShiftEnter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tool area. The method may be called only before invoke.
|
||||
*
|
||||
@@ -419,6 +425,10 @@ public abstract class ChooseByNameBase {
|
||||
|
||||
myTextField.addKeyListener(new KeyAdapter() {
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER && (e.getModifiers() & KeyEvent.SHIFT_MASK) != 0) {
|
||||
myClosedByShiftEnter = true;
|
||||
close(true);
|
||||
}
|
||||
if (!myListScrollPane.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user