Bug 319961 Reset perspective fails with parts moved into the editor area
1. Start a fresh e4 workbench 2. Move the Javadoc view into the editor area 3. Reset the perspective 4. Open the Javadoc view Result: The Javadoc view is opened in the editor area. In the bottom stack there still is a tab for the Javadoc view; this tab can be clicked, but it will activate the view in the editor area. The toolbar, however, is shown in the bottom stack.
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
} else {
				List<Object> elements = modelService.findElements(rootContainer, null, null,
						Collections.singletonList(category));
				if (elements.isEmpty()) {
					addToLastContainer(category, providedPart);
				} else {
					Object element = elements.get(0);
					if (element instanceof MPartStack) {
						MPartStack stack = (MPartStack) element;
						if (providedPart.getCurSharedRef() instanceof MPlaceholder) {
							stack.getChildren().add(providedPart.getCurSharedRef());
						} else {
							stack.getChildren().add(providedPart);
						}
					} else if (element instanceof MElementContainer<?>) {
						((MElementContainer<MPart>) element).getChildren().add(providedPart);
					} else {
						addToLastContainer(category, providedPart);
					}
				}
			}
		}
		return providedPart;
	}
	private void addToLastContainer(String category, MPart part) {
		MElementContainer<?> lastContainer = getLastContainer();
		if (lastContainer instanceof MPartStack) {
			MPartStack stack = (MPartStack) lastContainer;
			if (part.getCurSharedRef() instanceof MPlaceholder) {
				stack.getChildren().add(part.getCurSharedRef());