本文整理汇总了Java中edu.umd.cs.findbugs.Plugin.setGloballyEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.setGloballyEnabled方法的具体用法?Java Plugin.setGloballyEnabled怎么用?Java Plugin.setGloballyEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.findbugs.Plugin
的用法示例。
在下文中一共展示了Plugin.setGloballyEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enablePlugins
import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
private static void enablePlugins(Iterable<String> plugins, boolean enabled) {
for (String pid : plugins) {
Plugin plugin = Plugin.getByPluginId(pid);
if (plugin != null) {
if (plugin.cannotDisable())
JOptionPane.showMessageDialog(null,
"Cannot disable plugin: " + plugin.getPluginId() + "\n" + plugin.getShortDescription(),
"Cannot disable plugin", JOptionPane.ERROR_MESSAGE);
else
plugin.setGloballyEnabled(enabled);
}
}
}
示例2: handleWindowClose
import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
private void handleWindowClose() {
TreeModel bt = (MainFrame.getInstance().getTree().getModel());
if (bt instanceof BugTreeModel)
((BugTreeModel) bt).checkSorter();
Project project = getCurrentProject();
boolean changed = pluginsAdded;
pluginsAdded = false;
List<String> enabledPlugins = new ArrayList<String>();
List<String> disabledPlugins = new ArrayList<String>();
for (Map.Entry<Plugin, EnabledSettings> entry : pluginEnabledStatus.entrySet()) {
Plugin plugin = entry.getKey();
EnabledSettings enabled = entry.getValue();
if (project != null) {
Boolean newSetting = enabled.project;
Boolean existingSetting = project.getPluginStatus(plugin);
if (existingSetting != newSetting && (newSetting == null || !newSetting.equals(existingSetting))) {
project.setPluginStatusTrinary(plugin.getPluginId(), newSetting);
changed = true;
}
}
if (enabled.global)
enabledPlugins.add(plugin.getPluginId());
else
disabledPlugins.add(plugin.getPluginId());
if (plugin.isGloballyEnabled() != enabled.global) {
plugin.setGloballyEnabled(enabled.global);
changed = true;
}
}
if (changed && project != null) {
MainFrame.getInstance().updateBugTree();
MainFrame.getInstance().setProjectChanged(true);
}
if (project == null) {
GUISaveState.getInstance().setPluginsEnabled(enabledPlugins, disabledPlugins);
GUISaveState.getInstance().save();
}
}
示例3: enablePlugins
import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
/**
* Enables or disables a FindBugs plugin.
*
* @param plugins
* @param enabled
*/
protected void enablePlugins(String pluginId, boolean enabled) {
Plugin plugin = Plugin.getByPluginId(pluginId);
if (plugin != null) {
if (!enabled && plugin.cannotDisable()) {
fail("Cannot disable plugin: " + plugin.getPluginId() + '\n' + plugin.getShortDescription());
} else {
plugin.setGloballyEnabled(enabled);
}
}
}