* improved cellrenderers a need full row update an state change

This commit is contained in:
Reinhard Pointner 2009-02-16 19:08:55 +00:00
parent c5f499b47f
commit e06c5971b8
2 changed files with 9 additions and 11 deletions

View File

@ -47,6 +47,7 @@ class RenameAction extends AbstractAction {
name.append(".").append(extension); name.append(".").append(extension);
} }
// same parent, different name
File target = new File(source.getParentFile(), name.toString()); File target = new File(source.getParentFile(), name.toString());
todoQueue.addLast(new Match<File, File>(source, target)); todoQueue.addLast(new Match<File, File>(source, target));
@ -70,16 +71,14 @@ class RenameAction extends AbstractAction {
// rename failed // rename failed
Logger.getLogger("ui").warning(ExceptionUtilities.getRootCauseMessage(e)); Logger.getLogger("ui").warning(ExceptionUtilities.getRootCauseMessage(e));
boolean revertFailed = false; boolean revertSuccess = true;
// revert rename operations // revert rename operations
for (Match<File, File> match : doneQueue) { for (Match<File, File> match : doneQueue) {
if (!match.getCandidate().renameTo(match.getValue())) { revertSuccess &= match.getCandidate().renameTo(match.getValue());
revertFailed = true;
}
} }
if (revertFailed) { if (!revertSuccess) {
Logger.getLogger("ui").severe("Failed to revert all rename operations."); Logger.getLogger("ui").severe("Failed to revert all rename operations.");
} }
} }

View File

@ -208,9 +208,8 @@ class ChecksumTableModel extends AbstractTableModel {
for (ChecksumCell replacement : replacements) { for (ChecksumCell replacement : replacements) {
int row = getRowIndex(replacement); int row = getRowIndex(replacement);
// update this cell // update this row
fireTableCellUpdated(row, 0); fireTableRowsUpdated(row, row);
fireTableCellUpdated(row, getColumnIndex(replacement));
} }
if (rowCount != getRowCount()) { if (rowCount != getRowCount()) {
@ -249,8 +248,8 @@ class ChecksumTableModel extends AbstractTableModel {
int row = getRowIndex((ChecksumRow) evt.getSource()); int row = getRowIndex((ChecksumRow) evt.getSource());
if (row >= 0) { if (row >= 0) {
// update only column 0 (state) // update row
fireTableCellUpdated(row, 0); fireTableRowsUpdated(row, row);
} }
} }
}; };