Java Code Examples for com.vaadin.ui.Link#setDescription()

The following examples show how to use com.vaadin.ui.Link#setDescription() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SPUIComponentProvider.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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;

}
 
Example 2
Source File: SPUIComponentProvider.java    From hawkbit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Generates help/documentation links from within management UI.
 *
 * @param i18n
 *            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;

}