Example usage for com.vaadin.ui ListSelect ListSelect

List of usage examples for com.vaadin.ui ListSelect ListSelect

Introduction

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

Prototype

public ListSelect() 

Source Link

Document

Constructs a new ListSelect.

Usage

From source file:org.opennms.features.pluginmgr.vaadin.pluginmanager.SimpleInstanceListEditor.java

License:Apache License

@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
    // common part: create layout
    verticalLayout_2 = new VerticalLayout();
    verticalLayout_2.setImmediate(false);
    verticalLayout_2.setWidth("-1px");
    verticalLayout_2.setHeight("-1px");
    verticalLayout_2.setMargin(true);//from ww  w .j  a v a2  s. c o  m
    verticalLayout_2.setSpacing(true);

    // karafListSelect
    karafListSelect = new ListSelect();
    karafListSelect.setCaption("Karaf Manifest Instances");
    karafListSelect.setImmediate(false);
    karafListSelect.setWidth("-1px");
    karafListSelect.setHeight("-1px");
    verticalLayout_2.addComponent(karafListSelect);

    // addKarafInstanceManifestButton
    addKarafInstanceManifestButton = new Button();
    addKarafInstanceManifestButton.setCaption("Add Karaf Instance");
    addKarafInstanceManifestButton.setImmediate(true);
    addKarafInstanceManifestButton.setWidth("-1px");
    addKarafInstanceManifestButton.setHeight("-1px");
    verticalLayout_2.addComponent(addKarafInstanceManifestButton);

    // askDeleteButton
    askDeleteButton = new Button();
    askDeleteButton.setCaption("Delete Karaf Instance");
    askDeleteButton.setImmediate(true);
    askDeleteButton.setWidth("-1px");
    askDeleteButton.setHeight("-1px");
    verticalLayout_2.addComponent(askDeleteButton);

    // deleteConfirmVerticalLayout
    deleteConfirmVerticalLayout = buildDeleteConfirmVerticalLayout();
    verticalLayout_2.addComponent(deleteConfirmVerticalLayout);

    return verticalLayout_2;
}

From source file:probe.com.view.core.ListSelectDatasetExplorerFilter.java

/**
 *
 * @param filterId//from   w  ww  . j a  va  2 s. c  o  m
 * @param defaultLabel
 * @param pgArr
 */
public ListSelectDatasetExplorerFilter(int filterId, String defaultLabel, Set<String> pgArr) {
    this.setSizeUndefined();
    this.filterId = filterId;

    //        this.exploringFiltersManager = exploringFiltersManager;
    this.setSpacing(true);

    this.defaultLabel = defaultLabel;
    Label captionLabel = new Label(defaultLabel);
    captionLabel.setStyleName("custLabel");

    if (!defaultLabel.equalsIgnoreCase("")) {
        this.addComponent(captionLabel);
    }
    list = new ListSelect();
    list.setWidth("200px");
    list.setHeight("90px");
    list.setNullSelectionAllowed(true);
    list.setMultiSelect(true);
    for (String str : pgArr) {
        if (!str.equalsIgnoreCase("")) {
            list.addItem(str);
        }
    }

    list.setImmediate(true);
    //        
    HorizontalLayout hlo = new HorizontalLayout();
    hlo.setSpacing(true);
    hlo.addComponent(list);
    this.addComponent(hlo);

    clearBtn = new Button("Clear");
    clearBtn.setPrimaryStyleName("resetbtn");
    clearBtn.setWidth("50px");
    clearBtn.setHeight("24px");
    clearBtn.addClickListener(ListSelectDatasetExplorerFilter.this);
    hlo.addComponent(clearBtn);
    //        exploringFiltersManager.registerFilter(ListSelectDatasetExplorerFilter.this);
}

From source file:probe.com.view.core.ListSelectFilter.java

/**
 *
 * @param control//from   w w w .j  ava 2 s  . c o  m
 * @param filterId
 * @param defaultLabel
 * @param datasetNamesList
 */
@SuppressWarnings("LeakingThisInConstructor")
public ListSelectFilter(SearchingFiltersControl_t control, int filterId, String defaultLabel,
        String[] datasetNamesList) {
    this.setSizeUndefined();
    this.filterId = filterId;
    //        this.setStyleName("custLabel");
    this.control = control;
    this.setSpacing(true);
    //        int widthInt = defaultLabel.length() * 7;
    //        String width = "200px";
    //        if (widthInt > 200) {
    //            width = widthInt + "px";
    //        }
    this.defaultLabel = defaultLabel;
    Label captionLabel = new Label(defaultLabel);
    //        captionLabel.setWidth(width);
    captionLabel.setStyleName("custLabel");

    if (!defaultLabel.equalsIgnoreCase("")) {
        this.addComponent(captionLabel);
    }
    list = new ListSelect();
    list.setWidth("200px");
    list.setHeight("90px");
    list.setNullSelectionAllowed(true);
    list.setMultiSelect(true);

    for (String str : datasetNamesList) {
        list.addItem(str);
    }
    list.setImmediate(true);
    list.addValueChangeListener(this);
    HorizontalLayout hlo = new HorizontalLayout();
    hlo.setSpacing(true);
    hlo.addComponent(list);
    //         filterConfirmLabel = new FilterConfirmLabel();       
    //        hlo.addComponent(filterConfirmLabel);
    this.addComponent(hlo);
    clearBtn = new Button("Clear");
    clearBtn.setStyleName(Reindeer.BUTTON_SMALL);
    clearBtn.addClickListener(this);
    hlo.addComponent(clearBtn);
}

From source file:se.natusoft.osgi.aps.apsconfigadminweb.gui.vaadin.components.configeditor.ValueComponentListEditor.java

License:Open Source License

/**
 * Creates a new ValueListEditor.// www .  java2s. c  o  m
 *
 * @param valueEditModel The config value edit model representing a specific config value.
 * @param valueComponent The component to edit a list of.
 */
public ValueComponentListEditor(APSConfigValueEditModel valueEditModel, ValueComponent valueComponent) {
    this.valueEditModel = valueEditModel;

    // Setup component gui.
    this.editLine = valueComponent;
    this.editLine.enableNullValues();
    this.editLine.getComponent().setWidth("100%");
    this.editLine.getComponent().setEnabled(true);
    this.editLine.setComponentValue("", false);
    this.editLine.addListener(this.editLineListener);
    addComponent(this.editLine.getComponent());

    this.values = new ListSelect();
    this.values.setRows(4); // With the exception of 1 , 2 and 3 will give 4!
    this.values.setWidth("100%");
    this.values.setNullSelectionAllowed(false);
    this.values.setEnabled(false);
    this.values.setImmediate(true);
    this.values.addListener(this.valuesListener);
    addComponent(this.values);

    HorizontalLayout buttonsLayout = new HorizontalLayout();
    {
        Button addButton = new Button(" + ");
        addButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                addValue();
            }
        });
        buttonsLayout.addComponent(addButton);

        this.removeButton = new Button(" - ");
        this.removeButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                removeValue();
            }
        });
        this.removeButton.setEnabled(false);
        buttonsLayout.addComponent(this.removeButton);

        this.sizeLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;[ ]", Label.CONTENT_XHTML);
        this.sizeLabel.setStyleName(CSS.APS_MANYVALUE_COUNT_LABEL);
        buttonsLayout.addComponent(this.sizeLabel);
    }
    addComponent(buttonsLayout);
}