To change the display attributes,cell editors etc for each column of a JTable
use setColumnAttributes
method of symantec.itools.db.beans.binding.TableBindingModel.
Each ColumnAttributes object in the array can be customised.
Alternately use setColumnAttributes
of symantec.itools.db.beans.binding.DBColumnModel
and plug it into JTable. In this case editable property will be neglected.
JCurrencyTextField
A cell renderer is created based on the cell editor component.
Specific properties of specific cell editors and cell renderers are also
stored as attributes. For example, ATMMode, Currency symbol, decimal and
thousand's separator, etc in case of JCurrencyTextField.
Warning: serialized objects of this class will not be compatible with
future swing releases. The current serialization support is appropriate
for short term storage or RMI between Swing1.0 applications. It will
not be possible to load serialized Swing1.0 objects with future releases
of Swing. The JDK1.2 release of Swing will be the compatibility
baseline for the serialized form of Swing objects.
- Version:
- 1.0 09/10/98
- Author:
- Vasudev Rao
- See Also:
- TableColumnModel, DefaultTableColumnModel, TableBindingModel, DBColumnModel, JMaskedTextField, JCurrencyTextField
-
ATMMode
- JCurrencyTextField's ATMMode
-
background
- Background color for the table column.
-
cellEditor
- cellEditor.
-
cellEditorComponent
- cellEditorComponent.
-
cellRenderer
- cellRenderer.
-
cellRendererComponent
- cellRendererComponent.
-
clickCountToStart
- Click count to initiate editing of a table cell
-
currencyLeading
- JCurrencyTextField's currency symbol position
-
currencySymbol
- JCurrencyTextField's currencySymbol
-
decimalPoint
- JCurrencyTextField's decimalPoint
-
digitsAfterDecimal
- JCurrencyTextField's digitsAfterDecimal
-
editable
- Determines whether a column is editable.
-
editableCombo
- Determines whether combobox editor is editable.
-
editorDataBound
- Determines whether combobox editor is databound.
-
enforceDataCompleteness
- Defined for future use.
-
falseValue
- Used by checkbox editor and renderers which are internally created
Used to provide a means for using CheckBox when the cell value is
not truly boolean.
-
foreground
- Foreground color for the table column.
-
headerRenderer
- headerRenderer.
-
headerRendererComponent
- headerRendererComponent.
-
headerValue
- Header value which is used as header text
-
identifier
- Identifier for each table column
-
isResizable
- isResizable property of a table column
-
label
- Label for the checkbox editor and renderer.
-
lookup
- The string used to make combobox editor databound.
-
mask
- String that represents an input mask for JMaskedTextField.
-
maxWidth
- maxWidth property of a table column
-
minWidth
- minWidth property of a table column
-
modelIndex
- modelIndex property of a table column.
-
separator
- JCurrencyTextField's separator
-
separatorEnabled
- JCurrencyTextField's separator enabled property
-
shouldSelectCell
-
-
sizeWidthToFit
- Determines whether or not the column should be resized to fit
its header.
-
staticList
- String array used to create combobox editor's drop down list.
-
trueValue
- Used by checkbox editor and renderers which are internally created
Used to provide a means for using CheckBox when the cell value is
not truly boolean.
-
width
- width property of a table column.
-
symantec.itools.db.beans.binding.ColumnAttributes()
- Default constructor
-
symantec.itools.db.beans.binding.ColumnAttributes(TableCellEditor, TableCellRenderer, TableCellRenderer, Object, Object, boolean, int, int, int, int)
- Constructor that takes in all the TableColumn attributes as
parameters.
-
symantec.itools.db.beans.binding.ColumnAttributes(Object, Object, boolean, int, int, int, Color, Color, boolean, JTextField)
- Constructor used for generating code when JTextField is chosen as cell editor component type
-
symantec.itools.db.beans.binding.ColumnAttributes(Object, Object, boolean, int, int, int, Color, Color, boolean, JComboBox, boolean, String[])
- Constructor used for generating code when JComboBox is chosen as cell editor component type
with a list of strings as items in the drop-down
-
symantec.itools.db.beans.binding.ColumnAttributes(Object, Object, boolean, int, int, int, Color, Color, boolean, JComboBox, boolean, boolean, String)
- Constructor used for generating code when a database aware JComboBox is chosen
as cell editor component type
-
symantec.itools.db.beans.binding.ColumnAttributes(Object, Object, boolean, int, int, int, Color, Color, boolean, JCheckBox, String, String, String)
- Constructor used for generating code when JCheckBox is chosen as cell editor component
-
symantec.itools.db.beans.binding.ColumnAttributes(Object, Object, boolean, int, int, int, Color, Color, boolean, JMaskedTextField, String, boolean)
- Constructor used for generating code when JMaskedTextField is chosen as cell editor component
-
symantec.itools.db.beans.binding.ColumnAttributes(Object, Object, boolean, int, int, int, Color, Color, boolean, JCurrencyTextField, boolean, String, char, int, char, boolean, boolean)
- Constructor used for generating code when JCurrencyTextField is chosen as cell editor component
-
clone()
-
-
createCheckBoxEditor(JCheckBox)
-
-
createComboBoxEditor(JComboBox)
-
-
createCurrencyEditor(JCurrencyTextField)
-
-
createMaskedEditor(JMaskedTextField)
-
-
createTextEditor(JTextField)
-
-
getBackground()
- Returns the background color for this column.
-
getCellEditor()
- Returns the TableCellEditor.
-
getCellEditorComponent()
- Returns the cell editor component.
-
getCellRenderer()
- Returns the TableCellRenderer.
-
getClickCountToStart()
- Returns the number of clicks needed to initiate editing.
-
getColorFromString(String)
-
-
getCurrencySymbol()
-
-
getDecimalPoint()
- Returns the decimal separator for JCurrencyTextField.
-
getDigitsAfterDecimal()
- Returns the number of digits after decimal for JCurrencyTextField.
-
getEnforceDataCompleteness()
-
-
getFalseValue()
- Returns the false string for checkbox editor.
-
getForeground()
- Returns the foreground color for this column.
-
getHeaderRenderer()
- Returns the header renderer.
-
getHeaderValue()
- Returns the Object used as the value for the headerRenderer.
-
getIdentifier()
- Returns the value of identifier.
-
getLabel()
- Gets the label for checkbox editor.
-
getLookup()
- Returns the string used to make combobox databound.
-
getMask()
- Returns the input mask for JMaskedTextField.
-
getMaxWidth()
- Returns the TableColumn's maximum width.
-
getMinWidth()
- Returns the TableColumn's minimum width.
-
getSeparator()
- Returns the thousands separator for JCurrencyTextField.
-
getStaticList()
- Returns the list of strings in the drop down list of combobox.
-
getTrueValue()
- Returns the true string for checkbox editor.
-
getWidth()
- Returns the TableColumn's width.
-
isATMMode()
- Returns the ATMMode for JCurrencyTextField.
-
isCurrencyLeading()
- Returns the currency symbol position for JCurrencyTextField.
-
isEditable()
- Returns whether the user can change values in this column.
-
isEditableCombo()
- Returns whether the combobox is in itself editable or just a drop down list.
-
isEditorDataBound()
- Returns whther combobox editor is databound
-
isResizable()
- Returns whether the user can resize the receiver in its JTableView.
-
isSeparatorEnabled()
- Returns whether or not currency editor separator is enabled.
-
isSizeWidthToFit()
- Returns whether TableColumn's width is adjusted to fit the header text.
-
setATMMode(boolean)
- Sets the ATMMode for JCurrencyTextField.
-
setBackground(Color)
- Sets the background color for this column.
-
setCellEditor(TableCellEditor)
- Sets the TableCellEditor used by JTable to draw individual values for this column to tce.
-
setCellEditorComponent(JComponent)
- Sets the cell editor component and creates an appropriate cell editor and cell renderer.
-
setCellRenderer(TableCellRenderer)
- Sets the TableCellRenderer used by JTable to draw individual values for this column to tcr.
-
setClickCountToStart(int)
- Sets the number of clicks to initiate editing.
-
setCurrencyLeading(boolean)
- Sets the currency symbol position for JCurrencyTextField.
-
setCurrencySymbol(String)
- Sets the currency symbol for JCurrencyTextField.
-
setDecimalPoint(char)
- Sets the decimal separator for JCurrencyTextField.
-
setDigitsAfterDecimal(int)
- Sets the number of digits after decimal for JCurrencyTextField.
-
setEditable(boolean)
- Sets whether the user can change values in this column.
-
setEditableCombo(boolean)
- Sets whether the combobox is in itself editable or just a drop down list.
-
setEditorDataBound(boolean)
- Sets whether the combobox editor is databound or not.
-
setEnforceDataCompleteness(boolean)
-
-
setFalseValue(String)
- Sets the false string for checkbox editor.
-
setForeground(Color)
- Sets the foreground color for this column.
-
setHeaderRenderer(TableCellRenderer)
- Sets the renderer used by JTable to draw header values for this column to thr.
-
setHeaderValue(Object)
- Sets the Object used as the value for the headerRenderer
-
setIdentifier(Object)
- Sets the Object used as the value for identifier.
-
setLabel(String)
- Sets the label for checkbox editor.
-
setLookup(String)
- Sets the string used to make combobox databound.
-
setMask(String)
- Sets the input mask for JMaskedTextField.
-
setMaxWidth(int)
- Sets the TableColumn's maximum width to maxWidth, also adjusting
the current width if it's greater than this value.
-
setMinWidth(int)
- Sets the TableColumn's minimum width to minWidth.
-
setResizable(boolean)
- Sets whether the user can resize the receiver in its JTableView.
-
setSeparator(char)
- Sets the thousands separator for JCurrencyTextField.
-
setSeparatorEnabled(boolean)
- Sets whether or not currency editor separator is enabled.
-
setSizeWidthToFit(boolean)
- Sets whether TableColumn's width should be adjusted to fit the header text.
-
setStaticList(String[])
- Sets the list of strings in the drop down list of combobox.
-
setTrueValue(String)
- Sets the true string for checkbox editor.
-
setWidth(int)
- Sets the TableColumn's width.
-
toString()
- Overrides Object's toString().
ATMMode
protected boolean ATMMode
- JCurrencyTextField's ATMMode
background
protected java.awt.Color background
- Background color for the table column. Automatic code generation for
this property is limited to named colors.
cellEditor
protected transient com.sun.java.swing.table.TableCellEditor cellEditor
- cellEditor. Automatically created based on the component type
cellEditorComponent
protected transient com.sun.java.swing.JComponent cellEditorComponent
- cellEditorComponent. Can be one of
- JTextField
- JComboBox
- JCheckBox
- JMaskedTextField
- JCurrencyTextField
cellRenderer
protected transient com.sun.java.swing.table.TableCellRenderer cellRenderer
- cellRenderer. Automatically created based on the component type
cellRendererComponent
protected transient com.sun.java.swing.JComponent cellRendererComponent
- cellRendererComponent. Defined for future use.
clickCountToStart
protected int clickCountToStart
- Click count to initiate editing of a table cell
currencyLeading
protected boolean currencyLeading
- JCurrencyTextField's currency symbol position
currencySymbol
protected java.lang.String currencySymbol
- JCurrencyTextField's currencySymbol
decimalPoint
protected char decimalPoint
- JCurrencyTextField's decimalPoint
digitsAfterDecimal
protected int digitsAfterDecimal
- JCurrencyTextField's digitsAfterDecimal
editable
protected boolean editable
- Determines whether a column is editable. This property is used
if TableBindingModel's
setColumnAttributes
is used.
Otherwise it is neglected.
editableCombo
protected boolean editableCombo
- Determines whether combobox editor is editable. Note that this is
different from column's editable property.
editorDataBound
protected boolean editorDataBound
- Determines whether combobox editor is databound. This property is
neglected for all other editors.
enforceDataCompleteness
protected boolean enforceDataCompleteness
- Defined for future use. Would determine whether or not isDataComplete() of
JMaskedTextField needs to be tested before stopping cell editing.
falseValue
protected java.lang.String falseValue
- Used by checkbox editor and renderers which are internally created
Used to provide a means for using CheckBox when the cell value is
not truly boolean. For example "Y" may be used for true and "N" for
false.
foreground
protected java.awt.Color foreground
- Foreground color for the table column. Automatic code generation for
this property is limited to named colors.
headerRenderer
protected transient com.sun.java.swing.table.TableCellRenderer headerRenderer
- headerRenderer. Defined for future use.
headerRendererComponent
protected transient com.sun.java.swing.JComponent headerRendererComponent
- headerRendererComponent. Defined for future use.
headerValue
protected transient java.lang.Object headerValue
- Header value which is used as header text
identifier
protected transient java.lang.Object identifier
- Identifier for each table column
isResizable
protected boolean isResizable
- isResizable property of a table column
label
protected java.lang.String label
- Label for the checkbox editor and renderer. The checkbox will be
centralized in a cell if label is empty
lookup
protected java.lang.String lookup
- The string used to make combobox editor databound. A datamodel which
uses Symantec's JDBC API is created internally created using this string.
Use staticList instead of this during design time ( for example, in custom
property editors for a bean).It is neglected for editors other than combobox.
mask
protected java.lang.String mask
- String that represents an input mask for JMaskedTextField. It neglected for
all other cell editor components.
maxWidth
protected int maxWidth
- maxWidth property of a table column
minWidth
protected int minWidth
- minWidth property of a table column
modelIndex
protected int modelIndex
- modelIndex property of a table column.
A one-up number is used for each column in DBColumnModel. Defined
here for future use.
separator
protected char separator
- JCurrencyTextField's separator
separatorEnabled
protected boolean separatorEnabled
- JCurrencyTextField's separator enabled property
shouldSelectCell
protected boolean shouldSelectCell
sizeWidthToFit
protected boolean sizeWidthToFit
- Determines whether or not the column should be resized to fit
its header. Defined here for future use.
staticList
protected java.lang.String[] staticList
- String array used to create combobox editor's drop down list. It is neglected
for editors other than combobox.
trueValue
protected java.lang.String trueValue
- Used by checkbox editor and renderers which are internally created
Used to provide a means for using CheckBox when the cell value is
not truly boolean. For example "Y" may be used for true and "N" for
false.
width
protected int width
- width property of a table column.
ColumnAttributes
public ColumnAttributes()
- Default constructor
ColumnAttributes
public ColumnAttributes(TableCellEditor cellEditor,
TableCellRenderer cellRenderer,
TableCellRenderer headerRenderer,
Object headerValue,
Object identifier,
boolean isResizable,
int maxWidth,
int minWidth,
int modelIndex,
int width)
- Constructor that takes in all the TableColumn attributes as
parameters. If any of cellEditor, cellRenderer,headerRenderer,headerValue
or identifier is null, defaults are used.
ColumnAttributes
public ColumnAttributes(Object identifier,
Object headerValue,
boolean isResizable,
int width,
int minWidth,
int maxWidth,
Color bg,
Color fg,
boolean editable,
JTextField tf)
- Constructor used for generating code when JTextField is chosen as cell editor component type
ColumnAttributes
public ColumnAttributes(Object identifier,
Object headerValue,
boolean isResizable,
int width,
int minWidth,
int maxWidth,
Color bg,
Color fg,
boolean editable,
JComboBox cb,
boolean editableCombo,
String[] items)
- Constructor used for generating code when JComboBox is chosen as cell editor component type
with a list of strings as items in the drop-down
ColumnAttributes
public ColumnAttributes(Object identifier,
Object headerValue,
boolean isResizable,
int width,
int minWidth,
int maxWidth,
Color bg,
Color fg,
boolean editable,
JComboBox cb,
boolean editableCombo,
boolean editorDataBound,
String lookup)
- Constructor used for generating code when a database aware JComboBox is chosen
as cell editor component type
ColumnAttributes
public ColumnAttributes(Object identifier,
Object headerValue,
boolean isResizable,
int width,
int minWidth,
int maxWidth,
Color bg,
Color fg,
boolean editable,
JCheckBox ch,
String trueValue,
String falseValue,
String label)
- Constructor used for generating code when JCheckBox is chosen as cell editor component
ColumnAttributes
public ColumnAttributes(Object identifier,
Object headerValue,
boolean isResizable,
int width,
int minWidth,
int maxWidth,
Color bg,
Color fg,
boolean editable,
JMaskedTextField mtf,
String mask,
boolean enforceCompleteness)
- Constructor used for generating code when JMaskedTextField is chosen as cell editor component
ColumnAttributes
public ColumnAttributes(Object identifier,
Object headerValue,
boolean isResizable,
int width,
int minWidth,
int maxWidth,
Color bg,
Color fg,
boolean editable,
JCurrencyTextField ctf,
boolean ATMMode,
String currencySymbol,
char decimalPoint,
int digitsAfterDecimal,
char separator,
boolean currencyLeading,
boolean separatorEnabled)
- Constructor used for generating code when JCurrencyTextField is chosen as cell editor component
clone
public synchronized java.lang.Object clone()
- Overrides:
- clone in class Object
createCheckBoxEditor
protected void createCheckBoxEditor(JCheckBox ch)
createComboBoxEditor
protected void createComboBoxEditor(JComboBox cb)
createCurrencyEditor
protected void createCurrencyEditor(JCurrencyTextField t)
createMaskedEditor
protected void createMaskedEditor(JMaskedTextField t)
createTextEditor
protected void createTextEditor(JTextField t)
getBackground
public java.awt.Color getBackground()
- Returns the background color for this column.
getCellEditor
public com.sun.java.swing.table.TableCellEditor getCellEditor()
- Returns the TableCellEditor.
getCellEditorComponent
public com.sun.java.swing.JComponent getCellEditorComponent()
- Returns the cell editor component.
getCellRenderer
public com.sun.java.swing.table.TableCellRenderer getCellRenderer()
- Returns the TableCellRenderer.
getClickCountToStart
public int getClickCountToStart()
- Returns the number of clicks needed to initiate editing.
getColorFromString
protected java.awt.Color getColorFromString(String nm)
getCurrencySymbol
public java.lang.String getCurrencySymbol()
getDecimalPoint
public char getDecimalPoint()
- Returns the decimal separator for JCurrencyTextField.
getDigitsAfterDecimal
public int getDigitsAfterDecimal()
- Returns the number of digits after decimal for JCurrencyTextField.
getEnforceDataCompleteness
public boolean getEnforceDataCompleteness()
getFalseValue
public java.lang.String getFalseValue()
- Returns the false string for checkbox editor.
getForeground
public java.awt.Color getForeground()
- Returns the foreground color for this column.
getHeaderRenderer
public com.sun.java.swing.table.TableCellRenderer getHeaderRenderer()
- Returns the header renderer.
getHeaderValue
public java.lang.Object getHeaderValue()
- Returns the Object used as the value for the headerRenderer.
getIdentifier
public java.lang.Object getIdentifier()
- Returns the value of identifier.
getLabel
public java.lang.String getLabel()
- Gets the label for checkbox editor.
getLookup
public java.lang.String getLookup()
- Returns the string used to make combobox databound.
getMask
public java.lang.String getMask()
- Returns the input mask for JMaskedTextField.
getMaxWidth
public int getMaxWidth()
- Returns the TableColumn's maximum width.
getMinWidth
public int getMinWidth()
- Returns the TableColumn's minimum width.
getSeparator
public char getSeparator()
- Returns the thousands separator for JCurrencyTextField.
getStaticList
public java.lang.String[] getStaticList()
- Returns the list of strings in the drop down list of combobox.
getTrueValue
public java.lang.String getTrueValue()
- Returns the true string for checkbox editor.
getWidth
public int getWidth()
- Returns the TableColumn's width.
isATMMode
public boolean isATMMode()
- Returns the ATMMode for JCurrencyTextField.
isCurrencyLeading
public boolean isCurrencyLeading()
- Returns the currency symbol position for JCurrencyTextField.
isEditable
public boolean isEditable()
- Returns whether the user can change values in this column.
isEditableCombo
public boolean isEditableCombo()
- Returns whether the combobox is in itself editable or just a drop down list.
isEditorDataBound
public boolean isEditorDataBound()
- Returns whther combobox editor is databound
isResizable
public boolean isResizable()
- Returns whether the user can resize the receiver in its JTableView.
isSeparatorEnabled
public boolean isSeparatorEnabled()
- Returns whether or not currency editor separator is enabled.
isSizeWidthToFit
public boolean isSizeWidthToFit()
- Returns whether TableColumn's width is adjusted to fit the header text.
setATMMode
public void setATMMode(boolean b)
- Sets the ATMMode for JCurrencyTextField.
- See Also:
- JCurrencyTextField
setBackground
public void setBackground(Color c)
- Sets the background color for this column.
setCellEditor
public void setCellEditor(TableCellEditor tce)
- Sets the TableCellEditor used by JTable to draw individual values for this column to tce.
setCellEditorComponent
public void setCellEditorComponent(JComponent t)
- Sets the cell editor component and creates an appropriate cell editor and cell renderer.
setCellRenderer
public void setCellRenderer(TableCellRenderer tcr)
- Sets the TableCellRenderer used by JTable to draw individual values for this column to tcr.
setClickCountToStart
public void setClickCountToStart(int count)
- Sets the number of clicks to initiate editing.
setCurrencyLeading
public void setCurrencyLeading(boolean b)
- Sets the currency symbol position for JCurrencyTextField.
- See Also:
- JCurrencyTextField
setCurrencySymbol
public void setCurrencySymbol(String symbol)
- Sets the currency symbol for JCurrencyTextField.
- See Also:
- JCurrencyTextField
setDecimalPoint
public void setDecimalPoint(char d)
- Sets the decimal separator for JCurrencyTextField.
- See Also:
- JCurrencyTextField
setDigitsAfterDecimal
public void setDigitsAfterDecimal(int i)
- Sets the number of digits after decimal for JCurrencyTextField.
- See Also:
- JCurrencyTextField
setEditable
public void setEditable(boolean b)
- Sets whether the user can change values in this column. This property is used
iff TableBindingModel's
setColumnAttributes
is used. Otherwise it is
neglected.
setEditableCombo
public void setEditableCombo(boolean b)
- Sets whether the combobox is in itself editable or just a drop down list.
setEditorDataBound
public void setEditorDataBound(boolean b)
- Sets whether the combobox editor is databound or not.
setEnforceDataCompleteness
public void setEnforceDataCompleteness(boolean b)
setFalseValue
public void setFalseValue(String f)
- Sets the false string for checkbox editor.
setForeground
public void setForeground(Color c)
- Sets the foreground color for this column.
setHeaderRenderer
public void setHeaderRenderer(TableCellRenderer thr)
- Sets the renderer used by JTable to draw header values for this column to thr.
setHeaderValue
public void setHeaderValue(Object headerValue)
- Sets the Object used as the value for the headerRenderer
setIdentifier
public void setIdentifier(Object identifier)
- Sets the Object used as the value for identifier.
setLabel
public void setLabel(String l)
- Sets the label for checkbox editor.
setLookup
public void setLookup(String s)
- Sets the string used to make combobox databound. It should be of the form
"QNAlias@col1,col2,col3" where QNAlias is the alias name of the datasource
which could be a QueryNavigator.
- See Also:
- setLookupBinding(), QueryNavigator
setMask
public void setMask(String s)
- Sets the input mask for JMaskedTextField.
- See Also:
- JMaskedTextField
setMaxWidth
public void setMaxWidth(int maxWidth)
- Sets the TableColumn's maximum width to maxWidth, also adjusting
the current width if it's greater than this value.
setMinWidth
public void setMinWidth(int minWidth)
- Sets the TableColumn's minimum width to minWidth.
setResizable
public void setResizable(boolean resizable)
- Sets whether the user can resize the receiver in its JTableView.
setSeparator
public void setSeparator(char s)
- Sets the thousands separator for JCurrencyTextField.
- See Also:
- JCurrencyTextField
setSeparatorEnabled
public void setSeparatorEnabled(boolean b)
- Sets whether or not currency editor separator is enabled.
- See Also:
- JCurrencyTextField
setSizeWidthToFit
public void setSizeWidthToFit(boolean b)
- Sets whether TableColumn's width should be adjusted to fit the header text.
setStaticList
public void setStaticList(String[] s)
- Sets the list of strings in the drop down list of combobox.
setTrueValue
public void setTrueValue(String t)
- Sets the true string for checkbox editor.
setWidth
public void setWidth(int width)
- Sets the TableColumn's width.
toString
public java.lang.String toString()
- Overrides Object's toString().
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index