Search in sources :

Example 1 with CitationProvider

use of annis.gui.beans.CitationProvider in project ANNIS by korpling.

the class CitationLinkGenerator method generateCell.

@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
    Button btLink = new Button();
    btLink.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    btLink.setIcon(FontAwesome.SHARE_ALT);
    btLink.setDescription("Share query reference link");
    btLink.addClickListener(this);
    if (itemId instanceof DisplayedResultQuery) {
        btLink.addClickListener(new LinkClickListener((DisplayedResultQuery) itemId));
    } else if (itemId instanceof Query) {
        final CitationProvider citationProvider = new CitationProviderForQuery((Query) itemId);
        btLink.addClickListener(new LinkClickListener(citationProvider));
    } else if (itemId instanceof CitationProvider) {
        final CitationProvider citationProvider = (CitationProvider) itemId;
        btLink.addClickListener(new LinkClickListener(citationProvider));
    }
    return btLink;
}
Also used : CitationProvider(annis.gui.beans.CitationProvider) ContextualizedQuery(annis.gui.objects.ContextualizedQuery) DisplayedResultQuery(annis.gui.objects.DisplayedResultQuery) Query(annis.gui.objects.Query) Button(com.vaadin.ui.Button) DisplayedResultQuery(annis.gui.objects.DisplayedResultQuery)

Aggregations

CitationProvider (annis.gui.beans.CitationProvider)1 ContextualizedQuery (annis.gui.objects.ContextualizedQuery)1 DisplayedResultQuery (annis.gui.objects.DisplayedResultQuery)1 Query (annis.gui.objects.Query)1 Button (com.vaadin.ui.Button)1