|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel net.nand.util.i18n.gui.PropertiesTranslatorEditor.PTSwingTableModel
private class PropertiesTranslatorEditor.PTSwingTableModel
Data model for viewing/editing data in jtab
.
Adds getCellStatus(int, int)
.
Model row and column numbers are 0-based.
Model contains 1 line for each line in pair
; its row count is
pair.size()
+ 1 for new data at the end.
Field Summary | |
---|---|
private static int |
NUM_COLS
Number of columns: key, value src, value dest |
ParsedPropsFilePair |
pair
|
int |
sc
Search: sr and sc are the row and column of the previous matching cell, if any. |
private java.lang.String |
searchText
Search: lowercased current search text, or null if no search or no matches found |
boolean |
searchWrapped
If true, and the previous call to search(String, boolean) was successful,
the search wrapped around the end of the table before finding a match. |
private static long |
serialVersionUID
|
int |
sr
Search: sr and sc are the row and column of the previous matching cell, if any. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
PropertiesTranslatorEditor.PTSwingTableModel(PropertiesTranslatorEditor pted)
Create and populate with existing data. |
Method Summary | |
---|---|
void |
endSearch()
Done searching for now. |
PropertiesTranslatorEditor.CellStatus |
getCellStatus(int r,
int c)
Get the cell status, to visually show the user. |
int |
getColumnCount()
3 columns: key, src value, dest value |
java.lang.String |
getColumnName(int col)
|
java.lang.String |
getPTEColumnToolTip(int col)
Show src/dest file full path; see where-used for details |
int |
getRowCount()
1 row for each line in matched pair of data files, plus a blank row at the end |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
In our model this object will always be a String, or "" if the cell is empty. |
boolean |
isCellEditable(int r,
int c)
|
boolean |
isRowComment(int r)
Is this row a comment row, not a key+value row? |
boolean |
search(java.lang.String txt,
boolean forward)
Case-insensitive text search. |
void |
setValueAt(java.lang.Object newVal,
int r,
int c)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final int NUM_COLS
public ParsedPropsFilePair pair
private java.lang.String searchText
public int sr
sr
and sc
are the row and column of the previous matching cell, if any.
Next call to search(String, boolean)
will start after this cell
if the search text is the same as the previous call. To search from another
cell, you can change sr
and sc
before calling search
.
If no match was found, sr
may be 0 or may be outside the valid range of rows.
sc
is always valid.
searchWrapped
,
PropertiesTranslatorEditor.CellStatus.SEARCH_MATCH
public int sc
sr
and sc
are the row and column of the previous matching cell, if any.
Next call to search(String, boolean)
will start after this cell
if the search text is the same as the previous call. To search from another
cell, you can change sr
and sc
before calling search
.
If no match was found, sr
may be 0 or may be outside the valid range of rows.
sc
is always valid.
searchWrapped
,
PropertiesTranslatorEditor.CellStatus.SEARCH_MATCH
public boolean searchWrapped
search(String, boolean)
was successful,
the search wrapped around the end of the table before finding a match.
sr
Constructor Detail |
---|
public PropertiesTranslatorEditor.PTSwingTableModel(PropertiesTranslatorEditor pted)
Method Detail |
---|
public void endSearch()
public boolean search(java.lang.String txt, boolean forward)
getCellStatus(int, int)
will also highlight their cells. When done searching (when closing the search pane), call
endSearch()
to stop highlighting matches.
If continuing a previous search, keep moving from the previous match; otherwise start from top or bottom of table, depending on search direction.
If a match is found, then sr
, sc
, and searchWrapped
are valid afterwards.
txt
- Text to search for, or null
to repeat previous searchforward
- True to search top to bottom left to right, false to search bottom to top
public final int getRowCount()
public final int getColumnCount()
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public void setValueAt(java.lang.Object newVal, int r, int c)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
public java.lang.String getColumnName(int col)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.String getPTEColumnToolTip(int col)
public boolean isCellEditable(int r, int c)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public boolean isRowComment(int r)
public PropertiesTranslatorEditor.CellStatus getCellStatus(int r, int c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |