use of annis.gui.MetaDataPanel 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();
}
use of annis.gui.MetaDataPanel in project ANNIS by korpling.
the class SingleResultPanel method buttonClick.
@Override
public void buttonClick(ClickEvent event) {
if (event.getButton() == btInfo && result != null) {
Window infoWindow = new Window("Info for " + result.getId());
infoWindow.setModal(false);
MetaDataPanel meta = new MetaDataPanel(path.get(0), path.get(path.size() - 1));
infoWindow.setContent(meta);
infoWindow.setWidth("400px");
infoWindow.setHeight("400px");
UI.getCurrent().addWindow(infoWindow);
}
}
Aggregations