ariba.ui.table
Class AWTDisplayGroup

java.lang.Object
  extended by ariba.ui.table.AWTDisplayGroup

public final class AWTDisplayGroup
extends Object


Nested Class Summary
static interface AWTDisplayGroup.Grouper
           
static class AWTDisplayGroup.GroupingState
          use this type to mark grouping rows, tell if they're expanded, ...
static class AWTDisplayGroup.InitialExpandType
           
 
Field Summary
 int _scrollTopOffset
           
static int GroupingDefaultAllOpen
           
static int GroupingDefaultClosed
           
static int GroupingDefaultFirstOpen
           
static int GroupingDefaultFitBatch
          dynamically choose open all, or close all
 
Constructor Summary
AWTDisplayGroup()
          Constructor and misc
 
Method Summary
 void _setItemToForceVisible(Object rootItem, Object leafItem)
           
 void _setNumberOfObjectsPerBatch(int size)
           
 List allObjects()
           
static Object[] arrayFromOrderedList(Object list)
          TODO: move to ListUtil or ArrayUtil.
 int batchCount()
           
 int batchEndIndex()
           
 int batchStartIndex()
          This is the index of the top row of the batch.
 boolean bufferSelectionEdits()
           
 void centerBatchOnRow(int desiredScrollTopIndex)
          Doesn't quite center the batch on the row, more like 33% above, 66% below.
 void checkDataSource()
           
 void checkObjectArray(Object list)
          Check if our objectArray is out of sync.
As side effect, if the object array has changed, remember the list as the new value.
 void clearSelection()
           
 List computeSortedObjects(List objects)
           
 int currentBatchIndex()
           
 boolean currentDetailExpanded()
           
 boolean currentGroupingExpanded()
           
 AWTDisplayGroup.GroupingState currentGroupingState()
           
 Object currentItem()
           
 Map currentItemExtras()
          This is a useful bag for storing state associated with a row.
 int currentItemGroupingCount()
           
 boolean currentSelectedState()
          Selected / Selection Methods
 AWTDataSource dataSource()
          FIXME: stub implementations...
 AWTDisplayGroup.InitialExpandType detailInitialExpansionType()
           
 boolean detailRowAutoCollapse()
           
 List displayedObjects()
          Use with care -- causes array to get created.
 void displayNextBatch()
           
 void displayPreviousBatch()
           
 List effectiveSortOrderings()
          This returns the concatenation of the primarySortOrdering and sortOrderings.
 Map extrasForItem(Object item)
           
 void fetch()
           
 List filteredObjects()
          Will generate Null Pointer Exception if setObjectArray(java.util.List)() has not been called yet.
 void flushSelectionEdits()
           
 boolean forceCurrentItemVisibleLatch()
           
 int groupingExpansionDefault()
           
 String groupingKey()
           
 AWTDisplayGroup.GroupingState groupingState(Object row)
           
 boolean hasMultipleBatches()
           
 void hibernate()
           
 Object insert()
           
 Object insert(boolean autoAdd)
           
 boolean isCurrentItemGrouping()
           
 boolean isCurrentItemVisible()
           
 boolean isGroupingExpanded(Object row)
           
 boolean isGroupingRow(Object row)
           
 boolean isResetScrollTop()
           
static boolean listsIdentical(List l1, List l2)
          TODO: move to ListUtil.
 int numberOfDisplayedObjects()
           
 int numberOfObjectsPerBatch()
           
static boolean orderedListArrayMatch(Object list, Object[] array)
          TODO: move to ListUtil or ArrayUtil.
static AWTSortOrdering orderingMatchingKey(List list, String key)
           
 OutlineState outlineState()
           
 AWTPivotState pivotState()
           
 List primarySortOrderings()
           
 int scrollBottomCount()
           
 int scrollTopCount()
          Accessors for AWTScrollTableWrapper for scroll faulting
 int scrollTopIndex()
          The scrollTopIndex is the index of the top row that is currently displayed.
 Object selectedObject()
          the first of the selectedObjects that is part of the displayedObjects
 List selectedObjects()
          the "source of truth" on the selection
 void selectNext()
           
 void selectPrevious()
           
 void setBatchStartIndex(int index)
          This accepts any value.
 void setBufferSelectionEdits(boolean yn)
           
 void setCurrentBatchIndex(int num)
           
 void setCurrentGroupingExpanded(boolean expanded)
           
 void setCurrentItem(Object item)
          Item / Current Item Methods
 void setCurrentSelectedState(boolean state)
           
 void setDataSource(AWTDataSource dataSource)
           
 void setDetailInitialExpansionType(AWTDisplayGroup.InitialExpandType detailInitialExpansionType)
           
 void setDetailRowAutoCollapse(boolean detailRowAutoCollapse)
           
 void setGroupingExpanded(Object row, boolean expanded)
           
 void setGroupingExpansionDefault(int value)
           
 void setGroupingKey(String keyPathString)
           
 void setGroupSortOrdering(AWTSortOrdering ordering)
           
 void setItemListener(AWTDataTable.Column listener)
          Tell us about a column that needs to hear about changes to the current item.
A display group will inform a single column about changes to the current item via callbacks to AWTDataTable.Column.setCurrentItem()
 void setItemToForceVisible(Object item)
           
 void setNumberOfObjectsPerBatch(int size)
           
 void setObjectArray(List allObjects)
          Caching and misc methods
 void setOutlineAllObjects(List list)
          Called by OutlineRepetition with the unrolled set of objects.
 void setOutlineState(OutlineState state)
           
 void setPathToForceVisible(List path)
           
 void setPrimarySortOrderings(List sortOrderings)
          these can be set as a baseline (unalterable by the user) pre-sort
 void setScrollBatchSize(int size)
           
 int setScrollTopIndex(int index)
          See setScrollTopIndex(int, boolean)().
 int setScrollTopIndex(int index, boolean forceUpdateBatchStartIndex)
          This sets and validates the scroll top index.
 void setSelectedObject(Object object)
          Selection manipulation.
 void setSelectedObjects(List selection)
           
 void setSortOrderings(List sortOrderings)
          Sorting -- these are set interactively by the user of the table
 void setUseBatching(boolean yn)
          the useBatching() property determines whether displayedObjects() is a subarray of the whole array, or whether it's a the entire array (and the client is just rendering the subset of items from batchStartIndex() to batchEndIndex().
 List sortedChildList(List objects)
           
 List sortedMainList(List objects)
           
 List sortOrderings()
           
static Object subarray(Object array, int startIndex, int stopIndex)
          TODO: move to ArrayUtil.
 void toggleCurrentDetailExpanded()
           
 void updateDisplayedObjects()
           
 boolean useBatching()
           
static List vectorFromOrderedList(Object list)
          TODO: move to ListUtil.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GroupingDefaultClosed

public static final int GroupingDefaultClosed
See Also:
Constant Field Values

GroupingDefaultAllOpen

public static final int GroupingDefaultAllOpen
See Also:
Constant Field Values

GroupingDefaultFirstOpen

public static final int GroupingDefaultFirstOpen
See Also:
Constant Field Values

GroupingDefaultFitBatch

public static final int GroupingDefaultFitBatch
dynamically choose open all, or close all

See Also:
Constant Field Values

_scrollTopOffset

public int _scrollTopOffset
Constructor Detail

AWTDisplayGroup

public AWTDisplayGroup()
Constructor and misc

Method Detail

setItemListener

public void setItemListener(AWTDataTable.Column listener)
Tell us about a column that needs to hear about changes to the current item.
A display group will inform a single column about changes to the current item via callbacks to AWTDataTable.Column.setCurrentItem()

Parameters:
listener - the column that is told about current items

pivotState

public AWTPivotState pivotState()

setObjectArray

public void setObjectArray(List allObjects)
Caching and misc methods


isResetScrollTop

public boolean isResetScrollTop()

vectorFromOrderedList

public static List vectorFromOrderedList(Object list)
TODO: move to ListUtil.

Parameters:
list -
Returns:

arrayFromOrderedList

public static Object[] arrayFromOrderedList(Object list)
TODO: move to ListUtil or ArrayUtil.

Parameters:
list -
Returns:

orderedListArrayMatch

public static boolean orderedListArrayMatch(Object list,
                                            Object[] array)
TODO: move to ListUtil or ArrayUtil.

Parameters:
list -
Returns:

checkObjectArray

public void checkObjectArray(Object list)
Check if our objectArray is out of sync.
As side effect, if the object array has changed, remember the list as the new value.

Parameters:
list - The new object array

checkDataSource

public void checkDataSource()

hibernate

public void hibernate()

allObjects

public List allObjects()

effectiveSortOrderings

public List effectiveSortOrderings()
This returns the concatenation of the primarySortOrdering and sortOrderings.


orderingMatchingKey

public static AWTSortOrdering orderingMatchingKey(List list,
                                                  String key)

computeSortedObjects

public List computeSortedObjects(List objects)

filteredObjects

public List filteredObjects()
Will generate Null Pointer Exception if setObjectArray(java.util.List)() has not been called yet.

Returns:

sortedMainList

public List sortedMainList(List objects)

sortedChildList

public List sortedChildList(List objects)

listsIdentical

public static boolean listsIdentical(List l1,
                                     List l2)
TODO: move to ListUtil.

Parameters:
l1 -
l2 -
Returns:

setOutlineAllObjects

public void setOutlineAllObjects(List list)
Called by OutlineRepetition with the unrolled set of objects. For the purpose of batching, etc we need to treat this as the full displayed set.


groupingExpansionDefault

public int groupingExpansionDefault()

setGroupingExpansionDefault

public void setGroupingExpansionDefault(int value)

currentGroupingState

public AWTDisplayGroup.GroupingState currentGroupingState()

groupingState

public AWTDisplayGroup.GroupingState groupingState(Object row)

isGroupingRow

public boolean isGroupingRow(Object row)

isCurrentItemGrouping

public boolean isCurrentItemGrouping()

isGroupingExpanded

public boolean isGroupingExpanded(Object row)

setGroupingExpanded

public void setGroupingExpanded(Object row,
                                boolean expanded)

setGroupSortOrdering

public void setGroupSortOrdering(AWTSortOrdering ordering)

setGroupingKey

public void setGroupingKey(String keyPathString)

groupingKey

public String groupingKey()

currentGroupingExpanded

public boolean currentGroupingExpanded()

currentItemGroupingCount

public int currentItemGroupingCount()

isCurrentItemVisible

public boolean isCurrentItemVisible()

setCurrentGroupingExpanded

public void setCurrentGroupingExpanded(boolean expanded)

detailInitialExpansionType

public AWTDisplayGroup.InitialExpandType detailInitialExpansionType()

setDetailInitialExpansionType

public void setDetailInitialExpansionType(AWTDisplayGroup.InitialExpandType detailInitialExpansionType)

detailRowAutoCollapse

public boolean detailRowAutoCollapse()

setDetailRowAutoCollapse

public void setDetailRowAutoCollapse(boolean detailRowAutoCollapse)

currentDetailExpanded

public boolean currentDetailExpanded()

toggleCurrentDetailExpanded

public void toggleCurrentDetailExpanded()

displayedObjects

public List displayedObjects()
Use with care -- causes array to get created. This is the list of objects that will be displayed between batchStartIndex() and batchEndIndex(). Clients rendering are best using filteredObjects() directly with AWFor set to use.

See Also:
setUseBatching(boolean)

outlineState

public OutlineState outlineState()

setOutlineState

public void setOutlineState(OutlineState state)

updateDisplayedObjects

public void updateDisplayedObjects()

setCurrentItem

public void setCurrentItem(Object item)
Item / Current Item Methods


currentItem

public Object currentItem()

_setItemToForceVisible

public void _setItemToForceVisible(Object rootItem,
                                   Object leafItem)

setItemToForceVisible

public void setItemToForceVisible(Object item)

setPathToForceVisible

public void setPathToForceVisible(List path)

forceCurrentItemVisibleLatch

public boolean forceCurrentItemVisibleLatch()

extrasForItem

public Map extrasForItem(Object item)

currentItemExtras

public Map currentItemExtras()
This is a useful bag for storing state associated with a row.


currentSelectedState

public boolean currentSelectedState()
Selected / Selection Methods


bufferSelectionEdits

public boolean bufferSelectionEdits()

setBufferSelectionEdits

public void setBufferSelectionEdits(boolean yn)

flushSelectionEdits

public void flushSelectionEdits()

setCurrentSelectedState

public void setCurrentSelectedState(boolean state)

selectedObjects

public List selectedObjects()
the "source of truth" on the selection


setSelectedObjects

public void setSelectedObjects(List selection)

selectedObject

public Object selectedObject()
the first of the selectedObjects that is part of the displayedObjects


setSelectedObject

public void setSelectedObject(Object object)
Selection manipulation. These will push the visible batch to include the first selected object.


selectNext

public void selectNext()

selectPrevious

public void selectPrevious()

clearSelection

public void clearSelection()

setUseBatching

public void setUseBatching(boolean yn)
the useBatching() property determines whether displayedObjects() is a subarray of the whole array, or whether it's a the entire array (and the client is just rendering the subset of items from batchStartIndex() to batchEndIndex().


useBatching

public boolean useBatching()

setBatchStartIndex

public void setBatchStartIndex(int index)
This accepts any value.

Parameters:
index - This accepts any integer and edits it to a valid value.
See Also:
batchStartIndex()

batchStartIndex

public int batchStartIndex()
This is the index of the top row of the batch.

Returns:

batchEndIndex

public int batchEndIndex()

numberOfDisplayedObjects

public int numberOfDisplayedObjects()

_setNumberOfObjectsPerBatch

public void _setNumberOfObjectsPerBatch(int size)

setNumberOfObjectsPerBatch

public void setNumberOfObjectsPerBatch(int size)

setScrollBatchSize

public void setScrollBatchSize(int size)

numberOfObjectsPerBatch

public int numberOfObjectsPerBatch()

batchCount

public int batchCount()

hasMultipleBatches

public boolean hasMultipleBatches()

currentBatchIndex

public int currentBatchIndex()

setCurrentBatchIndex

public void setCurrentBatchIndex(int num)

displayNextBatch

public void displayNextBatch()

displayPreviousBatch

public void displayPreviousBatch()

scrollTopCount

public int scrollTopCount()
Accessors for AWTScrollTableWrapper for scroll faulting


scrollBottomCount

public int scrollBottomCount()

centerBatchOnRow

public void centerBatchOnRow(int desiredScrollTopIndex)
Doesn't quite center the batch on the row, more like 33% above, 66% below. Will adjust the input value to validity.

Parameters:
desiredScrollTopIndex - The row index to move the batch to.
See Also:
setUseBatching(boolean), scrollTopIndex()

scrollTopIndex

public int scrollTopIndex()
The scrollTopIndex is the index of the top row that is currently displayed.

Returns:
The scrollTopIndex

setScrollTopIndex

public int setScrollTopIndex(int index)
See setScrollTopIndex(int, boolean)().

Parameters:
index -
Returns:

setScrollTopIndex

public int setScrollTopIndex(int index,
                             boolean forceUpdateBatchStartIndex)
This sets and validates the scroll top index.

Parameters:
index - the new value, can be any int
forceUpdateBatchStartIndex - force an update of the internal batching data.
Returns:
the new (possibly modified) scroll top index.
See Also:
scrollTopIndex()

subarray

public static Object subarray(Object array,
                              int startIndex,
                              int stopIndex)
TODO: move to ArrayUtil.

Parameters:
array -
startIndex -
stopIndex -
Returns:

setSortOrderings

public void setSortOrderings(List sortOrderings)
Sorting -- these are set interactively by the user of the table


sortOrderings

public List sortOrderings()

setPrimarySortOrderings

public void setPrimarySortOrderings(List sortOrderings)
these can be set as a baseline (unalterable by the user) pre-sort


primarySortOrderings

public List primarySortOrderings()

dataSource

public AWTDataSource dataSource()
FIXME: stub implementations...


setDataSource

public void setDataSource(AWTDataSource dataSource)

fetch

public void fetch()

insert

public Object insert()

insert

public Object insert(boolean autoAdd)


AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.