|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openswing.swing.table.client.OrderPolicy
Title: OpenSwing Framework
Description: Class used by grid control in order to sort columns in a custom way.
Default column sort algorithm can be changed by overriding compareAttributeValues
method.
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Constructor Summary | |
OrderPolicy()
|
Method Summary | |
void |
afterSorting(VOListTableModel model)
Callback method invoked by grid after internally sorting columns. |
int |
compareAttributeValues(java.lang.String attributeName,
java.lang.String sortVersus,
java.lang.Object val1,
java.lang.Object val2,
VOListTableModel model)
Callback method invoked by grid in order to sort the specified column: it can be overrided in order to define a custom sorting algorithm. |
int |
compareRow(VOListAdapter modelAdapter,
Grids grids,
VOListTableModel model,
ValueObject o1,
ValueObject o2)
Method invoked by Grid component in order to compare two rows of the same VOListModel. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OrderPolicy()
Method Detail |
public final int compareRow(VOListAdapter modelAdapter, Grids grids, VOListTableModel model, ValueObject o1, ValueObject o2)
modelAdapter
- TableModel adapter, used to link ValueObjects to TableModelgrids
- Grids grid componentmodel
- grid modelo1
- value object related to first rowo2
- value object related to second row
public int compareAttributeValues(java.lang.String attributeName, java.lang.String sortVersus, java.lang.Object val1, java.lang.Object val2, VOListTableModel model)
attributeName
- attribute name that identities the column to sortsortVersus
- sorting order; allowed values: Consts.ASC_SORTED,Consts.DESC_SORTED,Consts.NO_SORTEDval1
- first value to compareval2
- second value to comparemodel
- VOListModel grid model to sort
public void afterSorting(VOListTableModel model)
model
- VOListModel grid model just sorted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |