|
Lines 369-374
Link Here
|
| 369 |
* Set of perspectives this view was closed in by the user |
369 |
* Set of perspectives this view was closed in by the user |
| 370 |
*/ |
370 |
*/ |
| 371 |
private Set fUserClosed = new HashSet(); |
371 |
private Set fUserClosed = new HashSet(); |
|
|
372 |
/** |
| 373 |
* Set of perspectives this view was auto-opened by view management. |
| 374 |
*/ |
| 375 |
private Set fAutoOpened = new HashSet(); |
| 372 |
|
376 |
|
| 373 |
public ViewBinding(IConfigurationElement element) { |
377 |
public ViewBinding(IConfigurationElement element) { |
| 374 |
fElement = element; |
378 |
fElement = element; |
|
Lines 438-443
Link Here
|
| 438 |
protected void userOpened() { |
442 |
protected void userOpened() { |
| 439 |
if (isTrackingViews()) { |
443 |
if (isTrackingViews()) { |
| 440 |
String id = getActivePerspective().getId(); |
444 |
String id = getActivePerspective().getId(); |
|
|
445 |
fAutoOpened.remove(id); |
| 441 |
fUserOpened.add(id); |
446 |
fUserOpened.add(id); |
| 442 |
fUserClosed.remove(id); |
447 |
fUserClosed.remove(id); |
| 443 |
saveViewBindings(); |
448 |
saveViewBindings(); |
|
Lines 447-452
Link Here
|
| 447 |
protected void userClosed() { |
452 |
protected void userClosed() { |
| 448 |
if (isTrackingViews()) { |
453 |
if (isTrackingViews()) { |
| 449 |
String id = getActivePerspective().getId(); |
454 |
String id = getActivePerspective().getId(); |
|
|
455 |
fAutoOpened.remove(id); |
| 450 |
fUserClosed.add(id); |
456 |
fUserClosed.add(id); |
| 451 |
fUserOpened.remove(id); |
457 |
fUserOpened.remove(id); |
| 452 |
saveViewBindings(); |
458 |
saveViewBindings(); |
|
Lines 472-477
Link Here
|
| 472 |
if (isAutoOpen()) { |
478 |
if (isAutoOpen()) { |
| 473 |
try { |
479 |
try { |
| 474 |
fIgnoreChanges = true; |
480 |
fIgnoreChanges = true; |
|
|
481 |
if (page.findViewReference(getViewId()) == null) { |
| 482 |
fAutoOpened.add(perspective.getId()); |
| 483 |
} |
| 475 |
page.showView(getViewId(), null, IWorkbenchPage.VIEW_CREATE); |
484 |
page.showView(getViewId(), null, IWorkbenchPage.VIEW_CREATE); |
| 476 |
} catch (PartInitException e) { |
485 |
} catch (PartInitException e) { |
| 477 |
DebugUIPlugin.log(e); |
486 |
DebugUIPlugin.log(e); |
|
Lines 519-532
Link Here
|
| 519 |
*/ |
528 |
*/ |
| 520 |
public void deactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) { |
529 |
public void deactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) { |
| 521 |
if (!isUserOpened(perspective)) { |
530 |
if (!isUserOpened(perspective)) { |
| 522 |
if (isAutoClose() && !isDefault(perspective)) { |
531 |
if (fAutoOpened.remove(perspective.getId())) { |
| 523 |
IViewReference reference = page.findViewReference(getViewId()); |
532 |
if (isAutoClose() && !isDefault(perspective)) { |
| 524 |
if (reference != null) { |
533 |
IViewReference reference = page.findViewReference(getViewId()); |
| 525 |
try { |
534 |
if (reference != null) { |
| 526 |
fIgnoreChanges = true; |
535 |
try { |
| 527 |
page.hideView(reference); |
536 |
fIgnoreChanges = true; |
| 528 |
} finally { |
537 |
page.hideView(reference); |
| 529 |
fIgnoreChanges = false; |
538 |
} finally { |
|
|
539 |
fIgnoreChanges = false; |
| 540 |
} |
| 530 |
} |
541 |
} |
| 531 |
} |
542 |
} |
| 532 |
} |
543 |
} |
|
Lines 933-943
Link Here
|
| 933 |
if (!fIgnoreChanges && page.getWorkbenchWindow().equals(fWindow)) { |
944 |
if (!fIgnoreChanges && page.getWorkbenchWindow().equals(fWindow)) { |
| 934 |
if(partRef != null) { |
945 |
if(partRef != null) { |
| 935 |
if (IWorkbenchPage.CHANGE_VIEW_SHOW == changeId || IWorkbenchPage.CHANGE_VIEW_HIDE == changeId) { |
946 |
if (IWorkbenchPage.CHANGE_VIEW_SHOW == changeId || IWorkbenchPage.CHANGE_VIEW_HIDE == changeId) { |
| 936 |
Iterator iterator = fContextIdsToBindings.values().iterator(); |
947 |
Set activatedContexts = (Set)fPerspectiveToActivatedContexts.get(perspective); |
| 937 |
while (iterator.hasNext()) { |
948 |
if (activatedContexts != null) { |
| 938 |
DebugContextViewBindings bindings = (DebugContextViewBindings) iterator.next(); |
949 |
Iterator iterator = activatedContexts.iterator(); |
| 939 |
bindings.setViewOpened(IWorkbenchPage.CHANGE_VIEW_SHOW == changeId, partRef.getId()); |
950 |
while (iterator.hasNext()) { |
| 940 |
} |
951 |
DebugContextViewBindings bindings = |
|
|
952 |
(DebugContextViewBindings)fContextIdsToBindings.get(iterator.next()); |
| 953 |
if (bindings != null) { |
| 954 |
bindings.setViewOpened(IWorkbenchPage.CHANGE_VIEW_SHOW == changeId, partRef.getId()); |
| 955 |
} |
| 956 |
} |
| 957 |
} |
| 941 |
} |
958 |
} |
| 942 |
} |
959 |
} |
| 943 |
} |
960 |
} |