当前位置: 首页>>代码示例>>Java>>正文


Java FilteringMode类代码示例

本文整理汇总了Java中com.vaadin.shared.ui.combobox.FilteringMode的典型用法代码示例。如果您正苦于以下问题:Java FilteringMode类的具体用法?Java FilteringMode怎么用?Java FilteringMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FilteringMode类属于com.vaadin.shared.ui.combobox包,在下文中一共展示了FilteringMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toVaadinFilterMode

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
public static com.vaadin.shared.ui.combobox.FilteringMode toVaadinFilterMode(FilterMode filterMode) {
    if (filterMode == null) {
        return null;
    }

    switch (filterMode) {
        case NO:
            return FilteringMode.OFF;
        case STARTS_WITH:
            return FilteringMode.STARTSWITH;
        case CONTAINS:
            return FilteringMode.CONTAINS;
        default:
            throw new UnsupportedOperationException("Unsupported FilterMode");
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:WebWrapperUtils.java

示例2: toFilterMode

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
public static FilterMode toFilterMode(com.vaadin.shared.ui.combobox.FilteringMode filterMode) {
    if (filterMode == null) {
        return null;
    }

    switch (filterMode) {
        case OFF:
            return FilterMode.NO;
        case CONTAINS:
            return FilterMode.CONTAINS;
        case STARTSWITH:
            return FilterMode.STARTS_WITH;
        default:
            throw new UnsupportedOperationException("Unsupported Vaadin FilteringMode");
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:WebWrapperUtils.java

示例3: LanguageSelectionField

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
public LanguageSelectionField() {
    languageBox.setNullSelectionAllowed(false);
    languageBox.setImmediate(true);
    languageBox.setWidth("200px");
    languageBox.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT);
    languageBox.setFilteringMode(FilteringMode.CONTAINS);

    languageCode = new ELabel().withStyleName(UIConstants.META_INFO);

    Locale[] supportedLanguage = LocalizationHelper.getAvailableLocales();
    for (Locale locale : supportedLanguage) {
        String language = locale.toLanguageTag();
        languageBox.addItem(language);
        languageBox.setItemCaption(language, locale.getDisplayName(locale));
    }
    languageBox.addValueChangeListener(valueChangeEvent -> {
        String value = (String) valueChangeEvent.getProperty().getValue();
        languageCode.setValue(value != null ? value : "");
    });
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:21,代码来源:LanguageSelectionField.java

示例4: SalePointSimpleSelect

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
/**
 * <p>Constructor for CompanySelect.</p>
 *
 * @param caption     a {@link java.lang.String} object.
 * @param description a {@link java.lang.String} object.
 */
public SalePointSimpleSelect(final String caption, final String description) {
    super(caption);

    // Преконфигурация
    setDescription(description);
    setInputPrompt("контакт...");
    setWidth(25, Unit.EM);
    setImmediate(true);
    setScrollToSelectedItem(true);

    // Инициализация контейнера
    container = new ExtaDbContainer<>(SalePoint.class);
    container.sort(new Object[]{SalePoint_.name.getName()}, new boolean[]{true});

    // Устанавливаем контент выбора
    setFilteringMode(FilteringMode.CONTAINS);
    setContainerDataSource(container);
    setItemCaptionMode(ItemCaptionMode.PROPERTY);
    setItemCaptionPropertyId("name");
    container.setSingleSelectConverter(this);

    // Функционал добавления нового контакта
    setNullSelectionAllowed(false);
    setNewItemsAllowed(false);
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:32,代码来源:SalePointSimpleSelect.java

示例5: LESelectField

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
protected LESelectField(final String caption, final String description) {
    super(caption);

    // Преконфигурация
    setWidth(15, Unit.EM);
    setDescription(description);
    setInputPrompt("ООО \"Рога и Копыта\"");
    setImmediate(true);
    setScrollToSelectedItem(true);

    // Инициализация контейнера
    container = new ListContainer<>(LegalEntity.class);
    refreshContainer();

    // Устанавливаем контент выбора
    setFilteringMode(FilteringMode.CONTAINS);
    setContainerDataSource(container);
    setItemCaptionMode(ItemCaptionMode.PROPERTY);
    setItemCaptionPropertyId("name");

    // Функционал добавления нового контакта
    setNullSelectionAllowed(false);
    setNewItemsAllowed(false);
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:25,代码来源:SPLegalEntityField.java

示例6: EmployeeSelectField

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
protected EmployeeSelectField(final String caption, final String description) {
    super(caption);

    // Преконфигурация
    setWidth(15, Unit.EM);
    setDescription(description);
    setInputPrompt("ФИО");
    setImmediate(true);
    setScrollToSelectedItem(true);

    // Инициализация контейнера
    container = new ExtaDbContainer<>(Employee.class);
    container.sort(new Object[]{"name"}, new boolean[]{true});
    setContainerFilter();

    // Устанавливаем контент выбора
    setFilteringMode(FilteringMode.CONTAINS);
    setContainerDataSource(container);
    setItemCaptionMode(ItemCaptionMode.PROPERTY);
    setItemCaptionPropertyId("name");
    container.setSingleSelectConverter(this);

    // Функционал добавления нового контакта
    setNullSelectionAllowed(false);
    setNewItemsAllowed(false);
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:27,代码来源:EmployeeField.java

示例7: initContent

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
@Override
protected Component initContent() {
    tokenField.setStyleName(ExtaTokenField.STYLE_TOKENFIELD);
    tokenField.setFilteringMode(FilteringMode.CONTAINS); // suggest
    tokenField.setInputPrompt("Выберите категорию...");
    tokenField.setDescription("Выберите одну или несколько категорий компании...");
    tokenField.setRememberNewTokens(false);
    tokenField.setNewTokensAllowed(false);
    tokenField.setWidth(getWidth(), getWidthUnits());
    tokenField.setHeight(getHeight(), getHeightUnits());

    tokenField.addValueChangeListener(event -> {
        final Set selected = (Set) tokenField.getValue();
        setValue(selected);
        refreshContainer(selected);
    });

    final Set<String> set = getValue() != null ? getValue() : null;
    if (set != null) {
        tokenField.setValue(newHashSet(set));
    }
    refreshContainer(set);

    return tokenField;
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:26,代码来源:CompanyCategoriesField.java

示例8: PersonSelectField

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
protected PersonSelectField(final String caption, final String description) {
    super(caption);

    // Преконфигурация
    setDescription(description);
    setInputPrompt("контакт...");
    setWidth(25, Unit.EM);
    setImmediate(true);
    setBuffered(true);
    setScrollToSelectedItem(true);

    // Инициализация контейнера
    container = new ExtaDbContainer<>(Person.class);
    container.sort(new Object[]{Person_.name.getName()}, new boolean[]{true});

    // Устанавливаем контент выбора
    setFilteringMode(FilteringMode.CONTAINS);
    setContainerDataSource(container);
    setItemCaptionMode(ItemCaptionMode.PROPERTY);
    setItemCaptionPropertyId("name");
    container.setSingleSelectConverter(this);

    // Функционал добавления нового контакта
    setNullSelectionAllowed(false);
    setNewItemsAllowed(false);
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:27,代码来源:PersonField.java

示例9: MotorModelSelect

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
/**
 * <p>Constructor for MotorBrandSelect.</p>
 *
 * @param caption a {@link String} object.
 */
public MotorModelSelect(final String caption) {
    super(caption);

    setDescription("Укажите модель техники");
    setInputPrompt("Выберите...");
    setRequiredError(String.format("Поле '%s' не может быть пустым", caption));
    setImmediate(true);
    setScrollToSelectedItem(true);
    setNullSelectionAllowed(false);
    setInvalidAllowed(true);
    setNewItemsAllowed(true);
    setNewItemHandler(newValue -> {
        addItem(newValue);
        setValue(newValue);
    });
    setFilteringMode(FilteringMode.CONTAINS);
    setWidth(15, Unit.EM);
    addValueChangeListener(e -> {
        final String value = (String) e.getProperty().getValue();
        if (value != null && !containsId(value)) {
            addItem(value);
            //setValue(value);
        }
    });
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:31,代码来源:MotorModelSelect.java

示例10: CuratorsGroupSelectField

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
protected CuratorsGroupSelectField(final String caption, final String description) {
    super(caption);

    // Преконфигурация
    setWidth(15, Unit.EM);
    setDescription(description);
    setInputPrompt("Имя");
    setImmediate(true);
    setScrollToSelectedItem(true);

    // Инициализация контейнера
    container = new ExtaDbContainer<>(CuratorsGroup.class);
    container.sort(new Object[]{"name"}, new boolean[]{true});

    // Устанавливаем контент выбора
    setFilteringMode(FilteringMode.CONTAINS);
    setContainerDataSource(container);
    setItemCaptionMode(ItemCaptionMode.PROPERTY);
    setItemCaptionPropertyId("name");
    container.setSingleSelectConverter(this);

    // Функционал добавления нового контакта
    setNullSelectionAllowed(false);
    setNewItemsAllowed(false);
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:26,代码来源:CuratorsGroupField.java

示例11: UserProfileSelect

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
/**
 * <p>Constructor for UserProfileSelect.</p>
 *
 * @param caption a {@link java.lang.String} object.
 * @param description a {@link java.lang.String} object.
 */
public UserProfileSelect(final String caption, final String description) {
	super(caption);
	// Преконфигурация
	setDescription(description);
	setInputPrompt("Выберите...");
	setWidth(25, Unit.EM);
	setImmediate(true);
	setScrollToSelectedItem(true);

	// Инициализация контейнера
	final ExtaDbContainer<UserProfile> container = new ExtaDbContainer<>(UserProfile.class);
	container.addNestedContainerProperty("employee.name");
	container.sort(new Object[]{"employee.name"}, new boolean[]{true});

	// Устанавливаем контент выбора
	setFilteringMode(FilteringMode.CONTAINS);
	setContainerDataSource(container);
	setItemCaptionMode(ItemCaptionMode.PROPERTY);
	setItemCaptionPropertyId("employee.name");
	container.setSingleSelectConverter(this);

	// Функционал добавления нового контакта
	setNullSelectionAllowed(false);
	setNewItemsAllowed(false);
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:32,代码来源:UserProfileSelect.java

示例12: bindTagField

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
public <T extends BaseEntity, L> TokenField bindTagField(final AbstractLayout form, final FieldGroup group,
		final Selected<T> selected, final String fieldLabel, final String fieldName)
{
	final TokenField field = new SplitTagField<T>(fieldLabel, false);
	field.setWidth("100%"); // width...
	field.setInputWidth("100%"); // and input width separately
	field.setFilteringMode(FilteringMode.CONTAINS); // suggest
	field.setTokenCaptionPropertyId(Tag_.name.getName());
	field.setInputPrompt("Enter one or more comma separated tags");
	field.setRememberNewTokens(false); // we can opt to do this ourselves
	field.setImmediate(true);

	if (group != null)
	{
		group.bind(field, fieldName);
	}
	form.addComponent(field);
	return field;
}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:20,代码来源:SMFormHelper.java

示例13: selectable7

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
public void selectable7() {
	// tag::selectable7[]
	SingleSelect<TestData> singleSelect = Components.input.singleSelect(TestData.class)
			.items(new TestData(1), new TestData(2)) // set the items
			.filteringMode(FilteringMode.CONTAINS) // <1>
			.build();
	// end::selectable7[]
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:9,代码来源:ExampleSelectable.java

示例14: buildFilter

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
/**
 * @see com.vaadin.ui.ComboBox#buildFilter(java.lang.String, com.vaadin.shared.ui.combobox.FilteringMode)
 */
@Override
protected Filter buildFilter(String filterString, FilteringMode filteringMode) {
	container.removeAllContainerFilters();
	container.addContainerFilter(new SimpleStringFilter(SiScolEtablissement_.libEtb.getName(), filterString, true, false));
	return null;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:10,代码来源:ComboBoxEtablissement.java

示例15: buildFilter

import com.vaadin.shared.ui.combobox.FilteringMode; //导入依赖的package包/类
/**
 * @see com.vaadin.ui.ComboBox#buildFilter(java.lang.String, com.vaadin.shared.ui.combobox.FilteringMode)
 */
@Override
protected Filter buildFilter(String filterString, FilteringMode filteringMode) {
	container.removeAllContainerFilters();
	container.addContainerFilter(new SimpleStringFilter(SiScolCommune_.libCom.getName(), filterString, true, false));
	return null;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:10,代码来源:ComboBoxCommune.java


注:本文中的com.vaadin.shared.ui.combobox.FilteringMode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。