Skip to content

Commit edbc549

Browse files
committed
Extract part focus code for re-use
1 parent 7f9ec57 commit edbc549

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,7 @@ private void activate(MPart part, boolean requiresFocus, boolean activateBranch)
767767
partActivationHistory.activate(part, activateBranch);
768768

769769
if (requiresFocus) {
770-
IEclipseContext context = part.getContext();
771-
if (context != null) {
772-
IPresentationEngine pe = context.get(IPresentationEngine.class);
773-
pe.focusGui(part);
774-
}
770+
focusPart(part);
775771
}
776772

777773
// store the activation time to sort the parts in MRU order
@@ -1513,4 +1509,12 @@ private MElementContainer<? extends MUIElement> getContainer() {
15131509
}
15141510
return outerContainer;
15151511
}
1512+
1513+
private static void focusPart(MPart part) {
1514+
IEclipseContext context = part.getContext();
1515+
if (context != null) {
1516+
IPresentationEngine pe = context.get(IPresentationEngine.class);
1517+
pe.focusGui(part);
1518+
}
1519+
}
15161520
}

0 commit comments

Comments
 (0)