本文整理匯總了Java中com.vaadin.ui.ComboBox.setFilteringMode方法的典型用法代碼示例。如果您正苦於以下問題:Java ComboBox.setFilteringMode方法的具體用法?Java ComboBox.setFilteringMode怎麽用?Java ComboBox.setFilteringMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.ComboBox
的用法示例。
在下文中一共展示了ComboBox.setFilteringMode方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDsComboField
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox getDsComboField() {
final Container container = createContainer();
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("bulkupload.ds.name"), "", null,
null, false, "", i18n.getMessage("bulkupload.ds.name"));
dsComboBox.setSizeUndefined();
dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE);
dsComboBox.setImmediate(true);
dsComboBox.setFilteringMode(FilteringMode.STARTSWITH);
dsComboBox.setPageLength(7);
dsComboBox.setContainerDataSource(container);
dsComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME_VERSION);
dsComboBox.setId(UIComponentIdProvider.BULK_UPLOAD_DS_COMBO);
dsComboBox.setWidth("100%");
return dsComboBox;
}
示例2: getComboBox
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
/**
* @param caption
* @param bindName
* @param container
* TODO
* @return
*/
private ComboBox getComboBox(String caption, String bindName,
Container container) {
ComboBox comboBox = new ComboBox(caption);
comboBox.setImmediate(true);
comboBox.setValidationVisible(false);
comboBox.setNewItemsAllowed(false);
comboBox.setFilteringMode(FilteringMode.CONTAINS);
comboBox.setNullSelectionAllowed(false);
fieldGroup.bind(comboBox, bindName);
comboBox.setContainerDataSource(container);
return comboBox;
}
示例3: buildQuoteSelector
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private Component buildQuoteSelector() {
quoteSelector = new ComboBox();
// quoteSelector.setInputPrompt("Select Stock/Index...");
// quoteSelector.setItemCaptionPropertyId(Quote.PROPERTY_NAME);
// quoteSelector.setItemCaptionMode(ItemCaptionMode.PROPERTY);
// Set full width
// quoteSelector.setWidth(100.0f, Unit.PERCENTAGE);
quoteSelector.addStyleName("borderless");
// Set the appropriate filtering mode for this example
quoteSelector.setFilteringMode(FilteringMode.CONTAINS);
quoteSelector.setImmediate(true);
// Disallow null selections
quoteSelector.setNullSelectionAllowed(false);
quoteSelector.addValueChangeListener(e -> {
chart.setChartSymbol(quotes.getItem(e.getProperty().getValue()).getBean().getChartSrc());
ticker.setSymbol(quotes.getItem(e.getProperty().getValue()).getBean().getTickerSrc());
chartToolbar.getCharts().getChildren().get(LiveChart.ChartDrawType.LINE.ordinal()*2).setChecked(false);
chartToolbar.getCharts().getChildren().get(LiveChart.ChartDrawType.CANDLE.ordinal()*2).setChecked(true);
});
return quoteSelector;
}
示例4: buildGrid
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
protected void buildGrid() {
grid = new Grid();
grid.setSelectionMode(SelectionMode.NONE);
grid.setSizeFull();
grid.setEditorEnabled(!readOnly);
container = new BeanItemContainer<Record>(Record.class);
grid.setContainerDataSource(container);
grid.setColumns("entityName", "attributeName", "xpath");
HeaderRow filterRow = grid.appendHeaderRow();
addColumn("entityName", filterRow);
addColumn("attributeName", filterRow);
ComboBox combo = new ComboBox();
combo.addValueChangeListener(e->saveXPathSettings());
combo.setWidth(100, Unit.PERCENTAGE);
combo.setImmediate(true);
combo.setNewItemsAllowed(true);
combo.setInvalidAllowed(true);
combo.setTextInputAllowed(true);
combo.setScrollToSelectedItem(true);
combo.setFilteringMode(FilteringMode.CONTAINS);
grid.getColumn("xpath").setEditorField(combo).setExpandRatio(1);
addShowPopulatedFilter("xpath", filterRow);
grid.setEditorBuffered(false);
addComponent(grid);
setExpandRatio(grid, 1);
}
示例5: buildEditor
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected Component buildEditor(final ValidatingFieldGroup<RaffleAllocation> fieldGroup2)
{
final MultiColumnFormLayout<RaffleAllocation> overviewForm = new MultiColumnFormLayout<RaffleAllocation>(1,
this.fieldGroup);
overviewForm.setColumnFieldWidth(0, 240);
overviewForm.setColumnLabelWidth(0, 110);
// overviewForm.setColumnExpandRatio(0, 1.0f);
overviewForm.setSizeFull();
final FormHelper<RaffleAllocation> formHelper = overviewForm.getFormHelper();
final ComboBox allocatedTo = formHelper.new EntityFieldBuilder<Contact>().setLabel("Allocated To")
.setField(RaffleAllocation_.allocatedTo).setListFieldName(Contact_.fullname).build();
allocatedTo.setFilteringMode(FilteringMode.CONTAINS);
allocatedTo.setTextInputAllowed(true);
allocatedTo.setNullSelectionAllowed(true);
allocatedTo.setDescription("The person the book has been allocated to.");
overviewForm.bindDateField("Date Allocated", RaffleAllocation_.dateAllocated, "yyyy-MM-dd", Resolution.DAY);
final ComboBox issuedBy = formHelper.new EntityFieldBuilder<Contact>().setLabel("Issued By")
.setField(RaffleAllocation_.issuedBy).setListFieldName(Contact_.fullname).build();
issuedBy.setFilteringMode(FilteringMode.CONTAINS);
issuedBy.setTextInputAllowed(true);
issuedBy.setDescription("The leader that issued the book to the member.");
issuedBy.setNullSelectionAllowed(true);
overviewForm.bindDateField("Date Issued", RaffleAllocation_.dateIssued, "yyyy-MM-dd", Resolution.DAY);
final TextField bookCountField = overviewForm.bindTextField("Book Count", "bookCount");
bookCountField.setReadOnly(true);
overviewForm.bindTextAreaField("Notes", RaffleAllocation_.notes, 6);
return overviewForm;
}
示例6: buildEditor
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected Component buildEditor(final ValidatingFieldGroup<Relationship> fieldGroup2)
{
final SMMultiColumnFormLayout<Relationship> relationshipForm = new SMMultiColumnFormLayout<Relationship>(1,
this.fieldGroup);
relationshipForm.setColumnFieldWidth(0, 180);
final FormHelper<Relationship> formHelper = relationshipForm.getFormHelper();
/**
* The type of relationship. e.g. Parent of
*/
final ComboBox type = formHelper.new EntityFieldBuilder<RelationshipType>().setLabel("Relationship")
.setField(Relationship_.type).setListFieldName(RelationshipType_.lhs).build();
type.setFilteringMode(FilteringMode.CONTAINS);
type.setTextInputAllowed(true);
/**
* The contact we are related to.
*/
this.relatedTo = formHelper.new EntityFieldBuilder<Contact>().setLabel("Related To").setField(Relationship_.rhs)
.setListFieldName(Contact_.fullname).build();
this.relatedTo.setFilteringMode(FilteringMode.CONTAINS);
this.relatedTo.setTextInputAllowed(true);
@SuppressWarnings("unchecked")
final JPAContainer<Relationship> rhscontainer = (JPAContainer<Relationship>) this.relatedTo
.getContainerDataSource();
rhscontainer.sort(new String[]
{ Contact_.lastname.getName(), Contact_.firstname.getName() }, new boolean[]
{ true, true });
return relationshipForm;
}
示例7: initContent
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected Component initContent() {
// A vertical layout with undefined width
final VerticalLayout box = new VerticalLayout();
box.setSizeUndefined();
final ComboBox productSelect = new ComboBox();
productSelect.setInputPrompt("Выберите продукт...");
productSelect.setImmediate(true);
productSelect.setNullSelectionAllowed(false);
// Инициализация контейнера
final ExtaDbContainer<TProduct> clientsCont = new ExtaDbContainer<>(productCls);
clientsCont.addContainerFilter(new Compare.Equal("active", true));
clientsCont.sort(new Object[]{"name"}, new boolean[]{true});
// Устанавливаем контент выбора
productSelect.setFilteringMode(FilteringMode.CONTAINS);
productSelect.setContainerDataSource(clientsCont);
productSelect.setItemCaptionMode(ItemCaptionMode.PROPERTY);
productSelect.setItemCaptionPropertyId("name");
productSelect.addStyleName(ExtaTheme.COMBOBOX_BORDERLESS);
productSelect.setPropertyDataSource(getPropertyDataSource());
productSelect.addValueChangeListener(e -> setValue((TProduct) productSelect.getConvertedValue()));
// productSelect.setValue(getValue());
clientsCont.setSingleSelectConverter(productSelect);
productSelect.setWidth(100, Unit.PERCENTAGE);
box.addComponent(productSelect);
// The layout shrinks to fit this label
final Label label = new Label(getFieldTextLabel());
label.addStyleName("ea-widthfittin-label");
label.setWidthUndefined();
label.setHeight("0px"); // Hide: Could be 0px
box.addComponent(label);
addValueChangeListener(e -> label.setValue(getFieldTextLabel()));
return box;
}
示例8: buildOverviewTab
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private void buildOverviewTab()
{
final SMMultiColumnFormLayout<Raffle> overviewForm = new SMMultiColumnFormLayout<Raffle>(1, this.fieldGroup);
overviewForm.setColumnFieldWidth(0, 300);
overviewForm.setSizeFull();
overviewForm.bindTextField("Name", Raffle_.name);
overviewForm.bindTextAreaField("Notes", Raffle_.notes, 6);
overviewForm.bindDateField("Start Date", Raffle_.startDate, "yyyy/MM/dd", Resolution.DAY);
overviewForm.bindDateField("Collect By Date", Raffle_.collectionsDate, "yyyy/MM/dd", Resolution.DAY)
.setDescription("The date the raffle ticksets need to be collected by.");
overviewForm.bindDateField("Return Date", Raffle_.returnDate, "yyyy/MM/dd", Resolution.DAY)
.setDescription("The date the raffle ticksets need to be returned to Branch.");
final FormHelper<Raffle> formHelper = overviewForm.getFormHelper();
final ComboBox groupRaffleManager = formHelper.new EntityFieldBuilder<Contact>()
.setLabel("Group Raffle Manager").setField(Raffle_.groupRaffleManager)
.setListFieldName(Contact_.fullname).build();
groupRaffleManager.setFilteringMode(FilteringMode.CONTAINS);
groupRaffleManager.setTextInputAllowed(true);
groupRaffleManager.setDescription("The Group member responsible for organising the Raffle.");
final ComboBox branchRaffleConact = formHelper.new EntityFieldBuilder<Contact>()
.setLabel("Branch Raffle Contact").setField(Raffle_.branchRaffleContact)
.setListFieldName(Contact_.fullname).build();
branchRaffleConact.setFilteringMode(FilteringMode.CONTAINS);
branchRaffleConact.setTextInputAllowed(true);
branchRaffleConact.setDescription("The Branch person who is a main contact for Raffle issues.");
overviewForm.bindTextField("Book No. Prefix", Raffle_.raffleNoPrefix)
.setDescription("If raffle books have a non-numeric prefix for the ticket no's enter it here.");
overviewForm.bindTextField("Tickets per Book", Raffle_.ticketsPerBook);
overviewForm.bindTextField("Total Tickets Sold", Raffle_.totalTicketsSold).setReadOnly(true);
overviewForm.bindTextField("Tickets Outstanding", Raffle_.ticketsOutstanding).setReadOnly(true);
overviewForm.bindTextField("Sales Price per Ticket", Raffle_.salePricePerTicket)
.setDescription("The amount each ticket is to be sold for.");
overviewForm.bindTextField("Revenue Target", Raffle_.revenueTarget)
.setDescription("The amount the Group is aiming to raise via the Raffle.");
overviewForm.bindTextField("Revenue Raised", Raffle_.revenueRaised).setReadOnly(true);
this.tabs.addTab(overviewForm, "Raffle");
}
示例9: buildNewRaffleLayout
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
AbstractLayout buildNewRaffleLayout(final ValidatingFieldGroup<Raffle> fieldGroup)
{
final SMMultiColumnFormLayout<Raffle> overviewForm = new SMMultiColumnFormLayout<Raffle>(1, fieldGroup);
overviewForm.setColumnFieldWidth(0, 300);
overviewForm.setSizeFull();
overviewForm.bindTextField("Name", Raffle_.name);
overviewForm.bindTextAreaField("Notes", Raffle_.notes, 6);
overviewForm.bindDateField("Start Date", Raffle_.startDate, "yyyy/MM/dd", Resolution.DAY);
overviewForm.bindDateField("Collect By Date", Raffle_.collectionsDate, "yyyy/MM/dd", Resolution.DAY)
.setDescription("The date the raffle ticksets need to be collected by.");
overviewForm.bindDateField("Return Date", Raffle_.returnDate, "yyyy/MM/dd", Resolution.DAY).setDescription(
"The date the raffle ticksets need to be returned to Branch.");
final FormHelper<Raffle> formHelper = overviewForm.getFormHelper();
final ComboBox groupRaffleManager = formHelper.new EntityFieldBuilder<Contact>()
.setLabel("Group Raffle Manager").setField(Raffle_.groupRaffleManager)
.setListFieldName(Contact_.fullname).build();
groupRaffleManager.setFilteringMode(FilteringMode.CONTAINS);
groupRaffleManager.setTextInputAllowed(true);
groupRaffleManager.setDescription("The Group member responsible for organising the Raffle.");
final ComboBox branchRaffleConact = formHelper.new EntityFieldBuilder<Contact>()
.setLabel("Branch Raffle Contact").setField(Raffle_.branchRaffleContact)
.setListFieldName(Contact_.fullname).build();
branchRaffleConact.setFilteringMode(FilteringMode.CONTAINS);
branchRaffleConact.setTextInputAllowed(true);
branchRaffleConact.setDescription("The Branch person who is a main contact for Raffle issues.");
overviewForm.bindTextField("Book No. Prefix", Raffle_.raffleNoPrefix).setDescription(
"If raffle books have a non-numeric prefix for the ticket no's enter it here.");
overviewForm.bindTextField("Tickets per Book", Raffle_.ticketsPerBook);
overviewForm.bindTextField("Total Tickets Sold", Raffle_.totalTicketsSold).setReadOnly(true);
overviewForm.bindTextField("Tickets Outstanding", Raffle_.ticketsOutstanding).setReadOnly(true);
overviewForm.bindTextField("Sales Price per Ticket", Raffle_.salePricePerTicket).setDescription(
"The amount each ticket is to be sold for.");
overviewForm.bindTextField("Revenue Target", Raffle_.revenueTarget).setDescription(
"The amount the Group is aiming to raise via the Raffle.");
overviewForm.bindTextField("Revenue Raised", Raffle_.revenueRaised).setReadOnly(true);
return overviewForm;
}
示例10: buildEditor
import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected Component buildEditor(final ValidatingFieldGroup<RaffleBook> fieldGroup2)
{
final MultiColumnFormLayout<RaffleBook> overviewForm = new MultiColumnFormLayout<RaffleBook>(1, this.fieldGroup);
overviewForm.setColumnFieldWidth(0, 240);
overviewForm.setColumnLabelWidth(0, 110);
overviewForm.setSizeFull();
final FormHelper<RaffleBook> formHelper = overviewForm.getFormHelper();
overviewForm.bindTextField("Ticket Count", RaffleBook_.ticketCount);
overviewForm.bindTextField("First No.", RaffleBook_.firstNo);
this.allocatedTo = formHelper.new EntityFieldBuilder<Contact>().setLabel("Allocated To")
.setField(new Path(RaffleBook_.raffleAllocation, RaffleAllocation_.allocatedTo).getName())
.setListFieldName(Contact_.fullname).setListClass(Contact.class).build();
this.allocatedTo.setFilteringMode(FilteringMode.CONTAINS);
this.allocatedTo.setTextInputAllowed(true);
this.allocatedTo.setNullSelectionAllowed(true);
this.allocatedTo.setDescription("The person the book has been allocated to.");
// you can't edit the allocation.
this.allocatedTo.setReadOnly(true);
overviewForm.bindTextField("Tickets Returned?", RaffleBook_.ticketsReturned).setDescription(
"The no. of tickets that have been returned.");
overviewForm.bindTextField("Amount Returned?", RaffleBook_.amountReturned).setDescription(
"The amount of money returned for this book.");
overviewForm.bindDateField("Date Returned", RaffleBook_.dateReturned, "yyyy-MM-dd", Resolution.DAY)
.setDescription("The date the money and tickets for this book were returned");
final ComboBox collectedBy = formHelper.new EntityFieldBuilder<Contact>().setLabel("Collected By")
.setField(RaffleBook_.collectedBy).setListFieldName(Contact_.fullname).build();
collectedBy.setFilteringMode(FilteringMode.CONTAINS);
collectedBy.setTextInputAllowed(true);
collectedBy.setDescription("The leader that collected the ticket stubs and money.");
overviewForm.bindBooleanField("Receipt Issued?", RaffleBook_.receiptIssued).setDescription(
"Has a receipt been issued for the return of this book?");
overviewForm.bindTextAreaField("Notes", RaffleBook_.notes, 6);
return overviewForm;
}