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.hip.vif.admin.admin.ui.PrintGroupView.java

License:Open Source License

/** Constructor
 *
 * @param inGroups {@link GroupContainer}
 * @param inTask {@link PrintGroupTask} */
public PrintGroupView(final GroupContainer inGroups, final PrintGroupTask inTask) {
    final IMessages lMessages = Activator.getMessages();
    final VerticalLayout lLayout = initLayout(lMessages, "admin.print.title.page"); //$NON-NLS-1$

    lLayout.addComponent(new Label(lMessages.getMessage("admin.print.remark"), ContentMode.HTML)); //$NON-NLS-1$
    lLayout.addComponent(RiplaViewHelper.createSpacer());

    final LabelValueTable lTable = new LabelValueTable();
    final ListSelect lGroups = new ListSelect();
    lGroups.setContainerDataSource(inGroups);
    lGroups.setRows(Math.min(SELECT_SIZE, inGroups.size()));
    lGroups.setStyleName(VIF_STYLE);//from  w  w w.j a  va 2 s  .  c  o  m
    lGroups.setMultiSelect(true);
    lGroups.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    lGroups.setItemCaptionPropertyId(GroupContainer.PROPERTY_CAPTION);
    lGroups.focus();
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.select"), lGroups); //$NON-NLS-1$
    lLayout.addComponent(lTable);

    final FileDownloaderExtension lDownloader = new FileDownloaderExtension(lGroups, inTask);
    final Button lPrint = new Button(lMessages.getMessage("admin.print.button.print")); //$NON-NLS-1$
    lDownloader.extend(lPrint);
    lLayout.addComponent(lPrint);
}

From source file:org.hip.vif.admin.admin.ui.SendMailView.java

License:Open Source License

/** @param inGroups {@link GroupContainer}
 * @param inTask {@link SendMailTask} */
public SendMailView(final GroupContainer inGroups, final SendMailTask inTask) {
    final IMessages lMessages = Activator.getMessages();
    final VerticalLayout lLayout = initLayout(lMessages, "admin.send.mail.title.page"); //$NON-NLS-1$

    lLayout.addComponent(new Label(lMessages.getMessage("admin.send.remark"), ContentMode.HTML)); //$NON-NLS-1$
    lLayout.addComponent(RiplaViewHelper.createSpacer());

    final LabelValueTable lTable = new LabelValueTable();
    final ListSelect lGroups = new ListSelect();
    lGroups.setContainerDataSource(inGroups);
    lGroups.setRows(Math.min(SELECT_SIZE, inGroups.size()));
    lGroups.setStyleName(VIF_STYLE);// w  w  w.ja  va2s .  c  om
    lGroups.setMultiSelect(true);
    lGroups.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    lGroups.setItemCaptionPropertyId(GroupContainer.PROPERTY_CAPTION);
    lGroups.focus();
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.select"), lGroups); //$NON-NLS-1$

    final TextField lSubject = new TextField();
    lSubject.setWidth(WIDTH, Unit.PIXELS);
    lSubject.setStyleName(VIF_STYLE);
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.subject"), lSubject); //$NON-NLS-1$

    final RichTextArea lBody = new RichTextArea();
    lBody.setStyleName("vif-editor " + VIF_STYLE); //$NON-NLS-1$
    lBody.setWidth(WIDTH, Unit.PIXELS);
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.body"), lBody); //$NON-NLS-1$
    lLayout.addComponent(lTable);

    send = new Button(lMessages.getMessage("admin.send.mail.button.send")); //$NON-NLS-1$
    // send.setClickShortcut(KeyCode.ENTER);
    send.addClickListener(new Button.ClickListener() {
        @Override
        @SuppressWarnings("unchecked")
        public void buttonClick(final ClickEvent inEvent) {
            if (!isValid(lGroups, lSubject, lBody)) {
                Notification.show(lMessages.getMessage("admin.send.mail.msg.not.valid"), //$NON-NLS-1$
                        Type.WARNING_MESSAGE);
                return;
            }
            if (!inTask.processGroups((Collection<GroupWrapper>) lGroups.getValue(),
                    lSubject.getValue().toString(), lBody.getValue())) {
                Notification.show(lMessages.getMessage("admin.send.mail.msg.errmsg"), Type.WARNING_MESSAGE); //$NON-NLS-1$
            }
        }
    });
    lLayout.addComponent(send);
}

From source file:org.jumpmind.metl.ui.views.design.ChooseWsdlServiceOperationWindow.java

License:Open Source License

public ChooseWsdlServiceOperationWindow(List<SoapOperation> operations, final ServiceChosenListener listener) {
    setCaption("Choose SOAP Operation");
    setModal(true);// w  w  w  . j av a 2 s .  c o m
    setResizable(false);
    setSizeUndefined();
    setClosable(false);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    setContent(layout);

    layout.addComponent(new Label("Choose the SOAP operation to use."));

    final ListSelect field = new ListSelect();
    field.setNullSelectionAllowed(false);
    field.setMultiSelect(false);
    field.setWidth(100, Unit.PERCENTAGE);
    field.setRows(15);
    layout.addComponent(field);

    Collections.sort(operations, new Comparator<SoapOperation>() {
        public int compare(SoapOperation o1, SoapOperation o2) {
            return o1.getOperationName().compareTo(o2.getOperationName());
        }
    });

    for (SoapOperation operation : operations) {
        field.addItem(operation);
        field.setItemCaption(operation,
                operation.getBindingName().getLocalPart() + "." + operation.getOperationName());
    }

    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    buttonLayout.setWidth(100, Unit.PERCENTAGE);

    Label spacer = new Label(" ");
    buttonLayout.addComponent(spacer);
    buttonLayout.setExpandRatio(spacer, 1);

    Button cancelButton = new Button("Cancel");
    cancelButton.setClickShortcut(KeyCode.ESCAPE);
    cancelButton.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            UI.getCurrent().removeWindow(ChooseWsdlServiceOperationWindow.this);
        }
    });
    buttonLayout.addComponent(cancelButton);

    Button okButton = new Button("Ok");
    okButton.setClickShortcut(KeyCode.ENTER);
    okButton.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            if (listener.onOk((SoapOperation) field.getValue())) {
                UI.getCurrent().removeWindow(ChooseWsdlServiceOperationWindow.this);
            }
        }
    });
    buttonLayout.addComponent(okButton);

    layout.addComponent(buttonLayout);
    field.focus();
}

From source file:org.lunarray.model.generation.vaadin.render.factories.form.vaadin.components.ListSelectPropertyStrategy.java

License:Open Source License

/** {@inheritDoc} */
@Override
protected Component createSelectComponent() {
    return new ListSelect();
}

From source file:org.lunifera.runtime.web.ecview.presentation.vaadin.internal.ListPresentation.java

License:Open Source License

/**
 * {@inheritDoc}/* w ww  .ja  v a 2  s  . c o m*/
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Component doCreateWidget(Object parent) {
    if (componentBase == null) {
        componentBase = new CssLayout();
        componentBase.addStyleName(CSS_CLASS_CONTROL_BASE);
        if (modelAccess.isCssIdValid()) {
            componentBase.setId(modelAccess.getCssID());
        } else {
            componentBase.setId(getEditpart().getId());
        }

        associateWidget(componentBase, modelAccess.yList);

        list = new ListSelect();
        list.addStyleName(CSS_CLASS_CONTROL);
        list.setMultiSelect(modelAccess.yList.getSelectionType() == YSelectionType.MULTI);
        list.setImmediate(true);
        list.setSizeFull();

        associateWidget(list, modelAccess.yList);

        if (list.isMultiSelect()) {
            property = new ObjectProperty(new HashSet(), Set.class);
        } else {
            property = new ObjectProperty(null, modelAccess.yList.getType());
        }
        list.setPropertyDataSource(property);

        // creates the binding for the field
        createBindings(modelAccess.yList, list);

        componentBase.addComponent(list);

        if (modelAccess.isCssClassValid()) {
            list.addStyleName(modelAccess.getCssClass());
        }

        applyCaptions();

        initializeField(list);
    }
    return componentBase;
}

From source file:org.lunifera.vaaclipse.ui.preferences.addon.internal.ListEditorRenderer.java

License:Open Source License

@Override
public void render() {
    select = new ListSelect();
    refreshSelect();//w w  w .  ja  va  2  s.  c  o m

    CssLayout layout = new CssLayout();
    layout.setWidth("100%");

    layout.addComponent(new Label(editor.getLabel()));

    HorizontalLayout row = new HorizontalLayout();
    row.setWidth("100%");
    layout.addComponent(row);

    row.addComponent(select);
    select.setWidth("100%");

    buttonPanel = new CssLayout();
    buttonPanel.setSizeFull();
    row.addComponent(buttonPanel);

    row.setExpandRatio(select, 8);
    row.setExpandRatio(buttonPanel, 2);

    createButtons();
    component = layout;
}

From source file:org.lunifera.web.ecp.uimodel.presentation.vaadin.internal.ListPresentation.java

License:Open Source License

/**
 * {@inheritDoc}// w  w  w .  j  a va 2  s. co m
 */
@Override
public Component createWidget(Object parent) {
    if (componentBase == null) {
        componentBase = new CssLayout();
        componentBase.addStyleName(CSS_CLASS__CONTROL_BASE);
        if (modelAccess.isCssIdValid()) {
            componentBase.setId(modelAccess.getCssID());
        } else {
            componentBase.setId(getEditpart().getId());
        }

        list = new ListSelect();
        list.addStyleName(CSS_CLASS__CONTROL);
        list.setSizeFull();
        componentBase.addComponent(list);

        if (modelAccess.isCssClassValid()) {
            list.addStyleName(modelAccess.getCssClass());
        }

        if (modelAccess.isLabelValid()) {
            list.setCaption(modelAccess.getLabel());
        }
    }
    return componentBase;
}

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

License:Apache License

@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
    // common part: create layout
    verticalLayout_2 = new VerticalLayout();
    verticalLayout_2.setImmediate(true);
    verticalLayout_2.setWidth("-1px");
    verticalLayout_2.setHeight("-1px");
    verticalLayout_2.setMargin(true);//from  www  . ja v a 2 s .c  o m

    // licenceListSelect
    licenceListSelect = new ListSelect();
    licenceListSelect.setCaption("Licence Id");
    licenceListSelect.setImmediate(true);
    licenceListSelect.setWidth("-1px");
    licenceListSelect.setHeight("-1px");
    verticalLayout_2.addComponent(licenceListSelect);
    verticalLayout_2.setExpandRatio(licenceListSelect, 1.0f);

    // controlsVerticalLayout
    controlsVerticalLayout = new VerticalLayout();
    controlsVerticalLayout.setImmediate(true);
    controlsVerticalLayout.setWidth("-1px");
    controlsVerticalLayout.setHeight("-1px");
    controlsVerticalLayout.setMargin(false);
    verticalLayout_2.addComponent(controlsVerticalLayout);

    return verticalLayout_2;
}

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

License:Apache License

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

    // editInstancelistButton
    editInstancelistButton = new Button();
    editInstancelistButton.setCaption("Edit Instance List");
    editInstancelistButton.setImmediate(true);
    editInstancelistButton.setDescription("Opens a new dialog to update the instance list");
    editInstancelistButton.setWidth("-1px");
    editInstancelistButton.setHeight("-1px");
    verticalLayout_2.addComponent(editInstancelistButton);

    // karafListSelect
    karafListSelect = new ListSelect();
    karafListSelect.setCaption("Karaf Instances");
    karafListSelect.setImmediate(true);
    karafListSelect.setDescription("Available Karaf Instances");
    karafListSelect.setWidth("100.0%");
    karafListSelect.setHeight("-1px");
    verticalLayout_2.addComponent(karafListSelect);

    return verticalLayout_2;
}

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

License:Apache License

@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
    // common part: create layout
    horizontalLayout_2 = new HorizontalLayout();
    horizontalLayout_2.setImmediate(true);
    horizontalLayout_2.setWidth("100.0%");
    horizontalLayout_2.setHeight("100.0%");
    horizontalLayout_2.setMargin(true);/*w  ww.  ja  v a2s .c o m*/

    // productListSelect
    productListSelect = new ListSelect();
    productListSelect.setCaption("Product Id");
    productListSelect.setImmediate(true);
    productListSelect.setWidth("-1px");
    productListSelect.setHeight("-1px");
    horizontalLayout_2.addComponent(productListSelect);
    horizontalLayout_2.setExpandRatio(productListSelect, 1.0f);

    // controlsVerticalLayout
    controlsVerticalLayout = new VerticalLayout();
    controlsVerticalLayout.setImmediate(true);
    controlsVerticalLayout.setWidth("-1px");
    controlsVerticalLayout.setHeight("-1px");
    controlsVerticalLayout.setMargin(false);
    horizontalLayout_2.addComponent(controlsVerticalLayout);
    horizontalLayout_2.setExpandRatio(controlsVerticalLayout, 1.0f);

    return horizontalLayout_2;
}