You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/11/24 18:22:02 UTC

[GitHub] lkishalmi closed pull request #1036: [NETBEANS-1733] Ask when downloading nbjavac - backport to 10.0 release

lkishalmi closed pull request #1036: [NETBEANS-1733] Ask when downloading nbjavac - backport to 10.0 release
URL: https://github.com/apache/incubator-netbeans/pull/1036
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/Bundle.properties b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/Bundle.properties
index 270ee567d8..6f10c14e4c 100644
--- a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/Bundle.properties
+++ b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/Bundle.properties
@@ -26,6 +26,7 @@ InstallerMissingModules_Install=Installing...
 InstallerMissingModules_TryAgainButton=&Try Again
 InstallerMissingModules_ErrorPanel_Title=Error
 InstallerMissingModules_ErrorPanel=Installation cannot be completed due to {0} \n {1}
+InstallerMissingModules_Cancelled=Install additional modules: {0}
 InstallerMissingModules_NeedsRestart=Restart IDE to complete instaling asked plugins.
 
 DebuggerConfigurationPanel.downloadButton.text=Download
diff --git a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
index f4cb616180..60caaa8822 100644
--- a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
+++ b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
@@ -31,7 +31,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.Callable;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.Icon;
@@ -66,7 +65,6 @@
 import javax.xml.parsers.ParserConfigurationException;
 import org.netbeans.api.project.ui.OpenProjects;
 import org.netbeans.spi.project.ui.LogicalViewProvider;
-import org.netbeans.spi.project.ui.ProjectConvertor;
 import org.openide.filesystems.FileUtil;
 import org.openide.loaders.DataFolder;
 import org.openide.nodes.FilterNode;
diff --git a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/ModulesInstaller.java b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/ModulesInstaller.java
index 691bc6622c..6364404227 100644
--- a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/ModulesInstaller.java
+++ b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/ModulesInstaller.java
@@ -31,14 +31,11 @@
 import javax.swing.JTextArea;
 import javax.swing.SwingUtilities;
 import org.netbeans.api.autoupdate.InstallSupport;
-import org.netbeans.api.autoupdate.InstallSupport.Installer;
-import org.netbeans.api.autoupdate.InstallSupport.Validator;
 import org.netbeans.api.autoupdate.OperationContainer;
 import org.netbeans.api.autoupdate.OperationException;
-import org.netbeans.api.autoupdate.OperationSupport.Restarter;
 import org.netbeans.api.autoupdate.UpdateElement;
 import org.netbeans.api.progress.ProgressHandle;
-import org.netbeans.api.progress.ProgressHandleFactory;
+import org.netbeans.modules.autoupdate.ui.api.PluginManager;
 import org.openide.DialogDisplayer;
 import org.openide.NotifyDescriptor;
 import org.openide.awt.Mnemonics;
@@ -207,32 +204,19 @@ private void doInstallMissingModules () throws OperationException {
         if (! installContainer.listInvalid ().isEmpty ()) {
             throw new IllegalArgumentException ("Some are invalid for install: " + installContainer.listInvalid ());
         }
-        InstallSupport installSupport = installContainer.getSupport ();
-        if (downloadHandle == null) {
-            downloadHandle = ProgressHandleFactory.createHandle (
-                getBundle ("InstallerMissingModules_Download",
-                presentUpdateElements (finder.getVisibleUpdateElements (modules4install))));
-        }
-        progressMonitor.onDownload(downloadHandle);
-        Validator v = installSupport.doDownload (downloadHandle, false);
-        if (verifyHandle == null) {
-            verifyHandle = ProgressHandleFactory.createHandle (
-                    getBundle ("InstallerMissingModules_Verify"));
-            }
-        progressMonitor.onValidate(verifyHandle);
-        Installer i = installSupport.doValidate (v, verifyHandle);
-        if (installHandle == null) {
-            installHandle = ProgressHandleFactory.createHandle (
-                    getBundle ("InstallerMissingModules_Install"));
+        boolean ok = PluginManager.openInstallWizard(installContainer);
+        if (!ok) {
+            StringBuilder sb = new StringBuilder();
+            String sep = "";
+            for (UpdateElement el : modules4install) {
+                sb.append(sep);
+                sb.append(el.getDisplayName());
+                sep = ", ";
             }
-        progressMonitor.onInstall(installHandle);
-        Restarter r = installSupport.doInstall (i, installHandle);
-        if (r != null) {
-            installSupport.doRestartLater (r);
-        } else {
-            waitToModuleLoaded ();
+            progressMonitor.onError(
+                getBundle("InstallerMissingModules_Cancelled", sb) // NOI18N
+            );
         }
-        /// XXX FindBrokenModules.clearModulesForRepair ();
     }
     
     public static String presentUpdateElements (Collection<UpdateElement> elems) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists