Example usage for com.vaadin.v7.ui TextArea TextArea

List of usage examples for com.vaadin.v7.ui TextArea TextArea

Introduction

In this page you can find the example usage for com.vaadin.v7.ui TextArea TextArea.

Prototype

public TextArea(Property dataSource) 

Source Link

Document

Constructs a TextArea with given property data source.

Usage

From source file:org.esn.esobase.view.tab.BookTranslateTab.java

public BookTranslateTab(DBService service) {
    this.service = service;
    this.setSizeFull();
    FilterChangeListener filterChangeListener = new FilterChangeListener();
    bookListlayout = new HorizontalLayout();
    bookListlayout.setWidth(100f, Unit.PERCENTAGE);
    bookTable = new ComboBox("");
    bookTable.setPageLength(20);/*from  w  w w. j  a v a  2 s .  c  o  m*/
    bookTable.setScrollToSelectedItem(true);
    bookTable.setDataProvider(new ListDataProvider<>(books));
    bookTable.addValueChangeListener(new BookSelectListener());

    bookTable.setWidth(100f, Unit.PERCENTAGE);
    locationTable = new ComboBox("?");
    locationTable.setPageLength(15);
    locationTable.setScrollToSelectedItem(true);

    locationTable.setWidth(100f, Unit.PERCENTAGE);
    locationTable.setDataProvider(new ListDataProvider<>(locations));

    locationTable.addValueChangeListener(filterChangeListener);

    subLocationTable = new ComboBox("?");
    subLocationTable.setPageLength(15);
    subLocationTable.setScrollToSelectedItem(true);
    subLocationTable.addValueChangeListener(filterChangeListener);

    subLocationTable.setWidth(100f, Unit.PERCENTAGE);
    subLocationTable.setDataProvider(new ListDataProvider<>(subLocations));

    FormLayout locationAndBook = new FormLayout(locationTable, subLocationTable, bookTable);
    locationAndBook.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
    locationAndBook.setSizeFull();

    bookListlayout.addComponent(locationAndBook);
    translateStatus = new ComboBoxMultiselect("? ",
            Arrays.asList(TRANSLATE_STATUS.values()));
    translateStatus.setClearButtonCaption("?");
    translateStatus.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            LoadFilters();
        }
    });
    noTranslations = new CheckBox("?  ?");
    noTranslations.setValue(Boolean.FALSE);
    noTranslations.addValueChangeListener(filterChangeListener);
    emptyTranslations = new CheckBox("?  ");
    emptyTranslations.setValue(Boolean.FALSE);
    emptyTranslations.addValueChangeListener(filterChangeListener);
    HorizontalLayout checkBoxlayout = new HorizontalLayout(noTranslations, emptyTranslations);
    translatorBox = new ComboBox("");
    translatorBox.setPageLength(15);
    translatorBox.setScrollToSelectedItem(true);
    translatorBox.setDataProvider(new ListDataProvider(service.getSysAccounts()));
    translatorBox.addValueChangeListener(filterChangeListener);
    refreshButton = new Button("");
    refreshButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            LoadFilters();
            LoadBookContent();
        }
    });
    countLabel = new Label();
    searchField = new TextField("?? ?");
    searchField.setSizeFull();
    searchField.setNullRepresentation("");
    searchField.addValueChangeListener(filterChangeListener);

    FormLayout filtersLayout = new FormLayout(translateStatus, translatorBox, checkBoxlayout, searchField);
    filtersLayout.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
    filtersLayout.setSizeFull();
    bookListlayout.addComponent(filtersLayout);
    bookListlayout.addComponent(refreshButton);
    bookListlayout.addComponent(countLabel);
    bookListlayout.setExpandRatio(locationAndBook, 0.4f);
    bookListlayout.setExpandRatio(filtersLayout, 0.4f);
    bookListlayout.setExpandRatio(refreshButton, 0.1f);
    bookListlayout.setExpandRatio(countLabel, 0.1f);
    bookListlayout.setHeight(105f, Unit.PIXELS);

    bookContentLayout = new TabSheet();
    bookContentLayout.setSizeFull();
    bookNameLayout = new HorizontalLayout();
    bookNameLayout.setSizeFull();
    bookNameOrigLayout = new VerticalLayout();
    bookNameEn = new TextField("?");
    bookNameEn.setWidth(500f, Unit.PIXELS);
    bookNameRu = new TextField(" ?");
    bookNameRu.setWidth(500f, Unit.PIXELS);
    bookNameRu.setNullRepresentation("");
    bookNameOrigLayout.addComponent(bookNameEn);
    bookNameOrigLayout.addComponent(bookNameRu);
    bookNameLayout.addComponent(bookNameOrigLayout);
    bookNameTranslationsLayout = new VerticalLayout();
    bookNameTranslationsLayout.setSizeFull();
    bookNameLayout.addComponent(bookNameTranslationsLayout);
    bookContentLayout.addTab(bookNameLayout, "?");

    bookTextLayout = new HorizontalLayout();
    bookTextLayout.setSizeFull();
    bookTextOrigLayout = new HorizontalLayout();
    bookTextOrigLayout.setSizeFull();
    bookTextEn = new TextArea("?");
    bookTextEn.setRows(20);
    bookTextEn.setSizeFull();
    bookTextRu = new TextArea(" ?");
    bookTextRu.setRows(20);
    bookTextRu.setSizeFull();
    bookTextRu.setNullRepresentation("");
    bookTextOrigLayout.addComponent(bookTextEn);
    bookTextOrigLayout.addComponent(bookTextRu);
    bookTextLayout.addComponent(bookTextOrigLayout);
    bookTextTranslationsLayout = new VerticalLayout();
    bookTextTranslationsLayout.setSizeFull();
    bookTextLayout.addComponent(bookTextTranslationsLayout);
    bookTextLayout.setExpandRatio(bookTextOrigLayout, 2f);
    bookTextLayout.setExpandRatio(bookTextTranslationsLayout, 1f);
    bookContentLayout.addTab(bookTextLayout, "?");
    bookNameEn.setReadOnly(true);
    bookNameRu.setReadOnly(true);
    bookTextEn.setReadOnly(true);
    bookTextRu.setReadOnly(true);
    this.addComponent(bookListlayout);
    this.addComponent(bookContentLayout);
    this.bookListlayout.setHeight(105f, Unit.PIXELS);
    this.setExpandRatio(bookContentLayout, 1f);
    new NoAutcompleteComboBoxExtension(locationTable);
    new NoAutcompleteComboBoxExtension(subLocationTable);
    new NoAutcompleteComboBoxExtension(translatorBox);
    LoadFilters();
}