Search in sources :

Example 1 with CorpusBrowserEntry

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

the class ExampleTable method attach.

@Override
public void attach() {
    super.attach();
    addGeneratedColumn("example", new ColumnGenerator() {

        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            CorpusBrowserEntry corpusBrowserEntry = (CorpusBrowserEntry) itemId;
            Label l = new Label(corpusBrowserEntry.getExample());
            l.setContentMode(ContentMode.TEXT);
            l.addStyleName(Helper.CORPUS_FONT_FORCE);
            return l;
        }
    });
    setVisibleColumns("name", "example", "genlink");
    setColumnHeaders("Name", "Example (click to use query)", "URL");
    setColumnExpandRatio("name", 0.3f);
    setColumnExpandRatio("example", 0.7f);
    setImmediate(true);
}
Also used : CorpusBrowserEntry(annis.gui.beans.CorpusBrowserEntry) Table(com.vaadin.ui.Table) ColumnGenerator(com.vaadin.ui.Table.ColumnGenerator) Label(com.vaadin.ui.Label)

Aggregations

CorpusBrowserEntry (annis.gui.beans.CorpusBrowserEntry)1 Label (com.vaadin.ui.Label)1 Table (com.vaadin.ui.Table)1 ColumnGenerator (com.vaadin.ui.Table.ColumnGenerator)1