01: package net.sourceforge.squirrel_sql.fw.datasetviewer;
02:
03: /*
04: * Copyright (C) 2001-2002 Colin Bell
05: * colbell@users.sourceforge.net
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: */
21:
22: /**
23: * This is represents a <TT>IDataSetViewerDestination</TT> that doesn't
24: * actually display the data, it simply stores it for future use.
25: *
26: * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
27: */
28: public interface IDataSetModel extends IDataSetViewer {
29: /**
30: * Get the column definitions.
31: *
32: * @return Column definitions.
33: */
34: ColumnDisplayDefinition[] getColumnDefinitions();
35:
36: /**
37: * Return number of rows in model.
38: *
39: * @return Number of rows.
40: */
41: int getRowCount();
42:
43: /**
44: * Return the data value for the specified cell.
45: *
46: * @param rowIndex The row whose value is being retrieved.
47: * @param columnIndex The column whose value is being retrieved.
48: *
49: * @return the data value for the specified cell.
50: */
51: Object getValueAt(int rowIndex, int columnIndex);
52:
53: /**
54: * Set the data value for the specified cell.
55: *
56: * @param value The new value for the cell.
57: * @param rowIndex The row whose value is being set.
58: * @param columnIndex The column whose value is being set.
59: *
60: * @throws IllegalStateException
61: * if <TT>IDataSetModel</TT> hasn't been specified.
62: */
63: void setValueAt(Object value, int rowIndex, int columnIndex);
64:
65: /**
66: * Adds a listener for events in this model.
67: *
68: * @param lis <TT>DataSetModelListener</TT> that will be
69: * notified when events occur in this model.
70: */
71: void addListener(IDataSetModelListener lis);
72:
73: /**
74: * Removes an event listener fromthis model.
75: *
76: * @param lis <TT>DataSetModelListener</TT> to be removed.
77: */
78: void removeListener(IDataSetModelListener lis);
79: }
|