1 21 22 package com.izforge.izpack.panels; 23 24 import java.io.IOException ; 25 26 import net.n3.nanoxml.XMLElement; 27 28 import com.izforge.izpack.installer.AutomatedInstallData; 29 import com.izforge.izpack.installer.PanelAutomation; 30 import com.izforge.izpack.installer.PanelAutomationHelper; 31 import com.izforge.izpack.installer.ProcessPanelWorker; 32 import com.izforge.izpack.util.AbstractUIProcessHandler; 33 34 40 public class ProcessPanelAutomationHelper extends PanelAutomationHelper implements PanelAutomation, 41 AbstractUIProcessHandler 42 { 43 44 private int noOfJobs = 0; 45 46 private int currentJob = 0; 47 48 54 public void makeXMLData(AutomatedInstallData installData, XMLElement panelRoot) 55 { 56 } 59 60 67 public boolean runAutomated(AutomatedInstallData idata, XMLElement panelRoot) 68 { 69 try 70 { 71 ProcessPanelWorker worker = new ProcessPanelWorker(idata, this); 72 73 worker.run(); 74 75 return worker.getResult(); 76 } 77 catch (IOException e) 78 { 79 e.printStackTrace(); 80 return false; 81 } 82 83 } 84 85 public void logOutput(String message, boolean stderr) 86 { 87 if (stderr) 88 { 89 System.err.println(message); 90 } 91 else 92 { 93 System.out.println(message); 94 } 95 } 96 97 102 public void startProcessing(int noOfJobs) 103 { 104 System.out.println("[ Starting processing ]"); 105 this.noOfJobs = noOfJobs; 106 } 107 108 112 public void finishProcessing() 113 { 114 System.out.println("[ Processing finished ]"); 115 } 116 117 120 public void startProcess(String name) 121 { 122 this.currentJob++; 123 System.out.println("Starting process " + name + " (" + Integer.toString(this.currentJob) 124 + "/" + Integer.toString(this.noOfJobs) + ")"); 125 } 126 127 public void finishProcess() 128 { 129 } 130 } 131 | Popular Tags |