Search in sources :

Example 1 with CorpusBrowserPanel

use of annis.gui.CorpusBrowserPanel in project ANNIS by korpling.

the class CorpusListPanel method initCorpusBrowser.

public void initCorpusBrowser(String topLevelCorpusName, final Button l) {
    AnnisCorpus c = ui.getQueryState().getAvailableCorpora().getItem(topLevelCorpusName).getBean();
    MetaDataPanel meta = new MetaDataPanel(c.getName());
    CorpusBrowserPanel browse = new CorpusBrowserPanel(c, ui.getQueryController());
    GridLayout infoLayout = new GridLayout(2, 2);
    infoLayout.setSizeFull();
    String corpusURL = Helper.generateCorpusLink(Sets.newHashSet(topLevelCorpusName));
    Label lblLink = new Label("Link to corpus: <a href=\"" + corpusURL + "\">" + corpusURL + "</a>", ContentMode.HTML);
    lblLink.setHeight("-1px");
    lblLink.setWidth("-1px");
    infoLayout.addComponent(meta, 0, 0);
    infoLayout.addComponent(browse, 1, 0);
    infoLayout.addComponent(lblLink, 0, 1, 1, 1);
    infoLayout.setRowExpandRatio(0, 1.0f);
    infoLayout.setColumnExpandRatio(0, 0.5f);
    infoLayout.setColumnExpandRatio(1, 0.5f);
    infoLayout.setComponentAlignment(lblLink, Alignment.MIDDLE_CENTER);
    Window window = new Window("Corpus information for " + c.getName() + " (ID: " + c.getId() + ")", infoLayout);
    window.setWidth(70, Unit.EM);
    window.setHeight(45, Unit.EM);
    window.setResizable(true);
    window.setModal(false);
    window.setResizeLazy(true);
    window.addCloseListener(new Window.CloseListener() {

        @Override
        public void windowClose(Window.CloseEvent e) {
            l.setEnabled(true);
        }
    });
    UI.getCurrent().addWindow(window);
    window.center();
}
Also used : Window(com.vaadin.ui.Window) GridLayout(com.vaadin.ui.GridLayout) CorpusBrowserPanel(annis.gui.CorpusBrowserPanel) MetaDataPanel(annis.gui.MetaDataPanel) AnnisCorpus(annis.service.objects.AnnisCorpus) Label(com.vaadin.ui.Label)

Aggregations

CorpusBrowserPanel (annis.gui.CorpusBrowserPanel)1 MetaDataPanel (annis.gui.MetaDataPanel)1 AnnisCorpus (annis.service.objects.AnnisCorpus)1 GridLayout (com.vaadin.ui.GridLayout)1 Label (com.vaadin.ui.Label)1 Window (com.vaadin.ui.Window)1