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

View File

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