本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}