Lines 760-765
Link Here
|
760 |
makeActive(ref); |
760 |
makeActive(ref); |
761 |
} else if (newPartContainer == activeEditorContainer) { |
761 |
} else if (newPartContainer == activeEditorContainer) { |
762 |
if (ref instanceof IEditorReference) { |
762 |
if (ref instanceof IEditorReference) { |
|
|
763 |
if (part!=null) { |
764 |
IWorkbenchPartSite site = part.getSite(); |
765 |
if (site instanceof PartSite) { |
766 |
ref = ((PartSite) site).getPane() |
767 |
.getPartReference(); |
768 |
} |
769 |
} |
763 |
makeActiveEditor((IEditorReference)ref); |
770 |
makeActiveEditor((IEditorReference)ref); |
764 |
} else { |
771 |
} else { |
765 |
makeActiveEditor(null); |
772 |
makeActiveEditor(null); |
Lines 1101-1107
Link Here
|
1101 |
* @param ref the editor to make active, or <code>null</code> for no active editor |
1108 |
* @param ref the editor to make active, or <code>null</code> for no active editor |
1102 |
*/ |
1109 |
*/ |
1103 |
private void makeActiveEditor(IEditorReference ref) { |
1110 |
private void makeActiveEditor(IEditorReference ref) { |
1104 |
if (ref == getActiveEditor()) { |
1111 |
if (ref == getActiveEditorReference()) { |
1105 |
return; |
1112 |
return; |
1106 |
} |
1113 |
} |
1107 |
|
1114 |
|
Lines 1115-1121
Link Here
|
1115 |
actionSwitcher.updateTopEditor(part); |
1122 |
actionSwitcher.updateTopEditor(part); |
1116 |
|
1123 |
|
1117 |
if (ref != null) { |
1124 |
if (ref != null) { |
1118 |
activationList.bringToTop(ref); |
1125 |
activationList.bringToTop(getReference(part)); |
1119 |
} |
1126 |
} |
1120 |
|
1127 |
|
1121 |
partList.setActiveEditor(ref); |
1128 |
partList.setActiveEditor(ref); |
Lines 1473-1478
Link Here
|
1473 |
if (isZoomed()) |
1480 |
if (isZoomed()) |
1474 |
zoomOut(); |
1481 |
zoomOut(); |
1475 |
|
1482 |
|
|
|
1483 |
makeActiveEditor(null); |
1476 |
makeActive(null); |
1484 |
makeActive(null); |
1477 |
|
1485 |
|
1478 |
// Close and dispose the editors. |
1486 |
// Close and dispose the editors. |
Lines 2171-2176
Link Here
|
2171 |
* This method is called when the page is deactivated. |
2179 |
* This method is called when the page is deactivated. |
2172 |
*/ |
2180 |
*/ |
2173 |
protected void onDeactivate() { |
2181 |
protected void onDeactivate() { |
|
|
2182 |
makeActiveEditor(null); |
2174 |
makeActive(null); |
2183 |
makeActive(null); |
2175 |
if (getActivePerspective() != null) |
2184 |
if (getActivePerspective() != null) |
2176 |
getActivePerspective().onDeactivate(); |
2185 |
getActivePerspective().onDeactivate(); |
Lines 2467-2472
Link Here
|
2467 |
if (!certifyPart(part)) |
2476 |
if (!certifyPart(part)) |
2468 |
return; |
2477 |
return; |
2469 |
|
2478 |
|
|
|
2479 |
if (part instanceof MultiEditor) { |
2480 |
part = ((MultiEditor) part).getActiveEditor(); |
2481 |
} |
2482 |
|
2470 |
// Real work. |
2483 |
// Real work. |
2471 |
setActivePart(part); |
2484 |
setActivePart(part); |
2472 |
} |
2485 |
} |
Lines 2829-2836
Link Here
|
2829 |
label = newPart != null ? newPart.getTitle() : "none"; //$NON-NLS-1$ |
2842 |
label = newPart != null ? newPart.getTitle() : "none"; //$NON-NLS-1$ |
2830 |
} |
2843 |
} |
2831 |
try { |
2844 |
try { |
2832 |
IWorkbenchPartReference partref = getReference(newPart); |
2845 |
IWorkbenchPartReference partref = getReference(newPart); |
2833 |
partBeingActivated = partref; |
2846 |
IWorkbenchPartReference realPartRef = null; |
|
|
2847 |
if (newPart != null) { |
2848 |
IWorkbenchPartSite site = newPart.getSite(); |
2849 |
if (site instanceof PartSite) { |
2850 |
realPartRef = ((PartSite) site).getPane() |
2851 |
.getPartReference(); |
2852 |
} |
2853 |
} |
2854 |
|
2855 |
partBeingActivated = realPartRef; |
2834 |
|
2856 |
|
2835 |
UIStats.start(UIStats.ACTIVATE_PART, label); |
2857 |
UIStats.start(UIStats.ACTIVATE_PART, label); |
2836 |
// Notify perspective. It may deactivate fast view. |
2858 |
// Notify perspective. It may deactivate fast view. |
Lines 2848-2856
Link Here
|
2848 |
if (newPart != null) { |
2870 |
if (newPart != null) { |
2849 |
activationList.setActive(newPart); |
2871 |
activationList.setActive(newPart); |
2850 |
if (newPart instanceof IEditorPart) { |
2872 |
if (newPart instanceof IEditorPart) { |
2851 |
IEditorReference ref = (IEditorReference) getReference(newPart); |
2873 |
makeActiveEditor((IEditorReference)realPartRef); |
2852 |
makeActiveEditor(ref); |
2874 |
} |
2853 |
} |
|
|
2854 |
} |
2875 |
} |
2855 |
activatePart(newPart); |
2876 |
activatePart(newPart); |
2856 |
|
2877 |
|
Lines 3470-3496
Link Here
|
3470 |
*/ |
3491 |
*/ |
3471 |
void setActive(IWorkbenchPart part) { |
3492 |
void setActive(IWorkbenchPart part) { |
3472 |
if (parts.size() <= 0) |
3493 |
if (parts.size() <= 0) |
3473 |
return; |
3494 |
return; |
3474 |
PartPane pane = ((PartSite) part.getSite()).getPane(); |
3495 |
IWorkbenchPartReference ref = getReference(part); |
3475 |
if (pane instanceof MultiEditorInnerPane) { |
3496 |
if (ref != null) { |
3476 |
MultiEditorInnerPane innerPane = (MultiEditorInnerPane) pane; |
3497 |
if (ref == parts.get(parts.size() - 1)) |
3477 |
setActive(innerPane.getParentPane().getPartReference().getPart( |
3498 |
return; |
3478 |
true)); |
3499 |
parts.remove(ref); |
3479 |
} else { |
3500 |
parts.add(ref); |
3480 |
IWorkbenchPartReference ref = getReference(part); |
3501 |
} |
3481 |
if (ref != null) { |
|
|
3482 |
if (ref == parts.get(parts.size() - 1)) |
3483 |
return; |
3484 |
parts.remove(ref); |
3485 |
parts.add(ref); |
3486 |
} |
3487 |
} |
3488 |
} |
3502 |
} |
3489 |
|
3503 |
|
3490 |
/* |
3504 |
/* |
3491 |
* Ensures that the given part appears AFTER any other part in the same |
3505 |
* Ensures that the given part appears AFTER any other part in the same |
3492 |
* container. |
3506 |
* container. |
3493 |
*/ |
3507 |
*/ |
3494 |
void bringToTop(IWorkbenchPartReference ref) { |
3508 |
void bringToTop(IWorkbenchPartReference ref) { |
3495 |
ILayoutContainer targetContainer = getContainer(ref); |
3509 |
ILayoutContainer targetContainer = getContainer(ref); |
3496 |
|
3510 |
|