You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/02/07 19:18:31 UTC
svn commit: r619541 -
/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModel.java
Author: hlship
Date: Thu Feb 7 10:18:27 2008
New Revision: 619541
URL: http://svn.apache.org/viewvc?rev=619541&view=rev
Log:
TAPESTRY-2081: It should be possible to override a Grid column header as easily as overriding a Grid cell
Added:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModel.java
- copied, changed from r617192, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModelProvider.java
Copied: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModel.java (from r617192, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModelProvider.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModel.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModel.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModelProvider.java&r1=617192&r2=619541&rev=619541&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModelProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridModel.java Thu Feb 7 10:18:27 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,9 +19,10 @@
/**
* A provider of model data to the sub-components of the {@link Grid} component. The primary
- * implementor of this component is the Grid component itself.
+ * implementor of this component is the Grid component itself. In addition, provides access
+ * to properties used to control paging and sort order.
*/
-public interface GridModelProvider
+public interface GridModel
{
/**
* Returns the data model, which defines the columns (in terms of properties of the row type),
@@ -33,4 +34,27 @@
* Returns the source for the data to be presented in the Grid.
*/
GridDataSource getDataSource();
+
+ /**
+ * Indicates the current sort column.
+ *
+ * @return current sort column, or null for no column
+ */
+ String getSortColumnId();
+
+ /**
+ * Indicates if soft is ascending or descending
+ *
+ * @return sort ascending flag
+ */
+ boolean isSortAscending();
+
+ /**
+ * Updates the column sort. When the columnId matches the current sort column, the
+ * ascending/descending flag is toggled. Otherwise, the specified column becomes
+ * the sort column, and sort mode is switched to ascending.
+ *
+ * @param columnId property id of column to sort on
+ */
+ void updateSort(String columnId);
}