当前位置: 首页>>代码示例>>Java>>正文


Java Link.setTargetName方法代码示例

本文整理汇总了Java中com.vaadin.ui.Link.setTargetName方法的典型用法代码示例。如果您正苦于以下问题:Java Link.setTargetName方法的具体用法?Java Link.setTargetName怎么用?Java Link.setTargetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Link的用法示例。


在下文中一共展示了Link.setTargetName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SourceView

import com.vaadin.ui.Link; //导入方法依赖的package包/类
public SourceView() {

        Label caption = new Label("Sources");
        caption.addStyleName(DSTheme.LABEL_HUGE);
        addComponents(caption);

        List<Link> linkList = new ArrayList<Link>();

        Link aidedd = new Link("AideDD", new ExternalResource("http://www.aidedd.org/"));
        linkList.add(aidedd);
        Link gemmaline = new Link("Gemmaline", new ExternalResource("http://www.gemmaline.com/faerun/"));
        linkList.add(gemmaline);
        Link frwiki = new Link("Wiki des royaumes oubliés",
                new ExternalResource("https://fr.wikipedia.org/wiki/Portail:Royaumes_oubli%C3%A9s"));
        linkList.add(frwiki);

        for (Link link : linkList) {
            link.setTargetName("_blank");
            addComponent(link);
        }
    }
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:22,代码来源:SourceView.java

示例2: getDetailComponent

import com.vaadin.ui.Link; //导入方法依赖的package包/类
public Component getDetailComponent(Attachment attachment) {
  VerticalLayout verticalLayout = new VerticalLayout();
  verticalLayout.setSpacing(true);
  verticalLayout.setMargin(true);
  
  verticalLayout.addComponent(new Label(attachment.getDescription()));
  
  HorizontalLayout linkLayout = new HorizontalLayout();
  linkLayout.setSpacing(true);
  verticalLayout.addComponent(linkLayout);
  
  // Icon
  linkLayout.addComponent(new Embedded(null, Images.RELATED_CONTENT_URL));
  
  // Link
  Link link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
  link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
  linkLayout.addComponent(link);
  
  return verticalLayout;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:UrlAttachmentRenderer.java

示例3: generateMgrLink

import com.vaadin.ui.Link; //导入方法依赖的package包/类
public static Object generateMgrLink(String caption, String url) {
    Link mgrLink = new Link();
    mgrLink.setCaption(caption);
    mgrLink.setResource(new ExternalResource(url));
    mgrLink.setDescription("Click to go to application");
    mgrLink.setTargetName("_blank");
    return mgrLink;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:9,代码来源:ViewUtil.java

示例4: getHelpLink

import com.vaadin.ui.Link; //导入方法依赖的package包/类
/**
 * Generates help/documentation links from within management UI.
 *
 * @param uri
 *            to documentation site
 *
 * @return generated link
 */
public static Link getHelpLink(final String uri) {

    final Link link = new Link("", new ExternalResource(uri));
    link.setTargetName("_blank");
    link.setIcon(FontAwesome.QUESTION_CIRCLE);
    link.setDescription("Documentation");
    return link;

}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:18,代码来源:SPUIComponentProvider.java

示例5: LinkField

import com.vaadin.ui.Link; //导入方法依赖的package包/类
public LinkField(Item item, Object propertyId) {

		String url = (String) item.getItemProperty(propertyId).getValue();
		link = new Link(url, new ExternalResource(url));
		link.setTargetName("_blank");
		setCompositionRoot(link);
	}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:8,代码来源:LinkField.java

示例6: generateCell

import com.vaadin.ui.Link; //导入方法依赖的package包/类
@Override
public Object generateCell(final Object columnId, final Item item, final Object itemId) {
    final String url = (String) item.getItemProperty(columnId).getValue();
    if (!isNullOrEmpty(url)) {
        final Link link = new Link(url, new ExternalResource(url));
        link.setTargetName("_blank");
        return link;
    } else
        return null;
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:11,代码来源:UrlLinkColumnGen.java

示例7: generateCell

import com.vaadin.ui.Link; //导入方法依赖的package包/类
@Override
public Object generateCell(final Object columnId, final Item item, final Object itemId) {
    final String url = (String) item.getItemProperty(columnId).getValue();
    if (!isNullOrEmpty(url)) {
        final Link link = new Link(url, new ExternalResource(MessageFormat.format("mailto:{0}", url)));
        link.setTargetName("_blank");
        return link;
    } else
        return null;
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:11,代码来源:EmailLinkColumnGen.java

示例8: getDownloadLink

import com.vaadin.ui.Link; //导入方法依赖的package包/类
/**
 * Get a Vaadin Link object associated with a file in the R working
 * directory.
 * 
 * @param linkCaption
 * @param filename
 * @return Vaadin link object
 */
public Link getDownloadLink(String linkCaption, String filename) {

	Link link = new Link();
	/* Open the link in a new window */
	link.setTargetName("_blank");

	link.setCaption(linkCaption);
	link.setResource(getDownloadResource(filename));
	return link;
}
 
开发者ID:avirkki,项目名称:RVaadin,代码行数:19,代码来源:RContainer.java

示例9: SupportLayout

import com.vaadin.ui.Link; //导入方法依赖的package包/类
public SupportLayout() {
    Link link = new Link("Open Security Controller", new ExternalResource("http://www.intel.com/osc"));
    link.setTargetName("_blank");
    addComponent(link);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:6,代码来源:SupportLayout.java

示例10: getLink

import com.vaadin.ui.Link; //导入方法依赖的package包/类
/**
 * Method to create a link.
 *
 * @param id
 *            of the link
 * @param name
 *            of the link
 * @param resource
 *            path of the link
 * @param icon
 *            of the link
 * @param targetOpen
 *            specify how the link should be open (f. e. new windows =
 *            _blank)
 * @param style
 *            chosen style of the link. Might be {@code null} if no style
 *            should be used
 * @return a link UI component
 */
public static Link getLink(final String id, final String name, final String resource, final FontAwesome icon,
        final String targetOpen, final String style) {

    final Link link = new Link(name, new ExternalResource(resource));
    link.setId(id);
    link.setIcon(icon);
    link.setDescription(name);

    link.setTargetName(targetOpen);
    if (style != null) {
        link.setStyleName(style);
    }

    return link;

}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:36,代码来源:SPUIComponentProvider.java

示例11: JobsStatusViewComponent

import com.vaadin.ui.Link; //导入方法依赖的package包/类
public JobsStatusViewComponent(URL appUrl) {

		VerticalLayout mainLayout = new VerticalLayout();
		mainLayout.setSpacing(true);
		mainLayout.setMargin(true);
		mainLayout.setWidth("100%");

		// Refresher will update UI as progress is made
		final Refresher refresher = new Refresher();
		refresher.setRefreshInterval(UPDATE_STATUS_INTERVAL);
		refresher.addListener(this);
		mainLayout.addComponent(refresher);

		mainLayout.addComponent(buildTableControls());

		form = new Form();
		form.setCaption("Selected Job");
		form.setWidth("420px");
		form.setFormFieldFactory(new ExpressZipFieldFactory());
		form.setVisible(true);
		form.setImmediate(true);

		table = new Table(null);
		table.addStyleName("expresszip");
		table.setWidth("100%");
		table.setSelectable(true);
		table.setImmediate(true);
		table.setNullSelectionAllowed(false);
		table.setPageLength(0);
		table.setHeight("250px");
		container = new BeanItemContainer<Job>(Job.class, Job.getJobQueue());
		container.addNestedContainerProperty("exportProps.jobName");
		container.addNestedContainerProperty("exportProps.userNotation");
		table.setContainerDataSource(container);

		table.setVisibleColumns(new String[] { "exportProps.jobName", "exportProps.userNotation", "status" });
		table.setColumnHeaders(new String[] { "Job Name", "User Name", "Status" });
		table.sort(new Object[] { "exportProps.jobName", "exportProps.userNotation" }, new boolean[] { true, true });
		table.setColumnExpandRatio("status", 0.8f);
		
		// use green bar to highlight selected row
		ExpressZipTreeTable.enableFirstColumnHighlighter(table);
		
		updateTableData();

		mainLayout.addComponent(table);
		mainLayout.setExpandRatio(table, 1.0f);

		mainLayout.addComponent(form);

		Link browseExports = new Link("Browse Archived Jobs", new ExternalResource(appUrl.getProtocol() + "://"
				+ appUrl.getAuthority() + "/exportdir/"));
		// Open the URL in a new window/tab
		browseExports.setTargetName("_blank");
		mainLayout.addComponent(browseExports);

		// setContent(mainLayout);
		setCompositionRoot(mainLayout);
	}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:60,代码来源:JobsStatusViewComponent.java

示例12: getGraph

import com.vaadin.ui.Link; //导入方法依赖的package包/类
/**
 * Get a Vaadin Window element that contains the corresponding R plot
 * generated by submitting and evaluating the RPlotCall String. The
 * imageName corresponds to the downloadable .png image name. The full name
 * of the images shown in the browser are of the format
 * {@code imageName_ISODate_runningId_[sessionId].png}, e.g.
 * 'Image_2012-08-29_001_[bmgolmfgvk].png' to keep them chronologically
 * ordered.
 * 
 * @param RPlotCall
 *            the String to be evaluated by R
 * @param width
 *            the width of the graphical image
 * @param height
 *            the height of the graphical image
 * @param imageName
 *            the image name attached to the right-click downloadable file
 * @param windowName
 *            the title name of the Vaadin window element
 * @return Vaadin Window object
 */
public Window getGraph(final String RPlotCall, final int width,
		final int height, final String imageName, String windowName) {

	/* Construct a Window to show the graphics */
	Window RGraphics = new Window(windowName);
	HorizontalLayout root = new HorizontalLayout();
	root.setMargin(true);

	RGraphics.setContent(root);
	RGraphics.setSizeUndefined();

	/* Control the image position */
	final int imageXoffset = 180;
	final int imageYoffset = 60;

	int imageYpos = rand.nextInt(50);
	int imageXpos = rand.nextInt(90);

	RGraphics.setPositionX(imageXoffset + imageXpos);
	RGraphics.setPositionY(imageYoffset + imageYpos);

	/* Call R for the graphics */
	Embedded rPlot = getEmbeddedGraph(RPlotCall, width, height, imageName);
	root.addComponent(rPlot);

	/*
	 * Button bar to generate PDF (and for other options in the future)
	 */
	if (showButtonsInGraph) {
		final HorizontalLayout buttonLayout = new HorizontalLayout();
		Button open = new Button("PDF");
		open.setStyleName(Reindeer.BUTTON_SMALL);
		buttonLayout.addComponent(open);

		Button.ClickListener openClicked = new Button.ClickListener() {

			private static final long serialVersionUID = 1L;

			@Override
			public void buttonClick(ClickEvent event) {
				StreamResource s = getImageResource(RPlotCall, width
						/ screen_dpi, height / screen_dpi, imageName, "pdf");

				Link pdfLink = new Link("Open pdf", s);
				pdfLink.setTargetName("_blank");

				buttonLayout.removeAllComponents();
				buttonLayout.addComponent(pdfLink);
			}
		};
		open.addClickListener(openClicked);
		root.addComponent(buttonLayout);
	}

	return RGraphics;
}
 
开发者ID:avirkki,项目名称:RVaadin,代码行数:78,代码来源:RContainer.java


注:本文中的com.vaadin.ui.Link.setTargetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。