当前位置: 首页>>代码示例>>Java>>正文


Java CollectionDatasource.SupportsPaging方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:WebRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:WebRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:DesktopRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:DesktopRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:WebRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:WebRowsCount.java

示例7: refreshDatasource

import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
protected void refreshDatasource(CollectionDatasource.SupportsPaging ds) {
    refreshing = true;
    try {
        ds.refresh();
    } finally {
        refreshing = false;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:WebRowsCount.java

示例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);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:WebRowsCount.java

示例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));
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:DesktopRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:DesktopRowsCount.java

示例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);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:DesktopRowsCount.java

示例12: refreshDatasource

import com.haulmont.cuba.gui.data.CollectionDatasource; //导入方法依赖的package包/类
private void refreshDatasource(CollectionDatasource.SupportsPaging ds) {
    refreshing = true;
    try {
        ds.refresh();
    } finally {
        refreshing = false;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:DesktopRowsCount.java


注:本文中的com.haulmont.cuba.gui.data.CollectionDatasource.SupportsPaging方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。