bug 322393: [modeling] Possibility to customize the Master section's styles
https://bugs.eclipse.org/bugs/show_bug.cgi?id=322393
diff --git a/modeling/plugins/org.eclipse.pde.emfforms/src/org/eclipse/pde/emfforms/editor/EmfMasterDetailBlock.java b/modeling/plugins/org.eclipse.pde.emfforms/src/org/eclipse/pde/emfforms/editor/EmfMasterDetailBlock.java
index ed4a654..c7900e2 100644
--- a/modeling/plugins/org.eclipse.pde.emfforms/src/org/eclipse/pde/emfforms/editor/EmfMasterDetailBlock.java
+++ b/modeling/plugins/org.eclipse.pde.emfforms/src/org/eclipse/pde/emfforms/editor/EmfMasterDetailBlock.java
@@ -7,10 +7,10 @@
*
* Contributors:
* Anyware Technologies - initial API and implementation
- * Sebastien Moran <SMoran@sierrawireless.com> - bug 308802
+ * Sebastien Moran <SMoran@sierrawireless.com> - bug 308802, 322393
* Jacques Lescot <JLescot@sierrawireless.com> - bug 314677
*
- * $Id: EmfMasterDetailBlock.java,v 1.24 2010/06/16 16:25:46 bcabe Exp $
+ * $Id: EmfMasterDetailBlock.java,v 1.25 2010/06/16 17:28:11 bcabe Exp $
*/
package org.eclipse.pde.emfforms.editor;
@@ -42,6 +42,8 @@
public abstract class EmfMasterDetailBlock extends MasterDetailsBlock implements IDetailsPageProvider, IMenuListener {
+ public static final int DEFAULT_SECTION_OPTIONS = Section.DESCRIPTION | ExpandableComposite.TITLE_BAR;
+
public static final int DEFAULT_VIEWER_OPTIONS = SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
protected EmfFormEditor<?> parentEditor;
@@ -86,6 +88,8 @@
protected ToolBarManager toolBarManager;
private IAction removeAction;
+ private Section section;
+
public EmfMasterDetailBlock(EmfFormEditor<?> editor, String title) {
this.title = title;
this.parentEditor = editor;
@@ -100,7 +104,7 @@
protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
FormToolkit toolkit = parentEditor.getToolkit();
- Section section = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
+ section = toolkit.createSection(parent, getSectionOptions());
section.setText(title);
section.setDescription("Edit " + title); //$NON-NLS-1$
section.marginWidth = 5;
@@ -223,6 +227,10 @@
section.setClient(client);
}
+ protected int getSectionOptions() {
+ return DEFAULT_SECTION_OPTIONS;
+ }
+
/**
* Default styles : SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
*