|
2 | 2 |
|
3 | 3 | import java.awt.event.ActionEvent; |
4 | 4 | import java.awt.event.ActionListener; |
5 | | -import javax.swing.JOptionPane; |
6 | 5 | import org.netbeans.api.autoupdate.InstallSupport; |
7 | 6 | import org.netbeans.api.autoupdate.OperationContainer; |
8 | 7 | import org.openide.awt.ActionID; |
|
26 | 25 | import java.util.logging.Logger; |
27 | 26 | import java.util.prefs.Preferences; |
28 | 27 | import static org.chrisle.netbeans.plugins.nbinstallplugin.actions.Bundle.CTL_OsgiBundleFilterDescription; |
| 28 | +import org.netbeans.api.autoupdate.InstallSupport.Installer; |
| 29 | +import org.netbeans.api.autoupdate.OperationException; |
| 30 | +import org.netbeans.api.autoupdate.OperationSupport.Restarter; |
29 | 31 | import org.netbeans.api.autoupdate.UpdateManager; |
30 | 32 | import org.netbeans.api.autoupdate.UpdateUnit; |
31 | 33 | import org.netbeans.api.autoupdate.UpdateUnitProvider; |
32 | 34 | import org.netbeans.api.autoupdate.UpdateUnitProviderFactory; |
| 35 | +import org.netbeans.api.progress.ProgressHandle; |
| 36 | +import org.netbeans.api.progress.ProgressHandleFactory; |
33 | 37 | import org.openide.DialogDisplayer; |
34 | 38 | import org.openide.NotifyDescriptor; |
35 | 39 | import org.openide.filesystems.FileUtil; |
| 40 | +import org.openide.util.Cancellable; |
36 | 41 | import org.openide.util.NbBundle; |
37 | 42 | import org.openide.util.NbBundle.Messages; |
38 | 43 | import org.openide.util.NbPreferences; |
@@ -295,21 +300,21 @@ private static boolean isOSGiBundle(File jarFile) { |
295 | 300 | return false; |
296 | 301 | } |
297 | 302 |
|
298 | | -// static Restarter doInstall(InstallSupport support, Installer installer) throws OperationException { |
299 | | -// final String displayName = "Installing plugin..."; |
300 | | -// System.out.println(displayName); |
301 | | -// ProgressHandle installHandle = ProgressHandleFactory.createHandle( |
302 | | -// displayName, |
303 | | -// new Cancellable() { |
304 | | -// @Override |
305 | | -// public boolean cancel() { |
306 | | -// return true; |
307 | | -// } |
308 | | -// } |
309 | | -// ); |
310 | | -// |
311 | | -// return support.doInstall(installer, installHandle); |
312 | | -// } |
| 303 | + static Restarter doInstall(InstallSupport support, Installer installer) throws OperationException { |
| 304 | + final String displayName = "Installing plugin..."; |
| 305 | + System.out.println(displayName); |
| 306 | + ProgressHandle installHandle = ProgressHandleFactory.createHandle( |
| 307 | + displayName, |
| 308 | + new Cancellable() { |
| 309 | + @Override |
| 310 | + public boolean cancel() { |
| 311 | + return true; |
| 312 | + } |
| 313 | + } |
| 314 | + ); |
| 315 | + |
| 316 | + return support.doInstall(installer, installHandle); |
| 317 | + } |
313 | 318 | // |
314 | 319 | // static Installer doVerify(InstallSupport support, Validator validator) throws OperationException { |
315 | 320 | // final String displayName = "Validating Gradle plugin..."; |
|
0 commit comments