diff -r b3d334d8c4fb autoupdate.ui/apichanges.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autoupdate.ui/apichanges.xml Mon Feb 07 15:12:10 2011 +0100 @@ -0,0 +1,114 @@ + + + + + + + + + + Autoupdate UI API + + + + + + + + PluginManager.openInstallWizard + + + + + +

+ PluginManager ands its openInstallWizard + shows standard UI for installing of selected modules. +

+
+ + +
+
+ + + + + + + Change History for the Autoupdate UI API + + + + + + +

Introduction

+ +

This document lists changes made to the Autoupdate UI API.

+ + +
+ + +

@FOOTER@

+ + +
+ +
diff -r b3d334d8c4fb autoupdate.ui/arch.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autoupdate.ui/arch.xml Mon Feb 07 15:12:10 2011 +0100 @@ -0,0 +1,1097 @@ + + +]> + + + + &api-questions; + + + + +

+ The AutoUpdate UI module contains user visible elements (actions in menu, + dialogs), that allow any users to download new, or existing modules from + a pre-registered or manually registered update centers. In addition + the module also provides an API to allow other modules to + invoke pieces of the user related work flow (dialogs, wizards) directly + at moments independent on the rest of the provided UI. +

+
+ + + + + +

+ XXX +

+
+ + + + + +

+ The module is part of NetBeans IDE distribution for long time and its + functionality is covered and tested by many eyes using NetBeans IDE. + The API will be added in incremental manner (starting from 7.0) + and will slowly expose the + bits of already existing UI to external module writers. +

+
+ + + + + + + Primary purpose of the API is to share classical UI for downloading and + installing additional modules. Read about + PluginManager.openInstallWizard. + + + + + + + +

+ + this module exposes bits of its UI and user related workflow actions + (related to installing, upgrading, etc.) by providing an API calls + for other modules to invoke bits of here-in available functionality. + +

+
+ + + + + + + + + + + + +

+ XXX no answer for compat-deprecation +

+
+ + + + + +

+ XXX no answer for compat-i18n +

+
+ + + + + +

+ XXX no answer for compat-standards +

+
+ + + + + +

+ XXX no answer for compat-version +

+
+ + + + + +

+ Runs of JRE. +

+
+ + + + + +

+ No need for JDK. +

+
+ + + + + + + + + + + + +

+ XXX no answer for dep-non-nb +

+
+ + + + + +

+ XXX no answer for dep-platform +

+
+ + + + + +

+ You modules can use the AutoUpdateUI API directly (of course + you almost certainly need also + Autoudate Services), just be aware that this module comes with a UI. + It is not always practical to depend on modules that provide a UI from + low level infrastructure modules - if that is your case, consider separating + calls to AutoUpdateUI into separate + bridge module. +

+
+ + + + + +

+ XXX no answer for deploy-jar +

+
+ + + + + +

+ XXX no answer for deploy-nbm +

+
+ + + + + +

+ XXX no answer for deploy-packages +

+
+ + + + + +

+ XXX no answer for deploy-shared +

+
+ + + + + +

+ XXX no answer for exec-ant-tasks +

+
+ + + + + +

+ XXX no answer for exec-classloader +

+
+ + + + + +

+ XXX no answer for exec-component +

+
+ + + + + +

+ XXX no answer for exec-introspection +

+
+ + + + + +

+ XXX no answer for exec-privateaccess +

+
+ + + + + +

+ XXX no answer for exec-process +

+
+ + + + + +

+ XXX no answer for exec-property +

+
+ + + + + +

+ XXX no answer for exec-reflection +

+
+ + + + + +

+ XXX no answer for exec-threading +

+
+ + + + + +

+ XXX no answer for format-clipboard +

+
+ + + + + +

+ XXX no answer for format-dnd +

+
+ + + + + +

+ XXX no answer for format-types +

+
+ + + + + +

+ XXX no answer for lookup-lookup +

+
+ + + + + +

+ XXX no answer for lookup-register +

+
+ + + + + +

+ XXX no answer for lookup-remove +

+
+ + + + + +

+ XXX no answer for perf-exit +

+
+ + + + + +

+ XXX no answer for perf-huge_dialogs +

+
+ + + + + +

+ XXX no answer for perf-limit +

+
+ + + + + +

+ XXX no answer for perf-mem +

+
+ + + + + +

+ XXX no answer for perf-menus +

+
+ + + + + +

+ XXX no answer for perf-progress +

+
+ + + + + +

+ XXX no answer for perf-scale +

+
+ + + + + +

+ XXX no answer for perf-spi +

+
+ + + + + +

+ XXX no answer for perf-startup +

+
+ + + + + +

+ XXX no answer for perf-wakeup +

+
+ + + + + +

+ XXX no answer for resources-file +

+
+ + + + + +

+ XXX no answer for resources-layer +

+
+ + + + + +

+ XXX no answer for resources-mask +

+
+ + + + + +

+ XXX no answer for resources-preferences +

+
+ + + + + +

+ XXX no answer for resources-read +

+
+ + + + + +

+ XXX no answer for security-grant +

+
+ + + + + +

+ XXX no answer for security-policy +

+
+ +
diff -r b3d334d8c4fb autoupdate.ui/manifest.mf --- a/autoupdate.ui/manifest.mf Mon Feb 07 10:25:43 2011 +0100 +++ b/autoupdate.ui/manifest.mf Mon Feb 07 15:12:10 2011 +0100 @@ -3,6 +3,6 @@ OpenIDE-Module-Install: org/netbeans/modules/autoupdate/ui/actions/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/autoupdate/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/autoupdate/ui/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.19 +OpenIDE-Module-Specification-Version: 1.20 AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true diff -r b3d334d8c4fb autoupdate.ui/nbproject/project.properties --- a/autoupdate.ui/nbproject/project.properties Mon Feb 07 10:25:43 2011 +0100 +++ b/autoupdate.ui/nbproject/project.properties Mon Feb 07 15:12:10 2011 +0100 @@ -9,3 +9,6 @@ test.config.working.includes=\ org/netbeans/test/autoupdate/Autoupdate.class + +javadoc.arch=${basedir}/arch.xml +javadoc.apichanges=${basedir}/apichanges.xml diff -r b3d334d8c4fb autoupdate.ui/nbproject/project.xml --- a/autoupdate.ui/nbproject/project.xml Mon Feb 07 10:25:43 2011 +0100 +++ b/autoupdate.ui/nbproject/project.xml Mon Feb 07 15:12:10 2011 +0100 @@ -126,14 +126,9 @@ - - com.microchip.mplab.nbide.embedded - com.sun.tools.dlight.tools.customizer - org.netbeans.modules.autoupdate.pluginimporter - org.netbeans.modules.cnd.toolchain - org.netbeans.modules.maven.junit + org.netbeans.modules.autoupdate.ui.api - + diff -r b3d334d8c4fb autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/api/PluginManager.java --- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/api/PluginManager.java Mon Feb 07 10:25:43 2011 +0100 +++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/api/PluginManager.java Mon Feb 07 15:12:10 2011 +0100 @@ -46,39 +46,58 @@ import org.netbeans.api.autoupdate.InstallSupport; import org.netbeans.api.autoupdate.OperationContainer; import org.netbeans.api.autoupdate.OperationContainer.OperationInfo; -import org.netbeans.modules.autoupdate.ui.actions.PluginManagerAction; +import org.netbeans.api.autoupdate.UpdateManager; import org.netbeans.modules.autoupdate.ui.wizards.InstallUnitWizard; import org.netbeans.modules.autoupdate.ui.wizards.InstallUnitWizardModel; import org.netbeans.modules.autoupdate.ui.wizards.OperationWizardModel.OperationType; -/** - * +/** Access to UI features of PluginManager that can be useful in other modules + * as well. + * @since 1.20 + * * @author Jirka Rechtacek */ public final class PluginManager { - private static PluginManagerAction p = null; - private static Runnable toRun = null; - public static void show () { - if (p == null) { - p = new PluginManagerAction (); - } - p.performAction (); + private PluginManager() { } - public static boolean openInstallWizard (OperationContainer updateContainer) { - if (updateContainer == null) { + /** Open standard dialog for installing set of modules. Shows it to the user, + * asks for confirmation, license acceptance, etc. The whole operation requires + * AWT dispatch thread access (to show the dialog) and blocks + * (until the user clicks through), so either call from AWT dispatch thread + * directly, or be sure you hold no locks and block no progress of other + * threads to avoid deadlocks. +
+{@link OperationContainer} container = OperationContainer.createForInstall();
+for ({@link UpdateUnit} u : {@link UpdateManager#getUpdateUnits(org.netbeans.api.autoupdate.UpdateManager.TYPE[]) UpdateManager.getDefault().getUpdateUnits(UpdateManager.TYPE.MODULE)}) {
+    if (u.getCodeName().matches("org.my.favorite.module")) {
+        if (u.getAvailableUpdates().isEmpty()) {
+            continue;
+        }
+        container.add(u.getAvailableUpdates().get(0));
+    }
+}
+PluginManager.openInstallWizard(container);
+
+ * + * @param container the container with list of modules for install + * @return true if all the requested modules were successfullly installed, + * false otherwise. + */ + public static boolean openInstallWizard(OperationContainer container) { + if (container == null) { throw new IllegalArgumentException ("OperationContainer cannot be null."); // NOI18N } - List> all = updateContainer.listAll (); + List> all = container.listAll (); if (all.isEmpty ()) { throw new IllegalArgumentException ("OperationContainer cannot be empty."); // NOI18N } - List> invalid = updateContainer.listInvalid(); + List> invalid = container.listInvalid(); if (! invalid.isEmpty ()) { throw new IllegalArgumentException ("OperationContainer cannot contain invalid elements but " + invalid); // NOI18N } OperationInfo info = all.get (0); OperationType doOperation = info.getUpdateUnit ().getInstalled () == null ? OperationType.INSTALL : OperationType.UPDATE; - return new InstallUnitWizard ().invokeWizard (new InstallUnitWizardModel (doOperation, updateContainer)); + return new InstallUnitWizard ().invokeWizard (new InstallUnitWizardModel (doOperation, container)); } } diff -r b3d334d8c4fb nbbuild/build.properties --- a/nbbuild/build.properties Mon Feb 07 10:25:43 2011 +0100 +++ b/nbbuild/build.properties Mon Feb 07 15:12:10 2011 +0100 @@ -101,6 +101,7 @@ config.javadoc.stable=\ api.annotations.common,\ autoupdate.services,\ + autoupdate.ui,\ core.ide,\ openide.util,\ openide.util.lookup,\ diff -r b3d334d8c4fb nbbuild/javadoctools/links.xml --- a/nbbuild/javadoctools/links.xml Mon Feb 07 10:25:43 2011 +0100 +++ b/nbbuild/javadoctools/links.xml Mon Feb 07 15:12:10 2011 +0100 @@ -202,3 +202,4 @@ + diff -r b3d334d8c4fb nbbuild/javadoctools/properties.xml --- a/nbbuild/javadoctools/properties.xml Mon Feb 07 10:25:43 2011 +0100 +++ b/nbbuild/javadoctools/properties.xml Mon Feb 07 15:12:10 2011 +0100 @@ -200,3 +200,4 @@ + diff -r b3d334d8c4fb nbbuild/javadoctools/replaces.xml --- a/nbbuild/javadoctools/replaces.xml Mon Feb 07 10:25:43 2011 +0100 +++ b/nbbuild/javadoctools/replaces.xml Mon Feb 07 15:12:10 2011 +0100 @@ -200,3 +200,4 @@ +