1 /* $Id: SSCellEditing.java,v 1.6 2005/02/04 22:48:52 yoda2 Exp $ 2 * 3 * Tab Spacing = 4 4 * 5 * Copyright (c) 2003-2005, The Pangburn Company and Prasanth R. Pasala 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions are met: 10 * 11 * Redistributions of source code must retain the above copyright notice, this 12 * list of conditions and the following disclaimer. Redistributions in binary 13 * form must reproduce the above copyright notice, this list of conditions and 14 * the following disclaimer in the documentation and/or other materials 15 * provided with the distribution. The names of its contributors may not be 16 * used to endorse or promote products derived from this software without 17 * specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 * 31 */ 32 33 package com.nqadmin.swingSet; 34 35 /** 36 * SSCellEditing.java 37 *<p> 38 * SwingSet - Open Toolkit For Making Swing Controls Database-Aware 39 *<p><pre> 40 * The SSCellEditing interface specifies the methods the SSTableModel will use to 41 * determine whether or not a given cell can be edited or if a user-specified 42 * value for a cell is valid or invalid. 43 *</pre><p> 44 * @author $Author: yoda2 $ 45 * @version $Revision: 1.6 $ 46 */ 47 public interface SSCellEditing { 48 49 /** 50 * Returns true if the cell at row _row and at column _column is editable else 51 * false. 52 * 53 * SSTableModel first looks in to uneditable columns, if the column is not 54 * in the uneditable columns list then this function is called (If SSCellEditing 55 * is implemented). 56 * 57 * @param _row the row to which the cell belongs. 58 * @param _column the column to which the cell belongs. 59 * 60 * @return returns true is the cell is editable else false. 61 */ 62 public boolean isCellEditable(int _row, int _column); 63 64 /** 65 * This function is called when ever a update to a cell is done but before 66 * the value is updated in the database.<BR> 67 * If the function returns false the update is cancelled, if it returns true 68 * the value will be updated in the database.<BR> 69 * 70 * @param _row the row in which update is taking place. 71 * @param _column the column at which update is taking place. 72 * @param _oldValue the present value in the cell being edited. 73 * @param _newValue the new value entered in the cell being edited. 74 * 75 * @return returns true if update should be made else false. 76 */ 77 public boolean cellUpdateRequested(int _row, int _column, Object _oldValue, Object _newValue); 78 79 } // end public interface SSCellEditing { 80 81 82 83 /* 84 * $Log: SSCellEditing.java,v $ 85 * Revision 1.6 2005/02/04 22:48:52 yoda2 86 * API cleanup & updated Copyright info. 87 * 88 * Revision 1.5 2004/11/11 14:45:33 yoda2 89 * Using TextPad, converted all tabs to "soft" tabs comprised of four actual spaces. 90 * 91 * Revision 1.4 2004/08/10 22:06:59 yoda2 92 * Added/edited JavaDoc, made code layout more uniform across classes, made various small coding improvements suggested by PMD. 93 * 94 * Revision 1.3 2004/03/08 16:43:37 prasanth 95 * Updated copyright year. 96 * 97 * Revision 1.2 2003/12/18 20:12:40 prasanth 98 * Update class description. 99 * 100 * Revision 1.1 2003/12/16 18:02:47 prasanth 101 * Initial version. 102 * 103 */