|
Lines 7-12
Link Here
|
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Carlos Devoto carlos.devoto@compuware.com Bug 213645 |
| 10 |
* Markus Alexander Kuppe, Versant Corporation - bug #215797 |
11 |
* Markus Alexander Kuppe, Versant Corporation - bug #215797 |
| 11 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
| 12 |
|
13 |
|
|
Lines 543-553
Link Here
|
| 543 |
//long startTick = System.currentTimeMillis(); |
544 |
//long startTick = System.currentTimeMillis(); |
| 544 |
// Update the model first |
545 |
// Update the model first |
| 545 |
List toMove = getTrueViewOrder(vs); |
546 |
List toMove = getTrueViewOrder(vs); |
| 546 |
for (Iterator viewIter = toMove.iterator(); viewIter.hasNext();) { |
547 |
if (toMove.isEmpty()) { |
| 547 |
IViewReference ref = (IViewReference) viewIter.next(); |
548 |
// We are dealing with an empty durable ViewStack; hide it! |
| 548 |
addViewReference(vs.getID(), -1, ref, false); |
549 |
vs.dispose(); |
|
|
550 |
ILayoutContainer parentContainer = vs.getContainer(); |
| 551 |
ContainerPlaceholder placeholder = new ContainerPlaceholder(vs |
| 552 |
.getID()); |
| 553 |
placeholder.setRealContainer(vs); |
| 554 |
parentContainer.replace(vs, placeholder); |
| 555 |
|
| 556 |
} else { |
| 557 |
for (Iterator viewIter = toMove.iterator(); viewIter.hasNext();) { |
| 558 |
IViewReference ref = (IViewReference) viewIter.next(); |
| 559 |
addViewReference(vs.getID(), -1, ref, false); |
| 560 |
} |
| 549 |
} |
561 |
} |
| 550 |
|
|
|
| 551 |
vs.deferUpdates(false); |
562 |
vs.deferUpdates(false); |
| 552 |
|
563 |
|
| 553 |
// Find (or create) the trim stack to move to |
564 |
// Find (or create) the trim stack to move to |
|
Lines 555-563
Link Here
|
| 555 |
.calcStackSide(stackBounds), paneOrientation); |
566 |
.calcStackSide(stackBounds), paneOrientation); |
| 556 |
vstb.setRestoreOnUnzoom(restoreOnUnzoom); |
567 |
vstb.setRestoreOnUnzoom(restoreOnUnzoom); |
| 557 |
vstb.setSelectedTabId(selId); |
568 |
vstb.setSelectedTabId(selId); |
| 558 |
updateTrim(vstb.getId()); |
569 |
if (toMove.isEmpty()) { |
| 559 |
|
570 |
// We are dealing with an empty durable ViewStack; show the trim! |
| 560 |
//System.out.println("minimize time: " + (System.currentTimeMillis()-startTick)); //$NON-NLS-1$ |
571 |
IWindowTrim trim = vstb; |
|
|
572 |
|
| 573 |
// Ensure that the trim is displayed |
| 574 |
if (!trim.getControl().getVisible()) { |
| 575 |
tbm.setTrimVisible(trim, true); |
| 576 |
} |
| 577 |
|
| 578 |
if (trim instanceof FastViewBar) { |
| 579 |
FastViewBar fvb = (FastViewBar) trim; |
| 580 |
fvb.update(true); |
| 581 |
} else if (trim instanceof ViewStackTrimToolBar) { |
| 582 |
vstb.update(true); |
| 583 |
vstb.getControl().pack(); |
| 584 |
LayoutUtil.resize(trim.getControl()); |
| 585 |
} |
| 586 |
tbm.forceLayout(); |
| 587 |
} else { |
| 588 |
updateTrim(vstb.getId()); |
| 589 |
} |
| 590 |
|
| 591 |
//System.out.println("minimize time: " + (System.currentTimeMillis()-startTick)); //$NON-NLS-1$ |
| 561 |
if (vstb != null) { |
592 |
if (vstb != null) { |
| 562 |
animation.addEndRect(vstb.getControl()); |
593 |
animation.addEndRect(vstb.getControl()); |
| 563 |
scheduleDeferrableAnimation(); |
594 |
scheduleDeferrableAnimation(); |
|
Lines 591-596
Link Here
|
| 591 |
secondaryId = idParts[1]; |
622 |
secondaryId = idParts[1]; |
| 592 |
|
623 |
|
| 593 |
List fvs = getFastViews(id); |
624 |
List fvs = getFastViews(id); |
|
|
625 |
if (fvs.isEmpty()) { |
| 626 |
// We are dealing with a durable view stack that is currently empty, so execute special logic to restore it from the minimized state |
| 627 |
LayoutPart part = perspective.getPresentation().findPart(id, null); |
| 628 |
if (part instanceof ContainerPlaceholder) { |
| 629 |
ContainerPlaceholder containerPlaceholder = (ContainerPlaceholder) part; |
| 630 |
ILayoutContainer parentContainer = containerPlaceholder |
| 631 |
.getContainer(); |
| 632 |
ILayoutContainer container = (ILayoutContainer) containerPlaceholder |
| 633 |
.getRealContainer(); |
| 634 |
if (container instanceof LayoutPart) { |
| 635 |
parentContainer.replace(containerPlaceholder, |
| 636 |
(LayoutPart) container); |
| 637 |
} |
| 638 |
containerPlaceholder.setRealContainer(null); |
| 639 |
IWindowTrim trim = tbm.getTrim(id); |
| 640 |
|
| 641 |
// If it's not there there's not much we can do |
| 642 |
if (trim == null) |
| 643 |
return; |
| 644 |
|
| 645 |
// Hide the trim |
| 646 |
if (trim.getControl().getVisible()) { |
| 647 |
tbm.setTrimVisible(trim, false); |
| 648 |
tbm.forceLayout(); |
| 649 |
} |
| 650 |
} |
| 651 |
return; |
| 652 |
} |
| 653 |
|
| 594 |
for (Iterator fvIter = fvs.iterator(); fvIter.hasNext();) { |
654 |
for (Iterator fvIter = fvs.iterator(); fvIter.hasNext();) { |
| 595 |
IViewReference ref = (IViewReference) fvIter.next(); |
655 |
IViewReference ref = (IViewReference) fvIter.next(); |
| 596 |
removeViewReference(ref, true, !fvIter.hasNext()); |
656 |
removeViewReference(ref, true, !fvIter.hasNext()); |