• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SimpleStringFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getManufacturingFilterListener

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * Returns the TextChangeListener that gets triggered
 * 
 * @return
 */
private TextChangeListener getManufacturingFilterListener() {
	return new TextChangeListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -2368474286053602744L;

		@Override
		public void textChange(TextChangeEvent event) {
			String newValue = (String) event.getText();
			@SuppressWarnings("unchecked")
			BeanItemContainer<VehicleInfo> container = ((BeanItemContainer<VehicleInfo>) grid
					.getContainerDataSource());
			// This is important, this removes the previous filter that was
			// used to filter the container
			container.removeContainerFilters(MANUFACTURER);
			if (null != newValue && !newValue.isEmpty()) {
				container.addContainerFilter(new SimpleStringFilter(
						MANUFACTURER, newValue, true, false));
			}
			grid.recalculateColumnWidths();
		}
	};
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:31,代码来源:FilterGrid.java


示例2: addDateFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * Ajoute un filtre en DateField sur une liste de colonnes
 * 
 * @param filterRow
 * @param container
 * @param propertys
 */
private void addDateFilter(String... propertys) {
	for (String property : propertys) {
		HeaderCell cell = getFilterCell(property);
		LocalDateField filterField = new LocalDateField(true);
		filterField.setImmediate(true);
		filterField.setWidth(100, Unit.PERCENTAGE);
		filterField.addValueChangeListener(change -> {
			LocalDate value = filterField.getValue();
			// Can't modify filters so need to replace
			container.removeContainerFilters(property);
			// (Re)create the filter if necessary
			if (value != null) {
				container.addContainerFilter(new SimpleStringFilter(property, value.toString(), true, false));
			}
			fireFilterListener();
		});
		cell.setComponent(filterField);
	}
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:27,代码来源:GridFormatting.java


示例3: addComboBoxFilters

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * Ajoute un filtre en combobox String sur une colonne
 * 
 * @param property
 * @param cb
 */
public void addComboBoxFilters(String property, ComboBox cb, String libNull) {
	HeaderCell cell = getFilterCell(property);
	cb.addValueChangeListener(e -> {
		container.removeContainerFilters(property);
		if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
				&& !((String) cb.getValue()).equals(libNull)) {
			container.addContainerFilter(new SimpleStringFilter(property, (String) cb.getValue(), true, true));
		} else if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
				&& ((String) cb.getValue()).equals(libNull)) {
			container.addContainerFilter(new IsNull(property));
		}
		fireFilterListener();
		fireFilterListener();
	});
	cb.setImmediate(true);
	cb.setWidth(100, Unit.PERCENTAGE);
	cb.addStyleName(ValoTheme.COMBOBOX_TINY);
	cell.setComponent(cb);
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:26,代码来源:GridFormatting.java


示例4: equals

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
	if (obj == null) {
		return false;
	}

	// Only ones of the objects of the same class can be equal
	if (!(obj instanceof SimpleStringFilter)) {
		return false;
	}
	final SimpleStringFilter o = (SimpleStringFilter) obj;

	// Checks the properties one by one
	if (propertyId != o.getPropertyId() && o.getPropertyId() != null && !o.getPropertyId().equals(propertyId)) {
		return false;
	}
	if (filterString != o.getFilterString() && o.getFilterString() != null
			&& !o.getFilterString().equals(filterString)) {
		return false;
	}
	return true;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:23,代码来源:InsensitiveStringFilter.java


示例5: getCategoryFilterListener

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * @return
 */
private ValueChangeListener getCategoryFilterListener() {
	return new ValueChangeListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -2368474286053602744L;

		@SuppressWarnings("unchecked")
		@Override
		public void valueChange(ValueChangeEvent event) {
			String newValue = (String) event.getProperty().getValue();
			BeanItemContainer<VehicleInfo> container = ((BeanItemContainer<VehicleInfo>) grid
					.getContainerDataSource());
			container.removeContainerFilters(CATEGORY);
			if (null != newValue && !newValue.isEmpty()) {
				container.addContainerFilter(new SimpleStringFilter(
						CATEGORY, newValue, true, true));
			}
		}
	};
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:26,代码来源:FilterGrid.java


示例6: addColumn

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
protected void addColumn(String propertyId, HeaderRow filterRow) {
    grid.getColumn(propertyId).setEditable(false);
    HeaderCell cell = filterRow.getCell(propertyId);
    TextField filterField = new TextField();
    filterField.setInputPrompt("Filter");
    filterField.setImmediate(true);
    filterField.addStyleName(ValoTheme.TEXTFIELD_TINY);
    filterField.setWidth(100, Unit.PERCENTAGE);
    filterField.addTextChangeListener(change -> {
        container.removeContainerFilters(propertyId);
        if (!change.getText().isEmpty()) {
            container.addContainerFilter(
                    new SimpleStringFilter(propertyId, change.getText(), true, false));
        }
    });
    cell.setComponent(filterField);
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:18,代码来源:EditExcelReaderPanel.java


示例7: filterForString

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
protected Container.Filter filterForString(Object propertyId, String pattern) {
    // if ends with one WILDCARD
    if (pattern.endsWith(WILDCARD)) {
        // strip it, and check recursively (to strip any other *'s)
        return filterForString(propertyId, pattern.substring(0, pattern.length()-1));
    } else if (pattern.startsWith(WILDCARD)) {
        // if it starts with a WILDCARD, then strip it
        // and look for the pattern anywhere in the word
        do {
            pattern = pattern.substring(1, pattern.length());
        } while (pattern.startsWith(WILDCARD));
        return new SimpleStringFilter(propertyId, pattern, true, false);
    }

    return new SimpleStringFilter(propertyId, pattern, true, true);
}
 
开发者ID:tyl,项目名称:field-binder,代码行数:17,代码来源:DefaultFilterFactory.java


示例8: testClearToFindOnEmptyFilteredContainer

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
@Test
public void testClearToFindOnEmptyFilteredContainer() {
    final FilterableListContainer<Person> container =
            new FilterableListContainer <Person>(Person.class);

    container.setCollection(new ArrayList<Person>(){{
        add(new Person("aa"));
        add(new Person("ab"));
    }});

    container.addContainerFilter(new SimpleStringFilter("name", "x", true, false));


    final FindButtonBar findButtonBar = new FindButtonBar();
    findButtonBar.getNavigation().setContainer(container);

    assertEquals(0, container.size());

    assertButtonsEnabled(findButtonBar.getClearToFindButton());
    assertButtonsDisabled(findButtonBar.getFindButton());
}
 
开发者ID:tyl,项目名称:field-binder,代码行数:22,代码来源:FindButtonBarTest.java


示例9: addContainerFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * HbnContainer only supports old style addContainerFilter(Object, String, boolean booblean) API and
 * {@link SimpleStringFilter}. Support for this newer API maybe in upcoming versions.
 * 
 * Also note that for complex filtering it is possible to override {@link #getBaseCriteria()} method and add filter
 * so the query directly.
 */
// TODO support new filtering api properly
@Override
public void addContainerFilter(Filter filter) throws UnsupportedFilterException
{
	logger.executionTrace();

	if (!(filter instanceof SimpleStringFilter))
	{
		final String message = "HbnContainer only supports old style addContainerFilter(Object, String, boolean booblean) API";
		throw new UnsupportedFilterException(message);
	}

	final SimpleStringFilter sf = (SimpleStringFilter) filter;
	final String filterString = sf.getFilterString();
	final Object propertyId = sf.getPropertyId();
	final boolean ignoreCase = sf.isIgnoreCase();
	final boolean onlyMatchPrefix = sf.isOnlyMatchPrefix();

	addContainerFilter(propertyId, filterString, "", ignoreCase, onlyMatchPrefix); // TODO: empty string?
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:28,代码来源:CustomHbnContainer.java


示例10: removeContainerFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * This is an internal HbnContainer utility method that removes the given container filter.
 */
@Override
public void removeContainerFilter(Filter filter)
{
	logger.executionTrace();

	// TODO support new filtering api properly
	// TODO the workaround for SimpleStringFilter works wrong, but hopefully will be good enough for now

	if (filter instanceof SimpleStringFilter)
	{
		final SimpleStringFilter sf = (SimpleStringFilter) filter;
		final Object propertyId = sf.getPropertyId();
		removeContainerFilters(propertyId);
	}
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:19,代码来源:CustomHbnContainer.java


示例11: getContainerFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
	if (filterString.trim().length() > 0)
	{
		return new Or(new SimpleStringFilter(Task_.dueDate.getName(), filterString, true, false),
				new SimpleStringFilter(new Path(Task_.taskType, TaskType_.name).getName(), filterString, true,
						false), new SimpleStringFilter(new Path(Task_.withContact, Contact_.lastname).getName(),
								filterString, true, false), new SimpleStringFilter(new Path(Task_.withContact,
										Contact_.firstname).getName(), filterString, true, false), new SimpleStringFilter(new Path(
												Task_.addedBy, User_.username).getName(), filterString, true, false),
												new SimpleStringFilter(Task_.subject.getName(), filterString, true, false));
	}
	else
	{
		return null;
	}
}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:19,代码来源:TaskView.java


示例12: filter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
private void filter(String filterString) {
    container.removeAllContainerFilters();
    if (filterString.length() > 0) {
        String[] filterWords = filterString.split(" ");
        Container.Filter[] filters = new Container.Filter[filterWords.length];
        for (int i = 0; i < filterWords.length; ++i) {
            String word = filterWords[i];
            filters[i] = new Or(
                    new SimpleStringFilter("stringProperty", word, false, false),
                    new SimpleStringFilter("integerProperty", word, true, true),
                    new SimpleStringFilter("embeddedProperty.enumProperty", word, true, false)
            );
        }
        container.addContainerFilter(new And(filters));
    }
}
 
开发者ID:peholmst,项目名称:vaadin-mockapp,代码行数:17,代码来源:SampleTableView.java


示例13: buildFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的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


示例14: buildFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的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


示例15: buildFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的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();
	SimpleStringFilter libFilter = new SimpleStringFilter(SiScolDepartement_.libDep.getName(), filterString, true, false);
	SimpleStringFilter codFilter = new SimpleStringFilter(SiScolDepartement_.codDep.getName(), filterString, true, false);		
	container.addContainerFilter(new Or(libFilter,codFilter));
	return null;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:13,代码来源:ComboBoxDepartement.java


示例16: buildFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的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(SiScolPays_.libPay.getName(), filterString, true, false));
	return null;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:11,代码来源:ComboBoxPays.java


示例17: setFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * Filter the table based on a search string that is searched for in the
 * product name, availability and category columns.
 * 
 * @param filterString
 *            string to look for
 */
public void setFilter(String filterString) {
    LogManager.getLogger(this.getClass()).info("FilterString : "+filterString);
    getContainer().removeAllContainerFilters();
    if (filterString.length() > 0) {
        SimpleStringFilter nameFilter = new SimpleStringFilter(
                "productName", filterString, true, false);
        SimpleStringFilter availabilityFilter = new SimpleStringFilter(
                "availability", filterString, true, false);
        /*SimpleStringFilter categoryFilter = new SimpleStringFilter(
                "category", filterString, true, false);*/
        //getContainer().addContainerFilter(nameFilter);
        getContainer().addContainerFilter(new Or(nameFilter, availabilityFilter/*, categoryFilter*/));
    }
}
 
开发者ID:jvalenciag,项目名称:VaadinSpringShiroMongoDB,代码行数:22,代码来源:ProductTable.java


示例18: initializeTextField

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
protected void initializeTextField() {
	//
	// Initialize GUI settings
	//
	this.textFieldFilter.setImmediate(true);
	//
	// Respond to the text change events
	//
	this.textFieldFilter.addTextChangeListener(new TextChangeListener() {
		private static final long serialVersionUID = 1L;
		SimpleStringFilter currentFilter = null;

		@Override
		public void textChange(TextChangeEvent event) {
			//
			// Remove current filter
			//
			if (this.currentFilter != null) {
				FunctionSelectionWindow.highOrderFunctions.removeContainerFilter(this.currentFilter);
				this.currentFilter = null;
			}
			//
			// Get the text
			//
			String value = event.getText();
			if (value != null && value.length() > 0) {
				//
				// Add the new filter
				//
				this.currentFilter = new SimpleStringFilter(PROPERTY_SHORTNAME, value, true, false);
				FunctionSelectionWindow.highOrderFunctions.addContainerFilter(this.currentFilter);
			}
		}
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:36,代码来源:FunctionSelectionWindow.java


示例19: setFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
/**
 * Filter the grid based on a search string that is searched for in the
 * product name, availability and category columns.
 *
 * @param filterString
 *            string to look for
 */
public void setFilter(String filterString) {
    getContainer().removeAllContainerFilters();
    if (filterString.length() > 0) {
        SimpleStringFilter nameFilter = new SimpleStringFilter(
                "productName", filterString, true, false);
        SimpleStringFilter availabilityFilter = new SimpleStringFilter(
                "availability", filterString, true, false);
        SimpleStringFilter categoryFilter = new SimpleStringFilter(
                "category", filterString, true, false);
        getContainer().addContainerFilter(
                new Or(nameFilter, availabilityFilter, categoryFilter));
    }

}
 
开发者ID:vaadin,项目名称:archetype-application-example,代码行数:22,代码来源:ProductGrid.java


示例20: getContainerFilter

import com.vaadin.data.util.filter.SimpleStringFilter; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
	return new Or(new SimpleStringFilter(Raffle_.name.getName(), filterString, true, false),
			new SimpleStringFilter(Raffle_.startDate.getName(), filterString, true, false));

}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:8,代码来源:RaffleView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ThrowableProxy类代码示例发布时间:2022-05-21
下一篇:
Java SQLiteDatabaseLockedException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap