mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -120,6 +120,8 @@ public class MacMessagesImpl extends MacMessages {
|
||||
// invoke(invoke(alert, "buttons"), "objectAtIndex:", count == 1 ? 0 : 1));
|
||||
//}
|
||||
|
||||
enableEscapeToCloseTheMessage(alert);
|
||||
|
||||
String doNotAsk = toStringViaUTF8(doNotAskText);
|
||||
if (!"-1".equals(doNotAsk)) {
|
||||
invoke(alert, "setShowsSuppressionButton:", 1);
|
||||
@@ -161,10 +163,10 @@ public class MacMessagesImpl extends MacMessages {
|
||||
//invoke(window, "makeFirstResponder:",
|
||||
// invoke(invoke(alert, "buttons"), "objectAtIndex:", alternateExist ? 2 : otherExist ? 1 : 0));
|
||||
//
|
||||
////it is impossible to override ESCAPE key behavior -> key should be named "Cancel" to be bound to ESC
|
||||
//if (!alternateExist) {
|
||||
// invoke(invoke(invoke(alert, "buttons"), "objectAtIndex:", 1), "setKeyEquivalent:", nsString("\\e"));
|
||||
//}
|
||||
|
||||
if (!alternateExist) {
|
||||
enableEscapeToCloseTheMessage(alert);
|
||||
}
|
||||
|
||||
String doNotAsk = toStringViaUTF8(doNotAskText);
|
||||
if (!"-1".equals(doNotAsk)) {
|
||||
@@ -200,6 +202,11 @@ public class MacMessagesImpl extends MacMessages {
|
||||
}
|
||||
}
|
||||
|
||||
private static ID enableEscapeToCloseTheMessage(ID alert) {
|
||||
return invoke(invoke(invoke(alert, "buttons"), "objectAtIndex:",
|
||||
invoke(invoke(alert, "buttons"), "count").intValue() - 1), "setKeyEquivalent:", nsString("\033"));
|
||||
}
|
||||
|
||||
private MacMessagesImpl() {}
|
||||
|
||||
private static final Callback windowDidBecomeMainCallback = new Callback() {
|
||||
|
||||
Reference in New Issue
Block a user