Package org.omegat.gui.editor.chartable
Class CharTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.omegat.gui.editor.chartable.CharTableModel
- All Implemented Interfaces:
Serializable,TableModel
Character table table model
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidleave only unique characters in the data string.voidappendChar(Character c, boolean checkUnique) Append a new character to the data.intgetColumnName(int column) getData()intgetValueAt(int rowIndex, int columnIndex) modifyPoint(Point p) Prevent the use of invalid points in the table (beyond data string length).voidremoveSelection(int row1, int col1, int row2, int col2) Remove the selected characters from the model.booleanset the data to a selected stringMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Constructor Details
-
CharTableModel
-
-
Method Details
-
setData
set the data to a selected string- Parameters:
data- the new string- Returns:
- true if the data have been replaced.
-
getData
-
allowOnlyUnique
public void allowOnlyUnique()leave only unique characters in the data string. -
appendChar
Append a new character to the data.- Parameters:
c- the charactercheckUnique- check for being unique or not
-
removeSelection
public void removeSelection(int row1, int col1, int row2, int col2) Remove the selected characters from the model.- Parameters:
row1- from rowcol1- from columnrow2- to rowcol2- to column
-
getRowCount
public int getRowCount() -
getColumnCount
public int getColumnCount() -
getValueAt
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
modifyPoint
Prevent the use of invalid points in the table (beyond data string length).- Parameters:
p- the point in question- Returns:
- the modified point.
-