1 /* 2 * Copyright (c) 2003-2008 by Cosylab d. d. 3 * 4 * This file is part of CosyBeans-Common. 5 * 6 * CosyBeans-Common is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * CosyBeans-Common is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with CosyBeans-Common. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 package com.cosylab.gui.components.table; 21 22 /** 23 * <code>ObjectTableEngine</code> is intermediator betwean arbitrary objects 24 * and <code>ObjectTableModel</code> structure. It converts objects to 25 * <code>TableRow</code>s and executes operations on rows. 26 * 27 * @author <a href="mailto:igor.kriznar@cosylab.com">Igor Kriznar</a> 28 */ 29 public interface ObjectTableEngine 30 { 31 /** 32 * Creates new row for key object. 33 * 34 * @param key key for which row is created 35 * 36 * @return new or recycled table row 37 */ 38 public TableRow getTableRow(Object key); 39 40 /** 41 * Signals to factory that row with associated key is no longer in use. 42 * 43 * @param key kay object for row 44 * @param row row to be released 45 */ 46 public void releaseTableRow(Object key, TableRow row); 47 48 /** 49 * Sets new value which resulted from user interaction with table to the 50 * context underlayng kay object. 51 * 52 * @param value new value as user has set with table editors 53 * @param key the key object 54 * @param row row associated with kay object 55 * @param columnIndex DOCUMENT ME! 56 */ 57 public void setValue(Object value, Object key, TableRow row, int columnIndex); 58 59 /** 60 * Returns name of column. Same order of columns must be used 61 * when construction rows. 62 * 63 * @return name of column, or <code>null</code> 64 */ 65 public String getColumnName(int index); 66 } 67 68 /* __oOo__ */