Use the new ChangeDetailCache in PatchSetDisclosurePanel

Use the ChangeDetailCache to propagate updates from a
PatchSetDisclosurePanel to the ChangeScreen.  This
decouples a PatchSetDisclosurePanel and PatchSetsBlock from
having any knowledge of a ChangeScreen, making them
embeddable in other components now.

Since it is no longer needed, eliminate the
update(ChangeDetail) method on ChangeScreen, instead the
ChangeDetail should be directly updated in the
ChangeDetailCache.  This will provide the additional
benefit of updating any other potential listeners to that
cache.

Change-Id: Iaa49770f6183a4847b4ec9f826f5223aec49be94
This commit is contained in:
Martin Fick
2011-12-29 18:45:50 -07:00
parent b61aff0702
commit ade9eb3c9f
3 changed files with 24 additions and 46 deletions

View File

@@ -251,7 +251,7 @@ public class ChangeScreen extends Screen
patchesGrid.setWidget(0, 1, patchesList);
add(patchesGrid);
patchSetsBlock = new PatchSetsBlock(this);
patchSetsBlock = new PatchSetsBlock();
add(patchSetsBlock);
comments = new FlowPanel();
@@ -284,10 +284,6 @@ public class ChangeScreen extends Screen
}
}
void update(final ChangeDetail detail) {
detailCache.set(detail);
}
private void display(final ChangeDetail detail) {
displayTitle(detail.getChange().getKey(), detail.getChange().getSubject());