bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
---|---|---|
public void pause() { playing = false; pause = true; syncSlider(); }
|
public void pause() { playing = false; pause = true; }
| 3,241,438 |
public void stop() { timer.stop(); playing = false; pause = false; up = true; syncSlider(); }
|
public void stop() { timer.stop(); playing = false; pause = false; up = true; syncSlider(); }
| 3,241,439 |
public void setQuitButtonText(String text) { if (text == null) text = langpack.getString("installer.quit"); quitButton.setText(text); }
|
public void setQuitButtonText(String text) { if (text == null) text = langpack.getString("installer.quit"); quitButton.setText(text); }
| 3,241,440 |
protected void wipeAborted() { Iterator it; // We set interrupt to all running Unpacker and wait 40 sec for maximum. // If interrupt is discarded (return value false), return immediately: if (!Unpacker.interruptAll(40000)) return; // Wipes them all in 2 stages UninstallData u = UninstallData.getInstance(); it = u.getFilesList().iterator(); if (!it.hasNext()) return; while (it.hasNext()) { String p = (String) it.next(); File f = new File(p); f.delete(); } String fullCleanup = installdata.getVariable("InstallerFrame.cleanAllAtInterrupt"); if (fullCleanup == null || !fullCleanup.equalsIgnoreCase("no")) cleanWipe(new File(installdata.getInstallPath())); }
|
protected void wipeAborted() { Iterator it; // We set interrupt to all running Unpacker and wait 40 sec for maximum. // If interrupt is discarded (return value false), return immediately: if (!Unpacker.interruptAll(40000)) return; // Wipes them all in 2 stages UninstallData u = UninstallData.getInstance(); it = u.getFilesList().iterator(); if (!it.hasNext()) return; while (it.hasNext()) { String p = (String) it.next(); File f = new File(p); f.delete(); } String fullCleanup = installdata.getVariable("InstallerFrame.cleanAllAtInterrupt"); if (fullCleanup == null || !"no".equalsIgnoreCase(fullCleanup)) cleanWipe(new File(installdata.getInstallPath())); }
| 3,241,441 |
private void writeUninstallData() { try { // We get the data UninstallData udata = UninstallData.getInstance(); List files = udata.getFilesList(); ZipOutputStream outJar = installdata.uninstallOutJar; if (outJar == null) return; // We write the files log outJar.putNextEntry(new ZipEntry("install.log")); BufferedWriter logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(installdata.getInstallPath()); logWriter.newLine(); Iterator iter = files.iterator(); while (iter.hasNext()) { logWriter.write((String) iter.next()); if (iter.hasNext()) logWriter.newLine(); } logWriter.flush(); outJar.closeEntry(); // We write the uninstaller jar file log outJar.putNextEntry(new ZipEntry("jarlocation.log")); logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(udata.getUninstallerJarFilename()); logWriter.newLine(); logWriter.write(udata.getUninstallerPath()); logWriter.flush(); outJar.closeEntry(); // Write out executables to execute on uninstall outJar.putNextEntry(new ZipEntry("executables")); ObjectOutputStream execStream = new ObjectOutputStream(outJar); iter = udata.getExecutablesList().iterator(); execStream.writeInt(udata.getExecutablesList().size()); while (iter.hasNext()) { ExecutableFile file = (ExecutableFile) iter.next(); execStream.writeObject(file); } execStream.flush(); outJar.closeEntry(); // Write out additional uninstall data // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { Iterator keys = additionalData.keySet().iterator(); HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { String key = (String) keys.next(); Object contents = additionalData.get(key); if (key.equals("__uninstallLibs__")) { Iterator nativeLibIter = ((List) contents).iterator(); while (nativeLibIter != null && nativeLibIter.hasNext()) { String nativeLibName = (String) ((List) nativeLibIter.next()).get(0); byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; outJar.putNextEntry(new ZipEntry("native/" + nativeLibName)); InputStream in = getClass().getResourceAsStream( "/native/" + nativeLibName); while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } outJar.closeEntry(); } } else if (key.equals("uninstallerListeners") || key.equals("uninstallerJars")) { // It is a ArrayList of ArrayLists which contains the // full // package paths of all needed class files. // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); while (listenerIter.hasNext()) { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; CustomData customData = (CustomData) listenerIter.next(); // First element of the list contains the listener // class path; // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { String contentPath = (String) liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try { outJar.putNextEntry(new ZipEntry(contentPath)); } catch (ZipException ze) { // Ignore, or ignore not ?? May be it is a // exception because // a doubled entry was tried, then we should // ignore ... Debug.trace("ZipException in writing custom data: " + ze.getMessage()); continue; } InputStream in = getClass().getResourceAsStream("/" + contentPath); if (in != null) { while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } else Debug.trace("custom data not found: " + contentPath); outJar.closeEntry(); } } // Third we write the list into the // uninstaller.jar outJar.putNextEntry(new ZipEntry(key)); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(subContents); objOut.flush(); outJar.closeEntry(); } else { outJar.putNextEntry(new ZipEntry(key)); if (contents instanceof ByteArrayOutputStream) { ((ByteArrayOutputStream) contents).writeTo(outJar); } else { ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(contents); objOut.flush(); } outJar.closeEntry(); } } } // Cleanup outJar.flush(); outJar.close(); } catch (Exception err) { err.printStackTrace(); } }
|
private void writeUninstallData() { try { // We get the data UninstallData udata = UninstallData.getInstance(); List files = udata.getFilesList(); ZipOutputStream outJar = installdata.uninstallOutJar; if (outJar == null) return; // We write the files log outJar.putNextEntry(new ZipEntry("install.log")); BufferedWriter logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(installdata.getInstallPath()); logWriter.newLine(); Iterator iter = files.iterator(); while (iter.hasNext()) { logWriter.write((String) iter.next()); if (iter.hasNext()) logWriter.newLine(); } logWriter.flush(); outJar.closeEntry(); // We write the uninstaller jar file log outJar.putNextEntry(new ZipEntry("jarlocation.log")); logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(udata.getUninstallerJarFilename()); logWriter.newLine(); logWriter.write(udata.getUninstallerPath()); logWriter.flush(); outJar.closeEntry(); // Write out executables to execute on uninstall outJar.putNextEntry(new ZipEntry("executables")); ObjectOutputStream execStream = new ObjectOutputStream(outJar); iter = udata.getExecutablesList().iterator(); execStream.writeInt(udata.getExecutablesList().size()); while (iter.hasNext()) { ExecutableFile file = (ExecutableFile) iter.next(); execStream.writeObject(file); } execStream.flush(); outJar.closeEntry(); // Write out additional uninstall data // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { Iterator keys = additionalData.keySet().iterator(); HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { String key = (String) keys.next(); Object contents = additionalData.get(key); if ("__uninstallLibs__".equals(key)) { Iterator nativeLibIter = ((List) contents).iterator(); while (nativeLibIter != null && nativeLibIter.hasNext()) { String nativeLibName = (String) ((List) nativeLibIter.next()).get(0); byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; outJar.putNextEntry(new ZipEntry("native/" + nativeLibName)); InputStream in = getClass().getResourceAsStream( "/native/" + nativeLibName); while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } outJar.closeEntry(); } } else if (key.equals("uninstallerListeners") || key.equals("uninstallerJars")) { // It is a ArrayList of ArrayLists which contains the // full // package paths of all needed class files. // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); while (listenerIter.hasNext()) { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; CustomData customData = (CustomData) listenerIter.next(); // First element of the list contains the listener // class path; // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { String contentPath = (String) liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try { outJar.putNextEntry(new ZipEntry(contentPath)); } catch (ZipException ze) { // Ignore, or ignore not ?? May be it is a // exception because // a doubled entry was tried, then we should // ignore ... Debug.trace("ZipException in writing custom data: " + ze.getMessage()); continue; } InputStream in = getClass().getResourceAsStream("/" + contentPath); if (in != null) { while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } else Debug.trace("custom data not found: " + contentPath); outJar.closeEntry(); } } // Third we write the list into the // uninstaller.jar outJar.putNextEntry(new ZipEntry(key)); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(subContents); objOut.flush(); outJar.closeEntry(); } else { outJar.putNextEntry(new ZipEntry(key)); if (contents instanceof ByteArrayOutputStream) { ((ByteArrayOutputStream) contents).writeTo(outJar); } else { ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(contents); objOut.flush(); } outJar.closeEntry(); } } } // Cleanup outJar.flush(); outJar.close(); } catch (Exception err) { err.printStackTrace(); } }
| 3,241,442 |
private void writeUninstallData() { try { // We get the data UninstallData udata = UninstallData.getInstance(); List files = udata.getFilesList(); ZipOutputStream outJar = installdata.uninstallOutJar; if (outJar == null) return; // We write the files log outJar.putNextEntry(new ZipEntry("install.log")); BufferedWriter logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(installdata.getInstallPath()); logWriter.newLine(); Iterator iter = files.iterator(); while (iter.hasNext()) { logWriter.write((String) iter.next()); if (iter.hasNext()) logWriter.newLine(); } logWriter.flush(); outJar.closeEntry(); // We write the uninstaller jar file log outJar.putNextEntry(new ZipEntry("jarlocation.log")); logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(udata.getUninstallerJarFilename()); logWriter.newLine(); logWriter.write(udata.getUninstallerPath()); logWriter.flush(); outJar.closeEntry(); // Write out executables to execute on uninstall outJar.putNextEntry(new ZipEntry("executables")); ObjectOutputStream execStream = new ObjectOutputStream(outJar); iter = udata.getExecutablesList().iterator(); execStream.writeInt(udata.getExecutablesList().size()); while (iter.hasNext()) { ExecutableFile file = (ExecutableFile) iter.next(); execStream.writeObject(file); } execStream.flush(); outJar.closeEntry(); // Write out additional uninstall data // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { Iterator keys = additionalData.keySet().iterator(); HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { String key = (String) keys.next(); Object contents = additionalData.get(key); if (key.equals("__uninstallLibs__")) { Iterator nativeLibIter = ((List) contents).iterator(); while (nativeLibIter != null && nativeLibIter.hasNext()) { String nativeLibName = (String) ((List) nativeLibIter.next()).get(0); byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; outJar.putNextEntry(new ZipEntry("native/" + nativeLibName)); InputStream in = getClass().getResourceAsStream( "/native/" + nativeLibName); while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } outJar.closeEntry(); } } else if (key.equals("uninstallerListeners") || key.equals("uninstallerJars")) { // It is a ArrayList of ArrayLists which contains the // full // package paths of all needed class files. // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); while (listenerIter.hasNext()) { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; CustomData customData = (CustomData) listenerIter.next(); // First element of the list contains the listener // class path; // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { String contentPath = (String) liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try { outJar.putNextEntry(new ZipEntry(contentPath)); } catch (ZipException ze) { // Ignore, or ignore not ?? May be it is a // exception because // a doubled entry was tried, then we should // ignore ... Debug.trace("ZipException in writing custom data: " + ze.getMessage()); continue; } InputStream in = getClass().getResourceAsStream("/" + contentPath); if (in != null) { while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } else Debug.trace("custom data not found: " + contentPath); outJar.closeEntry(); } } // Third we write the list into the // uninstaller.jar outJar.putNextEntry(new ZipEntry(key)); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(subContents); objOut.flush(); outJar.closeEntry(); } else { outJar.putNextEntry(new ZipEntry(key)); if (contents instanceof ByteArrayOutputStream) { ((ByteArrayOutputStream) contents).writeTo(outJar); } else { ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(contents); objOut.flush(); } outJar.closeEntry(); } } } // Cleanup outJar.flush(); outJar.close(); } catch (Exception err) { err.printStackTrace(); } }
|
private void writeUninstallData() { try { // We get the data UninstallData udata = UninstallData.getInstance(); List files = udata.getFilesList(); ZipOutputStream outJar = installdata.uninstallOutJar; if (outJar == null) return; // We write the files log outJar.putNextEntry(new ZipEntry("install.log")); BufferedWriter logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(installdata.getInstallPath()); logWriter.newLine(); Iterator iter = files.iterator(); while (iter.hasNext()) { logWriter.write((String) iter.next()); if (iter.hasNext()) logWriter.newLine(); } logWriter.flush(); outJar.closeEntry(); // We write the uninstaller jar file log outJar.putNextEntry(new ZipEntry("jarlocation.log")); logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(udata.getUninstallerJarFilename()); logWriter.newLine(); logWriter.write(udata.getUninstallerPath()); logWriter.flush(); outJar.closeEntry(); // Write out executables to execute on uninstall outJar.putNextEntry(new ZipEntry("executables")); ObjectOutputStream execStream = new ObjectOutputStream(outJar); iter = udata.getExecutablesList().iterator(); execStream.writeInt(udata.getExecutablesList().size()); while (iter.hasNext()) { ExecutableFile file = (ExecutableFile) iter.next(); execStream.writeObject(file); } execStream.flush(); outJar.closeEntry(); // Write out additional uninstall data // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { Iterator keys = additionalData.keySet().iterator(); HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { String key = (String) keys.next(); Object contents = additionalData.get(key); if (key.equals("__uninstallLibs__")) { Iterator nativeLibIter = ((List) contents).iterator(); while (nativeLibIter != null && nativeLibIter.hasNext()) { String nativeLibName = (String) ((List) nativeLibIter.next()).get(0); byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; outJar.putNextEntry(new ZipEntry("native/" + nativeLibName)); InputStream in = getClass().getResourceAsStream( "/native/" + nativeLibName); while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } outJar.closeEntry(); } } else if ("uninstallerListeners".equals(key) || "uninstallerJars".equals(key)) { // It is a ArrayList of ArrayLists which contains the // full // package paths of all needed class files. // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); while (listenerIter.hasNext()) { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; CustomData customData = (CustomData) listenerIter.next(); // First element of the list contains the listener // class path; // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { String contentPath = (String) liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try { outJar.putNextEntry(new ZipEntry(contentPath)); } catch (ZipException ze) { // Ignore, or ignore not ?? May be it is a // exception because // a doubled entry was tried, then we should // ignore ... Debug.trace("ZipException in writing custom data: " + ze.getMessage()); continue; } InputStream in = getClass().getResourceAsStream("/" + contentPath); if (in != null) { while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } else Debug.trace("custom data not found: " + contentPath); outJar.closeEntry(); } } // Third we write the list into the // uninstaller.jar outJar.putNextEntry(new ZipEntry(key)); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(subContents); objOut.flush(); outJar.closeEntry(); } else { outJar.putNextEntry(new ZipEntry(key)); if (contents instanceof ByteArrayOutputStream) { ((ByteArrayOutputStream) contents).writeTo(outJar); } else { ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(contents); objOut.flush(); } outJar.closeEntry(); } } } // Cleanup outJar.flush(); outJar.close(); } catch (Exception err) { err.printStackTrace(); } }
| 3,241,443 |
public KeyedObjectPool createPool() { return new GenericKeyedObjectPool(_factory,_maxActive,_whenExhaustedAction,_maxWait,_maxIdle,_maxTotal,_testOnBorrow,_testOnReturn,_timeBetweenEvictionRunsMillis,_numTestsPerEvictionRun,_minEvictableIdleTimeMillis,_testWhileIdle); }
|
public KeyedObjectPool createPool() { return new GenericKeyedObjectPool(_factory,_maxActive,_whenExhaustedAction,_maxWait,_maxIdle,_maxTotal,_minIdle,_testOnBorrow,_testOnReturn,_timeBetweenEvictionRunsMillis,_numTestsPerEvictionRun,_minEvictableIdleTimeMillis,_testWhileIdle); }
| 3,241,444 |
public void errorUnpack(String error) { this.packOpLabel.setText(error); idata.installSuccess = false; JOptionPane.showMessageDialog( this, error.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); }
|
public void errorUnpack(String error) { this.packOpLabel.setText(error); idata.installSuccess = false; JOptionPane.showMessageDialog( this, error, parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); }
| 3,241,445 |
QuantumDef copy() { return new QuantumDef(family, pixelType, curveCoefficient, cdStart, cdEnd, bitResolution); }
|
QuantumDef copy() { return new QuantumDef(family, pixelType, curveCoefficient, cdStart, cdEnd, bitResolution); }
| 3,241,447 |
public InstallerFrame(String title, InstallData installdata) throws Exception { super(title); guiListener = new ArrayList(); visiblePanelMapping = new ArrayList(); this.installdata = installdata; this.langpack = installdata.langpack; // Sets the window events handler addWindowListener(new WindowHandler()); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // initialize rules by loading the conditions loadConditions(); // Builds the GUI loadIcons(); loadPanels(); buildGUI(); // We show the frame showFrame(); switchPanel(0); }
|
public InstallerFrame(String title, InstallData installdata) throws Exception { super(title); guiListener = new ArrayList(); visiblePanelMapping = new ArrayList(); this.installdata = installdata; this.langpack = installdata.langpack; // Sets the window events handler addWindowListener(new WindowHandler()); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // initialize rules by loading the conditions loadConditions(); // Builds the GUI loadIcons(); loadPanels(); buildGUI(); // We show the frame showFrame(); switchPanel(0); }
| 3,241,448 |
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
|
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
| 3,241,449 |
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
|
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
| 3,241,450 |
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
|
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
| 3,241,451 |
protected void buildQuery(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(Image.class); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.createCriteria("defaultPixels",LEFT_JOIN); // Add restrictions to the most distant criteria Criteria[] hy = Hierarchy.fetchParents(c,(Class) value(CLASS),Integer.MAX_VALUE); hy[hy.length-1].add(Restrictions.in("id",(Collection) value(IDS))); setCriteria( c ); }
|
protected void buildQuery(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(Image.class); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); Criteria pix = c.createCriteria("defaultPixels",LEFT_JOIN); pix.createCriteria("pixelsType",LEFT_JOIN); pix.createCriteria("pixelsDimensions",LEFT_JOIN); // Add restrictions to the most distant criteria Criteria[] hy = Hierarchy.fetchParents(c,(Class) value(CLASS),Integer.MAX_VALUE); hy[hy.length-1].add(Restrictions.in("id",(Collection) value(IDS))); setCriteria( c ); }
| 3,241,452 |
private String getLanguageResourceString(String resource) throws ResourceNotFoundException { InputStream in; String resourcePath = this.resourceBasePath + resource + "_" + this.locale; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else { // if there's no language dependent resource found resourcePath = this.resourceBasePath + resource; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else throw new ResourceNotFoundException("Can not find Resource " + resource + " for language " + this.locale); } }
|
private String getLanguageResourceString(String resource) throws ResourceNotFoundException { InputStream in; String resourcePath = this.resourceBasePath + resource + "_" + this.locale; in = ResourceManager.class.getResourceAsStream(resourcePath); if (in != null) return resourcePath; else { // if there's no language dependent resource found resourcePath = this.resourceBasePath + resource; in = ResourceManager.class.getResourceAsStream(resourcePath); if (in != null) return resourcePath; else throw new ResourceNotFoundException("Can not find Resource " + resource + " for language " + this.locale); } }
| 3,241,453 |
private String getLanguageResourceString(String resource) throws ResourceNotFoundException { InputStream in; String resourcePath = this.resourceBasePath + resource + "_" + this.locale; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else { // if there's no language dependent resource found resourcePath = this.resourceBasePath + resource; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else throw new ResourceNotFoundException("Can not find Resource " + resource + " for language " + this.locale); } }
|
private String getLanguageResourceString(String resource) throws ResourceNotFoundException { InputStream in; String resourcePath = this.resourceBasePath + resource + "_" + this.locale; in = ResourceManager.class.getResourceAsStream(resourcePath); if (in != null) return resourcePath; else { // if there's no language dependent resource found resourcePath = this.resourceBasePath + resource; in = ResourceManager.class.getResourceAsStream(resourcePath); if (in != null) return resourcePath; else throw new ResourceNotFoundException("Can not find Resource " + resource + " for language " + this.locale); } }
| 3,241,454 |
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; int[] rgb; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval, should come in next version. rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
|
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; int[] rgb; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval, should come in next version. rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
| 3,241,455 |
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; int[] rgb; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval, should come in next version. rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
|
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; int[] rgb; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval, should come in next version. rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
| 3,241,456 |
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
|
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); boolean isNull = false; if (renderingDef == null) { isNull = true; renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
| 3,241,457 |
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
|
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); } //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
| 3,241,458 |
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
|
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
| 3,241,459 |
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
|
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
| 3,241,461 |
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
|
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
| 3,241,462 |
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
|
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
| 3,241,463 |
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String os = System.getProperty("os.name"); String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "mac os x", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
|
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String os = System.getProperty("os.name"); String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "mac os x", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
| 3,241,464 |
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String os = System.getProperty("os.name"); String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "mac os x", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
|
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "mac os x", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
| 3,241,465 |
public void panelActivate() { // Text handling loadInfo(); parseText(); // UI handling textArea.setText(info.toString()); textArea.setCaretPosition(0); }
|
public void panelActivate() { // Text handling loadInfo(); parseText(); // UI handling textArea.setText(info); textArea.setCaretPosition(0); }
| 3,241,466 |
private boolean readCheckBox (Object [] field) { String variable = null; String trueValue = null; String falseValue = null; JCheckBox box = null; try { box = (JCheckBox)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; trueValue = (String)field [POS_TRUE]; if (trueValue == null) { trueValue = ""; } falseValue = (String)field [POS_FALSE]; if (falseValue == null) { falseValue = ""; } } catch (Throwable exception) { return (true); } if (box.isSelected ()) { idata.getVariableValueMap ().setVariable (variable, trueValue); entries.add (new TextValuePair (variable, trueValue)); } else { idata.getVariableValueMap ().setVariable (variable, falseValue); entries.add (new TextValuePair (variable, falseValue)); } return (true); }
|
private boolean readCheckBox (Object [] field) { String variable = null; String trueValue = null; String falseValue = null; JCheckBox box = null; try { box = (JCheckBox)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; trueValue = (String)field [POS_TRUE]; if (trueValue == null) { trueValue = ""; } falseValue = (String)field [POS_FALSE]; if (falseValue == null) { falseValue = ""; } } catch (Throwable exception) { return (true); } if (box.isSelected ()) { idata.setVariable (variable, trueValue); entries.add (new TextValuePair (variable, trueValue)); } else { idata.getVariableValueMap ().setVariable (variable, falseValue); entries.add (new TextValuePair (variable, falseValue)); } return (true); }
| 3,241,468 |
private boolean readCheckBox (Object [] field) { String variable = null; String trueValue = null; String falseValue = null; JCheckBox box = null; try { box = (JCheckBox)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; trueValue = (String)field [POS_TRUE]; if (trueValue == null) { trueValue = ""; } falseValue = (String)field [POS_FALSE]; if (falseValue == null) { falseValue = ""; } } catch (Throwable exception) { return (true); } if (box.isSelected ()) { idata.getVariableValueMap ().setVariable (variable, trueValue); entries.add (new TextValuePair (variable, trueValue)); } else { idata.getVariableValueMap ().setVariable (variable, falseValue); entries.add (new TextValuePair (variable, falseValue)); } return (true); }
|
private boolean readCheckBox (Object [] field) { String variable = null; String trueValue = null; String falseValue = null; JCheckBox box = null; try { box = (JCheckBox)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; trueValue = (String)field [POS_TRUE]; if (trueValue == null) { trueValue = ""; } falseValue = (String)field [POS_FALSE]; if (falseValue == null) { falseValue = ""; } } catch (Throwable exception) { return (true); } if (box.isSelected ()) { idata.getVariableValueMap ().setVariable (variable, trueValue); entries.add (new TextValuePair (variable, trueValue)); } else { idata.setVariable(variable, falseValue); entries.add (new TextValuePair (variable, falseValue)); } return (true); }
| 3,241,469 |
private boolean readComboBox (Object [] field) { String variable = null; String value = null; JComboBox comboBox = null; try { variable = (String)field [POS_VARIABLE]; comboBox = (JComboBox)field [POS_FIELD]; value = ((TextValuePair)comboBox.getSelectedItem ()).getValue (); } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
|
private boolean readComboBox (Object [] field) { String variable = null; String value = null; JComboBox comboBox = null; try { variable = (String)field [POS_VARIABLE]; comboBox = (JComboBox)field [POS_FIELD]; value = ((TextValuePair)comboBox.getSelectedItem ()).getValue (); } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.setVariable(variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
| 3,241,470 |
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.getVariableValueMap ().setVariable (variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
|
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable(variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
| 3,241,471 |
private boolean readRadioButton (Object [] field) { String variable = null; String value = null; JRadioButton button = null; try { button = (JRadioButton)field [POS_FIELD]; if (!button.isSelected ()) { return (true); } variable = (String)field [POS_VARIABLE]; value = (String)field [POS_TRUE]; } catch (Throwable exception) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
|
private boolean readRadioButton (Object [] field) { String variable = null; String value = null; JRadioButton button = null; try { button = (JRadioButton)field [POS_FIELD]; if (!button.isSelected ()) { return (true); } variable = (String)field [POS_VARIABLE]; value = (String)field [POS_TRUE]; } catch (Throwable exception) { return (true); } idata.setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
| 3,241,472 |
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, (String)field [POS_MESSAGE], parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.getVariableValueMap ().setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
|
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, (String)field [POS_MESSAGE], parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
| 3,241,473 |
private boolean readSearch (Object [] field) { String variable = null; String value = null; JComboBox comboBox = null; try { variable = (String)field [POS_VARIABLE]; comboBox = (JComboBox)field [POS_FIELD]; for (int i = 0; i < this.searchFields.size(); ++i) { SearchField sf = (SearchField)this.searchFields.elementAt (i); if (sf.belongsTo (comboBox)) { value = sf.getResult (); break; } } } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
|
private boolean readSearch (Object [] field) { String variable = null; String value = null; JComboBox comboBox = null; try { variable = (String)field [POS_VARIABLE]; comboBox = (JComboBox)field [POS_FIELD]; for (int i = 0; i < this.searchFields.size(); ++i) { SearchField sf = (SearchField)this.searchFields.elementAt (i); if (sf.belongsTo (comboBox)) { value = sf.getResult (); break; } } } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.setVariable(variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
| 3,241,474 |
private boolean readTextField (Object [] field) { JTextField textField = null; String variable = null; String value = null; try { textField = (JTextField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; value = textField.getText (); } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
|
private boolean readTextField (Object [] field) { JTextField textField = null; String variable = null; String value = null; try { textField = (JTextField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; value = textField.getText (); } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.setVariable(variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
| 3,241,475 |
private List [] getListenerLists() throws Exception { ArrayList [] uninstaller = new ArrayList[] {new ArrayList(),new ArrayList()}; // Load listeners if exist InputStream in; ObjectInputStream objIn; in = getClass().getResourceAsStream("/uninstallerListeners"); if( in != null ) { objIn = new ObjectInputStream(in); List listeners = (List)objIn.readObject(); objIn.close(); Iterator iter = listeners.iterator(); while( iter != null && iter.hasNext()) { Class clazz = Class.forName(((String) iter.next())); UninstallerListener ul = (UninstallerListener) clazz.newInstance(); if( ul.isFileListener()) uninstaller[1].add( ul ); else uninstaller[0].add( ul ); } } return uninstaller; }
|
private List [] getListenerLists() throws Exception { ArrayList [] uninstaller = new ArrayList[] {new ArrayList(),new ArrayList()}; // Load listeners if exist InputStream in; ObjectInputStream objIn; in = getClass().getResourceAsStream("/uninstallerListeners"); if( in != null ) { objIn = new ObjectInputStream(in); List listeners = (List)objIn.readObject(); objIn.close(); Iterator iter = listeners.iterator(); while( iter != null && iter.hasNext()) { Class clazz = Class.forName(((String) iter.next())); UninstallerListener ul = (UninstallerListener) clazz.newInstance(); if( ul.isFileListener()) uninstaller[1].add( ul ); else uninstaller[0].add( ul ); } } return uninstaller; }
| 3,241,476 |
public void removeEditor() { switch (model.getState()) { case DISCARDED: //case SAVE: throw new IllegalStateException("This method cannot be " + "invoked in the DISCARDED, SAVE state."); } Editor editor = model.getEditor(); if (editor != null) { if (editor.hasDataToSave()) { IconManager icons = IconManager.getInstance(); EditorSaverDialog d = new EditorSaverDialog(view, icons.getIcon(IconManager.QUESTION)); d.addPropertyChangeListener( EditorSaverDialog.SAVING_DATA_EDITOR_PROPERTY, controller); d.setVisible(true); return; } } model.setEditorType(NO_EDITOR); view.removeAllFromWorkingPane(); firePropertyChange(REMOVE_EDITOR_PROPERTY, Boolean.FALSE, Boolean.TRUE); }
|
public void removeEditor() { switch (model.getState()) { case DISCARDED: //case SAVE: throw new IllegalStateException("This method cannot be " + "invoked in the DISCARDED, SAVE state."); } Editor editor = model.getEditor(); if (editor != null) { if (editor.hasDataToSave()) { IconManager icons = IconManager.getInstance(); EditorSaverDialog d = new EditorSaverDialog(view, icons.getIcon(IconManager.QUESTION)); d.addPropertyChangeListener( EditorSaverDialog.SAVING_DATA_EDITOR_PROPERTY, controller); UIUtilities.centerAndShow(d); return; } } model.setEditorType(NO_EDITOR); view.removeAllFromWorkingPane(); firePropertyChange(REMOVE_EDITOR_PROPERTY, Boolean.FALSE, Boolean.TRUE); }
| 3,241,477 |
public static File findJarFile(Class clazz) { String resource = clazz.getName().replace('.', '/') + ".class"; URL url = ClassLoader.getSystemResource(resource); if (!url.getProtocol().equals("jar")) return null; String path = url.getFile(); // starts at "file:..." (use getPath() as of 1.3) path = path.substring(0, path.lastIndexOf('!')); File file; // getSystemResource() returns a valid URL (eg. spaces are %20), but a // file // Constructed w/ it will expect "%20" in path. URI and File(URI) // properly // deal with escaping back and forth, but didn't exist until 1.4 if (JAVA_SPECIFICATION_VERSION < 1.4) file = new File(fromURI(path)); else file = new File(URI.create(path)); return file; }
|
public static File findJarFile(Class clazz) { String resource = clazz.getName().replace('.', '/') + ".class"; URL url = ClassLoader.getSystemResource(resource); if (!"jar".equals(url.getProtocol())) return null; String path = url.getFile(); // starts at "file:..." (use getPath() as of 1.3) path = path.substring(0, path.lastIndexOf('!')); File file; // getSystemResource() returns a valid URL (eg. spaces are %20), but a // file // Constructed w/ it will expect "%20" in path. URI and File(URI) // properly // deal with escaping back and forth, but didn't exist until 1.4 if (JAVA_SPECIFICATION_VERSION < 1.4) file = new File(fromURI(path)); else file = new File(URI.create(path)); return file; }
| 3,241,478 |
private void initMethod(Method method) { int mod = method.getModifiers(); if ((mod & Modifier.PUBLIC) == 0 || (mod & Modifier.STATIC) == 0) throw new IllegalArgumentException("Method not public and static"); Class[] params = method.getParameterTypes(); if (params.length != 1 || !params[0].isArray() || !params[0].getComponentType().getName().equals("java.lang.String")) throw new IllegalArgumentException("Method must accept String array"); Class clazz = method.getDeclaringClass(); mod = clazz.getModifiers(); if ((mod & Modifier.PUBLIC) == 0 || (mod & Modifier.INTERFACE) != 0) throw new IllegalArgumentException("Method must be in a public class"); this.method = method; }
|
private void initMethod(Method method) { int mod = method.getModifiers(); if ((mod & Modifier.PUBLIC) == 0 || (mod & Modifier.STATIC) == 0) throw new IllegalArgumentException("Method not public and static"); Class[] params = method.getParameterTypes(); if (params.length != 1 || !params[0].isArray() || !"java.lang.String".equals(params[0].getComponentType().getName())) throw new IllegalArgumentException("Method must accept String array"); Class clazz = method.getDeclaringClass(); mod = clazz.getModifiers(); if ((mod & Modifier.PUBLIC) == 0 || (mod & Modifier.INTERFACE) != 0) throw new IllegalArgumentException("Method must be in a public class"); this.method = method; }
| 3,241,479 |
protected void processPI() throws Exception { XMLUtil.skipWhitespace(this.reader, '&', null, null); String target = XMLUtil.scanIdentifier(this.reader, '&', this.entityResolver); XMLUtil.skipWhitespace(this.reader, '&', null, null); Reader reader = new ContentReader(this.reader, this.entityResolver, '&', StdXMLParser.END_OF_PI, true, ""); if (!target.equalsIgnoreCase("xml")) { this.builder.newProcessingInstruction(target, reader); } reader.close(); }
|
protected void processPI() throws Exception { XMLUtil.skipWhitespace(this.reader, '&', null, null); String target = XMLUtil.scanIdentifier(this.reader, '&', this.entityResolver); XMLUtil.skipWhitespace(this.reader, '&', null, null); Reader reader = new ContentReader(this.reader, this.entityResolver, '&', StdXMLParser.END_OF_PI, true, ""); if (!"xml".equalsIgnoreCase(target)) { this.builder.newProcessingInstruction(target, reader); } reader.close(); }
| 3,241,480 |
protected void processSpecialTag(boolean allowCDATA) throws Exception { char ch = XMLUtil.read(this.reader, null, '&', this.entityResolver); switch (ch) { case '[': if (allowCDATA) { this.processCDATA(); } else { XMLUtil.skipTag(this.reader, '&', this.entityResolver); } return; case 'D': this.processDocType(); return; case '-': XMLUtil.skipComment(this.reader, this.entityResolver); return; } }
|
protected void processSpecialTag(boolean allowCDATA) throws Exception { char ch = XMLUtil.read(this.reader, null, '&', this.entityResolver); switch (ch) { case '[': if (allowCDATA) { this.processCDATA(); } else { XMLUtil.skipTag(this.reader, '&', this.entityResolver); } case 'D': this.processDocType(); case '-': XMLUtil.skipComment(this.reader, this.entityResolver); } }
| 3,241,481 |
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
|
public ZipOutputStream addPack(int packNumber, String name, String targetOs, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
| 3,241,483 |
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
|
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, targetOs, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
| 3,241,484 |
private static Lender getLender(final FactoryConfig config) { final BorrowPolicy borrowPolicy = config.borrowPolicy; Lender lender; if (config.maxIdle != 0) { if (BorrowPolicy.FIFO.equals(borrowPolicy)) { lender = new FifoLender(); } else if (BorrowPolicy.LIFO.equals(borrowPolicy)) { lender = new LifoLender(); } else if (BorrowPolicy.SOFT_FIFO.equals(borrowPolicy)) { lender = new SoftLender(new FifoLender()); } else if (BorrowPolicy.SOFT_LIFO.equals(borrowPolicy)) { lender = new SoftLender(new LifoLender()); } else if (BorrowPolicy.NULL.equals(borrowPolicy)) { lender = new NullLender(); } else { throw new IllegalStateException("No clue what this borrow type is: " + borrowPolicy); } } else { lender = new NullLender(); } // If the lender is a NullLender then there is no point to evicting idle objects that aren't there. if (!(lender instanceof NullLender)) { // If the evictIdleMillis were less than evictInvalidFrequencyMillis // then the InvalidEvictorLender would never run. if (config.evictInvalidFrequencyMillis > 0 && config.evictIdleMillis > config.evictInvalidFrequencyMillis) { lender = new InvalidEvictorLender(lender); ((InvalidEvictorLender)lender).setValidationFrequencyMillis(config.evictInvalidFrequencyMillis); } if (config.evictIdleMillis > 0) { lender = new IdleEvictorLender(lender); ((IdleEvictorLender)lender).setIdleTimeoutMillis(config.evictIdleMillis); } } return lender; }
|
private static Lender getLender(final FactoryConfig config) { final BorrowPolicy borrowPolicy = config.borrowPolicy; Lender lender; if (config.maxIdle != 0) { if (BorrowPolicy.FIFO.equals(borrowPolicy)) { lender = new FifoLender(); } else if (BorrowPolicy.LIFO.equals(borrowPolicy)) { lender = new LifoLender(); } else if (BorrowPolicy.SOFT_FIFO.equals(borrowPolicy)) { lender = new SoftLender(new FifoLender()); } else if (BorrowPolicy.SOFT_LIFO.equals(borrowPolicy)) { lender = new SoftLender(new LifoLender()); } else if (BorrowPolicy.NULL.equals(borrowPolicy)) { lender = new NullLender(); } else { throw new IllegalStateException("No clue what this borrow type is: " + borrowPolicy); } } else { lender = new NullLender(); } // If the lender is a NullLender then there is no point to evicting idle objects that aren't there. if (!(lender instanceof NullLender)) { // If the evictIdleMillis were less than evictInvalidFrequencyMillis // then the InvalidEvictorLender would never run. if (config.evictInvalidFrequencyMillis > 0 && config.evictIdleMillis < config.evictInvalidFrequencyMillis) { lender = new InvalidEvictorLender(lender); ((InvalidEvictorLender)lender).setValidationFrequencyMillis(config.evictInvalidFrequencyMillis); } if (config.evictIdleMillis > 0) { lender = new IdleEvictorLender(lender); ((IdleEvictorLender)lender).setIdleTimeoutMillis(config.evictIdleMillis); } } return lender; }
| 3,241,486 |
public void setCurrentDetails() { LocalAdmin localAdmin = (LocalAdmin) sf.getAdminService(); ITypes iTypes = sf.getTypesService(); IUpdate iUpdate = sf.getUpdateService(); clearCurrentDetails(); if (ec == null) throw new InternalException( "EventContext is null in EventContext. Invalid configuration."); if (ec.getPrincipal() == null) throw new InternalException( "Principal is null in EventContext. Security system failure."); if (ec.getPrincipal().getName() == null) throw new InternalException( "Principal.name is null in EventContext. Security system failure."); final Principal p = ec.getPrincipal(); // Experimenter final Experimenter exp = localAdmin.lookupExperimenter(p.getName()); exp.getGraphHolder().setToken(token, token); CurrentDetails.setOwner(exp); // Member of Groups List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock()); CurrentDetails.setMemberOfGroups(memberOfGroupsIds); // Leader of Groups List<Long> leaderOfGroupsIds = localAdmin.getLeaderOfGroupIds(exp); CurrentDetails.setLeaderOfGroups(leaderOfGroupsIds); // Active group if (p.getGroup() == null) throw new InternalException( "Principal.group is null in EventContext. Security system failure."); ExperimenterGroup grp = localAdmin.groupProxy(p.getGroup()); grp.getGraphHolder().setToken(token, token); CurrentDetails.setGroup(grp); // isAdmin if (isSystemGroup(grp)) { CurrentDetails.setAdmin(true); } // Event if (p.getEventType() == null) throw new InternalException( "Principal.eventType is null in EventContext. Security system failure."); EventType type = iTypes.getEnumeration(EventType.class, p .getEventType()); type.getGraphHolder().setToken(token, token); CurrentDetails.newEvent(type, token); Event event = getCurrentEvent(); event.getGraphHolder().setToken(token, token); try { setCurrentEvent(iUpdate.saveAndReturnObject(event)); } catch (InvalidDataAccessApiUsageException ex) { // TODO check for read-only bef. exception log.warn("Attempt to save event in SecuritySystem failed. " + "Using unsaved.", ex); setCurrentEvent(event); } }
|
public void setCurrentDetails() { LocalAdmin localAdmin = (LocalAdmin) sf.getAdminService(); ITypes iTypes = sf.getTypesService(); IUpdate iUpdate = sf.getUpdateService(); clearCurrentDetails(); if (ec == null) throw new InternalException( "EventContext is null in EventContext. Invalid configuration."); if (ec.getPrincipal() == null) throw new InternalException( "Principal is null in EventContext. Security system failure."); if (ec.getPrincipal().getName() == null) throw new InternalException( "Principal.name is null in EventContext. Security system failure."); final Principal p = ec.getPrincipal(); // Experimenter final Experimenter exp = localAdmin.lookupExperimenter(p.getName()); exp.getGraphHolder().setToken(token, token); CurrentDetails.setOwner(exp); // Member of Groups List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock()); CurrentDetails.setMemberOfGroups(memberOfGroupsIds); // Leader of Groups List<Long> leaderOfGroupsIds = localAdmin.getLeaderOfGroupIds(exp); CurrentDetails.setLeaderOfGroups(leaderOfGroupsIds); // Active group if (p.getGroup() == null) throw new InternalException( "Principal.group is null in EventContext. Security system failure."); ExperimenterGroup grp = localAdmin.groupProxy(p.getGroup()); grp.getGraphHolder().setToken(token, token); CurrentDetails.setGroup(grp); // isAdmin if (isSystemGroup(grp)) { CurrentDetails.setAdmin(true); } // Event if (p.getEventType() == null) throw new InternalException( "Principal.eventType is null in EventContext. Security system failure."); EventType type = iTypes.getEnumeration(EventType.class, p .getEventType()); type.getGraphHolder().setToken(token, token); CurrentDetails.newEvent(type, token); Event event = getCurrentEvent(); event.getGraphHolder().setToken(token, token); try { setCurrentEvent(iUpdate.saveAndReturnObject(event)); } catch (InvalidDataAccessApiUsageException ex) { // TODO check for read-only bef. exception log.warn("Attempt to save event in SecuritySystem failed. " + "Using unsaved.", ex); setCurrentEvent(event); } }
| 3,241,487 |
public void setCurrentDetails() { LocalAdmin localAdmin = (LocalAdmin) sf.getAdminService(); ITypes iTypes = sf.getTypesService(); IUpdate iUpdate = sf.getUpdateService(); clearCurrentDetails(); if (ec == null) throw new InternalException( "EventContext is null in EventContext. Invalid configuration."); if (ec.getPrincipal() == null) throw new InternalException( "Principal is null in EventContext. Security system failure."); if (ec.getPrincipal().getName() == null) throw new InternalException( "Principal.name is null in EventContext. Security system failure."); final Principal p = ec.getPrincipal(); // Experimenter final Experimenter exp = localAdmin.lookupExperimenter(p.getName()); exp.getGraphHolder().setToken(token, token); CurrentDetails.setOwner(exp); // Member of Groups List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock()); CurrentDetails.setMemberOfGroups(memberOfGroupsIds); // Leader of Groups List<Long> leaderOfGroupsIds = localAdmin.getLeaderOfGroupIds(exp); CurrentDetails.setLeaderOfGroups(leaderOfGroupsIds); // Active group if (p.getGroup() == null) throw new InternalException( "Principal.group is null in EventContext. Security system failure."); ExperimenterGroup grp = localAdmin.groupProxy(p.getGroup()); grp.getGraphHolder().setToken(token, token); CurrentDetails.setGroup(grp); // isAdmin if (isSystemGroup(grp)) { CurrentDetails.setAdmin(true); } // Event if (p.getEventType() == null) throw new InternalException( "Principal.eventType is null in EventContext. Security system failure."); EventType type = iTypes.getEnumeration(EventType.class, p .getEventType()); type.getGraphHolder().setToken(token, token); CurrentDetails.newEvent(type, token); Event event = getCurrentEvent(); event.getGraphHolder().setToken(token, token); try { setCurrentEvent(iUpdate.saveAndReturnObject(event)); } catch (InvalidDataAccessApiUsageException ex) { // TODO check for read-only bef. exception log.warn("Attempt to save event in SecuritySystem failed. " + "Using unsaved.", ex); setCurrentEvent(event); } }
|
public void setCurrentDetails() { LocalAdmin localAdmin = (LocalAdmin) sf.getAdminService(); ITypes iTypes = sf.getTypesService(); IUpdate iUpdate = sf.getUpdateService(); clearCurrentDetails(); if (ec == null) throw new InternalException( "EventContext is null in EventContext. Invalid configuration."); if (ec.getPrincipal() == null) throw new InternalException( "Principal is null in EventContext. Security system failure."); if (ec.getPrincipal().getName() == null) throw new InternalException( "Principal.name is null in EventContext. Security system failure."); final Principal p = ec.getPrincipal(); // Experimenter final Experimenter exp = localAdmin.lookupExperimenter(p.getName()); exp.getGraphHolder().setToken(token, token); CurrentDetails.setOwner(exp); // Member of Groups List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock()); CurrentDetails.setMemberOfGroups(memberOfGroupsIds); // Leader of Groups List<Long> leaderOfGroupsIds = localAdmin.getLeaderOfGroupIds(exp); CurrentDetails.setLeaderOfGroups(leaderOfGroupsIds); // Active group if (p.getGroup() == null) throw new InternalException( "Principal.group is null in EventContext. Security system failure."); ExperimenterGroup grp = localAdmin.groupProxy(p.getGroup()); grp.getGraphHolder().setToken(token, token); CurrentDetails.setGroup(grp); // isAdmin if (isSystemGroup(grp)) { CurrentDetails.setAdmin(true); } // Event if (p.getEventType() == null) throw new InternalException( "Principal.eventType is null in EventContext. Security system failure."); EventType type = iTypes.getEnumeration(EventType.class, p .getEventType()); type.getGraphHolder().setToken(token, token); CurrentDetails.newEvent(type, token); Event event = getCurrentEvent(); event.getGraphHolder().setToken(token, token); try { setCurrentEvent(iUpdate.saveAndReturnObject(event)); } catch (InvalidDataAccessApiUsageException ex) { // TODO check for read-only bef. exception log.warn("Attempt to save event in SecuritySystem failed. " + "Using unsaved.", ex); setCurrentEvent(event); } }
| 3,241,488 |
public ShellLink (int type, String name) throws Exception, IllegalArgumentException { if ((type < MIN_TYPE) || (type > MAX_TYPE) ) { throw (new IllegalArgumentException ("the type parameter used an illegal value")); } if (name == null) { throw (new IllegalArgumentException ("the name parameter was null")); } linkName = name; linkType = type; initialize (); if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get a path for this type of link")); } }
|
publicShellLink(inttype,Stringname)throwsException,IllegalArgumentException{if((type<MIN_TYPE)||(type>MAX_TYPE)){throw(newIllegalArgumentException("thetypeparameterusedanillegalvalue"));}if(name==null){throw(newIllegalArgumentException("thenameparameterwasnull"));}linkName=name;linkType=type;initialize();if(GetLinkPath(linkType)!=SL_OK){throw(newException("couldnotgetapathforthistypeoflink"));}}
| 3,241,489 |
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get link path")); } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
|
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } int result = GetLinkPath (linkType); if (result != SL_OK) { throw (new Exception ("could not get link path")); } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
| 3,241,490 |
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get link path")); } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
|
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } if (GetLinkPath (linkType) != SL_OK) { if (result == SL_WRONG_DATA_TYPE) { throw (new Exception ("could not get link path, registry returned unexpected data type")); } else { throw (new Exception ("could not get link path")); } } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
| 3,241,491 |
public void save () throws Exception { // set all values on the native side set (); // make sure the target actually resolves int result = Resolve (); if (result != SL_OK) { throw (new Exception ("cannot resolve target")); } // make sure the directory exists File directory = new File (fullLinkPath (userType)); if (!directory.exists ()) { directory.mkdirs (); linkDirectory = directory.getPath (); } else { linkDirectory = null; } // perform the save operation String saveTo = fullLinkName (userType); result = saveLink (saveTo); if (result == SL_NO_IPERSIST) { throw (new Exception ("could not get handle for IPesist")); } else if (result == SL_NO_SAVE) { throw (new Exception ("the save operation failed")); } linkFileName = saveTo; }
|
public void save () throws Exception { // set all values on the native side set (); // make sure the target actually resolves int result = Resolve (); if (result != SL_OK) { throw (new Exception ("cannot resolve target")); } // make sure the directory exists File directory = new File (fullLinkPath (userType)); if (!directory.exists ()) { directory.mkdirs (); linkDirectory = directory.getPath (); } else { linkDirectory = ""; } // perform the save operation String saveTo = fullLinkName (userType); result = saveLink (saveTo); if (result == SL_NO_IPERSIST) { throw (new Exception ("could not get handle for IPesist")); } else if (result == SL_NO_SAVE) { throw (new Exception ("the save operation failed")); } linkFileName = saveTo; }
| 3,241,493 |
public void save () throws Exception { // set all values on the native side set (); // make sure the target actually resolves int result = Resolve (); if (result != SL_OK) { throw (new Exception ("cannot resolve target")); } // make sure the directory exists File directory = new File (fullLinkPath (userType)); if (!directory.exists ()) { directory.mkdirs (); linkDirectory = directory.getPath (); } else { linkDirectory = null; } // perform the save operation String saveTo = fullLinkName (userType); result = saveLink (saveTo); if (result == SL_NO_IPERSIST) { throw (new Exception ("could not get handle for IPesist")); } else if (result == SL_NO_SAVE) { throw (new Exception ("the save operation failed")); } linkFileName = saveTo; }
|
public void save () throws Exception { // set all values on the native side set (); // make sure the target actually resolves int result = Resolve (); if (result != SL_OK) { throw (new Exception ("cannot resolve target")); } // make sure the directory exists File directory = new File (fullLinkPath (userType)); if (!directory.exists ()) { directory.mkdirs (); linkDirectory = directory.getPath (); } else { linkDirectory = null; } // perform the save operation String saveTo = fullLinkName (userType); result = saveLink (saveTo); if (result == SL_NO_IPERSIST) { throw (new Exception ("could not get handle for IPesist")); } else if (result == SL_NO_SAVE) { throw (new Exception ("the save operation failed")); } linkFileName = saveTo; }
| 3,241,494 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,496 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,497 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,498 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,499 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,500 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,501 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,502 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,503 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,504 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,505 |
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
|
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
| 3,241,506 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); parent.setQuitButtonText(parent.langpack.getString("FinishPanel.done")); parent.setQuitButtonIcon("done"); if (idata.installSuccess) { // We set the information add(LabelFactory.create(parent.icons.getImageIcon("check"))); add(IzPanelLayout.createParagraphGap()); add(LabelFactory.create(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), LEADING), NEXT_LINE); add(IzPanelLayout.createParagraphGap()); if (idata.uninstallOutJar != null) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; add(LabelFactory.create(parent.langpack .getString("FinishPanel.uninst.info"), parent.icons .getImageIcon("information"), LEADING), NEXT_LINE); add(LabelFactory.create(path, parent.icons.getImageIcon("empty"), LEADING), NEXT_LINE); } } else centerPanel.add(LabelFactory.create(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), LEADING)); getLayoutHelper().completeLayout(); // Call, or call not? }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); parent.setQuitButtonText(parent.langpack.getString("FinishPanel.done")); parent.setQuitButtonIcon("done"); if (idata.installSuccess) { // We set the information add(LabelFactory.create(parent.icons.getImageIcon("check"))); add(IzPanelLayout.createParagraphGap()); add(LabelFactory.create(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), LEADING), NEXT_LINE); add(IzPanelLayout.createParagraphGap()); if (idata.uninstallOutJar != null) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; add(LabelFactory.create(parent.langpack .getString("FinishPanel.uninst.info"), parent.icons .getImageIcon("information"), LEADING), NEXT_LINE); add(LabelFactory.create(path, parent.icons.getImageIcon("empty"), LEADING), NEXT_LINE); } } else add(LabelFactory.create(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), LEADING)); getLayoutHelper().completeLayout(); // Call, or call not? }
| 3,241,507 |
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
|
public int executeFiles(int currentStage) { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
| 3,241,508 |
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
|
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
| 3,241,509 |
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
|
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
| 3,241,510 |
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
|
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && ((currentStage == ExecutableFile.POSTINSTALL && efile.executionStage == ExecutableFile.POSTINSTALL) || (currentStage==ExecutableFile.UNINSTALL && efile.executionStage == ExecutableFile.UNINSTALL))) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
| 3,241,511 |
public int executeFiles() { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { boolean deleteAfterwards = true; ExecutableFile efile = (ExecutableFile) efileIterator.next(); File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } // loop through all operating systems Iterator osIterator = efile.osList.iterator(); if (!osIterator.hasNext()) { Debug.trace("no os to install the file on!"); } while (osIterator.hasNext()) { Os os = (Os) osIterator.next(); Debug.trace("checking if os param on file "+os+" equals current os"); if (os.matchCurrentSystem()) { Debug.trace("match current os"); // execute command in POSTINSTALL stage if ((exitStatus == 0) && (efile.executionStage == ExecutableFile.POSTINSTALL)) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) javax.swing.JOptionPane.showMessageDialog(null, message, "Installation error", javax.swing.JOptionPane.ERROR_MESSAGE); else if (efile.onFailure == ExecutableFile.WARN) { javax.swing.JOptionPane.showMessageDialog(null, message, "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); exitStatus = 0; } else if ( javax.swing.JOptionPane.showConfirmDialog(null, message + "Would you like to proceed?", "Installation Warning", javax.swing.JOptionPane.YES_NO_OPTION) == javax.swing.JOptionPane.YES_OPTION) exitStatus = 0; } } } else { Debug.trace("-no match with current os!"); } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
|
publicintexecuteFiles(){intexitStatus=0;String[]output=newString[2];StringpathSep=System.getProperty("path.separator");StringosName=System.getProperty("os.name").toLowerCase();Stringpermissions=(System.getProperty("user.name").equals("root"))?"a+x":"u+x";//loopthroughallexecutablesIteratorefileIterator=files.iterator();while((exitStatus==0)&&efileIterator.hasNext()){booleandeleteAfterwards=true;ExecutableFileefile=(ExecutableFile)efileIterator.next();Filefile=newFile(efile.path);Debug.trace("handelingexecutablefile"+efile);//fixexecutablepermissionforunixsystemsif(pathSep.equals(":")&&(!osName.startsWith("mac")||osName.endsWith("x"))){ Debug.trace("makingfileexecutable(settingexecutableflag)");String[]params={"/bin/chmod",permissions,file.toString()};exitStatus=executeCommand(params,output);}//loopthroughalloperatingsystemsIteratorosIterator=efile.osList.iterator();if(!osIterator.hasNext()){ Debug.trace("noostoinstallthefileon!");}while(osIterator.hasNext()){Osos=(Os)osIterator.next(); Debug.trace("checkingifosparamonfile"+os+"equalscurrentos");if(os.matchCurrentSystem()){ Debug.trace("matchcurrentos");//executecommandinPOSTINSTALLstageif((exitStatus==0)&&(efile.executionStage==ExecutableFile.POSTINSTALL)){ListparamList=newArrayList();if(ExecutableFile.BIN==efile.type)paramList.add(file.toString());elseif(ExecutableFile.JAR==efile.type&&null==efile.mainClass){paramList.add(System.getProperty("java.home")+"/bin/java");paramList.add("-jar");paramList.add(file.toString());}elseif(ExecutableFile.JAR==efile.type&&null!=efile.mainClass){paramList.add(System.getProperty("java.home")+"/bin/java");paramList.add("-cp="+file.toString());paramList.add(efile.mainClass);}if(null!=efile.argList&&!efile.argList.isEmpty())paramList.addAll(efile.argList);String[]params=newString[paramList.size()];for(inti=0;i<paramList.size();i++)params[i]=(String)paramList.get(i);exitStatus=executeCommand(params,output);//bringadialogdependingonreturncodeandfailurehandlingif(exitStatus!=0){deleteAfterwards=false;Stringmessage=output[0]+"\n"+output[1];if(message.length()==1)message=newString("Failedtoexecute"+file.toString()+".");if(efile.onFailure==ExecutableFile.ABORT)javax.swing.JOptionPane.showMessageDialog(null,message,"Installationerror",javax.swing.JOptionPane.ERROR_MESSAGE);elseif(efile.onFailure==ExecutableFile.WARN){javax.swing.JOptionPane.showMessageDialog(null,message,"Installationwarning",javax.swing.JOptionPane.WARNING_MESSAGE);exitStatus=0;}elseif(javax.swing.JOptionPane.showConfirmDialog(null,message+"Wouldyouliketoproceed?","InstallationWarning",javax.swing.JOptionPane.YES_NO_OPTION)==javax.swing.JOptionPane.YES_OPTION)exitStatus=0;}}}else{ Debug.trace("-nomatchwithcurrentos!");}} //POSTINSTALLexecutableswillbedeleted if(efile.executionStage==ExecutableFile.POSTINSTALL&&deleteAfterwards) { if(file.canWrite())file.delete(); }}returnexitStatus;}
| 3,241,512 |
public Pack(String name, String description, List osConstraints, boolean required, boolean preselected) { this.name = name; this.description = description; this.osConstraints = osConstraints; this.required = required; this.preselected = preselected; nbytes = 0; }
|
public Pack( String name, String description, List osConstraints, boolean required, boolean preselected) { this.name = name; this.description = description; this.osConstraints = osConstraints; this.required = required; this.preselected = preselected; nbytes = 0; }
| 3,241,513 |
public static String toByteUnitsString(int bytes) { if (bytes < KILOBYTES) return String.valueOf(bytes) + " bytes"; else if (bytes < (MEGABYTES)) { double value = bytes / KILOBYTES; return formatter.format(value) + " KB"; } else if (bytes < (GIGABYTES)) { double value = bytes / MEGABYTES; return formatter.format(value) + " MB"; } else { double value = bytes / GIGABYTES; return formatter.format(value) + " GB"; } }
|
public static String toByteUnitsString(int bytes) { if (bytes < KILOBYTES) return String.valueOf(bytes) + " bytes"; else if (bytes < (MEGABYTES)) { double value = bytes / KILOBYTES; return formatter.format(value) + " KB"; } else if (bytes < (GIGABYTES)) { double value = bytes / MEGABYTES; return formatter.format(value) + " MB"; } else { double value = bytes / GIGABYTES; return formatter.format(value) + " GB"; } }
| 3,241,514 |
public static String toByteUnitsString(int bytes) { if (bytes < KILOBYTES) return String.valueOf(bytes) + " bytes"; else if (bytes < (MEGABYTES)) { double value = bytes / KILOBYTES; return formatter.format(value) + " KB"; } else if (bytes < (GIGABYTES)) { double value = bytes / MEGABYTES; return formatter.format(value) + " MB"; } else { double value = bytes / GIGABYTES; return formatter.format(value) + " GB"; } }
|
public static String toByteUnitsString(int bytes) { if (bytes < KILOBYTES) return String.valueOf(bytes) + " bytes"; else if (bytes < (MEGABYTES)) { double value = bytes / KILOBYTES; return formatter.format(value) + " KB"; } else if (bytes < (GIGABYTES)) { double value = bytes / MEGABYTES; return formatter.format(value) + " MB"; } else { double value = bytes / GIGABYTES; return formatter.format(value) + " GB"; } }
| 3,241,515 |
public void run() { CursorableLinkedList.Cursor cursor = null; while(!_cancelled) { long sleeptime = 0L; synchronized(GenericObjectPool.this) { sleeptime = _timeBetweenEvictionRunsMillis; } try { Thread.currentThread().sleep(_timeBetweenEvictionRunsMillis); } catch(Exception e) { ; // ignored } try { synchronized(GenericObjectPool.this) { if(!_pool.isEmpty()) { if(null == cursor) { cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } else if(!cursor.hasPrevious()) { cursor.close(); cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } for(int i=0,m=getNumTests();i<m;i++) { if(!cursor.hasPrevious()) { cursor.close(); cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } else { ObjectTimestampPair pair = (ObjectTimestampPair)(cursor.previous()); if(System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { try { cursor.remove(); _factory.destroyObject(pair.value); } catch(Exception e) { ; // ignored } } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(pair.value); active = true; } catch(Exception e) { cursor.remove(); try { _factory.passivateObject(pair.value); } catch(Exception ex) { ; // ignored } _factory.destroyObject(pair.value); } if(active) { if(!_factory.validateObject(pair.value)) { cursor.remove(); try { _factory.passivateObject(pair.value); } catch(Exception ex) { ; // ignored } _factory.destroyObject(pair.value); } else { try { _factory.passivateObject(pair.value); } catch(Exception e) { cursor.remove(); _factory.destroyObject(pair.value); } } } } } } } } } catch(Exception e) { // ignored } } if(null != cursor) { cursor.close(); } }
|
public void run() { CursorableLinkedList.Cursor cursor = null; while(!_cancelled) { long sleeptime = 0L; synchronized(GenericObjectPool.this) { sleeptime = _timeBetweenEvictionRunsMillis; } try { Thread.currentThread().sleep(_timeBetweenEvictionRunsMillis); } catch(Exception e) { ; // ignored } try { synchronized(GenericObjectPool.this) { if(!_pool.isEmpty()) { if(null == cursor) { cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } else if(!cursor.hasPrevious()) { cursor.close(); cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } for(int i=0,m=getNumTests();i<m;i++) { if(!cursor.hasPrevious()) { cursor.close(); cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } else { ObjectTimestampPair pair = (ObjectTimestampPair)(cursor.previous()); if(System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { try { cursor.remove(); _factory.destroyObject(pair.value); } catch(Exception e) { ; // ignored } } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(pair.value); active = true; } catch(Exception e) { cursor.remove(); try { _factory.passivateObject(pair.value); } catch(Exception ex) { ; // ignored } _factory.destroyObject(pair.value); } if(active) { if(!_factory.validateObject(pair.value)) { cursor.remove(); try { _factory.passivateObject(pair.value); } catch(Exception ex) { ; // ignored } _factory.destroyObject(pair.value); } else { try { _factory.passivateObject(pair.value); } catch(Exception e) { cursor.remove(); _factory.destroyObject(pair.value); } } } } } } } } } catch(Exception e) { // ignored } } if(null != cursor) { cursor.close(); } }
| 3,241,516 |
PixelsDimensions getPixelsDimensions(long pixelsID) throws DSOutOfServiceException, DSAccessException { try { IQuery query = getIQueryService(); Pixels pixs = (Pixels) query.get(Pixels.class, pixelsID); return (PixelsDimensions) query.get(PixelsDimensions.class, pixelsID); } catch (Exception e) { handleException(e, "Cannot retrieve the dimension of "+ "the pixels set."); } return null; }
|
PixelsDimensions getPixelsDimensions(long pixelsID) throws DSOutOfServiceException, DSAccessException { try { IQuery query = getIQueryService(); Pixels pixs = (Pixels) query.get(Pixels.class, pixs.getPixelsDimensions().getId().longValue()); return (PixelsDimensions) query.get(PixelsDimensions.class, pixs.getPixelsDimensions().getId().longValue()); } catch (Exception e) { handleException(e, "Cannot retrieve the dimension of "+ "the pixels set."); } return null; }
| 3,241,517 |
ExperimenterData login(String userName, String password) throws DSOutOfServiceException { System.getProperties().setProperty("omero.user", userName); //TODO: Remove it asap System.getProperties().setProperty("omero.pass", "ome"); //System.getProperties().setProperty("omero.pass", password); try { entry = new ServiceFactory(); connected = true; return getUserDetails(userName); } catch (Exception e) { connected = false; String s = "Can't connect to OMERO. OMERO info not valid."; e.printStackTrace(); throw new DSOutOfServiceException(s, e); } }
|
ExperimenterData login(String userName, String password) throws DSOutOfServiceException { System.getProperties().setProperty("omero.user", userName); //TODO: Remove it asap System.getProperties().setProperty("omero.pass", "ome"); //System.getProperties().setProperty("omero.pass", password); try { entry = new ServiceFactory(new Login(userName, "ome")); connected = true; return getUserDetails(userName); } catch (Exception e) { connected = false; String s = "Can't connect to OMERO. OMERO info not valid."; e.printStackTrace(); throw new DSOutOfServiceException(s, e); } }
| 3,241,518 |
public void actionPerformed(ActionEvent e) { // Prepares the file chooser JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(idata.getInstallPath())); fc.setMultiSelectionEnabled(false); fc.addChoosableFileFilter(fc.getAcceptAllFileFilter()); //fc.setCurrentDirectory(new File(".")); // Shows it try { if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { // We handle the xml data writing File file = fc.getSelectedFile(); FileOutputStream out = new FileOutputStream(file); BufferedOutputStream outBuff = new BufferedOutputStream(out, 5120); parent.writeXMLTree(idata.xmlData, outBuff); outBuff.flush(); outBuff.close(); autoButton.setEnabled(false); } } catch (Exception err) { err.printStackTrace(); JOptionPane.showMessageDialog(this, err.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); } }
|
public void actionPerformed(ActionEvent e) { // Prepares the file chooser JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(idata.getInstallPath())); fc.setMultiSelectionEnabled(false); fc.addChoosableFileFilter(fc.getAcceptAllFileFilter()); //fc.setCurrentDirectory(new File(".")); // Shows it try { if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { // We handle the xml data writing File file = fc.getSelectedFile(); FileOutputStream out = new FileOutputStream(file); BufferedOutputStream outBuff = new BufferedOutputStream(out, 5120); parent.writeXMLTree(idata.xmlData, outBuff); outBuff.flush(); outBuff.close(); autoButton.setEnabled(false); } } catch (Exception err) { err.printStackTrace(); JOptionPane.showMessageDialog(this, err.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); } }
| 3,241,519 |
public void actionPerformed(ActionEvent e) { // Prepares the file chooser JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(idata.getInstallPath())); fc.setMultiSelectionEnabled(false); fc.addChoosableFileFilter(fc.getAcceptAllFileFilter()); //fc.setCurrentDirectory(new File(".")); // Shows it try { if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { // We handle the xml data writing File file = fc.getSelectedFile(); FileOutputStream out = new FileOutputStream(file); BufferedOutputStream outBuff = new BufferedOutputStream(out, 5120); parent.writeXMLTree(idata.xmlData, outBuff); outBuff.flush(); outBuff.close(); autoButton.setEnabled(false); } } catch (Exception err) { err.printStackTrace(); JOptionPane.showMessageDialog(this, err.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); } }
|
public void actionPerformed(ActionEvent e) { // Prepares the file chooser JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(idata.getInstallPath())); fc.setMultiSelectionEnabled(false); fc.addChoosableFileFilter(fc.getAcceptAllFileFilter()); //fc.setCurrentDirectory(new File(".")); // Shows it try { if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { // We handle the xml data writing File file = fc.getSelectedFile(); FileOutputStream out = new FileOutputStream(file); BufferedOutputStream outBuff = new BufferedOutputStream(out, 5120); parent.writeXMLTree(idata.xmlData, outBuff); outBuff.flush(); outBuff.close(); autoButton.setEnabled(false); } } catch (Exception err) { err.printStackTrace(); JOptionPane.showMessageDialog( this, err.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); } }
| 3,241,520 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
| 3,241,521 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
| 3,241,522 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
| 3,241,523 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
| 3,241,524 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
| 3,241,525 |
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
|
public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton(parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add(new JLabel(parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
| 3,241,526 |
protected void setUp() throws Exception { super.setUp(); sf = new MockServiceFactory(); ec = new ThreadLocalEventContext(); sec = new BasicSecuritySystem (sf,ec ); sf.mockAdmin = mock(IAdmin.class); sf.mockQuery = mock(LocalQuery.class); sf.mockTypes = mock(ITypes.class); filter = new UpdateFilter( sec, (LocalQuery) sf.getQueryService() ); rootLogin(); }
|
protected void setUp() throws Exception { super.setUp(); sf = new MockServiceFactory(); ec = new ThreadLocalEventContext(); sec = new BasicSecuritySystem (sf,ec ); sf.mockAdmin = mock(IAdmin.class); sf.mockQuery = mock(LocalQuery.class); sf.mockTypes = mock(ITypes.class); filter = new UpdateFilter( ); rootLogin(); }
| 3,241,527 |
public abstract void addLangPack(String iso3, InputStream input) throws Exception;
|
public abstract void addLangPack(String iso3, InputStream input) throws Exception;
| 3,241,528 |
public abstract void addNativeLibrary(String name, InputStream input) throws Exception;
|
public abstract void addNativeLibrary(String name, InputStream input) throws Exception;
| 3,241,529 |
public abstract ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception;
|
public abstract ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception;
| 3,241,530 |
public abstract void addPanelClass(String classFilename, InputStream input) throws Exception;
|
public abstract void addPanelClass(String classFilename, InputStream input) throws Exception;
| 3,241,531 |
public abstract void addResource(String resId, InputStream input) throws Exception;
|
public abstract void addResource(String resId, InputStream input) throws Exception;
| 3,241,532 |
protected long copyStream(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } return bytesCopied; }
|
protected long copyStream(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } return bytesCopied; }
| 3,241,533 |
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
|
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
| 3,241,534 |
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
|
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream(is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
| 3,241,535 |
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
|
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
| 3,241,536 |
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
|
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
| 3,241,537 |
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
|
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
| 3,241,538 |
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
|
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { InputStream is = getClass().getResourceAsStream("/lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); } if (skeleton_is == null) { skeleton_is = new ZipInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
| 3,241,539 |
public Object getValueAt(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); switch (columnIndex) { case 0 : int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0); } return new Integer(val); case 1 : if (pack.id == null || pack.id.equals("")){ return pack.name; }else{ return langpack.getString(pack.id); } case 2 : return Pack.toByteUnitsString((int) pack.nbytes); default : return null; } }
|
public Object getValueAt(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); switch (columnIndex) { case 0 : int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0); } return new Integer(val); case 1 : if (langpack == null || pack.id == null || pack.id.equals("")){ return pack.name; }else{ return langpack.getString(pack.id); } case 2 : return Pack.toByteUnitsString((int) pack.nbytes); default : return null; } }
| 3,241,540 |
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i >= 0) { Pack pack = (Pack) idata.availablePacks.get(i); String desc = ""; if (pack.id != null && !pack.id.equals("")) { desc = langpack.getString(pack.id+".description"); } if (desc.equals("")) { desc = pack.description; } descriptionArea.setText(desc); } }
|
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i >= 0) { Pack pack = (Pack) idata.availablePacks.get(i); String desc = ""; if (langpack != null && pack.id != null && !pack.id.equals("")) { desc = langpack.getString(pack.id+".description"); } if (desc.equals("")) { desc = pack.description; } descriptionArea.setText(desc); } }
| 3,241,541 |
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = new JLabel(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } agreeLabel = new JLabel(parent.langpack.getString("LicencePanel.agree"), parent.icons.getImageIcon("help"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(agreeLabel, gbConstraints); add(agreeLabel); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.yes"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.no"), false); group.add(noRadio); parent.buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); }
|
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = new JLabel(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } agreeLabel = new JLabel(parent.langpack.getString("LicencePanel.agree"), parent.icons.getImageIcon("help"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(agreeLabel, gbConstraints); add(agreeLabel); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.yes"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.no"), false); group.add(noRadio); parent.buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); }
| 3,241,542 |
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = new JLabel(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } agreeLabel = new JLabel(parent.langpack.getString("LicencePanel.agree"), parent.icons.getImageIcon("help"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(agreeLabel, gbConstraints); add(agreeLabel); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.yes"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.no"), false); group.add(noRadio); parent.buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); }
|
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = new JLabel(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } agreeLabel = new JLabel(parent.langpack.getString("LicencePanel.agree"), parent.icons.getImageIcon("help"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(agreeLabel, gbConstraints); add(agreeLabel); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.yes"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.no"), false); group.add(noRadio); parent.buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); }
| 3,241,543 |
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = new JLabel(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } agreeLabel = new JLabel(parent.langpack.getString("LicencePanel.agree"), parent.icons.getImageIcon("help"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(agreeLabel, gbConstraints); add(agreeLabel); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.yes"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.no"), false); group.add(noRadio); parent.buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); }
|
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = new JLabel(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } agreeLabel = new JLabel(parent.langpack.getString("LicencePanel.agree"), parent.icons.getImageIcon("help"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(agreeLabel, gbConstraints); add(agreeLabel); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.yes"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.no"), false); group.add(noRadio); parent.buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); }
| 3,241,544 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.