org.netbeans.modules.autoupdate.ui 1.23.1

org.netbeans.modules.autoupdate.ui.api
Class PluginManager

java.lang.Object
  extended by org.netbeans.modules.autoupdate.ui.api.PluginManager

public final class PluginManager
extends Object

Access to UI features of PluginManager that can be useful in other modules as well.

Since:
1.21

Method Summary
static boolean openInstallWizard(OperationContainer<InstallSupport> container)
          Open standard dialog for installing set of modules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

openInstallWizard

public static boolean openInstallWizard(OperationContainer<InstallSupport> container)
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.
OperationContainer container = OperationContainer.createForInstall();
for (UpdateUnit u : 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);

Parameters:
container - the container with list of modules for install
Returns:
true if all the requested modules were successfullly installed, false otherwise.

org.netbeans.modules.autoupdate.ui 1.23.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.