Search in sources :

Example 1 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project charts by vaadin.

the class ContainerWithLotsOfData method getChart.

@Override
protected Component getChart() {
    HorizontalLayout lo = new HorizontalLayout();
    ContainerDataSeries container = createContainer();
    Component table = createTable(container.getVaadinContainer());
    Component chart = createChart(container);
    lo.addComponents(table);
    lo.addComponent(chart);
    table.setSizeFull();
    chart.setSizeFull();
    lo.setSizeFull();
    lo.setExpandRatio(table, 1);
    lo.setExpandRatio(chart, 5);
    return lo;
}
Also used : Component(com.vaadin.ui.Component) ContainerDataSeries(com.vaadin.v7.addon.charts.model.ContainerDataSeries) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 2 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout 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)

Example 3 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsCategorySelectField method initContent.

/**
 * @see com.vaadin.ui.CustomField#initContent()
 */
@Override
protected Component initContent() {
    HorizontalLayout main = new HorizontalLayout();
    main.setWidth("100%");
    main.setSpacing(true);
    m_tree = new CmsCategoryTree();
    m_tree.setWidth("100%");
    m_tree.setHeight("34px");
    m_tree.setDisplayOnly(true);
    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(super.getInternalValue())) {
        setInternalValue(super.getInternalValue());
    }
    main.addComponent(m_tree);
    main.setExpandRatio(m_tree, 2);
    Button open = new Button("");
    open.addStyleName(OpenCmsTheme.BUTTON_ICON);
    open.setIcon(FontOpenCms.GALLERY);
    open.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            openWindow();
        }
    });
    main.addComponent(open);
    return main;
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 4 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class A_CmsEditUserGroupRoleDialog method init.

/**
 * Init method.<p>
 */
protected void init() {
    setHeightUndefined();
    removeExistingTable(getLeftTableLayout());
    removeExistingTable(getRightTableLayout());
    final CmsAvailableRoleOrPrincipalTable table = new CmsAvailableRoleOrPrincipalTable(this);
    if (getAvailableItemsIndexedContainer("caption", "icon").size() > 0) {
        getRightTableLayout().addComponent(new FixedHeightPanel(table, ITEM_HEIGHT), 0);
    } else {
        getRightTableLayout().addComponent(new FixedHeightPanel(CmsVaadinUtils.getInfoLayout(getEmptyMessage()), ITEM_HEIGHT));
    }
    if (getItemsOfUserIndexedContainer("prop1", "prop2", "prop3").size() > 0) {
        getLeftTableLayout().addComponent(new FixedHeightPanel(new CmsCurrentRoleOrPrincipalTable(this, m_cms, m_principal), ITEM_HEIGHT), 0);
    } else {
        getLeftTableLayout().addComponent(new FixedHeightPanel(CmsVaadinUtils.getInfoLayout(getEmptyMessage()), ITEM_HEIGHT));
    }
    TextField siteTableFilter = new TextField();
    siteTableFilter.setIcon(FontOpenCms.FILTER);
    siteTableFilter.setInputPrompt(Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
    siteTableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    siteTableFilter.setWidth("200px");
    siteTableFilter.addTextChangeListener(new TextChangeListener() {

        private static final long serialVersionUID = 1L;

        public void textChange(TextChangeEvent event) {
            table.filterTable(event.getText());
        }
    });
    if (getParentLayout().getComponent(0) instanceof TextField) {
        getParentLayout().removeComponent(getParentLayout().getComponent(1));
        getParentLayout().removeComponent(getParentLayout().getComponent(0));
    }
    HorizontalLayout caps = new HorizontalLayout();
    caps.setSpacing(true);
    caps.setWidth("100%");
    caps.setHeight("30px");
    caps.addComponent(new Label(getCurrentTableCaption()));
    caps.addComponent(new Label(getAddCaptionText()));
    getParentLayout().addComponent(caps, 0);
    getParentLayout().addComponent(siteTableFilter, 0);
    getParentLayout().setComponentAlignment(siteTableFilter, com.vaadin.ui.Alignment.TOP_RIGHT);
    getParentLayout().setExpandRatio(getParentLayout().getComponent(2), 1);
}
Also used : TextChangeEvent(com.vaadin.v7.event.FieldEvents.TextChangeEvent) Label(com.vaadin.v7.ui.Label) TextField(com.vaadin.v7.ui.TextField) TextChangeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 5 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsAdditionalInfosDialog method submit.

/**
 * Submit additional info to user.<p>
 */
protected void submit() {
    if (m_userinfoNoEditGroup.getRows().size() != m_addInfoReadOnly.size()) {
        List<String> currentKeys = getKeyListFromGroup(m_userinfoNoEditGroup);
        for (String key : m_addInfoReadOnly.keySet()) {
            if (!currentKeys.contains(key)) {
                saveAddInfo(key, null);
            }
        }
    }
    for (I_CmsEditableGroupRow row : m_userinfoGroup.getRows()) {
        String key = ((TextField) (((HorizontalLayout) row.getComponent()).getComponent(0))).getValue();
        String value = ((TextField) (((HorizontalLayout) row.getComponent()).getComponent(1))).getValue();
        saveAddInfo(key, value);
        m_addInfoEditable.remove(key);
    }
    // Remaining items in list seem to be deleted by the user..
    for (String key : m_addInfoEditable.keySet()) {
        saveAddInfo(key, null);
    }
    try {
        m_cms.writeUser(m_user);
    } catch (CmsException e) {
        LOG.error("Unable to write user.", e);
    }
}
Also used : CmsException(org.opencms.main.CmsException) TextField(com.vaadin.v7.ui.TextField) I_CmsEditableGroupRow(org.opencms.ui.components.editablegroup.I_CmsEditableGroupRow) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Aggregations

HorizontalLayout (com.vaadin.ui.HorizontalLayout)53 Button (com.vaadin.ui.Button)37 Label (com.vaadin.ui.Label)32 VerticalLayout (com.vaadin.ui.VerticalLayout)32 ComboBox (com.vaadin.v7.ui.ComboBox)29 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)29 CssStyles (de.symeda.sormas.ui.utils.CssStyles)29 Alignment (com.vaadin.ui.Alignment)28 ValoTheme (com.vaadin.ui.themes.ValoTheme)28 Captions (de.symeda.sormas.api.i18n.Captions)28 ButtonHelper (de.symeda.sormas.ui.utils.ButtonHelper)27 FacadeProvider (de.symeda.sormas.api.FacadeProvider)26 Strings (de.symeda.sormas.api.i18n.Strings)26 VaadinIcons (com.vaadin.icons.VaadinIcons)25 UserProvider (de.symeda.sormas.ui.UserProvider)25 ControllerProvider (de.symeda.sormas.ui.ControllerProvider)24 ComboBoxHelper (de.symeda.sormas.ui.utils.ComboBoxHelper)23 MenuBar (com.vaadin.ui.MenuBar)22 UserRight (de.symeda.sormas.api.user.UserRight)22 ViewModelProviders (de.symeda.sormas.ui.ViewModelProviders)22