### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java,v retrieving revision 1.62 diff -u -r1.62 MultiPageEditorPart.java --- Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java 1 Jun 2010 19:22:36 -0000 1.62 +++ Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java 15 Jan 2011 20:16:45 -0000 @@ -134,6 +134,13 @@ private CTabFolder container; /** + * Container style bits. + * + * @see #setContainerStyle + */ + private int containerStyle = SWT.BOTTOM; + + /** * List of nested editors. Element type: IEditorPart. Need to hang onto them * here, in addition to using get/setData on the items, because dispose() * needs to access them, but widgetry has already been disposed at that @@ -269,6 +276,48 @@ } /** + * Returns the container style bits. + *
+ * The default value is SWT.BOTTOM
. Subclassers should
+ * call setContainerStyle
to change this value, rather than
+ * overriding this method.
+ *
+ * The container style bits are used by the framework method
+ * createContainer
when creating this editor's container.
+ *
+ * The MultiPageEditor
implementation supports following
+ * styles: SWT.TOP, SWT.BOTTOM.
+ *
+ * Note: Only one of the styles SWT.TOP and SWT.BOTTOM may be specified. + *
+ * + * @param newContainerStyle + * the new container style bits + */ + protected void setContainerStyle(int newContainerStyle) { + int mask = SWT.TOP | SWT.BOTTOM; + newContainerStyle = newContainerStyle & mask; + // TOP and BOTTOM are mutually exclusive. + // BOTTOM is the default + if ((newContainerStyle & SWT.BOTTOM) != 0) + newContainerStyle = newContainerStyle & ~SWT.TOP; + containerStyle = newContainerStyle; + } + + /** * Creates an empty container. Creates a CTabFolder with no style bits set, * and hooks a selection listener which callspageChange()
* whenever the selected tab changes.
@@ -282,7 +331,7 @@
// use SWT.FLAT style so that an extra 1 pixel border is not reserved
// inside the folder
parent.setLayout(new FillLayout());
- final CTabFolder newContainer = new CTabFolder(parent, SWT.BOTTOM
+ final CTabFolder newContainer = new CTabFolder(parent, getContainerStyle()
| SWT.FLAT);
newContainer.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {