本文整理汇总了Java中com.vaadin.data.util.filter.IsNull类的典型用法代码示例。如果您正苦于以下问题:Java IsNull类的具体用法?Java IsNull怎么用?Java IsNull使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IsNull类属于com.vaadin.data.util.filter包,在下文中一共展示了IsNull类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addComboBoxFilters
import com.vaadin.data.util.filter.IsNull; //导入依赖的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
示例2: testRootItemIds
import com.vaadin.data.util.filter.IsNull; //导入依赖的package包/类
@Test
public void testRootItemIds() {
LinkedList<SortBy> orderby = new LinkedList<SortBy>();
orderby.add(new SortBy("firstName", true));
LinkedList<Object> result = new LinkedList<Object>();
// Instruct mocks
expect(
entityProviderMock.getAllEntityIdentifiers(container,
new IsNull("manager"), orderby)).andReturn(result);
replay(entityProviderMock);
// Set up container
container.setParentProperty("manager");
container.setEntityProvider(entityProviderMock);
container.sort(new Object[] { "firstName" }, new boolean[] { true });
// Run test
assertSame(result, container.rootItemIds());
// Verify
verify(entityProviderMock);
}
开发者ID:mysema,项目名称:vaadin-querydsl-prototype,代码行数:25,代码来源:QuerydslJPAContainerTest.java
示例3: addShowPopulatedFilter
import com.vaadin.data.util.filter.IsNull; //导入依赖的package包/类
protected void addShowPopulatedFilter(String propertyId, HeaderRow filterRow) {
HeaderCell cell = filterRow.getCell(propertyId);
CheckBox group = new CheckBox("Show Set Only");
group.setImmediate(true);
group.addValueChangeListener(l->{
container.removeContainerFilters(propertyId);
if (group.getValue()) {
container.addContainerFilter(new And(new Not(new Compare.Equal(propertyId,"")), new Not(new IsNull(propertyId))));
}
});
group.addStyleName(ValoTheme.CHECKBOX_SMALL);
cell.setComponent(group);
}
开发者ID:JumpMind,项目名称:metl,代码行数:15,代码来源:EditExcelReaderPanel.java
示例4: UserContactSelect
import com.vaadin.data.util.filter.IsNull; //导入依赖的package包/类
protected UserContactSelect() {
super("");
final Filter filter = new Not(new IsNull("userProfile"));
final Class<Employee> contactType1 = Employee.class;
// Преконфигурация
setDescription("Выберите пользователя системы");
setInputPrompt("контакт...");
setWidth(25, Unit.EM);
setImmediate(true);
setScrollToSelectedItem(true);
// Инициализация контейнера
this.container = new ExtaDbContainer<>(Employee.class);
if (filter != null) {
this.container.addContainerFilter(filter);
}
container.sort(new Object[]{Employee_.name.getName()}, new boolean[]{true});
// Устанавливаем контент выбора
setFilteringMode(FilteringMode.CONTAINS);
setContainerDataSource(this.container);
setItemCaptionMode(ItemCaptionMode.PROPERTY);
setItemCaptionPropertyId("name");
container.setSingleSelectConverter(this);
// Функционал добавления нового контакта
setNullSelectionAllowed(false);
setNewItemsAllowed(false);
}
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:32,代码来源:UserContactSelectField.java
示例5: visit
import com.vaadin.data.util.filter.IsNull; //导入依赖的package包/类
public Object visit(Operation<?> expr, @Nullable Void context) {
Operator<?> op = expr.getOperator();
if (op == Ops.OR) {
return new Or((Filter)handle(expr, 0), (Filter)handle(expr, 1));
} else if (op == Ops.AND) {
return new And((Filter)handle(expr, 0), (Filter)handle(expr, 1));
} else if (op == Ops.NOT) {
return new Not((Filter)handle(expr, 0));
} else if (op == Ops.LIKE) {
return new Like((String)handle(expr, 0), (String)handle(expr, 1));
} else if (op == Ops.EQ) {
return new Equal(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.EQ_IGNORE_CASE) {
// not supported
} else if (op == Ops.NE) {
return new Not(new Equal(handle(expr, 0), handle(expr, 1)));
} else if (op == Ops.IS_NULL) {
return new IsNull(handle(expr, 0));
} else if (op == Ops.STARTS_WITH) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), false, true);
} else if (op == Ops.STARTS_WITH_IC) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), true, true);
} else if (op == Ops.ENDS_WITH) {
// not supported
} else if (op == Ops.ENDS_WITH_IC) {
// not supported
} else if (op == Ops.STRING_CONTAINS) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), false, false);
} else if (op == Ops.STRING_CONTAINS_IC) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), true, false);
} else if (op == Ops.BETWEEN) {
return new Between((Object)handle(expr, 0), (Comparable)handle(expr, 1), (Comparable)handle(expr, 2));
} else if (op == Ops.IN) {
// not supported
} else if (op == Ops.NOT_IN) {
// not supported
} else if (op == Ops.LT) {
return new Less(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.GT) {
return new Greater(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.LOE) {
return new LessOrEqual(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.GOE) {
return new GreaterOrEqual(handle(expr, 0), handle(expr, 1));
}
throw new UnsupportedOperationException("Illegal operation " + expr);
}
开发者ID:mysema,项目名称:vaadin-querydsl-prototype,代码行数:48,代码来源:VaadinExpressionVisitor.java
示例6: getContent
import com.vaadin.data.util.filter.IsNull; //导入依赖的package包/类
@Override
public Component getContent()
{
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
final Label label = new Label("<h1>Select the Issuer (you) and the person to allocate books to.</h1>",
ContentMode.HTML);
label.setContentMode(ContentMode.HTML);
layout.addComponent(label);
final Raffle raffle = this.setupWizardView.getRaffle();
// The container just lets us use a fieldgroup which we need to bind the
// twincol selection to.
final RaffleAllocationDao daoRaffleAllocation = new DaoFactory().getRaffleAllocationDao();
final JPAContainer<RaffleAllocation> allocationContainer = daoRaffleAllocation.createVaadinContainer();
this.group = new ValidatingFieldGroup<RaffleAllocation>(allocationContainer, RaffleAllocation.class);
this.group.setItemDataSource(allocationContainer.createEntityItem(new RaffleAllocation()));
final MultiColumnFormLayout<RaffleAllocation> overviewForm = new MultiColumnFormLayout<RaffleAllocation>(2,
this.group);
overviewForm.setColumnFieldWidth(0, 200);
overviewForm.setColumnFieldWidth(1, 200);
final FormHelper<RaffleAllocation> formHelper = overviewForm.getFormHelper();
this.issuedBy = formHelper.new EntityFieldBuilder<Contact>().setLabel("Issued By")
.setField(RaffleAllocation_.issuedBy).setListFieldName(Contact_.fullname).build();
this.issuedBy.setFilteringMode(FilteringMode.CONTAINS);
this.issuedBy.setTextInputAllowed(true);
this.issuedBy.setRequired(true);
overviewForm.newLine();
this.allocatedToContact = formHelper.new EntityFieldBuilder<Contact>().setLabel("Allocate To")
.setField(RaffleAllocation_.allocatedTo).setListFieldName(Contact_.fullname).build();
this.allocatedToContact.setFilteringMode(FilteringMode.CONTAINS);
this.allocatedToContact.setTextInputAllowed(true);
this.allocatedToContact.setDescription("The Contact to issue tickets to.");
this.allocatedToContact.setRequired(true);
overviewForm.colspan(2);
final RaffleBookDao daoRaffleBook = new DaoFactory().getRaffleBookDao();
final JPAContainer<RaffleBook> container = daoRaffleBook.createVaadinContainer();
container.addContainerFilter(new And(new IsNull(RaffleBook_.raffleAllocation.getName()), new Compare.Equal(
new Path(RaffleBook_.raffle, BaseEntity_.id).getName(), raffle.getId())));
this.bookSelectionField = formHelper.new TwinColSelectBuilder<RaffleBook>().setLabel("Books")
.setField(RaffleAllocation_.books).setListFieldName(RaffleBook_.firstNo).setContainer(container)
.setLeftColumnCaption("Available (First No.)").setRightColumnCaption("Allocated").build();
layout.addComponent(overviewForm);
final Label labelAllocate = new Label("<h1>Click Next to allocate the selected books.</h1>", ContentMode.HTML);
layout.addComponent(labelAllocate);
this.issuedBy.focus();
return layout;
}
开发者ID:bsutton,项目名称:scoutmaster,代码行数:62,代码来源:ManualSelectionStep.java
注:本文中的com.vaadin.data.util.filter.IsNull类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论