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();
}
Aggregations