com.atlassian.plugin.Plugin.isBundledPlugin()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中com.atlassian.plugin.Plugin.isBundledPlugin()方法的一些代码示例,展示了Plugin.isBundledPlugin()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.isBundledPlugin()方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:isBundledPlugin

Plugin.isBundledPlugin介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

/**
 * A plugin is determined to be non-user if
 * {@link com.atlassian.plugin.Plugin#isBundledPlugin()} is true or if the
 * host application has indicated to the plugins system that a plugin was
 * provided by it.
 * <p>
 * <strong>NOTE:</strong> If a user has upgraded a bundled plugin then the
 * decision of whether it is user installed plugin is determined by if the
 * application has indicated to the plugins system that a plugin was
 * provided or not.
 */
public boolean isUserInstalled(final Plugin plugin) {
  checkNotNull(plugin, "plugin");
  // It is user installed if it has not been marked as provided by the
  // application and it was not bundled.
  return !plugin.isBundledPlugin() && !metadata.applicationProvided(plugin);
}

代码示例来源:origin: com.atlassian.support/stp

private void loadPluginPropertiesIntoStore(final PropertyStore pluginPropertiesStore, final Collection<Plugin> pluginsCollection)
{
  for (final Plugin plugin : pluginsCollection)
  {
    final PluginInformation pluginInformation = plugin.getPluginInformation();
    final PropertyStore pluginStore = pluginPropertiesStore.addCategory(PLUGINS_PLUGIN);
    pluginStore.setValue(PLUGIN_KEY, plugin.getKey());
    pluginStore.setValue(PLUGIN_NAME, plugin.getName());  // this is important for the SysInfo page
    pluginStore.setValue(PLUGIN_VERSION, pluginInformation.getVersion());
    pluginStore.setValue(PLUGIN_VENDOR, pluginInformation.getVendorName());
    pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString());
    pluginStore.setValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl());
    pluginStore.setValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion()));
    pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED));
  }
}

代码示例来源:origin: com.atlassian.support/stp

private void addPluginInfo(final PropertyStore store) {
  callAndLogExceptions((Callable<Void>) () -> {
    Collection<Plugin> plugins = utils.getPlugins();
    PluginMetadataManager pluginMetadataManager = ComponentManager.getComponent(PluginMetadataManager.class);
    PropertyStore pluginProperties = store.addCategory(AbstractSupportApplicationInfo.ENABLED_PLUGINS);
    for (Plugin plugin : plugins) {
      PluginInformation pluginInformation = plugin.getPluginInformation();
      PropertyStore pluginStore = pluginProperties.addCategory(PLUGINS_PLUGIN);
      pluginStore.setValue(PLUGIN_KEY, plugin.getKey());
      pluginStore.setValue(PLUGIN_NAME, plugin.getName());
      pluginStore.setValue(PLUGIN_VERSION, pluginInformation.getVersion());
      pluginStore.setValue(PLUGIN_VENDOR, pluginInformation.getVendorName());
      pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString());
      pluginStore.setValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl());
      pluginStore.setValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion()));
      pluginStore.setValue(PLUGIN_USER_INSTALLED, pluginMetadataManager.isUserInstalled(plugin) ? "true" : "false");
      pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED));
    }
    return null;
  });
}

代码示例来源:origin: com.atlassian.support/stp

pluginStore.setValue(PLUGIN_VENDOR, info.getVendorName());
pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString());
pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED));

相关文章