summaryrefslogtreecommitdiff
path: root/scripting/workben/installer/IdeUpdater.java
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/workben/installer/IdeUpdater.java')
-rw-r--r--scripting/workben/installer/IdeUpdater.java77
1 files changed, 36 insertions, 41 deletions
diff --git a/scripting/workben/installer/IdeUpdater.java b/scripting/workben/installer/IdeUpdater.java
index b35b519abbe3..b0ec0cd35cbf 100644
--- a/scripting/workben/installer/IdeUpdater.java
+++ b/scripting/workben/installer/IdeUpdater.java
@@ -47,70 +47,65 @@ public class IdeUpdater extends Thread {
if (!installPath.endsWith(File.separator))
installPath += File.separator;
- File netbeansLauncher = new File( installPath + "bin" );
+ File netbeansLauncher = new File(installPath + "bin");
- if( netbeansLauncher.isDirectory() ) {
- isNetbeansPath = true;
- installPath = installPath +"modules" + File.separator;
- }
+ if (netbeansLauncher.isDirectory()) {
+ isNetbeansPath = true;
+ installPath = installPath + "modules" + File.separator;
+ }
- System.out.println( "IdeUpdater installPath is " + installPath + " isNetbeansPath is " + isNetbeansPath );
+ System.out.println("IdeUpdater installPath is " + installPath +
+ " isNetbeansPath is " + isNetbeansPath);
this.installPath = installPath;
this.statusLabel = statusLabel;
- listeners = new ArrayList<InstallListener>();
- threadSuspended = false;
- progressBar=pBar;
- progressBar.setStringPainted(true);
+ listeners = new ArrayList<InstallListener>();
+ threadSuspended = false;
+ progressBar = pBar;
+ progressBar.setStringPainted(true);
}// XmlUpdater
@Override
public void run() {
- internalThread = Thread.currentThread();
+ internalThread = Thread.currentThread();
- progressBar.setString("Unzipping Required Files");
+ progressBar.setString("Unzipping Required Files");
ZipData zd = new ZipData();
- // Adding IDE support
- if( isNetbeansPath ) {
- if (!zd.extractEntry("ide/office.jar",installPath, statusLabel))
- {
- onInstallComplete();
- return;
- }
- }
- else {
- if (!zd.extractEntry("ide/idesupport.jar",installPath, statusLabel))
- {
- onInstallComplete();
- return;
- }
- if (!zd.extractEntry("ide/OfficeScripting.jar",installPath, statusLabel))
- {
- onInstallComplete();
- return;
+ // Adding IDE support
+ if (isNetbeansPath) {
+ if (!zd.extractEntry("ide/office.jar", installPath, statusLabel)) {
+ onInstallComplete();
+ return;
+ }
+ } else {
+ if (!zd.extractEntry("ide/idesupport.jar", installPath, statusLabel)) {
+ onInstallComplete();
+ return;
+ }
+
+ if (!zd.extractEntry("ide/OfficeScripting.jar", installPath, statusLabel)) {
+ onInstallComplete();
+ return;
+ }
}
- }
- statusLabel.setText("Installation Complete");
- progressBar.setString("Installation Complete");
- progressBar.setValue(10);
- onInstallComplete();
+ statusLabel.setText("Installation Complete");
+ progressBar.setString("Installation Complete");
+ progressBar.setValue(10);
+ onInstallComplete();
}// run
- public void addInstallListener(InstallListener listener)
- {
+ public void addInstallListener(InstallListener listener) {
listeners.add(listener);
}// addInstallListener
- private void onInstallComplete()
- {
- for( InstallListener l : listeners)
- {
+ private void onInstallComplete() {
+ for (InstallListener l : listeners) {
l.installationComplete(null);
}
}// onInstallComplete