This is an automated email from the ASF dual-hosted git repository.

sdedic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new fd2a2de  NETBEANS-951: terminate application in headless mode (#586)
fd2a2de is described below

commit fd2a2de2141b66fc47c1f1d888b7bbc3bc81d4e4
Author: Svatopluk Dedic <svatopluk.de...@oracle.com>
AuthorDate: Tue Jun 12 10:01:33 2018 +0200

    NETBEANS-951: terminate application in headless mode (#586)
---
 o.n.core/src/org/netbeans/core/GuiRunLevel.java | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/o.n.core/src/org/netbeans/core/GuiRunLevel.java 
b/o.n.core/src/org/netbeans/core/GuiRunLevel.java
index f46f028..c072a90 100644
--- a/o.n.core/src/org/netbeans/core/GuiRunLevel.java
+++ b/o.n.core/src/org/netbeans/core/GuiRunLevel.java
@@ -36,6 +36,7 @@ import org.openide.awt.StatusDisplayer;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
 import org.openide.util.NbBundle;
+import org.openide.util.RequestProcessor;
 import org.openide.util.lookup.ServiceProvider;
 import org.openide.windows.WindowManager;
 
@@ -67,12 +68,19 @@ public class GuiRunLevel implements RunLevel {
         Splash.getInstance().increment(10);
 
         if (CLIOptions.isGui()) {
-        
//---------------------------------------------------------------------------------------------------------
-        // initialize main window AFTER the setup wizard is finished
-
-        initializeMainWindow ();
-        StartLog.logProgress ("Main window initialized"); // NOI18N
-        Splash.getInstance().increment(1);
+            
//---------------------------------------------------------------------------------------------------------
+            // initialize main window AFTER the setup wizard is finished
+
+            initializeMainWindow ();
+            StartLog.logProgress ("Main window initialized"); // NOI18N
+            Splash.getInstance().increment(1);
+        } else {
+            RequestProcessor.getDefault().post(new Runnable() {
+                @Override
+                public void run() {
+                    maybeDie(null);
+                }
+            });
         }
 
         // 
-----------------------------------------------------------------------------------------------------

-- 
To stop receiving notification emails like this one, please contact
sde...@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to