com.sas.table
Interface TableNavigationV2Interface

All Superinterfaces:
TableNavigationInterface
All Known Implementing Classes:
BaseDataBean

public interface TableNavigationV2Interface
extends TableNavigationInterface

Defines an interface that adds to the TableNavigationInterface, which is used for navigating through a table. Implementations of the TableNavigationV2Interface can add support for various commit levels, the ability to page through the table in larger increments, and a simple means for cancelling or refreshing data.

The following table is the recommended implementation for commit level behavior.  Some implementations support cell level updates, and these implementations will have distinctions between row and cell level commits.  Also, the isModified method should be used to determine when data is "dirty".  This can be used to determine whether an autocommit is necessary.  It can also be used to throw exceptions or deliver a warning to users who may lose changes that have been made.

COMMITLEVEL_NONE COMMITLEVEL_ROW COMMITLEVEL_CELL
first, last, next, previous, move, insert, pageForward, pageBackWard No Yes Yes
cancel No No No
refresh No Yes Yes
commit Yes Yes Yes

The com.sas.models.databean.BaseDataBean class is one class that implements this interface.

Since:
2.0
See Also:
TableNavigationInterface

Field Summary
static int COMMITLEVEL_CELL
          Automatically commit cells
static int COMMITLEVEL_NONE
          Do not automatically commit
static int COMMITLEVEL_ROW
          Automatically commit rows
static int DEFAULT_PAGESIZE
          Default amount to move when paging through records
 
Method Summary
 boolean cancel()
          Cancels any changes to the current row of the table.
 int getAutoCommitLevel()
          Gets the the level at which the data will be committed.
 int getPageSize()
          Gets the number of records in a page.
 java.lang.Exception getStatusException()
          Gets a status exception.
 boolean isCancelSupported()
          Determines whether the cancel method can be called.
 boolean isPageBackwardSupported()
          Determines whether the pageBackward method can be called.
 boolean isPageForwardSupported()
          Determines whether the pageForward method can be called.
 boolean isRefreshSupported()
          Determines whether the refresh method can be called.
 boolean pageBackward()
          Moves the cursor backward one page, which is determined by pageAmount.
 boolean pageForward()
          Moves the cursor forward one page, which is determined by pageAmount.
 boolean refresh()
          Refreshes the data in the table.
 void setAutoCommitLevel(int autoCommitLevel)
          Sets the level at which data will be committed.
 void setPageSize(int pageSize)
          Sets the number of records in a page.
 
Methods inherited from interface com.sas.table.TableNavigationInterface
commit, delete, first, insert, isCommitSupported, isCursorValid, isDeleteSupported, isFirstSupported, isInsertSupported, isLastSupported, isModified, isNextSupported, isPreviousSupported, last, move, next, previous
 

Field Detail

DEFAULT_PAGESIZE

static final int DEFAULT_PAGESIZE
Default amount to move when paging through records

See Also:
Constant Field Values

COMMITLEVEL_NONE

static final int COMMITLEVEL_NONE
Do not automatically commit

See Also:
Constant Field Values

COMMITLEVEL_ROW

static final int COMMITLEVEL_ROW
Automatically commit rows

See Also:
Constant Field Values

COMMITLEVEL_CELL

static final int COMMITLEVEL_CELL
Automatically commit cells

See Also:
Constant Field Values
Method Detail

cancel

boolean cancel()

Cancels any changes to the current row of the table. This includes any updates or inserting a new row into the table.

Returns:
true if the row was cancelled

refresh

boolean refresh()

Refreshes the data in the table.

Returns:
true if the data was refreshed

pageForward

boolean pageForward()

Moves the cursor forward one page, which is determined by pageAmount.

Returns:
true if the cursor was positioned on the next page

pageBackward

boolean pageBackward()

Moves the cursor backward one page, which is determined by pageAmount.

Returns:
true if the cursor was positioned on the previous page

setPageSize

void setPageSize(int pageSize)

Sets the number of records in a page. To be used when paging forward or backward.

Parameters:
pageSize - Number of records in a page.

getPageSize

int getPageSize()

Gets the number of records in a page. To be used when paging forward or backward.

Returns:
the number of records in a page.

setAutoCommitLevel

void setAutoCommitLevel(int autoCommitLevel)

Sets the level at which data will be committed. Valid values are COMMITLEVEL_NONE, COMMITLEVEL_ROW, and COMMITLEVEL_CELL. COMMITLEVEL_NONE is the default.

Parameters:
autoCommitLevel - Level at which the data will be committed.

getAutoCommitLevel

int getAutoCommitLevel()

Gets the the level at which the data will be committed. Valid values are COMMITLEVEL_NONE, COMMITLEVEL_ROW, and COMMITLEVEL_CELL. COMMITLEVEL_NONE is the default.

Returns:
the level at which the data will be committed.

getStatusException

java.lang.Exception getStatusException()

Gets a status exception. Many methods on the TableNavigationInterface and TableNaviationV2Interface return false rather than throwing an exception when a method fails. The statusException can be used to communicate a more detail explanation for the failure and this method gets that value.

Returns:
a description for the last error that has occurred

isCancelSupported

boolean isCancelSupported()

Determines whether the cancel method can be called.

Returns:
true is the cancel method can be called

isRefreshSupported

boolean isRefreshSupported()

Determines whether the refresh method can be called.

Returns:
true is the refresh method can be called

isPageForwardSupported

boolean isPageForwardSupported()

Determines whether the pageForward method can be called.

Returns:
true is the pageForward method can be called

isPageBackwardSupported

boolean isPageBackwardSupported()

Determines whether the pageBackward method can be called.

Returns:
true is the pageBackward method can be called



Copyright © 2009 SAS Institute Inc. All Rights Reserved.