Search in sources :

Example 1 with NativeSelect

use of com.vaadin.v7.ui.NativeSelect in project ANNIS by korpling.

the class FlatQueryBuilder method launch.

private void launch(QueryController cp) {
    this.cp = cp;
    rsc = new ReducingStringComparator();
    mainLayout = new VerticalLayout();
    // tracking lists for vertical nodes, edgeboxes and metaboxes
    vnodes = new ArrayList<>();
    eboxes = new ArrayList<>();
    mboxes = new ArrayList<>();
    spbox = null;
    // buttons and checks
    btGo = new Button(BUTTON_GO_LABEL, this);
    btGo.setStyleName(ChameleonTheme.BUTTON_SMALL);
    btClear = new Button(BUTTON_CLEAR_LABEL, this);
    btClear.setStyleName(ChameleonTheme.BUTTON_SMALL);
    btInitLanguage = new Button("Initialize", this);
    btInitLanguage.setDescription(INFO_INIT_LANG);
    btInitSpan = new Button("Initialize", this);
    btInitSpan.setDescription(INFO_INIT_SPAN);
    btInitMeta = new Button("Initialize", this);
    btInitMeta.setDescription(INFO_INIT_META);
    filtering = new NativeSelect("Filtering mechanisms");
    filtering.setDescription(INFO_FILTER);
    ReducingStringComparator rdc = new ReducingStringComparator();
    Set mappings = rdc.getMappings().keySet();
    int i;
    for (i = 0; i < mappings.size(); i++) {
        String mapname = (String) mappings.toArray()[i];
        filtering.addItem(i);
        filtering.setItemCaption(i, mapname);
    }
    filtering.addItem(i + 1);
    filtering.setItemCaption(i + 1, "generic");
    filtering.select(i + 1);
    filtering.setNullSelectionAllowed(false);
    filtering.setImmediate(true);
    // language layout
    language = new HorizontalLayout();
    languagenodes = new HorizontalLayout();
    language.addComponent(languagenodes);
    language.addComponent(btInitLanguage);
    language.setMargin(true);
    language.setCaption(LANG_CAPTION);
    language.addStyleName("linguistics-panel");
    // span layout
    span = new HorizontalLayout();
    span.setSpacing(true);
    span.addComponent(btInitSpan);
    span.setMargin(true);
    span.setCaption(SPAN_CAPTION);
    span.addStyleName("span-panel");
    // meta layout
    meta = new HorizontalLayout();
    meta.setSpacing(true);
    meta.addComponent(btInitMeta);
    meta.setMargin(true);
    meta.setCaption(META_CAPTION);
    meta.addStyleName("meta-panel");
    // toolbar layout
    toolbar = new HorizontalLayout();
    toolbar.setSpacing(true);
    toolbar.addComponent(btGo);
    toolbar.addComponent(btClear);
    toolbar.setMargin(true);
    toolbar.setCaption(TOOLBAR_CAPTION);
    toolbar.addStyleName("toolbar-panel");
    // advanced
    advanced = new HorizontalLayout();
    advanced.setSpacing(true);
    advanced.addComponent(filtering);
    advanced.setMargin(true);
    advanced.setCaption(ADVANCED_CAPTION);
    advanced.addStyleName("advanced-panel");
    // put everything on the layout
    mainLayout.setSpacing(true);
    mainLayout.addComponent(language);
    mainLayout.addComponent(span);
    mainLayout.addComponent(meta);
    mainLayout.addComponent(toolbar);
    mainLayout.addComponent(advanced);
    setContent(mainLayout);
    getContent().setWidth("100%");
    getContent().setHeight("-1px");
}
Also used : TreeSet(java.util.TreeSet) LinkedHashSet(java.util.LinkedHashSet) Set(java.util.Set) Button(com.vaadin.ui.Button) NativeSelect(com.vaadin.v7.ui.NativeSelect) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

Button (com.vaadin.ui.Button)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 NativeSelect (com.vaadin.v7.ui.NativeSelect)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1