Remove red background for outdated dependency after rebase

In the Dependencies table on the ChangeScreen an outdated dependency is
highlighted by a red background. If the user clicks on the rebase
button and the rebase is successful the outdated dependency gets fixed,
but in the Dependencies table the dependency is still highlighted by
the red background because the corresponding style is not removed. This
was broken by af4138b965.

Change-Id: I7ae672a6adea721bac91c7b6584cca6d0b8f3a74
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2012-09-26 08:11:43 +02:00
parent 5d960dcdb5
commit 8903b407ac

View File

@@ -208,6 +208,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
s += " (" + c.getStatus().name() + ")";
}
if (changeRowFormatter != null) {
removeChangeStyle(row, changeRowFormatter);
final String rowStyle = changeRowFormatter.getRowStyle(c);
if (rowStyle != null) {
table.getRowFormatter().addStyleName(row, rowStyle);
@@ -226,6 +227,19 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
setRowItem(row, c);
}
private void removeChangeStyle(int row,
final ChangeRowFormatter changeRowFormatter) {
final ChangeInfo oldChange = getRowItem(row);
if (oldChange == null) {
return;
}
final String oldRowStyle = changeRowFormatter.getRowStyle(oldChange);
if (oldRowStyle != null) {
table.getRowFormatter().removeStyleName(row, oldRowStyle);
}
}
private AccountLink link(final Account.Id id) {
return AccountLink.link(accountCache, id);
}