01: /*
02: * Copyright (C) 2003 Gerd Wagner
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License
06: * as published by the Free Software Foundation; either version 2
07: * of the License, or any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: */
18: package net.sourceforge.squirrel_sql.plugins.codecompletion;
19:
20: import java.sql.Types;
21:
22: public class CodeCompletionColumnInfo extends CodeCompletionInfo {
23: private String _columnName;
24: private String _columnType;
25: private int _columnSize;
26: private boolean _nullable;
27:
28: private String _toString;
29: private int _decimalDigits;
30:
31: public CodeCompletionColumnInfo(String columnName,
32: String columnType, int columnSize, int decimalDigits,
33: boolean nullable) {
34: _columnName = columnName;
35: _columnType = columnType;
36: _columnSize = columnSize;
37: _decimalDigits = decimalDigits;
38: _nullable = nullable;
39:
40: String decimalDigitsString = 0 == _decimalDigits ? "" : ","
41: + _decimalDigits;
42: _toString = _columnName + " " + _columnType + "("
43: + _columnSize + decimalDigitsString + ") "
44: + (_nullable ? "NULL" : "NOT NULL");
45: }
46:
47: public String getCompareString() {
48: return _columnName;
49: }
50:
51: public String toString() {
52: return _toString;
53: }
54: }
|