|
Lines 595-609
Link Here
|
| 595 |
// Use a copy of the current set of children to avoid a ConcurrentModificationException |
595 |
// Use a copy of the current set of children to avoid a ConcurrentModificationException |
| 596 |
// if a part is added to the same stack while iterating over the children (bug 78470) |
596 |
// if a part is added to the same stack while iterating over the children (bug 78470) |
| 597 |
LayoutPart[] childParts = (LayoutPart[]) children.toArray(new LayoutPart[children.size()]); |
597 |
LayoutPart[] childParts = (LayoutPart[]) children.toArray(new LayoutPart[children.size()]); |
| 598 |
// if we don't have a saved state, add the parts, otherwise "restore" |
|
|
| 599 |
// the parts :-) |
| 600 |
boolean addParts = (savedPresentationState==null); |
| 601 |
for (int i = 0; i < childParts.length; i++) { |
598 |
for (int i = 0; i < childParts.length; i++) { |
| 602 |
LayoutPart part = childParts[i]; |
599 |
LayoutPart part = childParts[i]; |
| 603 |
showPart(part, null, addParts); |
600 |
showPart(part, null); |
| 604 |
} |
601 |
} |
| 605 |
// if we didn't add the parts above, it's because we had a saved |
602 |
|
| 606 |
// presentation state. |
603 |
boolean addParts = (savedPresentationState==null); |
|
|
604 |
// we have saved state so restore the parts order |
| 607 |
if (!addParts) { |
605 |
if (!addParts) { |
| 608 |
PresentationSerializer serializer = new PresentationSerializer( |
606 |
PresentationSerializer serializer = new PresentationSerializer( |
| 609 |
getPresentableParts()); |
607 |
getPresentableParts()); |
|
Lines 1282-1297
Link Here
|
| 1282 |
* @param cookie other information |
1280 |
* @param cookie other information |
| 1283 |
*/ |
1281 |
*/ |
| 1284 |
private void showPart(LayoutPart part, Object cookie) { |
1282 |
private void showPart(LayoutPart part, Object cookie) { |
| 1285 |
showPart(part, cookie, true); |
|
|
| 1286 |
} |
| 1287 |
|
| 1288 |
/** |
| 1289 |
* Makes the given part visible in the presentation. |
| 1290 |
* @param part the part to add to the stack |
| 1291 |
* @param cookie other information |
| 1292 |
* @param addParts add this part to the presentation immediately |
| 1293 |
*/ |
| 1294 |
private void showPart(LayoutPart part, Object cookie, boolean addParts) { |
| 1295 |
|
1283 |
|
| 1296 |
if (isDisposed()) { |
1284 |
if (isDisposed()) { |
| 1297 |
return; |
1285 |
return; |
|
Lines 1311-1319
Link Here
|
| 1311 |
part.setContainer(this); |
1299 |
part.setContainer(this); |
| 1312 |
} |
1300 |
} |
| 1313 |
|
1301 |
|
| 1314 |
if (addParts) { |
1302 |
presentationSite.getPresentation().addPart(presentablePart, cookie); |
| 1315 |
presentationSite.getPresentation().addPart(presentablePart, cookie); |
|
|
| 1316 |
} |
| 1317 |
|
1303 |
|
| 1318 |
if (requestedCurrent == null) { |
1304 |
if (requestedCurrent == null) { |
| 1319 |
setSelection(part); |
1305 |
setSelection(part); |