net.sourceforge.squirrel_sql.plugins.smarttools
Class SmarttoolsHelper

java.lang.Object
  extended by net.sourceforge.squirrel_sql.plugins.smarttools.SmarttoolsHelper

public class SmarttoolsHelper
extends Object


Field Summary
static String CR
           
 
Method Summary
static int checkColumnData(Statement stmt, String sql)
          Check the columns data and returns found record number
static int convertStringToIntDef(String string, int defaultValue)
          Get the parsed string as int or defaultValue if an exception occured
static void fillOperatorTypes(JComboBox cbOperator, int usedGroup)
          Filled the given JComboBox with operator values
static String getDataTypeForDisplay(TableColumnInfo tableColumnInfo)
          Returns the readable data type for the given tableColumnInfo
static List<STDataType> getListSmarttoolsDataType(boolean withGroupNull)
          Get s list of jdbc datatypes and names in SmarttoolsDataTypes
static int getRowCount(Statement stmt, String tableName)
          Returns the row count of the given table
static boolean isDataTypeDate(int dataType)
          Returns true if dataType is a valid date data type
static boolean isDataTypeInt(int dataType)
          Returns true if dataType is a valid int data type
static boolean isDataTypeNumeric(int dataType)
          Returns true if dataType is a valid numeric data type
static boolean isDataTypeString(int dataType)
          Returns true if dataType is a valid string data type
static ImageIcon loadIcon(String imageIconName)
          Load an icon image with iconName from the sub package images to package of class FirebirdManagerPlugin
static void markAllRows(JTable tbl, int col, boolean mark)
          Mark or demark all rows in column col of table tbl
static void printTable(JTable table, String headerText, String footerText)
          Print the content of the given table
static void setColumnWidth(JTable table, int[] colWidth)
          Set the widths for the columns of table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CR

public static final String CR
Method Detail

loadIcon

public static ImageIcon loadIcon(String imageIconName)
Load an icon image with iconName from the sub package images to package of class FirebirdManagerPlugin

Parameters:
imageIconName - filename of the icon image
Returns:
ImageIcon or null

convertStringToIntDef

public static int convertStringToIntDef(String string,
                                        int defaultValue)
Get the parsed string as int or defaultValue if an exception occured

Parameters:
string - string to convert
defaultValue - default value which will be returned on an exception
Returns:
converted string or defaultValue

printTable

public static void printTable(JTable table,
                              String headerText,
                              String footerText)
Print the content of the given table

Parameters:
table - tables content to print
headerText - header text for output page
footerText - footer text for output page

getListSmarttoolsDataType

public static List<STDataType> getListSmarttoolsDataType(boolean withGroupNull)
Get s list of jdbc datatypes and names in SmarttoolsDataTypes

Returns:
jdbc datatypes and names

fillOperatorTypes

public static void fillOperatorTypes(JComboBox cbOperator,
                                     int usedGroup)
Filled the given JComboBox with operator values

Parameters:
cbOperator - JComboBox to fill
usedGroup - data type group (@see STDataType)

isDataTypeString

public static boolean isDataTypeString(int dataType)
Returns true if dataType is a valid string data type

Parameters:
dataType - data type to check
Returns:
true/false

isDataTypeInt

public static boolean isDataTypeInt(int dataType)
Returns true if dataType is a valid int data type

Parameters:
dataType - data type to check
Returns:
true/false

isDataTypeNumeric

public static boolean isDataTypeNumeric(int dataType)
Returns true if dataType is a valid numeric data type

Parameters:
dataType - data type to check
Returns:
true/false

isDataTypeDate

public static boolean isDataTypeDate(int dataType)
Returns true if dataType is a valid date data type

Parameters:
dataType - data type to check
Returns:
true/false

getDataTypeForDisplay

public static String getDataTypeForDisplay(TableColumnInfo tableColumnInfo)
Returns the readable data type for the given tableColumnInfo

Parameters:
tableColumnInfo - data to generate the readable data type info
Returns:
readable data type info

checkColumnData

public static int checkColumnData(Statement stmt,
                                  String sql)
                           throws SQLException
Check the columns data and returns found record number

Parameters:
stmt - Statement to execute query
sql - SQL-Statement for executeQuery
Returns:
number of found records
Throws:
SQLException - SQLException

markAllRows

public static void markAllRows(JTable tbl,
                               int col,
                               boolean mark)
Mark or demark all rows in column col of table tbl

Parameters:
tbl - JTable
col - column to mark or demark
mark - true=mark; false=demark

setColumnWidth

public static void setColumnWidth(JTable table,
                                  int[] colWidth)
Set the widths for the columns of table

Parameters:
table - table to set the column width
colWidth - array with the new column width

getRowCount

public static int getRowCount(Statement stmt,
                              String tableName)
                       throws SQLException
Returns the row count of the given table

Parameters:
stmt - Statement for sql
tableName - table to check
Returns:
row count
Throws:
SQLException - SQLException


Copyright © 2001-2011. All Rights Reserved.