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
ProviderPart partThreeImpl = new ProviderPart();
		ContextInjectionFactory.inject(partThreeImpl, partContextC);
		ESelectionService windowService = (ESelectionService) windowContext
				.get(ESelectionService.class.getName());
		EPartService partService = (EPartService) windowContext
				.get(EPartService.class.getName());
		Object selection = new Object();
		Object selection2 = new Object();
		assertNull(windowService.getSelection());
		assertNull(partOneImpl.input);
		assertNull(partTwoImpl.input);
		assertNull(partThreeImpl.input);
		partOneImpl.setSelection(selection);
		assertEquals(selection, windowService.getSelection());
		assertEquals(selection, partOneImpl.input);
		assertNull(partTwoImpl.input);
		assertNull(partThreeImpl.input);
		partThreeImpl.setSelection(selection2);
		assertEquals(selection, windowService.getSelection());
		assertEquals(selection, partOneImpl.input);
		assertNull(partTwoImpl.input);
		assertEquals(selection2, partThreeImpl.input);
		partService.activate(partB);
		assertNull(windowService.getSelection());
		assertEquals(selection, partOneImpl.input);
		assertNull(partTwoImpl.input);
		assertEquals(selection2, partThreeImpl.input);
		partService.activate(partC);
		assertEquals(selection2, windowService.getSelection());
		assertEquals(selection, partOneImpl.input);