當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.Filterable方法代碼示例

本文整理匯總了Java中com.vaadin.data.Container.Filterable方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.Filterable方法的具體用法?Java Container.Filterable怎麽用?Java Container.Filterable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.data.Container的用法示例。


在下文中一共展示了Container.Filterable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FilterableGrid

import com.vaadin.data.Container; //導入方法依賴的package包/類
public FilterableGrid(String caption, Container.Indexed dataSource) {
    super(caption, dataSource);

    if (!(dataSource instanceof Container.Filterable)) {
        throw new IllegalArgumentException("Container must be Filterable");
    }

    setSelectionMode(Grid.SelectionMode.SINGLE);
    setSizeFull();
    setWidth("100%");
    setHeight("100%");

    makeSearchHeader(
            (Container.Filterable) dataSource,
            dataSource.getContainerPropertyIds(),
            searchFieldRow);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:18,代碼來源:FilterableGrid.java

示例2: applyFilterPattern

import com.vaadin.data.Container; //導入方法依賴的package包/類
protected SearchPattern
        applyFilterPattern(Class<?> propertyType,
                            Object propertyId,
                            Object objectPattern,
                            Container.Filterable filterableContainer) {

    // remove last applied filter from the container
    SearchPattern lastPattern = getLastAppliedSearchPattern();
    if (lastPattern != null) {
        filterableContainer.removeContainerFilter(lastPattern.getFilter());
    }

    // if the objectPattern is non-empty
    if (!isEmpty(objectPattern)) {

        SearchPattern newPattern = getPattern(objectPattern);

        filterableContainer.addContainerFilter(newPattern.getFilter());
        setLastAppliedSearchPattern(newPattern);
    }

    return lastPattern;
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:24,代碼來源:SearchPatternField.java

示例3: setValue

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Sets the new value to field, and applies the filter on the target container (if any).
 *
 * If the given value is null, then it only clears the filter on the container.
 */
@Override
public void setValue(T newValue) throws ReadOnlyException {
    super.setValue(newValue);
    if (newValue != null) {
        getBackingField().setValue(newValue);
        return;
    }
    getBackingField().setValue(null);

    SearchPattern lastPattern = getLastAppliedSearchPattern();
    setLastAppliedSearchPattern(null);
    if (lastPattern == null) return;
    Container.Filterable c = getTargetContainer();
    if (c != null) c.removeContainerFilter(lastPattern.getFilter());

}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:22,代碼來源:SearchPatternField.java

示例4: search

import com.vaadin.data.Container; //導入方法依賴的package包/類
private void search(final String searchRequest) {
    Container.Filterable container = (Container.Filterable) tree.getContainerDataSource();
    if (StringUtils.isBlank(searchRequest)) {
        container.removeContainerFilter(filter);
        filter = null;
    } else {
        if (filter != null) {
            container.removeContainerFilter(filter);
        }
        filter = new TreeSearchFilter(PROPERTY_CAPTION, searchRequest);
        container.addContainerFilter(filter);
        expandAll();
    }
}
 
開發者ID:cuba-platform,項目名稱:sampler,代碼行數:15,代碼來源:SamplerFoldersPane.java

示例5: isFiltered

import com.vaadin.data.Container; //導入方法依賴的package包/類
public boolean isFiltered(Container container) {
    if (container instanceof Container.Filterable) {
        Collection<Container.Filter> filters = ((Container.Filterable) container).getContainerFilters();
        return filters != null && !filters.isEmpty();
    }
    return false;
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:8,代碼來源:NavigationLabel.java

示例6: updateClearToFind

import com.vaadin.data.Container; //導入方法依賴的package包/類
private void updateClearToFind(Container container) {
    disable(btnFind);
    disable(btnClearToFind);
    // if it is filterable
    if (container instanceof Container.Filterable) {
        Container.Filterable filterable = (Container.Filterable) container;
        if (filterable.size() > 0 // and it contains values
                || !filterable.getContainerFilters().isEmpty()) { // when no filters have been applied
            enable(btnClearToFind);
        }

    }
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:14,代碼來源:FindButtonBar.java

示例7: setContainer

import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public void setContainer(Container.Ordered container) {

    this.container = container;
    this.currentItemId = null;
    if (container == null || container.size() == 0) disableNavigation();
    if (container instanceof Container.Filterable) enableFind();
    else disableFind();

    first();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:12,代碼來源:BasicDataNavigation.java

示例8: onFind

import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public void onFind(OnFind.Event event) {
    Container.Filterable container = (Container.Filterable)event.getSource().getContainer();
    container.removeAllContainerFilters();

    for (SearchPattern p : searchWindow.getSearchPatterns()) {
        container.addContainerFilter(p.getFilter());
    }

    event.getSource().first();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:12,代碼來源:SearchWindowFindListeners.java

示例9: makeSearchFields

import com.vaadin.data.Container; //導入方法依賴的package包/類
protected Map<Object, Field<?>> makeSearchFields(Container.Filterable container, Collection<?> visiblePropertyIds) {
    final Map<Object, Field<?>> localSearchFieldMap = new HashMap<>();
    for (Object propertyId : visiblePropertyIds) {
        localSearchFieldMap.put(propertyId, makeSearchField(propertyId, container));
    }
    return localSearchFieldMap;
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:8,代碼來源:FilterableGrid.java

示例10: createField

import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public SearchPatternField<?, ?> createField(Object propertyId, Class<?> propertyType, Container.Filterable container) {

    SearchPatternField f ;
    if (java.lang.Enum.class.isAssignableFrom(propertyType)) {
        f = new SearchPatternComboBox(propertyId, propertyType, container);
    } else {
        f = new SearchPatternTextField(propertyId, propertyType, container);
    }
    f.setCaption(DefaultFieldFactory.createCaptionByPropertyId(propertyId));
    return f;
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:13,代碼來源:DefaultSearchFieldFactory.java

示例11: SearchPatternComboBox

import com.vaadin.data.Container; //導入方法依賴的package包/類
public SearchPatternComboBox(Object propertyId,
                             Class<?> propertyType,
                             Container.Filterable targetContainer) {

    super(new ComboBox(), Object.class, propertyId, propertyType, targetContainer);

    setFieldDefaults(getBackingField());
    addDefaultBackingFieldListeners();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:10,代碼來源:SearchPatternComboBox.java

示例12: dismiss

import com.vaadin.data.Container; //導入方法依賴的package包/類
public void dismiss() {
    super.dismiss();
    Container c = getGrid().getContainerDataSource();
    if (c instanceof Container.Filterable) {
        ((Container.Filterable) c).removeAllContainerFilters();
    }
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:8,代碼來源:GridZoomDialog.java

示例13: enableFind

import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public void enableFind() {
    this.findEnabled = getContainer() instanceof Container.Filterable;
    getEventRouter().fireEvent(new FindEnabled.Event(this, findEnabled));
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:6,代碼來源:BasicDataNavigation.java

示例14: makeSearchHeader

import com.vaadin.data.Container; //導入方法依賴的package包/類
protected void makeSearchHeader(Container.Filterable container, Collection<?> visiblePropertyIds, HeaderRow filterRow) {
    final Map<Object,Field<?>> localFilterMap = makeSearchFields(container, visiblePropertyIds);
    prepareFilterHeader(visiblePropertyIds, localFilterMap, filterRow);

    setSearchFieldMap(localFilterMap);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:7,代碼來源:FilterableGrid.java

示例15: makeSearchField

import com.vaadin.data.Container; //導入方法依賴的package包/類
protected Field<?> makeSearchField(final Object propertyId, Container.Filterable container) {
    Class<?> type = container.getType(propertyId);
    return searchFieldFactory.createField(propertyId, type, container);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:5,代碼來源:FilterableGrid.java


注:本文中的com.vaadin.data.Container.Filterable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。