1 17 package org.alfresco.web.ui.common.component.data; 18 19 import java.util.List ; 20 21 import org.alfresco.web.data.QuickSort; 22 23 26 public class GridListDataModel implements IGridDataModel 27 { 28 33 public GridListDataModel(List data) 34 { 35 this.data = data; 36 } 37 38 45 public Object getRow(int index) 46 { 47 return this.data.get(index); 48 } 49 50 55 public int size() 56 { 57 return this.data.size(); 58 } 59 60 67 public void sort(String column, boolean descending, String mode) 68 { 69 try 70 { 71 QuickSort sorter = new QuickSort(this.data, column, !descending, mode); 72 sorter.sort(); 73 } 74 catch (Exception err) 75 { 76 throw new RuntimeException ("Failed to sort data: " + err.getMessage(), err); 77 } 78 } 79 80 private List data = null; 81 } 82 | Popular Tags |