1 19 20 package com.izforge.izpack.installer; 21 22 import java.util.ArrayList ; 23 import java.util.HashMap ; 24 import java.util.List ; 25 import java.util.Map ; 26 import java.util.Properties ; 27 import java.util.zip.ZipOutputStream ; 28 29 import net.n3.nanoxml.XMLElement; 30 31 import com.izforge.izpack.Info; 32 import com.izforge.izpack.LocaleDatabase; 33 34 40 public class AutomatedInstallData 41 { 42 43 45 50 static final String [] CUSTOM_ACTION_TYPES = new String [] { "/installerListeners", 54 "/uninstallerListeners", "/uninstallerLibs", "/uninstallerJars"}; 55 56 public static final int INSTALLER_LISTENER_INDEX = 0; 57 58 public static final int UNINSTALLER_LISTENER_INDEX = 1; 59 60 public static final int UNINSTALLER_LIBS_INDEX = 2; 61 62 public static final int UNINSTALLER_JARS_INDEX = 3; 63 64 66 67 public String localeISO3; 68 69 70 public LocaleDatabase langpack; 71 72 73 public ZipOutputStream uninstallOutJar; 74 75 76 public Info info; 77 78 79 public List allPacks; 80 81 82 public List availablePacks; 83 84 85 public List selectedPacks; 86 87 88 public List panels; 89 90 91 public List panelsOrder; 92 93 94 public int curPanelNumber; 95 96 97 public boolean canClose = false; 98 99 100 public boolean installSuccess = true; 101 102 103 public XMLElement xmlData; 104 105 106 public Map customData; 107 108 111 protected Properties variables; 112 113 114 protected Map attributes; 115 116 120 private static AutomatedInstallData self = null; 121 122 126 public static AutomatedInstallData getInstance() 127 { 128 return( self); 129 } 130 131 134 public AutomatedInstallData() 135 { 136 availablePacks = new ArrayList (); 137 selectedPacks = new ArrayList (); 138 panels = new ArrayList (); 139 panelsOrder = new ArrayList (); 140 xmlData = new XMLElement("AutomatedInstallation"); 141 variables = new Properties (); 142 attributes = new HashMap (); 143 customData = new HashMap (); 144 if( self != null ) 145 throw new RuntimeException ("Panic!! second call of the InstallData Ctor!!"); 146 self = this; 147 } 148 149 155 public Properties getVariables() 156 { 157 return variables; 158 } 159 160 168 public void setVariable(String var, String val) 169 { 170 variables.setProperty(var, val); 171 } 172 173 181 public String getVariable(String var) 182 { 183 return variables.getProperty(var); 184 } 185 186 192 public void setInstallPath(String path) 193 { 194 setVariable(ScriptParser.INSTALL_PATH, path); 195 } 196 197 203 public String getInstallPath() 204 { 205 return getVariable(ScriptParser.INSTALL_PATH); 206 } 207 208 215 public Object getAttribute(String attr) 216 { 217 return attributes.get(attr); 218 } 219 220 231 public void setAttribute(String attr, Object val) 232 { 233 if (val == null) 234 attributes.remove(attr); 235 else 236 attributes.put(attr, val); 237 238 } 239 } 240 | Popular Tags |