本文整理了Java中com.atlassian.plugin.connect.modules.beans.WebItemModuleBean
类的一些代码示例,展示了WebItemModuleBean
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebItemModuleBean
类的具体详情如下:
包路径:com.atlassian.plugin.connect.modules.beans.WebItemModuleBean
类名称:WebItemModuleBean
[英]Adds a web item to a specified location in the application interface. A web item is a hyperlink that’s inserted into some standard place in the Atlassian application interface, such as the administration menu.
The form that the link takes can vary depending on the location. For instance, a web item in the header bar (with a location section of system.top.navigation.bar
) adds a link to the navigation bar across the top of the interface. On the other hand, a web item in the opsbar-operation
location section in JIRA adds an item to the issue operation buttons.
A web item link can open a new page in the application or a dialog, depending on your configuration.
Web items are a simple and useful way to extend Atlassian applications. If you want to extend an Atlassian application and don't know where to start, a web item may be all you need.
Your add-on can receive additional context from the application by using variable tokens in the url
attribute.
Example
[中]将web项添加到应用程序界面中的指定位置。web项是插入到Atlassian应用程序界面中某个标准位置的超链接,例如“管理”菜单。
链接的形式可能因位置而异。例如,标题栏中的web项(位置部分为'system.top.navigation.bar')会在界面顶部添加指向导航栏的链接。另一方面,JIRA中“opsbar操作”位置部分中的一个web项会将一个项添加到问题操作按钮中。
web项链接可以在应用程序或对话框中打开新页面,具体取决于您的配置。
Web项是扩展Atlassian应用程序的一种简单而有用的方法。如果你想扩展一个Atlassian应用程序,但又不知道从哪里开始,你可能只需要一个web项目。
通过在“url”属性中使用变量标记,您的加载项可以从应用程序接收[additional context](../../concepts/context parameters.html)。
实例
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-modules
@Override
public WebItemModuleBean build() {
return new WebItemModuleBean(this);
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-modules
public WebItemModuleBeanBuilder(WebItemModuleBean defaultBean) {
super(defaultBean);
this.location = defaultBean.getLocation();
this.weight = defaultBean.getWeight();
this.styleClasses = defaultBean.getStyleClasses();
this.needsEscaping = defaultBean.needsEscaping();
this.locationValidationEnabled = defaultBean.isLocationValidationEnabled();
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-modules
public WebItemModuleBeanBuilder(WebItemModuleBean defaultBean) {
super(defaultBean);
this.location = defaultBean.getLocation();
this.weight = defaultBean.getWeight();
this.styleClasses = defaultBean.getStyleClasses();
}
代码示例来源: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-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-server-modules
@Override
public String toString() {
return super.fillToStringHelper(Objects.toStringHelper(this))
.add("location", getLocation())
.add("weight", getWeight())
.add("styleClasses", getStyleClasses())
.toString();
}
代码示例来源: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();
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-modules
@Override
public String toString() {
return super.fillToStringHelper(Objects.toStringHelper(this))
.add("location", getLocation())
.add("weight", getWeight())
.add("styleClasses", getStyleClasses())
.toString();
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-modules
@Override
public WebItemModuleBean build() {
return new WebItemModuleBean(this);
}
}
代码示例来源: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-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-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-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-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;
}
内容来源于网络,如有侵权,请联系作者删除!