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
initialize(applicationContext, application);
		getEngine().createGui(window);
		IEclipseContext contextA = partA.getContext();
		IEclipseContext contextB = partB.getContext();
		IEclipseContext windowContext = window.getContext();
		ESelectionService serviceA = (ESelectionService) contextA
				.get(ESelectionService.class.getName());
		ESelectionService serviceB = (ESelectionService) contextB
				.get(ESelectionService.class.getName());
		ESelectionService windowService = (ESelectionService) windowContext
				.get(ESelectionService.class.getName());
		Object selection1 = new Object();
		Object selection2 = new Object();
		serviceA.setSelection(selection1);
		assertEquals(selection1, windowService.getSelection("partA")); 
		assertEquals(selection1, serviceA.getSelection("partA")); 
		assertEquals(selection1, serviceB.getSelection("partA")); 
		assertNull(windowService.getSelection("partB")); 
		assertNull(serviceA.getSelection("partB")); 
		assertNull(serviceB.getSelection("partB")); 
		serviceB.setSelection(selection2);
		assertEquals(selection1, windowService.getSelection("partA")); 
		assertEquals(selection1, serviceA.getSelection("partA")); 
		assertEquals(selection1, serviceB.getSelection("partA")); 
		assertEquals(selection2, windowService.getSelection("partB")); 
		assertEquals(selection2, serviceA.getSelection("partB")); 
		assertEquals(selection2, serviceB.getSelection("partB")); 
	}
	public void testSelectionListener() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE