本文整理汇总了Java中com.vaadin.data.util.filter.Or类的典型用法代码示例。如果您正苦于以下问题:Java Or类的具体用法?Java Or怎么用?Java Or使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Or类属于com.vaadin.data.util.filter包,在下文中一共展示了Or类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createContainer
import com.vaadin.data.util.filter.Or; //导入依赖的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;
}
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:25,代码来源:InfoFilesGrid.java
示例2: createContainer
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Container createContainer() {
// Запрос данных
final ExtaDbContainer<Lead> container = SecuredDataContainer.create(Lead.class, ExtaDomain.SALES_LEADS);
container.addNestedContainerProperty("responsible.name");
container.addNestedContainerProperty("responsibleAssist.name");
container.addContainerFilter(new Compare.Equal("status", status));
if (isMyOnly) {
final Employee user = lookup(UserManagementService.class).getCurrentUserEmployee();
container.addContainerFilter(
new Or(
new Compare.Equal("responsible", user),
new Compare.Equal("responsibleAssist", user)));
}
container.sort(new Object[]{"createdDate"}, new boolean[]{false});
return container;
}
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:21,代码来源:LeadsGrid.java
示例3: generateFilter
import com.vaadin.data.util.filter.Or; //导入依赖的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;
}
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:27,代码来源:UserProfileFilterGenerator.java
示例4: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的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
示例5: filter
import com.vaadin.data.util.filter.Or; //导入依赖的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
示例6: buildFilter
import com.vaadin.data.util.filter.Or; //导入依赖的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
示例7: setFilter
import com.vaadin.data.util.filter.Or; //导入依赖的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
示例8: setFilter
import com.vaadin.data.util.filter.Or; //导入依赖的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
示例9: setClientsFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
private void setClientsFilter(final String name, final String cellPhone) {
clientsContainer.removeAllContainerFilters();
final List<Container.Filter> filters = newArrayListWithCapacity(3);
if (!Strings.isNullOrEmpty(name)) {
filters.add(new Like("name", MessageFormat.format("%{0}%", name), false));
}
if (!Strings.isNullOrEmpty(cellPhone)) {
filters.add(new Like("phone", MessageFormat.format("%{0}%", cellPhone), false));
filters.add(new Like("secondPhone", MessageFormat.format("%{0}%", cellPhone), false));
}
if (!filters.isEmpty())
clientsContainer.addContainerFilter(new Or(filters.toArray(new Container.Filter[filters.size()])));
}
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:14,代码来源:LeadEditForm.java
示例10: createContainer
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Container createContainer() {
// Запрос данных
final ExtaDbContainer<Sale> container = SecuredDataContainer.create(Sale.class, domain);
container.addNestedContainerProperty("client.name");
container.addNestedContainerProperty("client.phone");
container.addNestedContainerProperty("clientContact.name");
container.addNestedContainerProperty("clientContact.phone");
container.addNestedContainerProperty("dealer.name");
container.addNestedContainerProperty("responsible.name");
container.addNestedContainerProperty("responsibleAssist.name");
container.addNestedContainerProperty("dealerManager.name");
container.addNestedContainerProperty("dealer.posAddress.regionWithType");
container.addNestedContainerProperty("dealer.posAddress.cityWithType");
container.addContainerFilter(new Compare.Equal("status",
domain == ExtaDomain.SALES_CANCELED ? Sale.Status.CANCELED :
domain == ExtaDomain.SALES_OPENED ? Sale.Status.NEW : Sale.Status.FINISHED));
if (isMyOnly) {
final Employee user = lookup(UserManagementService.class).getCurrentUserEmployee();
container.addContainerFilter(
new Or(
new Compare.Equal("responsible", user),
new Compare.Equal("responsibleAssist", user)));
}
container.sort(new Object[]{Sale_.lastModifiedDate.getName()}, new boolean[]{domain == ExtaDomain.SALES_OPENED});
return container;
}
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:31,代码来源:SalesGrid.java
示例11: or
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
public static Filter or(final Filter... filters)
{
final List<Filter> validFilters = new ArrayList<Filter>();
for (Filter filter : filters)
{
if (filter != null)
validFilters.add(filter);
}
if (validFilters.size() == 1)
return validFilters.get(0);
return new Or(validFilters.toArray(new Filter[validFilters.size()]));
}
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:15,代码来源:NullFilter.java
示例12: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的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
示例13: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(
new SimpleStringFilter(new Path(LoginAttempt_.user, User_.username).getName(), filterString, true,
false),
new SimpleStringFilter(LoginAttempt_.dateOfAttempt.getName(), filterString, true, false),
new SimpleStringFilter(LoginAttempt_.succeeded.getName(), filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:10,代码来源:LoginAttemptView.java
示例14: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(new Or(new Or(new Or(
new Or(new SimpleStringFilter(CommunicationLog_.activityDate.getName(), filterString, true, false),
new SimpleStringFilter(new Path(CommunicationLog_.type, CommunicationType_.name).getName(),
filterString, true, false)),
new SimpleStringFilter(new Path(CommunicationLog_.withContact, Contact_.lastname).getName(),
filterString, true, false)),
new SimpleStringFilter(new Path(CommunicationLog_.withContact, Contact_.firstname).getName(),
filterString, true, false)),
new SimpleStringFilter(new Path(CommunicationLog_.addedBy, User_.username).getName(), filterString,
true, false)),
new SimpleStringFilter(CommunicationLog_.subject.getName(), filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:16,代码来源:CommunicationLogView.java
示例15: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(
new Or(new SimpleStringFilter(Event_.eventStartDateTime.getName(), filterString, true, false),
new SimpleStringFilter(Event_.eventEndDateTime.getName(), filterString, true, false)),
new SimpleStringFilter(Event_.subject.getName(), filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:9,代码来源:EventView.java
示例16: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(new Or(new Or(new Or(
new Or(new SimpleStringFilter(BaseEntity_.created.getName(), filterString, true, false),
new SimpleStringFilter(Note_.subject.getName(), filterString, true, false)),
new SimpleStringFilter(Note_.body.getName(), filterString, true, false)))));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:9,代码来源:ChildNoteView.java
示例17: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(new Or(new Or(new Or(new Or(new SimpleStringFilter(CommunicationLog_.activityDate.getName(),
filterString, true, false), new SimpleStringFilter(new Path(CommunicationLog_.type,
CommunicationType_.name).getName(), filterString, true, false)), new SimpleStringFilter(new Path(
CommunicationLog_.withContact, Contact_.lastname).getName(), filterString, true, false)),
new SimpleStringFilter(new Path(CommunicationLog_.withContact, Contact_.firstname).getName(),
filterString, true, false)), new SimpleStringFilter(new Path(CommunicationLog_.addedBy,
User_.username).getName(), filterString, true, false)), new SimpleStringFilter(
CommunicationLog_.subject.getName(), filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:13,代码来源:ChildCommunicationView.java
示例18: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(new SimpleStringFilter(SessionHistory_.user.getName(), filterString, true, false),
new SimpleStringFilter(SessionHistory_.start.getName(), filterString, true, false),
new SimpleStringFilter(SessionHistory_.end.getName(), filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:8,代码来源:SessionHistoryView.java
示例19: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
//
return new Or(new SimpleStringFilter(User_.username.getName(), filterString, true, false),
new SimpleStringFilter(User_.emailAddress.getName(), filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:8,代码来源:UserView.java
示例20: getContainerFilter
import com.vaadin.data.util.filter.Or; //导入依赖的package包/类
@Override
protected Filter getContainerFilter(final String filterString, final boolean advancedSearchActive)
{
return new Or(new Or(new Or(new SimpleStringFilter(Organisation_.name.getName(), filterString, true, false),
new SimpleStringFilter(Organisation_.phone1, filterString, true, false)), new SimpleStringFilter(
Organisation_.phone2, filterString, true, false)), new SimpleStringFilter(Organisation_.phone3,
filterString, true, false));
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:9,代码来源:OrganisationView.java
注:本文中的com.vaadin.data.util.filter.Or类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论