|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BaseDataTypeComponent
net.sourceforge.squirrel_sql.plugins.derby.types.DerbyClobDataTypeComponent
public class DerbyClobDataTypeComponent
The components returned from this class extend RestorableJTextField and RestorableJTextArea for use in editing table cells that contain values of this data type. It provides the special behavior for null handling and resetting the cell to the original value.
| Field Summary |
|---|
| Fields inherited from class net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BaseDataTypeComponent |
|---|
_beepHelper, _colDef, _table, _textArea, _textField, NULL_VALUE_PATTERN |
| Constructor Summary | |
|---|---|
DerbyClobDataTypeComponent()
Default Constructor |
|
| Method Summary | |
|---|---|
boolean |
areEqual(Object obj1,
Object obj2)
Determine if two objects of this data type contain the same value. |
boolean |
canDoFileIO()
Can always do File I/O with Derby clobs. |
void |
exportObject(FileOutputStream outStream,
String text)
Construct an appropriate external representation of the object and write it to a file. |
String |
getClassName()
Return the name of the java class used to hold this data type. |
Object |
getDefaultValue(String dbDefaultValue)
Get a default value for the table used to input data for a new row to be inserted into the DB. |
JTextArea |
getJTextArea(Object value)
|
JTextField |
getJTextField()
Return a JTextField usable in a CellEditor. |
protected KeyListener |
getKeyListener(IRestorableTextComponent component)
If any custom key handling behavior is required, this can be set by sub-class implementations |
static boolean |
getReadCompleteClob()
Used to provide manual override in cases where we are exporting data. |
IWhereClausePart |
getWhereClauseValue(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. |
String |
importObject(FileInputStream inStream)
Read a file and construct a valid object from its contents. |
boolean |
isEditableInCell(Object originalValue)
This Data Type can be edited in a table cell. |
boolean |
isEditableInPopup(Object originalValue)
Returns true if data type may be edited in the popup, false if not. |
boolean |
needToReRead(Object originalValue)
Derby doesn't support using a Clob descriptor after the transaction that read it is closed. |
Object |
readResultSet(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. |
String |
renderObject(Object value)
Render a value into text for this DataType. |
void |
setColumnDisplayDefinition(ColumnDisplayDefinition def)
|
void |
setPreparedStatementValue(PreparedStatement pstmt,
Object value,
int position)
When updating the database, insert the appropriate datatype into the prepared statment at the given variable position. |
static void |
setReadCompleteClob(boolean val)
Used to provide manual override in cases where we are exporting data. |
static Object |
staticReadResultSet(ResultSet rs,
int index)
Derby does not allow to read a Clob, end the transaction, then attempt to get it's contents later. |
boolean |
useBinaryEditingPanel()
If true, this tells the PopupEditableIOPanel to use the binary editing panel rather than a pure text panel. |
Object |
validateAndConvert(String value,
Object originalValue,
StringBuffer messageBuffer)
Implement the interface for validating and converting to internal object. |
Object |
validateAndConvertInPopup(String value,
Object originalValue,
StringBuffer messageBuffer)
|
| Methods inherited from class net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BaseDataTypeComponent |
|---|
setBeepHelper, setTable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent |
|---|
setBeepHelper, setTable |
| Constructor Detail |
|---|
public DerbyClobDataTypeComponent()
| Method Detail |
|---|
public String getClassName()
getClassName in interface IDataTypeComponentgetClassName in class BaseDataTypeComponentpublic static boolean getReadCompleteClob()
public static void setReadCompleteClob(boolean val)
val - the new value of _readCompleteClob
public boolean areEqual(Object obj1,
Object obj2)
areEqual in interface IDataTypeComponentareEqual in class BaseDataTypeComponentpublic String renderObject(Object value)
renderObject in interface IDataTypeComponentrenderObject in class BaseDataTypeComponentpublic boolean isEditableInCell(Object originalValue)
If the data includes newlines, the user must not be allowed to edit it in the cell because the CellEditor uses a JTextField which filters out newlines. If we try to use anything other than a JTextField, or use a JTextField with no newline filtering, the text is not visible in the cell, so the user cannot even read the text, much less edit it. The simplest solution is to allow editing of multi-line text only in the Popup window.
isEditableInCell in interface IDataTypeComponentpublic boolean needToReRead(Object originalValue)
needToReRead in interface IDataTypeComponentpublic void setColumnDisplayDefinition(ColumnDisplayDefinition def)
setColumnDisplayDefinition in interface IDataTypeComponentsetColumnDisplayDefinition in class BaseDataTypeComponentBaseDataTypeComponent.setColumnDisplayDefinition(net.sourceforge.squirrel_sql.fw.datasetviewer.ColumnDisplayDefinition)
public Object validateAndConvert(String value,
Object originalValue,
StringBuffer messageBuffer)
validateAndConvert in interface IDataTypeComponentvalidateAndConvert in class BaseDataTypeComponentpublic boolean useBinaryEditingPanel()
useBinaryEditingPanel in interface IDataTypeComponentpublic boolean isEditableInPopup(Object originalValue)
isEditableInPopup in interface IDataTypeComponent
public Object validateAndConvertInPopup(String value,
Object originalValue,
StringBuffer messageBuffer)
validateAndConvertInPopup in interface IDataTypeComponentvalidateAndConvertInPopup in class BaseDataTypeComponentBaseDataTypeComponent.validateAndConvertInPopup(java.lang.String, java.lang.Object, java.lang.StringBuffer)protected KeyListener getKeyListener(IRestorableTextComponent component)
getKeyListener in class BaseDataTypeComponentpublic JTextField getJTextField()
getJTextField in interface IDataTypeComponentgetJTextField in class BaseDataTypeComponentpublic JTextArea getJTextArea(Object value)
getJTextArea in interface IDataTypeComponentgetJTextArea in class BaseDataTypeComponent
public Object readResultSet(ResultSet rs,
int index,
boolean limitDataRead)
throws SQLException
readResultSet in interface IDataTypeComponentSQLException
public static Object staticReadResultSet(ResultSet rs,
int index)
throws SQLException
rs - index -
SQLException
public IWhereClausePart getWhereClauseValue(Object value,
ISQLDatabaseMetaData md)
getWhereClauseValue in interface IDataTypeComponentgetWhereClauseValue in class BaseDataTypeComponent
public void setPreparedStatementValue(PreparedStatement pstmt,
Object value,
int position)
throws SQLException
setPreparedStatementValue in interface IDataTypeComponentSQLExceptionpublic Object getDefaultValue(String dbDefaultValue)
getDefaultValue in interface IDataTypeComponentpublic boolean canDoFileIO()
canDoFileIO in interface IDataTypeComponentIDataTypeComponent.canDoFileIO()
public String importObject(FileInputStream inStream)
throws IOException
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.
File is assumed to be and ASCII string of digits representing a value of this data type.
importObject in interface IDataTypeComponentimportObject in class BaseDataTypeComponentIOException
public void exportObject(FileOutputStream outStream,
String text)
throws IOException
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.
File is assumed to be and ASCII string of digits representing a value of this data type.
exportObject in interface IDataTypeComponentexportObject in class BaseDataTypeComponentIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||