Package com.iizix.prop.ui.table
Class TCell
java.lang.Object
com.iizix.prop.ui.table.TCell
- All Implemented Interfaces:
- Cloneable
The table cell contents that is used with the content provider.
This class is thread-safe and immutable.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final intAlign horizontal: center (= 5).- static final intAlign horizontal: default (=0).- static final intAlign horizontal: leading (= 44).- static final intAlign horizontal: left (= 4).- static final intAlign horizontal: right (= 6).- static final intAlign horizontal: trailing (= 66).- static final intAlign vertical: bottom (= 2).- static final intAlign vertical: default (= 0).- static final intAlign vertical: middle (= 5).- static final intAlign vertical: top (= 2).- static final intCell type: Checkbox (= 2).- static final intCell type: Combobox (= 4).- static final intCell type: KString (= 1).- static final intCell type: Radio button (= 3).- static final intCell type: String (= 0).- static final TCellAn empty table cell contents.- static final TCellAn empty table cell contents, but cell is selected.
- Constructor SummaryConstructorsConstructorDescription- TCell- (boolean isSelected) Creates a new instance of the table cell initialized with a radio button and its state default-aligned horizontally and vertically.- TCell- (boolean isSelected, int horizontalAlign, int verticalAlign, int style) Creates a new instance of the table cell initialized with a checkbox and its state default-aligned horizontally and vertically.- TCell- (int checkState) Creates a new instance of the table cell initialized with a checkbox and its state default-aligned horizontally and vertically.- TCell- (int checkState, int horizontalAlign, int verticalAlign, int style) Creates a new instance of the table cell initialized with a checkbox and its state default-aligned horizontally and vertically.Creates a new instance of the table cell initialized with the KString contents default-aligned horizontally and vertically.Creates a new instance of the table cell initialized with the KString contents default-aligned horizontally and vertically.Creates a new instance of the table cell initialized with the KString contents.Creates a new instance of the table cell initialized with the String contents default-aligned horizontally and vertically.Creates a new instance of the table cell initialized with the String contents default-aligned horizontally and vertically.Creates a new instance of the table cell initialized with the String contents.- TCell- (String string, TableCombo combo) Creates a new instance of the table cell initialized with a string and combobox default-aligned horizontally and vertically.- TCell- (String string, TableCombo combo, int horizontalAlign, int verticalAlign, int style) Creates a new instance of the table cell initialized with a string and combobox default-aligned horizontally and vertically.
- Method SummaryModifier and TypeMethodDescription- asCellOwner- (TableCell newOwner) Creates a new GCell instance that is cell selected.- asCellSelected- (boolean on) Creates a new GCell instance that is cell selected.- protected TCell- clone()Clones the table cell.- booleanChecks for equality.- intReturns if the check state.- intGets the column index in a row of the cell in the table.- getCombo()Gets the combo instance.- intGets the horizontal alignment of the cell.Gets the text contents when the cell is text.- getRow()Gets the row for the cell.- intGets the row index of the cell in the table.- intGets the selected item for a combobox.Converts the contents to a string, just the textual plain contents or the check state, or selected state.- int- getStyle()Gets the style.- getTable()Gets the table for the cell.- int- getType()Gets the cell type.- intGets the vertical alignment of the cell.- booleanReturns if the cell selection state is on or off.- booleanReturns if the radio button is selected.- toString()The debug string representation of this object.
- Field Details- EMPTYAn empty table cell contents.
- EMPTY_CELL_SELECTEDAn empty table cell contents, but cell is selected.
- CELL_TYPE_Stringpublic static final int CELL_TYPE_StringCell type: String (= 0).- See Also:
 
- CELL_TYPE_KStringpublic static final int CELL_TYPE_KStringCell type: KString (= 1).- See Also:
 
- CELL_TYPE_Checkpublic static final int CELL_TYPE_CheckCell type: Checkbox (= 2).- See Also:
 
- CELL_TYPE_Radiopublic static final int CELL_TYPE_RadioCell type: Radio button (= 3).- See Also:
 
- CELL_TYPE_Combopublic static final int CELL_TYPE_ComboCell type: Combobox (= 4).- See Also:
 
- ALIGN_HORIZONTAL_DEFAULTpublic static final int ALIGN_HORIZONTAL_DEFAULTAlign horizontal: default (=0).- See Also:
 
- ALIGN_HORIZONTAL_LEFTpublic static final int ALIGN_HORIZONTAL_LEFTAlign horizontal: left (= 4).- See Also:
 
- ALIGN_HORIZONTAL_LEADINGpublic static final int ALIGN_HORIZONTAL_LEADINGAlign horizontal: leading (= 44).- See Also:
 
- ALIGN_HORIZONTAL_CENTERpublic static final int ALIGN_HORIZONTAL_CENTERAlign horizontal: center (= 5).- See Also:
 
- ALIGN_HORIZONTAL_RIGHTpublic static final int ALIGN_HORIZONTAL_RIGHTAlign horizontal: right (= 6).- See Also:
 
- ALIGN_HORIZONTAL_TRAILINGpublic static final int ALIGN_HORIZONTAL_TRAILINGAlign horizontal: trailing (= 66).- See Also:
 
- ALIGN_VERTICAL_DEFAULTpublic static final int ALIGN_VERTICAL_DEFAULTAlign vertical: default (= 0).- See Also:
 
- ALIGN_VERTICAL_TOPpublic static final int ALIGN_VERTICAL_TOPAlign vertical: top (= 2).- See Also:
 
- ALIGN_VERTICAL_MIDDLEpublic static final int ALIGN_VERTICAL_MIDDLEAlign vertical: middle (= 5).- See Also:
 
- ALIGN_VERTICAL_BOTTOMpublic static final int ALIGN_VERTICAL_BOTTOMAlign vertical: bottom (= 2).- See Also:
 
 
- Constructor Details- TCellCreates a new instance of the table cell initialized with the String contents default-aligned horizontally and vertically.- Parameters:
- string- The cell String.
 
- TCellCreates a new instance of the table cell initialized with the String contents default-aligned horizontally and vertically.- Parameters:
- string- The cell String.
- isSelected- Flag for cell selection.
 
- TCellCreates a new instance of the table cell initialized with the String contents.- Parameters:
- string- The cell String.
- horizontalAlign- The horizontal alignment.
- verticalAlign- The vertical alignment.
- style- The style registered with the table, zero for none.
- Throws:
- IllegalArgumentException- If the alignment or style values are incorrect.
- NullPointerException- If the string is null.
 
- TCellCreates a new instance of the table cell initialized with the KString contents default-aligned horizontally and vertically.- Parameters:
- kstring- The cell String.
- Throws:
- IllegalArgumentException- If the alignment values are incorrect.
- NullPointerException- If the kstring is null.
 
- TCellCreates a new instance of the table cell initialized with the KString contents default-aligned horizontally and vertically.- Parameters:
- kstring- The cell String.
- isSelected- Flag for cell selection.
- Throws:
- IllegalArgumentException- If the alignment values are incorrect.
- NullPointerException- If the kstring is null.
 
- TCellCreates a new instance of the table cell initialized with the KString contents.- Parameters:
- kstring- The cell string.
- horizontalAlign- The horizontal alignment.
- verticalAlign- The vertical alignment.
- style- The style registered with the table, zero for none.
- Throws:
- IllegalArgumentException- If the alignment or style values are incorrect.
- NullPointerException- If the kstring is null.
 
- TCellpublic TCell- (int checkState) Creates a new instance of the table cell initialized with a checkbox and its state default-aligned horizontally and vertically.- Parameters:
- checkState- The check state (0=unchecked, 1=checked, 2=third state).
- Throws:
- IllegalArgumentException- If the alignment values are incorrect.
 
- TCellpublic TCell- (int checkState, int horizontalAlign, int verticalAlign, int style) Creates a new instance of the table cell initialized with a checkbox and its state default-aligned horizontally and vertically.- Parameters:
- checkState- The check state (0=unchecked, 1=checked, 2=third state).
- horizontalAlign- The horizontal alignment.
- verticalAlign- The vertical alignment.
- style- The style registered with the table, zero for none.
- Throws:
- IllegalArgumentException- If the checkState, alignment or style values are incorrect.
 
- TCellpublic TCell- (boolean isSelected) Creates a new instance of the table cell initialized with a radio button and its state default-aligned horizontally and vertically.- Parameters:
- isSelected- The radio button selected state.
 
- TCellpublic TCell- (boolean isSelected, int horizontalAlign, int verticalAlign, int style) Creates a new instance of the table cell initialized with a checkbox and its state default-aligned horizontally and vertically.- Parameters:
- isSelected- The radio button selected state.
- horizontalAlign- The horizontal alignment.
- verticalAlign- The vertical alignment.
- style- The style registered with the table, zero for none.
- Throws:
- IllegalArgumentException- If the alignment or style values are incorrect.
 
- TCellCreates a new instance of the table cell initialized with a string and combobox default-aligned horizontally and vertically.- Parameters:
- string- The cell String.
- combo- The combobox registered with the table.
- Throws:
- IllegalArgumentException- If the alignment values are incorrect.
 
- TCellCreates a new instance of the table cell initialized with a string and combobox default-aligned horizontally and vertically.- Parameters:
- string- The cell String.
- combo- The combobox registered with the table.
- horizontalAlign- The horizontal alignment.
- verticalAlign- The vertical alignment.
- style- The style registered with the table, zero for none.
- Throws:
- IllegalArgumentException- If the alignment or style values are incorrect.
 
 
- Method Details- cloneClones the table cell.- Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException- If the cell fails cloning due to contents.
 
- getRowGets the row for the cell.- Returns:
- The row, or null if not present in the table.
 
- getTableGets the table for the cell.- Returns:
- The table, or null if not present in the table.
 
- getColumnIndexpublic int getColumnIndex()Gets the column index in a row of the cell in the table.- Returns:
- The column index, or -1 if cell contents is not the current content.
 
- getRowIndexpublic int getRowIndex()Gets the row index of the cell in the table.- Returns:
- The row index, or -1 if cell contents is not the current content.
 
- getTypepublic int getType()Gets the cell type.- Returns:
- One of the values: CELL_TYPE_String, CELL_TYPE_KString, CELL_TYPE_Check, CELL_TYPE_Radio or CELL_TYPE_Combo.
 
- isCellSelectedpublic boolean isCellSelected()Returns if the cell selection state is on or off.- Returns:
- true if the cell is selected, false otherwise.
 
- getStringConverts the contents to a string, just the textual plain contents or the check state, or selected state.- Returns:
- The textual representation of the contents.
 
- getKStringGets the text contents when the cell is text.- Returns:
- The text contents, or null if cell is not CELL_TYPE_String.
 
- isSelectedpublic boolean isSelected()Returns if the radio button is selected.- Returns:
- true if selected, or false if unselected (or not a radio button).
 
- getCheckStatepublic int getCheckState()Returns if the check state.- Returns:
- One of: 0=unchecked, 1=checked, 2=third state or -1 if not a check type.
 
- getSelectionpublic int getSelection()Gets the selected item for a combobox.- Returns:
- The selected item index, -1 for none.
 
- getVerticalAlignpublic int getVerticalAlign()Gets the vertical alignment of the cell.- Returns:
- One of the values: ALIGN_VERTICAL_DEFAULT, ALIGN_VERTICAL_TOP, ALIGN_VERTICAL_MIDDLE or ALIGN_VERTICAL_BOTTOM.
 
- getHorizontalAlignpublic int getHorizontalAlign()Gets the horizontal alignment of the cell.- Returns:
- One of the values: ALIGN_HORIZONTAL_DEFAULT, ALIGN_HORIZONTAL_LEFT, ALIGN_HORIZONTAL_LEADING, ALIGN_HORIZONTAL_CENTER, ALIGN_HORIZONTAL_RIGHT or ALIGN_HORIZONTAL_TRAILING.
 
- getStylepublic int getStyle()Gets the style.- Returns:
- The registered style with the table, or zero for none.
 
- getComboGets the combo instance.- Returns:
- The combo instance, or null for none.
 
- asCellSelectedCreates a new GCell instance that is cell selected.- Parameters:
- on- The cell selection state.
- Returns:
- A new instance of the cell with cell selection state enabled.
 
- asCellOwnerCreates a new GCell instance that is cell selected.- Parameters:
- newOwner- The new GCell owner.
- Returns:
- A new instance of the cell with cell selection state enabled.
 
- equalsChecks for equality.
- toStringThe debug string representation of this object.