Bug 342998 Refactor ESelectionService into multiple classes
While there is a master/slave relationship "enforced" by the current implementation, it is non-obvious as the code is quite convoluted. The implementation needs to be refactored to enhance readability.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/ESelectionServiceTest.java
EPartService partService = (EPartService) windowContext
				.get(EPartService.class.getName());
		Object selection1 = new Object();
		Object selection2 = new Object();
		serviceA.setSelection(selection1);
		assertEquals(selection1, windowService.getSelection());
		assertEquals(selection1, serviceA.getSelection());
		assertEquals(selection1, serviceB.getSelection());
		serviceB.setSelection(selection2);
		assertEquals(selection1, windowService.getSelection());
		assertEquals(selection1, serviceA.getSelection());
		assertEquals(selection1, serviceB.getSelection());
		partService.activate(partB);
		assertEquals(selection2, windowService.getSelection());
		assertEquals(selection2, serviceA.getSelection());
		assertEquals(selection2, serviceB.getSelection());
	}
	public void testGetSelection_Id() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setElementId("partA"); 
		window.getChildren().add(partA);
		window.setSelectedElement(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setElementId("partB"); 
		window.getChildren().add(partB);