Lines 134-139
Link Here
|
134 |
private CTabFolder container; |
134 |
private CTabFolder container; |
135 |
|
135 |
|
136 |
/** |
136 |
/** |
|
|
137 |
* Container style bits. |
138 |
* |
139 |
* @see #setContainerStyle |
140 |
*/ |
141 |
private int containerStyle = SWT.BOTTOM; |
142 |
|
143 |
/** |
137 |
* List of nested editors. Element type: IEditorPart. Need to hang onto them |
144 |
* List of nested editors. Element type: IEditorPart. Need to hang onto them |
138 |
* here, in addition to using get/setData on the items, because dispose() |
145 |
* here, in addition to using get/setData on the items, because dispose() |
139 |
* needs to access them, but widgetry has already been disposed at that |
146 |
* needs to access them, but widgetry has already been disposed at that |
Lines 269-274
Link Here
|
269 |
} |
276 |
} |
270 |
|
277 |
|
271 |
/** |
278 |
/** |
|
|
279 |
* Returns the container style bits. |
280 |
* <p> |
281 |
* The default value is <code>SWT.BOTTOM</code>. Subclassers should |
282 |
* call <code>setContainerStyle</code> to change this value, rather than |
283 |
* overriding this method. |
284 |
* </p> |
285 |
* |
286 |
* @return the container style bits |
287 |
*/ |
288 |
protected int getContainerStyle() { |
289 |
return containerStyle; |
290 |
} |
291 |
|
292 |
/** |
293 |
* Sets the container style bits. This method has no effect after the |
294 |
* container is created. |
295 |
* <p> |
296 |
* The container style bits are used by the framework method |
297 |
* <code>createContainer</code> when creating this editor's container. |
298 |
* </p> |
299 |
* <p> |
300 |
* The <code>MultiPageEditor</code> implementation supports following |
301 |
* styles: SWT.TOP, SWT.BOTTOM. |
302 |
* </p> |
303 |
* <p> |
304 |
* Note: Only one of the styles SWT.TOP and SWT.BOTTOM may be specified. |
305 |
* </p> |
306 |
* |
307 |
* @param newContainerStyle |
308 |
* the new container style bits |
309 |
*/ |
310 |
protected void setContainerStyle(int newContainerStyle) { |
311 |
int mask = SWT.TOP | SWT.BOTTOM; |
312 |
newContainerStyle = newContainerStyle & mask; |
313 |
// TOP and BOTTOM are mutually exclusive. |
314 |
// BOTTOM is the default |
315 |
if ((newContainerStyle & SWT.BOTTOM) != 0) |
316 |
newContainerStyle = newContainerStyle & ~SWT.TOP; |
317 |
containerStyle = newContainerStyle; |
318 |
} |
319 |
|
320 |
/** |
272 |
* Creates an empty container. Creates a CTabFolder with no style bits set, |
321 |
* Creates an empty container. Creates a CTabFolder with no style bits set, |
273 |
* and hooks a selection listener which calls <code>pageChange()</code> |
322 |
* and hooks a selection listener which calls <code>pageChange()</code> |
274 |
* whenever the selected tab changes. |
323 |
* whenever the selected tab changes. |
Lines 282-288
Link Here
|
282 |
// use SWT.FLAT style so that an extra 1 pixel border is not reserved |
331 |
// use SWT.FLAT style so that an extra 1 pixel border is not reserved |
283 |
// inside the folder |
332 |
// inside the folder |
284 |
parent.setLayout(new FillLayout()); |
333 |
parent.setLayout(new FillLayout()); |
285 |
final CTabFolder newContainer = new CTabFolder(parent, SWT.BOTTOM |
334 |
final CTabFolder newContainer = new CTabFolder(parent, getContainerStyle() |
286 |
| SWT.FLAT); |
335 |
| SWT.FLAT); |
287 |
newContainer.addSelectionListener(new SelectionAdapter() { |
336 |
newContainer.addSelectionListener(new SelectionAdapter() { |
288 |
public void widgetSelected(SelectionEvent e) { |
337 |
public void widgetSelected(SelectionEvent e) { |