mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
disable typeahead in dialogs
This commit is contained in:
@@ -491,6 +491,10 @@ public abstract class DialogWrapper {
|
||||
return !myCheckBoxDoNotShowDialog.isSelected();
|
||||
}
|
||||
|
||||
public boolean isTypeAheadEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static JPanel addDoNotShowCheckBox(JComponent southPanel, JCheckBox checkBox) {
|
||||
final JPanel panel = new JPanel(new BorderLayout());
|
||||
|
||||
|
||||
+5
@@ -79,6 +79,11 @@ public class OptionsEditorDialog extends DialogWrapper implements DataProvider{
|
||||
return result == null ? findLastSavedConfigurable(groups, project) : result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTypeAheadEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected JComponent createCenterPanel() {
|
||||
myEditor = new OptionsEditor(myProject, myGroups, myPreselected);
|
||||
myEditor.getContext().addColleague(new OptionsEditorColleague.Adapter() {
|
||||
|
||||
@@ -82,7 +82,7 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
|
||||
|
||||
private final ActionCallback myWindowFocusedCallback = new ActionCallback("DialogFocusedCallback");
|
||||
private final ActionCallback myTypeAheadDone = new ActionCallback("DialogTypeAheadDone");
|
||||
private final ActionCallback myTypeAheadCallback = new ActionCallback();
|
||||
private ActionCallback myTypeAheadCallback;
|
||||
|
||||
/**
|
||||
* Creates modal <code>DialogWrapper</code>. The currently active window will be the dialog's parent.
|
||||
@@ -95,6 +95,7 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
|
||||
*/
|
||||
protected DialogWrapperPeerImpl(DialogWrapper wrapper, Project project, boolean canBeParent) {
|
||||
myWrapper = wrapper;
|
||||
myTypeAheadCallback = myWrapper.isTypeAheadEnabled() ? new ActionCallback() : (ActionCallback)null;
|
||||
myWindowManager = null;
|
||||
Application application = ApplicationManager.getApplication();
|
||||
if (application != null && application.hasComponent(WindowManager.class)) {
|
||||
@@ -378,7 +379,9 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
|
||||
}
|
||||
|
||||
public ActionCallback show() {
|
||||
IdeFocusManager.getInstance(myProject).typeAheadUntil(myTypeAheadCallback);
|
||||
if (myTypeAheadCallback != null) {
|
||||
IdeFocusManager.getInstance(myProject).typeAheadUntil(myTypeAheadCallback);
|
||||
}
|
||||
final ActionCallback result = new ActionCallback();
|
||||
|
||||
LOG.assertTrue(EventQueue.isDispatchThread(), "Access is allowed from event dispatch thread only");
|
||||
@@ -953,7 +956,9 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
|
||||
notifyFocused(wrapper);
|
||||
}
|
||||
}
|
||||
myTypeAheadCallback.setDone();
|
||||
if (myTypeAheadCallback != null) {
|
||||
myTypeAheadCallback.setDone();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user