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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user