com.atlassian.plugin.connect.modules.beans.builder.WebItemModuleBeanBuilder类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(118)

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

WebItemModuleBeanBuilder介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-modules

private static String createWebItemExample() {
  final WebItemModuleBean webItemModuleBean = WebItemModuleBean.newWebItemBean()
      .withName(i18nProperty("My Web Item"))
      .withUrl("/my-web-item")
      .withKey("web-item-example")
      .withLocation("system.preset.filters")
      .withIcon(newIconBean().withUrl("/maps/icon.png").withHeight(16).withWidth(16).build())
      .withStyleClasses("webitem", "system-present-webitem")
      .withTooltip(i18nProperty("Example tooltip"))
      .withWeight(200)
      .build();
  return JsonExamplesUtils.createModuleArrayAsString("webItems", webItemModuleBean);
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-integration-tests-support

public static WebItemModuleBean randomWebItemBean() {
  return newWebItemBean()
      .withName(new I18nProperty(randomModuleKey(), null))
      .withKey(randomModuleKey())
      .withLocation("system.nowhere")
      .withUrl("/nowhere")
      .build();
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-extension-spi

private WebItemModuleBean createWebItemModuleBean(ConnectPageModuleBean bean, String url) {
  Integer weight = bean.getWeight() == null ? getDefaultWeight() : bean.getWeight();
  String location = isNullOrEmpty(bean.getLocation()) ? getDefaultSection() : bean.getLocation();
  return newWebItemBean()
      .withName(bean.getName())
      .withKey(bean.getRawKey())
      .withContext(page)
      .withUrl(url)
      .withLocation(location)
      .withWeight(weight)
      .withIcon(bean.getIcon())
      .withConditions(bean.getConditions())
      .setNeedsEscaping(needsEscaping())
      .build();
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-extension-spi

@Override
public List<ModuleDescriptor<?>> createPluginModuleDescriptors(List<ConnectPageModuleBean> modules, ConnectAddonBean addon) {
  List<ModuleDescriptor<?>> descriptors = new ArrayList<>();
  for (ConnectPageModuleBean bean : modules) {
    if (hasWebItem()) {
      // create a web item targeting the iframe page
      Integer weight = bean.getWeight() == null ? getDefaultWeight() : bean.getWeight();
      String location = isNullOrEmpty(bean.getLocation()) ? getDefaultSection() : bean.getLocation();
      WebItemModuleBean webItemBean = newWebItemBean()
          .withName(bean.getName())
          .withKey(bean.getRawKey())
          .withContext(page)
          .withUrl(ConnectIFrameServletPath.forModule(addon.getKey(), bean.getRawKey()))
          .withLocation(location)
          .withWeight(weight)
          .withIcon(bean.getIcon())
          .withConditions(bean.getConditions())
          .setNeedsEscaping(needsEscaping())
          .build();
      descriptors.add(webItemModuleDescriptorFactory.createModuleDescriptor(
          webItemBean, addon, getConditionClasses()));
    }
    descriptors.add(createPageIFrame(bean, addon));
    descriptors.add(createRawIFrame(bean, addon));
  }
  return descriptors;
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-integration-tests-support

public static WebItemModuleBean randomWebItemBean() {
  return newWebItemBean()
      .withName(value(randomModuleKey()))
      .withKey(randomModuleKey())
      .withLocation("system.nowhere")
      .withUrl("/nowhere")
      .build();
}

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

@Override
public List<ModuleDescriptor> createPluginModuleDescriptors(List<ConnectPageModuleBean> modules, ConnectModuleProviderContext moduleProviderContext)
{
  List<ModuleDescriptor> descriptors = new ArrayList<>();
  final ConnectAddonBean connectAddonBean = moduleProviderContext.getConnectAddonBean();
  for (ConnectPageModuleBean bean : modules)
  {
    if (hasWebItem())
    {
      // create a web item targeting the iframe page
      Integer weight = bean.getWeight() == null ? getDefaultWeight() : bean.getWeight();
      String location = isNullOrEmpty(bean.getLocation()) ? getDefaultSection() : bean.getLocation();
      WebItemModuleBean webItemBean = newWebItemBean()
          .withName(bean.getName())
          .withKey(bean.getRawKey())
          .withContext(page)
          .withUrl(ConnectIFrameServletPath.forModule(connectAddonBean.getKey(), bean.getRawKey()))
          .withLocation(location)
          .withWeight(weight)
          .withIcon(bean.getIcon())
          .withConditions(bean.getConditions())
          .setNeedsEscaping(needsEscaping())
          .build();
      descriptors.add(webItemModuleDescriptorFactory.createModuleDescriptor(moduleProviderContext,
          pluginRetrievalService.getPlugin(), webItemBean, getConditionClasses()));
    }
    registerIframeRenderStrategy(bean, connectAddonBean);
  }
  return descriptors;
}

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

private static String createWebItemExample() {
  final WebItemModuleBean webItemModuleBean = WebItemModuleBean.newWebItemBean()
      .withName(i18nProperty("My Web Item"))
      .withUrl("/my-web-item")
      .withKey("web-item-example")
      .withLocation("system.preset.filters")
      .withIcon(newIconBean().withUrl("/maps/icon.png").withHeight(16).withWidth(16).build())
      .withStyleClasses("webitem", "system-present-webitem")
      .withTooltip(i18nProperty("Example tooltip"))
      .withWeight(200)
      .build();
  return JsonExamplesUtils.createModuleArrayAsString("webItems", webItemModuleBean);
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-test-support-plugin

public static WebItemModuleBean randomWebItemBean() {
    return newWebItemBean().withName(value(randomPluginKey())).withKey(randomPluginKey()).withLocation("system.nowhere").withUrl("/nowhere").build();
  }
}

相关文章