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