All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.xma.mdl.paging.IPagingWM Maven / Gradle / Ivy

The newest version!
/*******************************************************************************
 * Copyright (c) 2003, 2010 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

// @(#) $Id:  $
package at.spardat.xma.mdl.paging;

import at.spardat.xma.mdl.table.ITableWM;
/**
 * Interface defining the part of the paging model which is available on server and client side.
 * All this data is automatically synchronized between client and server. So you can let the user
 * modify this data using the GUI and query it on the server for loading the required slice of the
 * data objects to show in the corresponding table.
 *
 * @author gub
 * @since 2.3.0
 */
public interface IPagingWM {
    /**
     * Returns the index of the first data object to show in the result list.
     */
    public int getOffset();

    /**
     * Sets the index of the first data object to show in the result list.
     * It is the job of the {@link PagingListener} to actually change the data
     * in the attached table.
     */
    public void setOffset(int offset);

    /**
     * Returns the number of data objects to show at the same time. Default is 100.
     * The user can change the page size on the UI if the flag {@link PagingControlClient#SHOW_PAGESIZE}
     * is set.
     */
    public short getPageSize();

    /**
     * Sets the number of data objects to show at the same time.
     */
    public void setPageSize(short pageSize);

    /**
     * Returns the maximum pageSize the user can choose. Default is 1000.
     */
    public short getMaxPageSize();

    /**
     * Sets the maximum pageSize the user can choose. This is only relevant if
     * the flag {@link PagingControlClient#SHOW_PAGESIZE} is set.
     */
    public void setMaxPageSize(short maxPageSize);

    /**
     * Returns the total number of data objects in the complete complete query result,
     * or Integer.MAX_VALUE if unknown. This means the number of data sets without paging.
     */
    public int getResultSize();

    /**
     * Sets the total number of data objects in the query result. You should set this value, if it
     * is easy to determine from the database with low performance overhead. If you do not provide
     * this value, the paging model will try to determine it from the table if it is filled with less
     * data than specified in {@link #getPageSize()}.
     */
    public void setResultSize(int resultSize);

    /**
     * Returns the number of pages to jump forward or back when the user presses the fastNext or fastBack button.
     */
    public short getJumpSize();

    /**
     * Sets the number of pages to jump forward or back when the user presses the fastNext or fastBack button.
     */
    public void setJumpSize(short jumpSize);

    /**
     * Get the index of the column to sort. If the table contains only one page of the data,
     * it makes not much sense to sort just this page. Instead the whole data should be sorted
     * before the slice to show is cut out.
     */
    public short getSortingColumn();

    /**
     * Set the index of the column to sort.
     */
    public void setSortingColumn(short sortingColumn);

    /**
     * Get if sorting should be ascending or descending.
     */
    public boolean getAscending();

    /**
     * Sets if sorting should be ascending or descending.
     */
    public void setAscending(boolean ascending);

    /**
     * Returns the table this IPagingWM is attached to.
     */
    public ITableWM getTable();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy