Example usage for com.vaadin.ui Link Link

List of usage examples for com.vaadin.ui Link Link

Introduction

In this page you can find the example usage for com.vaadin.ui Link Link.

Prototype

public Link(String caption, Resource resource) 

Source Link

Document

Creates a new instance of Link.

Usage

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createAdminDataSummaryViewPageLink() {
    final Link pageLink = new Link(ADMIN_DATA_SUMMARY_LINK_TEXT,
            new ExternalResource(LINK_SEPARATOR + AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME));
    pageLink.setId(ViewAction.VISIT_ADMIN_DATA_SUMMARY_VIEW.name());
    pageLink.setIcon(FontAwesome.DATABASE);
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createAdminAgentOperationViewPageLink() {
    final Link pageLink = new Link(ADMIN_AGENT_OPERATIONS_LINK_TEXT,
            new ExternalResource(LINK_SEPARATOR + AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME));
    pageLink.setId(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW.name());
    pageLink.setIcon(FontAwesome.USER_SECRET);
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link addCommitteePageLink(final ViewRiksdagenCommittee data) {
    final Link pageLink = new Link(COMMITTEE + data.getEmbeddedId().getDetail(), new ExternalResource(
            PAGE_PREFIX + UserViews.COMMITTEE_VIEW_NAME + PAGE_SEPARATOR + data.getEmbeddedId().getOrgCode()));
    pageLink.setId(ViewAction.VISIT_COMMITTEE_VIEW.name() + PAGE_SEPARATOR + data.getEmbeddedId().getOrgCode());
    pageLink.setIcon(FontAwesome.GROUP);
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link addMinistryPageLink(final ViewRiksdagenMinistry data) {
    final Link pageLink = new Link(MINISTRY + data.getNameId(), new ExternalResource(
            PAGE_PREFIX + UserViews.MINISTRY_VIEW_NAME + PAGE_SEPARATOR + data.getNameId()));
    pageLink.setId(ViewAction.VISIT_MINISTRY_VIEW.name() + PAGE_SEPARATOR + data.getNameId());
    pageLink.setIcon(FontAwesome.GROUP);
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link addPartyPageLink(final ViewRiksdagenParty data) {
    final Link pageLink = new Link(PARTY + data.getPartyName(),
            new ExternalResource(PAGE_PREFIX + UserViews.PARTY_VIEW_NAME + PAGE_SEPARATOR + data.getPartyId()));
    pageLink.setId(ViewAction.VISIT_PARTY_VIEW.name() + PAGE_SEPARATOR + data.getPartyId());
    pageLink.setIcon(FontAwesome.GROUP);
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createPoliticianPageLink(final PersonData personData) {
    final Link pageLink = new Link(POLITICIAN + personData.getFirstName() + ' ' + personData.getLastName(),
            new ExternalResource(
                    PAGE_PREFIX + UserViews.POLITICIAN_VIEW_NAME + PAGE_SEPARATOR + personData.getId()));
    pageLink.setId(ViewAction.VISIT_POLITICIAN_VIEW.name() + PAGE_SEPARATOR + personData.getId());
    pageLink.setIcon(FontAwesome.BUG);/*from  w  w  w.  j  a v  a  2s  .  c o  m*/
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createSearchDocumentViewPageLink() {
    final Link pageLink = new Link(SEARCH,
            new ExternalResource(PAGE_PREFIX + UserViews.SEARCH_DOCUMENT_VIEW_NAME));
    pageLink.setId(ViewAction.VISIT_DOCUMENT_VIEW.name());
    pageLink.setIcon(FontAwesome.SEARCH);

    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createAdminPagingLink(final String label, final String page, final String pageId,
        final String pageNr) {
    final Link pageLink = new Link(label,
            new ExternalResource(PAGE_PREFIX + page + PAGE_SEPARATOR + "[" + pageNr + "]"));
    pageLink.setId(page + "ShowPage" + PAGE_SEPARATOR + pageNr);
    pageLink.setIcon(FontAwesome.SERVER);

    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createUserHomeViewPageLink() {
    final Link pageLink = new Link("User account:" + UserContextUtil.getUserNameFromSecurityContext(),
            new ExternalResource(PAGE_PREFIX + UserViews.USERHOME_VIEW_NAME));
    pageLink.setId(ViewAction.VISIT_USER_HOME_VIEW.name());
    pageLink.setIcon(FontAwesome.USER);/* w w  w.j  a v a2 s  . c  o m*/
    return pageLink;
}

From source file:com.karus.EnglishCheckerUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    VaadinServiceSession.getCurrent().setErrorHandler(this);
    setSizeFull();//from w ww  .j a v  a  2 s .  c  o  m

    try {
        DiscoveryNavigator navigator = new DiscoveryNavigator(this, getContent());
        navigator.navigateTo(UI.getCurrent().getPage().getFragment());
    }
    /**
     * Exception on page load
     */
    catch (AccessDeniedException e) {
        Label label = new Label(e.getMessage());
        label.setWidth(-1, Unit.PERCENTAGE);

        Link goToMain = new Link("Go to login page", new ExternalResource("/login/"));

        VerticalLayout layout = new VerticalLayout();
        layout.addComponent(label);
        layout.addComponent(goToMain);
        layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
        layout.setComponentAlignment(goToMain, Alignment.MIDDLE_CENTER);

        VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.setSizeFull();
        mainLayout.addComponent(layout);
        mainLayout.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);

        setContent(mainLayout);
        Notification.show(e.getMessage(), Notification.Type.ERROR_MESSAGE);
    }
}