本文整理匯總了Java中org.netbeans.api.autoupdate.UpdateElement類的典型用法代碼示例。如果您正苦於以下問題:Java UpdateElement類的具體用法?Java UpdateElement怎麽用?Java UpdateElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
UpdateElement類屬於org.netbeans.api.autoupdate包,在下文中一共展示了UpdateElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: logCurrentValues
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void logCurrentValues(CountsStruct pluginCounts) {
log("");
log("-----------------------------------------------------------");
log("| PLUGINS COUNTS IN DETAIL : |");
log("-----------------------------------------------------------");
log("NEW ELEMENTS:" + pluginCounts.getNewCount());
log("INSTALLED ELEMENTS:" + pluginCounts.getInstalledCount());
log("UPDATE ELEMENTS:" + pluginCounts.getUpdatesCount());
log("FILTERED ELEMENTS:" + pluginCounts.getFilteredCount());
log("PENDING ELEMENTS:" + pluginCounts.getPendingCount());
log("-----------------------------------------------------------");
log("-----------------------------------------------------------");
log("| PENDING PLUGINS : |");
log("-----------------------------------------------------------");
for (UpdateElement updateElement : currentlyPendingUninstalls) {
log("[" + updateElement.getDisplayName() + "] " + updateElement.getCodeName());
}
log("-----------------------------------------------------------");
}
示例2: logCurrentValues
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void logCurrentValues() {
log("");
log("-----------------------------------------------------------");
log("| PLUGINS COUNTS IN DETAIL : |");
log("-----------------------------------------------------------");
log("NEW ELEMENTS:" + newPlugins.size());
log("INSTALLED ELEMENTS:" + installedPlugins.size());
log("UPDATE ELEMENTS:" + updatePlugins.size());
log("-----------------------------------------------------------");
log("-----------------------------------------------------------");
log("| PLUGINS AVAILABLE FOR UNINSTALL : |");
log("-----------------------------------------------------------");
for (UpdateElement updateElement : updatePlugins) {
log("[" + updateElement.getDisplayName() + "] " + updateElement.getCodeName());
}
log("-----------------------------------------------------------");
}
示例3: setBody
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void setBody (final String msg, final Set<UpdateElement> updateElements) {
final List<UpdateElement> elements = new ArrayList<UpdateElement> (updateElements);
Collections.sort(elements, new Comparator<UpdateElement>() {
@Override
public int compare(UpdateElement o1, UpdateElement o2) {
return Collator.getInstance().compare(o1.getDisplayName(), o2.getDisplayName());
}
});
if (SwingUtilities.isEventDispatchThread ()) {
setBodyInEQ (msg, elements);
} else {
SwingUtilities.invokeLater (new Runnable () {
@Override
public void run () {
setBodyInEQ (msg, elements);
}
});
}
}
示例4: initWriteProblem
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
@Messages({
"# {0} - plugin_name",
"write_taTitle_Text=You don''t have permission to install plugin <b>{0}</b> into the installation directory.",
"write_taMessage_WarningText=To perform installation into the installation directory, you should run the application "
+ "as a user with administrative privilege, i.e. <i>Run as administrator</i> on Windows platform or "
+ "run as <i>sudo</i> command on Unix-like systems."})
private void initWriteProblem(UpdateElement culprit, String problemDescription) {
problem = problemDescription == null ?
write_taTitle_Text(culprit.getDisplayName()) : // NOI18N
problemDescription;
enhancedInitComponents();
cbShowAgain.setVisible(false);
taTitle.setText(problem);
taTitle.setToolTipText (problem);
tpMessage.setText(write_taMessage_WarningText()); // NOI18N
}
示例5: logCurrentValues
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void logCurrentValues() {
log("");
log("-----------------------------------------------------------");
log("| PLUGINS COUNTS IN DETAIL : |");
log("-----------------------------------------------------------");
log("NEW ELEMENTS:" + newPlugins.size());
log("INSTALLED ELEMENTS:" + installedPlugins.size());
log("UPDATE ELEMENTS:" + updatePlugins.size());
log("-----------------------------------------------------------");
log("-----------------------------------------------------------");
log("| NEW PLUGINS : |");
log("-----------------------------------------------------------");
for (UpdateElement updateElement : newPlugins) {
log("[" + updateElement.getDisplayName() + "] " + updateElement.getCodeName());
}
log("-----------------------------------------------------------");
}
示例6: logCurrentValues
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void logCurrentValues(CountsStruct pluginCounts) {
log("");
log("-----------------------------------------------------------");
log("| PLUGINS COUNTS IN DETAIL : |");
log("-----------------------------------------------------------");
log("NEW ELEMENTS:" + pluginCounts.getNewCount());
log("INSTALLED ELEMENTS:" + pluginCounts.getInstalledCount());
log("UPDATE ELEMENTS:" + pluginCounts.getUpdatesCount());
log("FILTERED ELEMENTS:" + pluginCounts.getFilteredCount());
log("PENDING ELEMENTS:" + pluginCounts.getPendingCount());
log("-----------------------------------------------------------");
log("-----------------------------------------------------------");
log("| PENDING PLUGINS : |");
log("-----------------------------------------------------------");
for (UpdateElement updateElement : currentlyPendingInstalls) {
log("[" + updateElement.getDisplayName() + "] " + updateElement.getCodeName());
}
log("-----------------------------------------------------------");
}
示例7: installUpdate
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
private static InstallationResult installUpdate(@NonNull final UpdateElement update) {
final ProgressHandle installHandle = ProgressHandle.createHandle(NbBundle.getMessage(
MissingModuleProblemsProvider.class,
"TXT_InstallModule",
update.getDisplayName()));
installHandle.start();
try {
final OperationContainer<InstallSupport> container = OperationContainer.createForInstall();
container.add(Collections.singleton(update));
final InstallSupport support = container.getSupport();
try {
final InstallSupport.Validator v = support.doDownload(installHandle, true, true);
final InstallSupport.Installer i = support.doValidate(v, installHandle);
final Restarter r = support.doInstall(i, installHandle);
return InstallationResult.success(support, r);
} catch (OperationException ex) {
Exceptions.printStackTrace(ex);
}
} finally {
installHandle.finish();
}
return InstallationResult.failure();
}
示例8: writeLicenses
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
private void writeLicenses(InstallUnitWizardModel model) {
goOverLicenses(model);
List<String> pluginsModel = new ArrayList<String>();
String fmt = NbBundle.getMessage(LicenseApprovalPanel.class,
"LicenseApprovalPanel_cbPlugins_ItemFormat");
for (UpdateElement el : license4plugins) {
String formatted = MessageFormat.format(fmt,
new Object[]{el.getDisplayName(), el.getSpecificationVersion()});
pluginsModel.add(formatted);
}
cbPlugins.setModel(new DefaultComboBoxModel(pluginsModel.toArray()));
if (! pluginsModel.isEmpty()) {
cbPlugins.setSelectedIndex(0);
}
}
示例9: testAquireEargersFromManager
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void testAquireEargersFromManager () throws IOException {
String eagerModule = "com.sun.testmodule.eager";
String regularModule1 = "org.yourorghere.independent";
String regularModule2 = "org.yourorghere.engine";
String catalog = generateCatalog (
generateModuleElement (eagerModule, "1.0", null, null, false, true,
regularModule1,
regularModule2),
generateModuleElement (regularModule1, "1.0", null, null, false, false),
generateModuleElement (regularModule2, "1.0", null, null, false, false, regularModule1)
);
UpdateUnitProviderFactory.getDefault ().create ("test-update-provider", "test-update-provider", generateFile (catalog));
UpdateUnitProviderFactory.getDefault ().refreshProviders (null, true);
Set<UpdateElement> eagerElements = UpdateManagerImpl.getInstance ().getAvailableEagers ();
assertFalse ("Some available eagers are found.", eagerElements.isEmpty ());
UpdateUnit ea = UpdateManagerImpl.getInstance ().getUpdateUnit (eagerModule);
UpdateElement foundEaEl = eagerElements.iterator ().next ();
UpdateUnit foundEaU = foundEaEl.getUpdateUnit ();
assertEquals ("Same eager UpdateUnit", ea, foundEaU);
// assertFalse ("Some installed eagers are found.", UpdateManagerImpl.getInstance ().getInstalledEagers ().isEmpty ());
}
示例10: getAvailableUpdates
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
@Override
public List<UpdateElement> getAvailableUpdates () {
synchronized(this) {
initializeFeature ();
}
if (updateElement == null) {
return Collections.emptyList ();
}
String id = updateElement.getCodeName ();
LOG.log (Level.FINE, "UpdateElement " + id + "[" +
(installedElement == null ? "<not installed>" : installedElement.getSpecificationVersion ()) + "] has update " +
id + "[" + updateElement.getSpecificationVersion () + "]");
return Collections.singletonList (updateElement);
}
示例11: run
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
@Override
public void run () {
if (SwingUtilities.isEventDispatchThread ()) {
Installer.RP.post (doCheckAvailableUpdates);
return ;
}
boolean hasUpdates = false;
if (Utilities.shouldCheckAvailableUpdates ()) {
Collection<UpdateElement> updates = new HashSet<UpdateElement> ();
checkUpdateElements(OperationType.UPDATE, null, false, updates);
hasUpdates = updates != null && ! updates.isEmpty ();
LazyUnit.storeUpdateElements (OperationType.UPDATE, updates);
Utilities.storeAcceptedLicenseIDs();
}
if (! hasUpdates && Utilities.shouldCheckAvailableNewPlugins ()) {
LazyUnit.storeUpdateElements (OperationType.INSTALL, checkUpdateElements(OperationType.INSTALL, null, false, null));
}
Installer.RP.post (doCheckLazyUpdates, 500);
}
示例12: notifyWritePermissionProblem
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
@Messages({
"# {0} - plugin_name",
"inBackground_WritePermission=You don''t have permission to install plugin {0} into the installation directory.",
"inBackground_WritePermission_Details=details", "cancel=Cancel", "install=Install anyway"})
private void notifyWritePermissionProblem(final OperationException ex, final UpdateElement culprit) {
// lack of privileges for writing
ActionListener onMouseClickAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ProblemPanel problem = new ProblemPanel(ex, culprit, false);
problem.showWriteProblemDialog();
}
};
String title = inBackground_WritePermission(culprit.getDisplayName());
String description = inBackground_WritePermission_Details();
NotificationDisplayer.getDefault().notify(title,
ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/error.png", false), // NOI18N
description, onMouseClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.ERROR);
}
示例13: testGetUpdateUnitsInNbmFile
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public void testGetUpdateUnitsInNbmFile () {
UpdateProvider localFilesProvider = new LocalNBMsProvider ("test-local-file-provider", NBM_FILE);
assertNotNull ("LocalNBMsProvider found for file " + NBM_FILE, localFilesProvider);
Map<String, UpdateUnit> units = UpdateUnitFactory.getDefault().getUpdateUnits (localFilesProvider);
assertNotNull ("UpdateUnit found in provider " + localFilesProvider.getDisplayName (), units);
assertEquals ("Provider providers only once unit in provider" + localFilesProvider.getName (), 1, units.size ());
String id = units.keySet ().iterator ().next ();
assertNotNull (localFilesProvider.getName () + " gives UpdateUnit.", units.get (id));
UpdateUnit u = units.get (id);
assertNull ("Unit is not installed.", u.getInstalled ());
assertNotNull ("Unit has update.", u.getAvailableUpdates ());
assertFalse ("Unit.getAvailableUpdates() is not empty.", u.getAvailableUpdates ().isEmpty ());
assertEquals ("Unit has only one update.", 1, u.getAvailableUpdates ().size ());
UpdateElement el = u.getAvailableUpdates ().get (0);
assertEquals ("org.yourorghere.depending", el.getCodeName ());
assertEquals ("1.0", el.getSpecificationVersion ());
assertEquals (0, el.getDownloadSize ());
}
示例14: handleBackwardCompatability
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
private static Set<UpdateElement> handleBackwardCompatability (Set<ModuleInfo> forInstall, Set<Dependency> brokenDependencies, boolean aggressive) {
if (cachedInfosReference != null) {
Set<ModuleInfo> cir = cachedInfosReference.get();
if (cir != null && cir.equals(forInstall) ) {
if (cachedResultReference != null) {
Set<UpdateElement> crr = cachedResultReference.get();
if (crr != null) {
return crr;
}
}
}
}
cachedInfosReference = new WeakReference<Set<ModuleInfo>>(forInstall);
err.finest("calling handleBackwardCompatability(size: " + forInstall.size() + ")");
Set<UpdateElement> moreRequested = new HashSet<UpdateElement> ();
// backward compatibility
for (ModuleInfo mi : forInstall) {
moreRequested.addAll(handleBackwardCompatability4ModuleInfo(mi, forInstall, brokenDependencies, aggressive));
}
cachedResultReference = new WeakReference<Set<UpdateElement>>(moreRequested);
return moreRequested;
}
示例15: installNativeComponent
import org.netbeans.api.autoupdate.UpdateElement; //導入依賴的package包/類
public UpdateElement installNativeComponent (UpdateUnit toInstall, UpdateElement installElement) throws Exception {
installElement = (installElement != null) ? installElement : toInstall.getAvailableUpdates ().get (0);
assertNotNull (toInstall);
// XXX: assert same could be broken later
assertSame (toInstall, Utilities.toUpdateUnit (toInstall.getCodeName ()));
OperationContainer<OperationSupport> container = OperationContainer.createForCustomInstallComponent ();
OperationContainer.OperationInfo<OperationSupport> info = container.add (installElement);
assertNotNull (info);
container.add (info.getRequiredElements ());
assertEquals (0,container.listInvalid ().size ());
OperationSupport support = container.getSupport ();
assertNotNull (support);
support.doOperation (null);
return installElement;
}