diff options
author | Lars Vogel | 2014-03-15 11:30:54 +0000 |
---|---|---|
committer | Lars Vogel | 2014-03-16 09:29:07 +0000 |
commit | 757bb1d316e08426744bceebeb7cfca31eac6f6d (patch) | |
tree | b8bb0784b1036b633f14c1a92e4b59c1bdf3c252 | |
parent | c046dbeeef08603f31cc83b321f3f3fda7c40ae1 (diff) | |
download | org.eclipse.e4.tools-757bb1d316e08426744bceebeb7cfca31eac6f6d.tar.gz org.eclipse.e4.tools-757bb1d316e08426744bceebeb7cfca31eac6f6d.tar.xz org.eclipse.e4.tools-757bb1d316e08426744bceebeb7cfca31eac6f6d.zip |
Bug 430462 - Reduce hard coded styling in the model editor
Change-Id: I0607a4a8ac7ca5c7390be58df631adddf4ab3190
Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
-rw-r--r-- | bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java index 1388a87e..f5d54029 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java @@ -496,33 +496,26 @@ public class ModelEditor { viewer = createTreeViewerArea(form); Composite parent = new Composite(form, SWT.NONE); - parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); - parent.setBackgroundMode(SWT.INHERIT_DEFAULT); - // parent.setData("org.eclipse.e4.ui.css.CssClassName","contentContainer"); FillLayout l = new FillLayout(); - l.marginWidth = 5; parent.setLayout(l); ShadowComposite editingArea = new ShadowComposite(parent, SWT.NONE); GridLayout gl = new GridLayout(); - gl.marginTop = 0; - gl.marginHeight = 0; editingArea.setLayout(gl); - editingArea.setBackgroundMode(SWT.INHERIT_DEFAULT); - // editingArea.setData("org.eclipse.e4.ui.css.CssClassName","contentContainer"); Composite headerContainer = new Composite(editingArea, SWT.NONE); - headerContainer.setBackgroundMode(SWT.INHERIT_DEFAULT); - headerContainer.setData(CSS_CLASS_KEY, "headerSectionContainer"); //$NON-NLS-1$ headerContainer.setLayout(new GridLayout(3, false)); headerContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); final Label iconLabel = new Label(headerContainer, SWT.NONE); iconLabel.setLayoutData(new GridData(20, 20)); - final Label textLabel = new Label(headerContainer, SWT.NONE); - textLabel.setData(CSS_CLASS_KEY, "sectionHeader"); //$NON-NLS-1$ - textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + final Label sectionHeaderLabel = new Label(headerContainer, SWT.NONE); + sectionHeaderLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + final Label separatorLabel = new Label(headerContainer, SWT.SEPARATOR | SWT.HORIZONTAL); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = 2; + separatorLabel.setLayoutData(gridData); final StackLayout layout = new StackLayout(); final Composite contentContainer = new Composite(editingArea, SWT.NONE); @@ -558,7 +551,7 @@ public class ModelEditor { final AbstractComponentEditor editor = getEditor(obj.eClass()); if (editor != null) { currentEditor = editor; - textLabel.setText(editor.getLabel(obj)); + sectionHeaderLabel.setText(editor.getLabel(obj)); iconLabel.setImage(editor.getImage(obj, iconLabel.getDisplay())); obsManager.runAndCollect(new Runnable() { @@ -576,7 +569,7 @@ public class ModelEditor { final AbstractComponentEditor editor = virtualEditors.get(entry.getId()); if (editor != null) { currentEditor = editor; - textLabel.setText(editor.getLabel(entry)); + sectionHeaderLabel.setText(editor.getLabel(entry)); iconLabel.setImage(editor.getImage(entry, iconLabel.getDisplay())); obsManager.runAndCollect(new Runnable() { |