本文整理汇总了Java中com.vaadin.data.util.filter.Compare.Equal方法的典型用法代码示例。如果您正苦于以下问题:Java Compare.Equal方法的具体用法?Java Compare.Equal怎么用?Java Compare.Equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.util.filter.Compare
的用法示例。
在下文中一共展示了Compare.Equal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
@Override
public Container.Filter createFilter(Class<?> targetType, Object targetPropertyId, Object pattern) {
if (pattern == null) return null;
if (String.class.isAssignableFrom(targetType) || java.lang.Enum.class.isAssignableFrom(targetType)) {
return filterForString(targetPropertyId, pattern.toString());
} else
if (isNumberClass(targetType)) {
return filterForNumber(targetPropertyId, targetType, pattern.toString());
} else
if (Date.class.isAssignableFrom(targetType) || DateTime.class.isAssignableFrom(targetType)) {
Container.Filter filter = filterForCompareDate(targetPropertyId, pattern.toString());
if (filter != null) return filter;
return filterForDateRange(targetPropertyId, pattern.toString());
} else {
// fallback to equality
return new Compare.Equal(targetPropertyId, pattern);
}
}
示例2: createContainer
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
@Override
protected Container createContainer() {
final ExtaDbContainer<InfoFile> dbContainer = new ExtaDbContainer<>(InfoFile.class);
final UserProfile user = lookup(UserManagementService.class).getCurrentUser();
if (user.getRole() != UserRole.ADMIN) {
final Set<String> permitBrands = newHashSet(user.getPermitBrands());
final Set<UserGroup> groups = user.getGroupList();
if (groups != null) {
for (final UserGroup group : groups) {
permitBrands.addAll(group.getPermitBrands());
}
}
if (!permitBrands.isEmpty()) {
final Container.Filter[] bFilters = new Container.Filter[permitBrands.size()];
int i = 0;
for (final String brand : permitBrands) {
bFilters[i] = new Compare.Equal(InfoFile_.permitBrands.getName(), brand);
i++;
}
dbContainer.addContainerFilter(new Or(bFilters));
}
}
return dbContainer;
}
示例3: generateFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
/**
* Generates a new Filter for the property with the given ID, using the
* Field object and its value as basis for the filtering.
*
* @param propertyId ID of the filtered property.
* @param originatingField Reference to the field that triggered this filter generating
* request.
* @return A generated Filter object, or NULL if you want to allow
* FilterTable to generate the default Filter for this property.
*/
@Override
public Container.Filter generateFilter(final Object propertyId, final Field<?> originatingField) {
if (originatingField instanceof UserProfileSelect) {
final UserProfile userProfile = (UserProfile) ((UserProfileSelect) originatingField).getConvertedValue();
if (userProfile != null) {
final Set<String> aliases = userProfile.getAliases();
final Container.Filter[] filters = new Container.Filter[aliases.size()];
int i = 0;
for (final String alias : aliases) {
filters[i++] = new Compare.Equal(propertyId, alias);
}
return filters.length > 1 ? new Or(filters) : filters[0];
}
}
return null;
}
示例4: setBogusParentFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
/**
* Load the page with a bogus parent filter to prevent possible large
* queries from being executed before a parent row is selected
*/
private void setBogusParentFilter()
{
P tmp;
try
{
tmp = parentType.newInstance();
tmp.setId(-1L);
parentFilter = new Compare.Equal(childKey, tmp);
}
catch (InstantiationException | IllegalAccessException e)
{
loggerChildCrud.warn("Failed to instance " + parentType + " to create bogus parent filter");
}
}
示例5: createParentFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
private void createParentFilter(EntityItem<P> item) throws InstantiationException, IllegalAccessException
{
parentFilter = new Compare.Equal(childKey, translateParentId(-1l));
if (item != null)
{
EntityItemProperty key = item.getItemProperty(parentKey);
Preconditions.checkNotNull(key, "parentKey " + parentKey + " doesn't exist in properties");
parentId = key.getValue();
if (parentId != null)
{
parentFilter = new Compare.Equal(childKey, translateParentId(parentId));
}
}
}
示例6: numberEqual
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
protected Container.Filter numberEqual(Object propertyId, String pattern) {
try {
int i = Integer.parseInt(pattern);
return new Compare.Equal(propertyId, i);
} catch (NumberFormatException ex) {
return null;
}
}
示例7: setContainerFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
protected void setContainerFilter() {
container.removeAllContainerFilters();
Filter fltr = null;
if (companySupplier != null && companySupplier.get() != null)
fltr = new Compare.Equal("company", companySupplier.get());
if (filter != null)
fltr = fltr != null ? new And(fltr, filter) : filter;
if (fltr != null)
container.addContainerFilter(fltr);
}
示例8: setContainerFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
protected void setContainerFilter() {
container.removeAllContainerFilters();
Filter fltr = null;
if (salePointSupplier != null && salePointSupplier.get() != null) {
fltr = new Compare.Equal("workPlace", salePointSupplier.get());
} else if (companySupplier != null && companySupplier.get() != null)
fltr = new Compare.Equal("company", companySupplier.get());
if (filter != null)
fltr = fltr != null ? new And(fltr, filter) : filter;
if (fltr != null)
container.addContainerFilter(fltr);
}
示例9: setContainerFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
protected void setContainerFilter() {
container.removeAllContainerFilters();
Container.Filter fltr = null;
if (regionSupplier != null && regionSupplier.get() != null)
fltr = new Compare.Equal(Company_.region.getName(), regionSupplier.get());
if (filter != null)
fltr = fltr != null ? new And(fltr, filter) : filter;
if (fltr != null)
container.addContainerFilter(fltr);
}
示例10: CommitBeanQuery
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
public CommitBeanQuery(QueryDefinition definition,
Map<String, Object> queryConfiguration, Object[] sortPropertyIds,
boolean[] sortStates) {
super(definition, queryConfiguration, sortPropertyIds, sortStates);
repository = (Repository) getQueryConfiguration().get("repository");
for (final Container.Filter filter : definition.getFilters()) {
if (filter instanceof Compare.Equal) {
final Compare.Equal equal = (Compare.Equal) filter;
if (equal.getPropertyId().equals("range")) {
range = (String) equal.getValue();
}
}
}
}
示例11: FileDiffBeanQuery
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
public FileDiffBeanQuery(QueryDefinition definition,
Map<String, Object> queryConfiguration, Object[] sortPropertyIds,
boolean[] sortStates) {
super(definition, queryConfiguration, sortPropertyIds, sortStates);
repository = (Repository) queryConfiguration.get("repository");
for (final Container.Filter filter : definition.getFilters()) {
if (filter instanceof Compare.Equal) {
final Compare.Equal equal = (Compare.Equal) filter;
if (equal.getPropertyId().equals("range")) {
range = (String) equal.getValue();
}
}
}
}
示例12: initFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
private void initFilter() {
final Container.Filter filter = new Compare.Equal("company.categories", CategoryService.COMPANY_CAT_DEALER);
setFilter(filter);
}
示例13: BankEmployeeField
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
public BankEmployeeField(final String caption, final String description) {
super(caption, description);
final Container.Filter filter = new Compare.Equal("company.categories", CategoryService.COMPANY_CAT_BANK);
setFilter(filter);
}
示例14: DealerEmployeeField
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
public DealerEmployeeField(final String caption, final String description) {
super(caption, description);
final Container.Filter filter = new Compare.Equal("company.categories", CategoryService.COMPANY_CAT_DEALER);
setFilter(filter);
}
示例15: initFilter
import com.vaadin.data.util.filter.Compare; //导入方法依赖的package包/类
private void initFilter() {
final Container.Filter filter =
new Compare.Equal(Company_.categories.getName(), CategoryService.COMPANY_CAT_DEALER);
setFilter(filter);
}