List of usage examples for com.vaadin.ui Link setDescription
public void setDescription(String description)
From source file:org.eclipse.hawkbit.ui.components.SPUIComponentProvider.java
License:Open Source License
/** * Generates help/documentation links from within management UI. * * @param i18n// www . j a v a 2 s .c om * the i18n * @param uri * to documentation site * * @return generated link */ public static Link getHelpLink(final VaadinMessageSource i18n, final String uri) { final Link link = new Link("", new ExternalResource(uri)); link.setTargetName("_blank"); link.setIcon(FontAwesome.QUESTION_CIRCLE); link.setDescription(i18n.getMessage("tooltip.documentation.link")); return link; }
From source file:org.escidoc.browser.ui.view.helpers.AdminDescriptorsTable.java
License:Open Source License
private Link buildLink(AdminDescriptor ad) { Link mdLink = new Link("View", new ExternalResource(buildUri(ad))); mdLink.setTargetName("_blank"); mdLink.setStyleName(BaseTheme.BUTTON_LINK); mdLink.setDescription("Show Admin Descriptor information in a separate window"); return mdLink; }
From source file:org.escidoc.browser.ui.view.helpers.ContainerMetadataTable.java
License:Open Source License
private Link buildLink(final MetadataRecord metadataRecord) { Link mdLink = new Link("View", new ExternalResource(buildUri(metadataRecord))); mdLink.setTargetName("_blank"); mdLink.setStyleName(BaseTheme.BUTTON_LINK); mdLink.setDescription("Show metadata information in a separate window"); return mdLink; }
From source file:ru.codeinside.gses.activiti.ftarchive.AttachmentField.java
License:Mozilla Public License
Component createDownloadLink(final FileValue fileValue) { final Link result = new Link(); result.setCaption(fileValue.getFileName()); result.setTargetName("_top"); result.setImmediate(true);/*www. j av a2 s. co m*/ result.setDescription(""); StreamResource.StreamSource streamSource = new StreamResource.StreamSource() { public InputStream getStream() { return new ByteArrayInputStream(fileValue.getContent()); } }; StreamResource resource = new StreamResource(streamSource, fileValue.getFileName(), Flash.app()) { public DownloadStream getStream() { final StreamSource ss = getStreamSource(); if (ss == null) { return null; } final DownloadStream ds = new DownloadStream(ss.getStream(), getMIMEType(), getFilename()); ds.setCacheTime(0); try { WebBrowser browser = (WebBrowser) result.getWindow().getTerminal(); if (browser.isIE()) { URI uri = new URI(null, null, fileValue.getFileName(), null); ds.setParameter("Content-Disposition", "attachment; filename=" + uri.toASCIIString()); } else { ds.setParameter("Content-Disposition", "attachment; filename=\"" + MimeUtility.encodeWord(fileValue.getFileName(), "utf-8", "Q") + "\""); } } catch (Exception e) { ds.setParameter("Content-Disposition", "attachment; filename=" + fileValue.getFileName()); } return ds; } }; resource.setMIMEType(fileValue.getMimeType()); result.setResource(resource); return result; }
From source file:ru.codeinside.gses.webui.utils.Components.java
License:Mozilla Public License
@Deprecated public static Link createAttachShowButton(final FileValue attachment, final Application appl) { if (attachment == null) { return null; }// w w w. j a v a 2 s .c o m final Link result = new Link(); result.setCaption(attachment.getFileName()); result.setTargetName("_top"); result.setImmediate(true); //String description = attachment.getDescription(); result.setDescription(""); StreamSource streamSource = new StreamSource() { private static final long serialVersionUID = 456334952891567271L; public InputStream getStream() { return new ByteArrayInputStream(attachment.getContent()); } }; StreamResource resource = new StreamResource(streamSource, attachment.getFileName(), appl) { private static final long serialVersionUID = -3869546661105572851L; public DownloadStream getStream() { final StreamSource ss = getStreamSource(); if (ss == null) { return null; } final DownloadStream ds = new DownloadStream(ss.getStream(), getMIMEType(), getFilename()); ds.setBufferSize(getBufferSize()); ds.setCacheTime(0); try { WebBrowser browser = (WebBrowser) result.getWindow().getTerminal(); if (browser.isIE()) { URI uri = new URI(null, null, attachment.getFileName(), null); ds.setParameter("Content-Disposition", "attachment; filename=" + uri.toASCIIString()); } else { ds.setParameter("Content-Disposition", "attachment; filename=\"" + MimeUtility.encodeWord(attachment.getFileName(), "utf-8", "Q") + "\""); } } catch (Exception e) { ds.setParameter("Content-Disposition", "attachment; filename=" + attachment.getFileName()); } return ds; } }; String type = attachment.getMimeType(); if (type != null) { resource.setMIMEType(type); } result.setResource(resource); return result; }