View | Details | Raw Unified | Return to bug 149719 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java (-2 / +15 lines)
Lines 124-129 Link Here
124
124
125
	private IServiceLocator pageContainerSite;
125
	private IServiceLocator pageContainerSite;
126
126
127
	private boolean tabsOnTop = false;
128
	
127
	/**
129
	/**
128
	 * Creates an empty multi-page editor with no pages.
130
	 * Creates an empty multi-page editor with no pages.
129
	 */
131
	 */
Lines 132-137 Link Here
132
	}
134
	}
133
135
134
	/**
136
	/**
137
	 * Creates an empty multi-page editor with no pages.
138
	 * 
139
	 * @param tabsOnTop 
140
	 * If set to true, the tabs will show on the top of the editor instead 
141
	 * of bottom by default. 
142
	 */
143
	protected MultiPageEditorPart(boolean tabsOnTop) {
144
	    this();
145
	    this.tabsOnTop = tabsOnTop;
146
	}
147
	/**
135
	 * Creates and adds a new page containing the given control to this
148
	 * Creates and adds a new page containing the given control to this
136
	 * multi-page editor. The control may be <code>null</code>, allowing it
149
	 * multi-page editor. The control may be <code>null</code>, allowing it
137
	 * to be created and set later using <code>setControl</code>.
150
	 * to be created and set later using <code>setControl</code>.
Lines 258-265 Link Here
258
		// use SWT.FLAT style so that an extra 1 pixel border is not reserved
271
		// use SWT.FLAT style so that an extra 1 pixel border is not reserved
259
		// inside the folder
272
		// inside the folder
260
		parent.setLayout(new FillLayout());
273
		parent.setLayout(new FillLayout());
261
		final CTabFolder newContainer = new CTabFolder(parent, SWT.BOTTOM
274
		final CTabFolder newContainer = new CTabFolder(parent, 
262
				| SWT.FLAT);
275
		        (tabsOnTop ? SWT.TOP : SWT.BOTTOM) | SWT.FLAT);
263
		newContainer.addSelectionListener(new SelectionAdapter() {
276
		newContainer.addSelectionListener(new SelectionAdapter() {
264
			public void widgetSelected(SelectionEvent e) {
277
			public void widgetSelected(SelectionEvent e) {
265
				int newPageIndex = newContainer.indexOf((CTabItem) e.item);
278
				int newPageIndex = newContainer.indexOf((CTabItem) e.item);

Return to bug 149719