Bug 280632 [CSS][UI] How to handle margins
In order to implement margins, we require that the control in question have a parent composite on which we can set marginLeft, marginRight, etc. This requires a rather odd contract between the widget construction and the styling, since the only reason for the composite and layout is to support the styling. It's also unrealistic to wrap every widget in a composite even if it will never have margins set. Another idea is for CSS to create the composite/layout on the fly when margins are being set. This would require the widget to be reparented.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/MWindowTest.java
assertEquals("MyWindow", shell.getText());
						
						IEclipseContext child = (IEclipseContext) appContext
								.getLocal(IServiceConstants.ACTIVE_CHILD);
						assertNotNull(child);
						assertEquals(window.getContext(), child);
						MContributedPart<MPart<?>> modelPart = getContributedPart(window);
						assertNotNull(modelPart);
						assertEquals(window, modelPart.getParent().getParent()
								.getParent());
						
						
						PartFactory factory = (PartFactory) modelPart
								.getOwner();
						factory.activate(modelPart);
						IEclipseContext next = (IEclipseContext) child
								.getLocal(IServiceConstants.ACTIVE_CHILD);
						while (next != null) {
							child = next;
							next = (IEclipseContext) child
									.getLocal(IServiceConstants.ACTIVE_CHILD);
						}
						assertFalse(window.getContext() == child);
						MContributedPart<?> contextPart = (MContributedPart<?>) child
								.get(MContributedPart.class.getName());
						assertNotNull(contextPart);
						assertEquals(window, contextPart.getParent()
								.getParent().getParent());
					}
				});