01: /*
02: * $Author$
03: * $Id$
04: * This is free software, as software should be; you can redistribute
05: * it and/or modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08:
09: * See LICENSE.txt for the full license covering this software/program/code.
10: */
11:
12: package util;
13:
14: import java.util.*;
15: import javax.swing.JTable;
16:
17: /**
18: * Utilities for jtables in sqlminus.
19: * @author rahul kumar <rahul_kumar@yahoo.com>
20: * @see isql/TableActions.java
21: */
22:
23: public class JTableUtil {
24:
25: public static void main(String args[]) {
26: }
27:
28: /** returns a list of selected columns, as names.
29: */
30: public static List getSelectedColumnNames(JTable jt) {
31: int cols[] = jt.getSelectedColumns();
32: List selcols = new ArrayList();
33: for (int i = 0; i < cols.length; i++) {
34: selcols.add(jt.getColumnName(cols[i]).trim());
35: }
36: return selcols;
37: }
38:
39: ////// START CONSTANTS AND CLASS LEVEL VARIABLES //////
40: static final String P = "JTableUtil"; // used in exception strings
41:
42: } // end of class
|