You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by en...@apache.org on 2020/10/20 06:46:50 UTC
[netbeans] branch delivery updated: Reload external changes
automatically in headless mode.
This is an automated email from the ASF dual-hosted git repository.
entl pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/delivery by this push:
new 6900794 Reload external changes automatically in headless mode.
new 468294c Merge pull request #2473 from entlicher/headlessUQEinDES_delivery
6900794 is described below
commit 6900794b5102a8f840e6a1e21741265e81a39a6b
Author: Martin Entlicher <ma...@oracle.com>
AuthorDate: Mon Oct 19 17:54:05 2020 +0200
Reload external changes automatically in headless mode.
---
.../src/org/openide/text/DataEditorSupport.java | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index 2edd115..fe9254c 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -21,6 +21,7 @@ package org.openide.text;
import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
import org.netbeans.modules.openide.loaders.SimpleES;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -1352,12 +1353,19 @@ public class DataEditorSupport extends CloneableEditorSupport {
try {
des.superSaveDoc();
} catch (UserQuestionException ex) {
- NotifyDescriptor nd = new NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
- NotifyDescriptor.YES_NO_OPTION);
- Object res = DialogDisplayer.getDefault().notify(nd);
-
- if (NotifyDescriptor.OK_OPTION.equals(res)) {
+ if (GraphicsEnvironment.isHeadless()) {
+ // We cn not ask for anything in headless mode.
+ // When there are e.g. external changes, we want to reload them,
+ // otherwise we'd keep an inconsistent state.
ex.confirmed();
+ } else {
+ NotifyDescriptor nd = new NotifyDescriptor.Confirmation(ex.getLocalizedMessage(),
+ NotifyDescriptor.YES_NO_OPTION);
+ Object res = DialogDisplayer.getDefault().notify(nd);
+
+ if (NotifyDescriptor.OK_OPTION.equals(res) || true) {
+ ex.confirmed();
+ }
}
}
} catch (IOException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists