Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 137527 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/PartStack.java (-19 / +5 lines)
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);
(-)src/org/eclipse/ui/examples/presentation/sidewinder/SideWinderItemViewPresentation.java (-1 / +6 lines)
Lines 474-482 Link Here
474
	public void setVisible(boolean isVisible) {
474
	public void setVisible(boolean isVisible) {
475
		presentationControl.setVisible(isVisible);
475
		presentationControl.setVisible(isVisible);
476
		
476
		
477
		IPresentablePart current = getSite().getSelectedPart();
477
		// Make the currently visible part visible
478
		// Make the currently visible part visible
478
		if (current != null) {
479
		if (current != null) {
479
			current.setVisible(isVisible);			
480
			current.setVisible(isVisible);
480
		}
481
		}
481
482
482
		if (isVisible) {
483
		if (isVisible) {
Lines 499-504 Link Here
499
500
500
	public void addPart(IPresentablePart newPart, Object cookie) {
501
	public void addPart(IPresentablePart newPart, Object cookie) {
501
		// Ignore the cookie for now, since we don't support drag-and-drop yet.
502
		// Ignore the cookie for now, since we don't support drag-and-drop yet.
503
		if (getPartItem(newPart)!=null) {
504
			return;
505
		}
506
		
502
		PartItem item = new PartItem(titleArea, newPart);
507
		PartItem item = new PartItem(titleArea, newPart);
503
		
508
		
504
		// Attach the newPart pointer to the ToolItem. This is used for getPartForTab
509
		// Attach the newPart pointer to the ToolItem. This is used for getPartForTab

Return to bug 137527