本文整理汇总了Java中org.vaadin.viritin.LazyList.PagingProvider方法的典型用法代码示例。如果您正苦于以下问题:Java LazyList.PagingProvider方法的具体用法?Java LazyList.PagingProvider怎么用?Java LazyList.PagingProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.vaadin.viritin.LazyList
的用法示例。
在下文中一共展示了LazyList.PagingProvider方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTestComponent
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
@Override
public Component getTestComponent() {
MGrid<Person> g = new MGrid<>(
new LazyList.PagingProvider<Person>() {
private static final long serialVersionUID = -9072230332041322210L;
@Override
public List<Person> findEntities(int firstRow) {
return Service.findAll(firstRow,
LazyList.DEFAULT_PAGE_SIZE);
}
},
new LazyList.CountProvider() {
private static final long serialVersionUID = -6915320247020779461L;
@Override
public int size() {
return (int) Service.count();
}
}
);
return g;
}
示例2: getTestComponent
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
@Override
public Component getTestComponent() {
MTable<Person> g = new MTable<>(
new LazyList.PagingProvider<Person>() {
private static final long serialVersionUID = -9072230332041322210L;
@Override
public List<Person> findEntities(int firstRow) {
return Service.findAll(firstRow,
LazyList.DEFAULT_PAGE_SIZE);
}
},
new LazyList.CountProvider() {
private static final long serialVersionUID = -6915320247020779461L;
@Override
public int size() {
return (int) Service.count();
}
}
);
return g;
}
示例3: loadFrom
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
/**
* Set a new strategies how to load options.
*
* @param filterablePagingProvider the paging provider that gives the actual
* options in pages
* @param filterableCountProvider the count provider to give the total about
* of options with current filter
* @param pageLength the length of the pages that component should use to
* access providers
*/
public void loadFrom(FilterablePagingProvider<T> filterablePagingProvider, FilterableCountProvider filterableCountProvider, int pageLength) {
this.fpp = filterablePagingProvider;
this.fcp = filterableCountProvider;
// Need to re-create the piggybackList & set container, some refactoring should be done here
piggybackLazyList = new LazyList<>(new LazyList.PagingProvider<T>() {
private static final long serialVersionUID = 1027614132444478021L;
@Override
public List<T> findEntities(int firstRow) {
return fpp.findEntities(firstRow,
getCurrentFilter());
}
},
new LazyList.CountProvider() {
private static final long serialVersionUID = -7339189124024626177L;
@Override
public int size() {
return fcp.size(getCurrentFilter());
}
}, pageLength);
setBic(new DummyFilterableListContainer<T>(getType(),
piggybackLazyList));
getSelect().setContainerDataSource(getBic());
}
示例4: getTestComponent
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
@Override
public Component getTestComponent() {
pagingProvider = new LazyList.PagingProvider<Person>() {
private static final long serialVersionUID = -9072230332041322210L;
@Override
public List<Person> findEntities(int firstRow) {
return Service.findByFirstName(firstNameFilter, firstRow,
LazyList.DEFAULT_PAGE_SIZE);
}
};
countProvider = new LazyList.CountProvider() {
private static final long serialVersionUID = -6915320247020779461L;
@Override
public int size() {
return (int) Service.countByFirstName(firstNameFilter);
}
};
MGrid<Person> g = new MGrid<>(Person.class)
.lazyLoadFrom(pagingProvider, countProvider);
Grid.HeaderRow filteringHeader = g.appendHeaderRow();
// Add new TextFields to each column which filters the data from
// that column
String columnId = "firstName";
TextField filter = new MTextField()
.withFullWidth().withStyleName(ValoTheme.TEXTFIELD_TINY)
.withInputPrompt("Filter");
filter.addTextChangeListener(event -> {
firstNameFilter = event.getText();
g.refreshRows();
});
filteringHeader.getCell(columnId).setComponent(filter);
filteringHeader.getCell(columnId).setStyleName("filter-header");
return g;
}
示例5: lazyLoadFrom
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
/**
* Makes the table lazy load its content with given strategy.
*
* @param pageProvider the interface via entities are fetched
* @param countProvider the interface via the count of items is detected
* @return this MTable object
*/
public MGrid<T> lazyLoadFrom(LazyList.PagingProvider<T> pageProvider,
LazyList.CountProvider countProvider) {
setRows(new LazyList<T>(pageProvider, countProvider, DEFAULT_PAGE_SIZE));
return this;
}
示例6: MGrid
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
/**
* A shorthand to create MGrid using LazyList. By default page size of
* LazyList.DEFAULT_PAGE_SIZE (30) is used.
*
* @param pageProvider the interface via entities are fetched
* @param countProvider the interface via the count of items is detected
*/
public MGrid(LazyList.PagingProvider<T> pageProvider,
LazyList.CountProvider countProvider) {
this(new LazyList<T>(pageProvider, countProvider, DEFAULT_PAGE_SIZE));
}
示例7: MTable
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
/**
* A shorthand to create MTable using LazyList. By default page size of
* LazyList.DEFAULT_PAGE_SIZE (30) is used.
*
* @param pageProvider the interface via entities are fetched
* @param countProvider the interface via the count of items is detected
*/
public MTable(LazyList.PagingProvider<T> pageProvider,
LazyList.CountProvider countProvider) {
this(new LazyList(pageProvider, countProvider, DEFAULT_PAGE_SIZE));
}
示例8: lazyLoadFrom
import org.vaadin.viritin.LazyList; //导入方法依赖的package包/类
/**
* Makes the table lazy load its content with given strategy.
*
* @param pageProvider the interface via entities are fetched
* @param countProvider the interface via the count of items is detected
* @return this MTable object
*/
public MTable<T> lazyLoadFrom(LazyList.PagingProvider<T> pageProvider,
LazyList.CountProvider countProvider) {
setBeans(new LazyList(pageProvider, countProvider, DEFAULT_PAGE_SIZE));
return this;
}