本文整理汇总了Java中com.haulmont.cuba.gui.data.CollectionDatasource.SupportsPaging方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionDatasource.SupportsPaging方法的具体用法?Java CollectionDatasource.SupportsPaging怎么用?Java CollectionDatasource.SupportsPaging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.data.CollectionDatasource
的用法示例。
在下文中一共展示了CollectionDatasource.SupportsPaging方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNextClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onNextClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
int firstResult = ds.getFirstResult();
ds.setFirstResult(ds.getFirstResult() + ds.getMaxResults());
refreshDatasource(ds);
if (state == State.LAST && size == 0) {
ds.setFirstResult(firstResult);
int maxResults = ds.getMaxResults();
ds.setMaxResults(maxResults + 1);
refreshDatasource(ds);
ds.setMaxResults(maxResults);
}
if (owner instanceof WebAbstractTable) {
com.vaadin.ui.Table vTable = (com.vaadin.ui.Table) ((WebAbstractTable) owner).getComponent();
vTable.setCurrentPageFirstItemIndex(0);
}
}
示例2: onLastClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onLastClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
int count = ((CollectionDatasource.SupportsPaging) datasource).getCount();
int itemsToDisplay = count % ds.getMaxResults();
if (itemsToDisplay == 0) itemsToDisplay = ds.getMaxResults();
ds.setFirstResult(count - itemsToDisplay);
refreshDatasource(ds);
if (owner instanceof WebAbstractTable) {
com.vaadin.ui.Table vTable = (com.vaadin.ui.Table) ((WebAbstractTable) owner).getComponent();
vTable.setCurrentPageFirstItemIndex(0);
}
}
示例3: onNextClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
private void onNextClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
int firstResult = ds.getFirstResult();
ds.setFirstResult(ds.getFirstResult() + ds.getMaxResults());
refreshDatasource(ds);
if (state == State.LAST && size == 0) {
ds.setFirstResult(firstResult);
int maxResults = ds.getMaxResults();
ds.setMaxResults(maxResults + 1);
refreshDatasource(ds);
ds.setMaxResults(maxResults);
}
if (owner instanceof DesktopAbstractTable) {
JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
table.scrollRowToVisible(0);
}
}
示例4: onLastClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onLastClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
int count = ((CollectionDatasource.SupportsPaging) datasource).getCount();
int itemsToDisplay = count % ds.getMaxResults();
if (itemsToDisplay == 0) itemsToDisplay = ds.getMaxResults();
ds.setFirstResult(count - itemsToDisplay);
refreshDatasource(ds);
if (owner instanceof DesktopAbstractTable) {
JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
table.scrollRowToVisible(0);
}
}
示例5: onPrevClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onPrevClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
int newStart = ds.getFirstResult() - ds.getMaxResults();
ds.setFirstResult(newStart < 0 ? 0 : newStart);
refreshDatasource(ds);
if (owner instanceof WebAbstractTable) {
com.vaadin.ui.Table vTable = (com.vaadin.ui.Table) ((WebAbstractTable) owner).getComponent();
vTable.setCurrentPageFirstItemIndex(0);
}
}
示例6: onFirstClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onFirstClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
ds.setFirstResult(0);
refreshDatasource(ds);
if (owner instanceof WebAbstractTable) {
com.vaadin.ui.Table vTable = (com.vaadin.ui.Table) ((WebAbstractTable) owner).getComponent();
vTable.setCurrentPageFirstItemIndex(0);
}
}
示例7: refreshDatasource
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void refreshDatasource(CollectionDatasource.SupportsPaging ds) {
refreshing = true;
try {
ds.refresh();
} finally {
refreshing = false;
}
}
示例8: onLinkClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onLinkClick() {
if (datasource == null || !(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
int count = ((CollectionDatasource.SupportsPaging) datasource).getCount();
component.getCountButton().setCaption(String.valueOf(count));
component.getCountButton().addStyleName("c-paging-count-number");
component.getCountButton().setEnabled(false);
}
示例9: onLinkClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
private void onLinkClick() {
if (datasource == null || !(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
int count = ((CollectionDatasource.SupportsPaging) datasource).getCount();
impl.getCountButton().setText(String.valueOf(count));
}
示例10: onPrevClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
private void onPrevClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
int newStart = ds.getFirstResult() - ds.getMaxResults();
ds.setFirstResult(newStart < 0 ? 0 : newStart);
refreshDatasource(ds);
if (owner instanceof DesktopAbstractTable) {
JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
table.scrollRowToVisible(0);
}
}
示例11: onFirstClick
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void onFirstClick() {
if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
return;
}
CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
ds.setFirstResult(0);
refreshDatasource(ds);
if (owner instanceof DesktopAbstractTable) {
JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
table.scrollRowToVisible(0);
}
}
示例12: refreshDatasource
import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
private void refreshDatasource(CollectionDatasource.SupportsPaging ds) {
refreshing = true;
try {
ds.refresh();
} finally {
refreshing = false;
}
}