Java Reference
In-Depth Information
L ISTING 13.6 Continued
* indirectly invoked by the JNLP Client for uninstallation
*/
private void uninstall (){
System.out.println(“Textuale uninstalled.”);
}
/**
* indirectly invoked by the JNLP Client for installation
*/
private void install (){
eis = (ExtensionInstallerService)
GeneralUtilities.getService(“javax.jnlp.ExtensionInstallerService”);
if (eis!=null) {
eis.setHeading(“Textuale - Text Editor”);
eis.setStatus(“Installing..”);
// in case of input methods or other needed optional packages
// put here custom code expanding Listing 11.6
for (int i=0; i<10; i++) {
eis.updateProgress(i*10);
try {
Thread.currentThread().sleep(100);
} catch (Exception e) {
System.out.println(“”+e);
13
}
}
eis.installSucceeded(false);
}
}
/**
* launch the installer - used by the JNLP Client
*/
static public void main(String[] args) {
String command = args[0];
Installer inst = new Installer();
if (command.equals(“install”))
inst.install();
else if (command.equals(“uninstall”))
inst.uninstall();
}
}
Search WWH ::




Custom Search