OSDN Git Service

外部プロセスの実行に失敗したとき、エラーのダイアログを表示するよう変更
authorAkihiro Ono <akihiro@ase.co.jp>
Fri, 27 Nov 2009 10:19:25 +0000 (19:19 +0900)
committerAkihiro Ono <akihiro@ase.co.jp>
Fri, 27 Nov 2009 10:19:25 +0000 (19:19 +0900)
installer/IzPack/src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java

index b27b143..3b7b907 100644 (file)
@@ -1,17 +1,17 @@
 /*
  * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
- * 
+ *
  * http://izpack.org/
  * http://izpack.codehaus.org/
- * 
+ *
  * Copyright 2004 Tino Schwarze
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- *     
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -67,7 +67,7 @@ public class ProcessPanelWorker implements Runnable
     private String logfiledir = null;
 
     protected AutomatedInstallData idata;
-    
+
     private Map<Boolean,List<ButtonConfig>> buttonConfigs = new Hashtable<Boolean, List<ButtonConfig>>();
 
     /**
@@ -101,7 +101,7 @@ public class ProcessPanelWorker implements Runnable
             e.printStackTrace();
             return false;
         }
-       
+
         IXMLParser parser = new XMLParser();
         IXMLElement spec;
         try
@@ -213,10 +213,10 @@ public class ProcessPanelWorker implements Runnable
                 this.jobs.add(new ProcessingJob(job_name, ef_list));
             }
         }
-        
+
         buttonConfigs.put(Boolean.FALSE, new ArrayList<ButtonConfig>());
         buttonConfigs.put(Boolean.TRUE, new ArrayList<ButtonConfig>());
-        
+
         for (IXMLElement ef : spec.getChildrenNamed("onFail")) {
             String conditionid = ef.hasAttribute("condition") ? ef.getAttribute("condition") : ef.hasAttribute("conditionid") ? ef.getAttribute("conditionid") : null;
             boolean unlockPrev = ef.hasAttribute("previous") ? Boolean.parseBoolean(ef.getAttribute("previous")) : false;
@@ -311,7 +311,7 @@ public class ProcessPanelWorker implements Runnable
 
         boolean unlockNext = true;
         boolean unlockPrev = false;
-        
+
         // get the ButtonConfigs matching the this.result
         for (ButtonConfig bc : buttonConfigs.get(Boolean.valueOf(this.result)))
         {
@@ -327,12 +327,12 @@ public class ProcessPanelWorker implements Runnable
                     continue;
                 }
             }
-            
+
             unlockNext = bc.isUnlockNext();
             unlockPrev = bc.isUnlockPrev();
             break;
         }
-        
+
         this.handler.finishProcessing(unlockPrev, unlockNext);
         if (logfile != null)
         {
@@ -464,12 +464,9 @@ public class ProcessPanelWorker implements Runnable
 
                     if (exitStatus != 0)
                     {
-                        if (this.handler.askQuestion("Process execution failed",
-                                "Continue anyway?", AbstractUIHandler.CHOICES_YES_NO,
-                                AbstractUIHandler.ANSWER_YES) == AbstractUIHandler.ANSWER_NO)
-                        {
-                            return false;
-                        }
+                        String message = AutomatedInstallData.getInstance().langpack.getString("FinishPanel.fail");
+                        this.handler.emitError("error", message);
+                        return false;
                     }
                 }
                 catch (InterruptedException ie)
@@ -693,20 +690,20 @@ public class ProcessPanelWorker implements Runnable
      * in the list if that pack is actually selected for installation. <br><br> <b>Note:</b><br>
      * If the list of selected packs is empty then <code>true</code> is always returned. The same
      * is true if the <code>packs</code> list is empty.
-     * 
+     *
      * @param packs a <code>Vector</code> of <code>String</code>s. Each of the strings denotes
      * a pack for which the schortcut should be created if the pack is actually installed.
-     * 
+     *
      * @return <code>true</code> if the shortcut is required for at least on pack in the list,
      * otherwise returns <code>false</code>.
      */
     /*--------------------------------------------------------------------------*/
     /*
      * @design
-     * 
+     *
      * The information about the installed packs comes from InstallData.selectedPacks. This assumes
      * that this panel is presented to the user AFTER the PacksPanel.
-     * 
+     *
      * /*--------------------------------------------------------------------------
      */
 
@@ -749,7 +746,7 @@ class  ButtonConfig {
     private final String conditionid;
     private final boolean unlockPrev;
     private final boolean unlockNext;
-    
+
     /**
      * @param conditionid
      * @param unlockPrev
@@ -769,7 +766,7 @@ class  ButtonConfig {
     {
         return unlockPrev;
     }
-    
+
     /**
      * @return the unlockNext
      */
@@ -778,7 +775,7 @@ class  ButtonConfig {
         return unlockNext;
     }
 
-    
+
     /**
      * @return the conditionid
      */