Java Doc for IDataTypeComponent.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » fw » datasetviewer » cellcomponent » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent

All known Subclasses:   net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeUnknown,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeFloat,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeTimestamp,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeBinary,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeByte,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeDouble,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeInteger,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeJavaObject,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeBigDecimal,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeBlob,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeOther,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeShort,  net.sourceforge.squirrel_sql.plugins.oracle.types.OracleXmlTypeDataTypeComponent,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeLong,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeString,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeTime,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeBoolean,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeClob,  net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeDate,
IDataTypeComponent
public interface IDataTypeComponent (Code)

author:
   gwg
author:
   These are the calls needed to support the various ways of displaying and
author:
   editing data for each data type.




Method Summary
public  booleanareEqual(Object obj1, Object obj2)
     Determine if two objects of this data type contain the same value.
public  booleancanDoFileIO()
     Say whether or not object can be exported to and imported from a file.
public  voidexportObject(FileOutputStream outStream, String text)
     Read a file and construct a valid object from its contents.
public  StringgetClassName()
     Return the name of the Java class used to store this data type in the application.
public  ObjectgetDefaultValue(String dbDefaultValue)
     Get a default value for the table used to input data for a new row to be inserted into the DB.
public  JTextAreagetJTextArea(Object value)
     Get the JTextArea component for this data type to be used in the CellPopupDialog and fill in the initial value in the appropriate representation.
public  JTextFieldgetJTextField()
     Get the JTextField component for this data type to be used in a CellEditor.
public  StringgetWhereClauseValue(Object value, ISQLDatabaseMetaData md)
     When updating the database, generate a string form of this object value that can be used in the WHERE clause to match the value in the database. A return value of null means that this column cannot be used in the WHERE clause, while a return of "null" (or "is null", etc) means that the column can be used in the WHERE clause and the value is actually a null value.
public  StringimportObject(FileInputStream inStream)
     Read a file and construct a valid object from its contents.
public  booleanisEditableInCell(Object originalValue)
     Returns true if data type may be edited within a table cell, false if not.
public  booleanisEditableInPopup(Object originalValue)
     Returns true if data type may be edited in the popup, false if not.
public  booleanneedToReRead(Object originalValue)
     See if a value in a column has been limited in some way and needs to be re-read before being used for editing.
public  ObjectreadResultSet(ResultSet rs, int index, boolean limitDataRead)
     On input from the DB, read the data from the ResultSet into the appropriate type of object to be stored in the table cell.
public  StringrenderObject(Object object)
     Convert the given object into its printable String value for use in Text output and the in-cell representations (CellRenderer and CellEditor).
public  voidsetColumnDisplayDefinition(ColumnDisplayDefinition def)
     Sets the display definition of the Column being operated upon.
public  voidsetPreparedStatementValue(PreparedStatement pstmt, Object value, int position)
     When updating the database, insert the appropriate datatype into the prepared statment at the given variable position.
public  voidsetTable(JTable table)
     Sets the JTable of which holds data rendered by this DataTypeComponent.
public  booleanuseBinaryEditingPanel()
     If true, this tells the PopupEditableIOPanel to use the binary editing panel rather than a pure text panel.
public  ObjectvalidateAndConvert(String value, Object originalValue, StringBuffer messageBuffer)
     Validate that the contents of a cell is in the right form for this data type and convert that text into an object of the correct (Java) type for the column Ideally this should be a static function, but the mechanics of using CellComponentFactory and the constraints of the Java language make that difficult.
public  ObjectvalidateAndConvertInPopup(String value, Object originalValue, StringBuffer messageBuffer)
     Validate that the contents of a cell is in the right form for this data type and convert that text into an object of the correct (Java) type for the column Ideally this should be a static function, but the mechanics of using CellComponentFactory and the constraints of the Java language make that difficult.



Method Detail
areEqual
public boolean areEqual(Object obj1, Object obj2)(Code)
Determine if two objects of this data type contain the same value. Neither of the objects is null.



canDoFileIO
public boolean canDoFileIO()(Code)
Say whether or not object can be exported to and imported from a file. We put both export and import together in one test on the assumption that all conversions can be done both ways.



exportObject
public void exportObject(FileOutputStream outStream, String text) throws IOException(Code)
Read a file and construct a valid object from its contents. Errors are returned by throwing an IOException containing the cause of the problem as its message.

DataType is responsible for validating that the given text text from a Popup JTextArea can be converted to an object. This text-to-object conversion is the same as validateAndConvertInPopup, which may be used internally by the object to do the validation.

The DataType object must flush and close the output stream before returning. Typically it will create another object (e.g. an OutputWriter), and that is the object that must be flushed and closed.




getClassName
public String getClassName()(Code)
Return the name of the Java class used to store this data type in the application.



getDefaultValue
public Object getDefaultValue(String dbDefaultValue)(Code)
Get a default value for the table used to input data for a new row to be inserted into the DB.



getJTextArea
public JTextArea getJTextArea(Object value)(Code)
Get the JTextArea component for this data type to be used in the CellPopupDialog and fill in the initial value in the appropriate representation. That representation may be the same as is renderObject(), or it may be different (e.g. a BLOB may have renderObject=>"" but fill in the actual value in the Popup TextArea).



getJTextField
public JTextField getJTextField()(Code)
Get the JTextField component for this data type to be used in a CellEditor. The value of the text field is set by the JTable mechanism using the same mechanism as the renderer. The Assumption here is that the CellEditor uses the same string representation as the CellRenderer.



getWhereClauseValue
public String getWhereClauseValue(Object value, ISQLDatabaseMetaData md)(Code)
When updating the database, generate a string form of this object value that can be used in the WHERE clause to match the value in the database. A return value of null means that this column cannot be used in the WHERE clause, while a return of "null" (or "is null", etc) means that the column can be used in the WHERE clause and the value is actually a null value. This function must also include the column label so that its output is of the form: "columnName = value" or "columnName is null" or whatever is appropriate for this column in the database.



importObject
public String importObject(FileInputStream inStream) throws IOException(Code)
Read a file and construct a valid object from its contents. Errors are returned by throwing an IOException containing the cause of the problem as its message.

DataType is responsible for validating that the imported data can be converted to an object, and then must return a text string that can be used in the Popup window text area. This object-to-text conversion is the same as is done by the DataType object internally in the getJTextArea() method.




isEditableInCell
public boolean isEditableInCell(Object originalValue)(Code)
Returns true if data type may be edited within a table cell, false if not.



isEditableInPopup
public boolean isEditableInPopup(Object originalValue)(Code)
Returns true if data type may be edited in the popup, false if not.



needToReRead
public boolean needToReRead(Object originalValue)(Code)
See if a value in a column has been limited in some way and needs to be re-read before being used for editing. For read-only tables this may actually return true since we want to be able to view the entire contents of the cell even if it was not completely loaded during the initial table setup.



readResultSet
public Object readResultSet(ResultSet rs, int index, boolean limitDataRead) throws java.sql.SQLException(Code)
On input from the DB, read the data from the ResultSet into the appropriate type of object to be stored in the table cell.



renderObject
public String renderObject(Object object)(Code)
Convert the given object into its printable String value for use in Text output and the in-cell representations (CellRenderer and CellEditor).



setColumnDisplayDefinition
public void setColumnDisplayDefinition(ColumnDisplayDefinition def)(Code)
Sets the display definition of the Column being operated upon.
Parameters:
  def - the ColumnDisplayDefinition that describes the column in the db table.



setPreparedStatementValue
public void setPreparedStatementValue(PreparedStatement pstmt, Object value, int position) throws java.sql.SQLException(Code)
When updating the database, insert the appropriate datatype into the prepared statment at the given variable position.



setTable
public void setTable(JTable table)(Code)
Sets the JTable of which holds data rendered by this DataTypeComponent.
Parameters:
  table - a JTable component



useBinaryEditingPanel
public boolean useBinaryEditingPanel()(Code)
If true, this tells the PopupEditableIOPanel to use the binary editing panel rather than a pure text panel. The binary editing panel assumes the data is an array of bytes, converts it into text form, allows the user to change how that data is displayed (e.g. Hex, Decimal, etc.), and converts the data back from text to bytes when the user editing is completed. If this returns false, this DataType class must convert the internal data into a text string that can be displayed (and edited, if allowed) in a TextField or TextArea, and must handle all user key strokes related to editing of that data.



validateAndConvert
public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer)(Code)
Validate that the contents of a cell is in the right form for this data type and convert that text into an object of the correct (Java) type for the column Ideally this should be a static function, but the mechanics of using CellComponentFactory and the constraints of the Java language make that difficult.



validateAndConvertInPopup
public Object validateAndConvertInPopup(String value, Object originalValue, StringBuffer messageBuffer)(Code)
Validate that the contents of a cell is in the right form for this data type and convert that text into an object of the correct (Java) type for the column Ideally this should be a static function, but the mechanics of using CellComponentFactory and the constraints of the Java language make that difficult.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.