for(Plugin p : Plugin.getAllPlugins()) { LOG.info("Plugin: {}", p.getPluginId()); LOG.info(" description: {}", p.getShortDescription()); LOG.info(" provider: {}", p.getProvider()); String version = p.getVersion();
System.out.println(" " + plugin.getPluginId() + " (default: " + (plugin.isEnabledByDefault() ? "enabled" : "disabled") + ")"); if (plugin.getShortDescription() != null) { System.out.println(" Description: " + plugin.getShortDescription());
private String getPluginNames(Collection<Plugin> plugins) { String text = ""; boolean first = true; for (Plugin plugin : plugins) { text = (first ? "" : ", ") + plugin.getShortDescription(); first = false; } return text; }
@Override public int compare(UpdateChecker.PluginUpdate o1, UpdateChecker.PluginUpdate o2) { return o1.getPlugin().getShortDescription().compareTo(o2.getPlugin().getShortDescription()); } });
@Override public void mousePressed(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { JPopupMenu menu = new JPopupMenu(); JMenuItem item = new JMenuItem("Uninstall " + plugin.getShortDescription() + "..."); item.addActionListener(new UninstallClickListener(plugin, url)); menu.add(item); menu.show(checkGlobal, e.getX(), e.getY()); } } });
private JLabel createPluginLabel(UpdateChecker.PluginUpdate update) { String name; if (update.getPlugin().isCorePlugin()) { name = "FindBugs"; } else { name = update.getPlugin().getShortDescription(); } JLabel label = new JLabel(MessageFormat.format( "<html><b>{0} {2}</b> is available<br><i><small>(currently installed: {1})", name, update.getPlugin().getVersion(), update.getVersion())); label.setFont(label.getFont().deriveFont(Font.PLAIN, label.getFont().getSize() + 4)); return label; }
@Override public String toString() { SimpleDateFormat format = new SimpleDateFormat(PLUGIN_RELEASE_DATE_FMT); StringBuilder buf = new StringBuilder(); String name = getPlugin().isCorePlugin() ? "FindBugs" : "FindBugs plugin " + getPlugin().getShortDescription(); buf.append( name + " " + getVersion() ); if (date == null) { buf.append(" has been released"); } else { buf.append(" was released " + format.format(date)); } buf.append( " (you have " + getPlugin().getVersion() + ")"); buf.append("\n"); buf.append(" " + message.replaceAll("\n", "\n ")); if (url != null) { buf.append("\nVisit " + url + " for details."); } return buf.toString(); } }
public @CheckForNull URI getRedirectURL(final boolean force) { String redirect = dfc.getGlobalOption(KEY_REDIRECT_ALL_UPDATE_CHECKS); String sysprop = System.getProperty("findbugs.redirectUpdateChecks"); if (sysprop != null) { redirect = sysprop; } Plugin setter = dfc.getGlobalOptionSetter(KEY_REDIRECT_ALL_UPDATE_CHECKS); URI redirectUri = null; String pluginName = setter == null ? "<unknown plugin>" : setter.getShortDescription(); if (redirect != null && !"".equals(redirect.trim())) { try { redirectUri = new URI(redirect); logError(Level.INFO, "Redirecting all plugin update checks to " + redirectUri + " (" + pluginName + ")"); } catch (URISyntaxException e) { String error = "Invalid update check redirect URI in " + pluginName + ": " + redirect; logError(Level.SEVERE, error); dfc.pluginUpdateCheckComplete(pluginUpdates, force); throw new IllegalStateException(error); } } return redirectUri; }
public String getPluginThatDisabledUpdateChecks() { String disable = dfc.getGlobalOption(KEY_DISABLE_ALL_UPDATE_CHECKS); Plugin setter = dfc.getGlobalOptionSetter(KEY_DISABLE_ALL_UPDATE_CHECKS); String pluginName = setter == null ? "<unknown plugin>" : setter.getShortDescription(); String disablingPlugin = null; if ("true".equalsIgnoreCase(disable)) { logError(Level.INFO, "Skipping update checks due to " + KEY_DISABLE_ALL_UPDATE_CHECKS + "=true set by " + pluginName); disablingPlugin = pluginName; } else if (disable != null && !"false".equalsIgnoreCase(disable)) { String error = "Unknown value '" + disable + "' for " + KEY_DISABLE_ALL_UPDATE_CHECKS + " in " + pluginName; logError(Level.SEVERE, error); throw new IllegalStateException(error); } return disablingPlugin; }
@Override public void actionPerformed(ActionEvent e) { int result = JOptionPane.showOptionDialog(PreferencesFrame.this, "Are you sure you want to uninstall " + plugin.getShortDescription() + "?" + "\n\nNo files will be deleted from your computer.", "", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
private static void enablePlugins(Iterable<String> plugins, boolean enabled) { for (String pid : plugins) { Plugin plugin = Plugin.getByPluginId(pid); if (plugin != null) { if (!enabled && plugin.cannotDisable()) { JOptionPane.showMessageDialog(null, "Cannot disable plugin: " + plugin.getPluginId() + "\n" + plugin.getShortDescription(), "Cannot disable plugin", JOptionPane.ERROR_MESSAGE); } else { plugin.setGloballyEnabled(enabled); } } } }
for(Plugin p : Plugin.getAllPlugins()) { System.out.println("Plugin: " + p.getPluginId()); System.out.println(" description: " + p.getShortDescription()); System.out.println(" provider: " + p.getProvider()); String version = p.getVersion();
System.out.println(" " + plugin.getPluginId() + " (default: " + (plugin.isEnabledByDefault() ? "enabled" : "disabled") + ")"); if (plugin.getShortDescription() != null) { System.out.println(" Description: " + plugin.getShortDescription());
continue; String text = plugin.getShortDescription(); String id = plugin.getPluginId(); if (text == null) {
public void checkForUpdates(Collection<Plugin> plugins, final boolean force) { if (updateChecksGloballyDisabled()) { dfc.pluginUpdateCheckComplete(pluginUpdates, force); return; } URI redirectUri = getRedirectURL(force); final CountDownLatch latch; if (redirectUri != null) { latch = new CountDownLatch(1); startUpdateCheckThread(redirectUri, plugins, latch); } else { MultiMap<URI,Plugin> pluginsByUrl = new MultiMap<URI, Plugin>(HashSet.class); for (Plugin plugin : plugins) { URI uri = plugin.getUpdateUrl(); if (uri == null) { logError(Level.FINE, "Not checking for updates for " + plugin.getShortDescription() + " - no update-url attribute in plugin XML file"); continue; } pluginsByUrl.add(uri, plugin); } latch = new CountDownLatch(pluginsByUrl.keySet().size()); for (URI uri : pluginsByUrl.keySet()) { startUpdateCheckThread(uri, pluginsByUrl.get(uri), latch); } } waitForCompletion(latch, force); }
xmlOutput.startTag("plugin"); xmlOutput.addAttribute("id", plugin.getPluginId()); xmlOutput.addAttribute("name", plugin.getShortDescription()); xmlOutput.addAttribute("version", plugin.getVersion()); Date date = plugin.getReleaseDate();