KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > presentations > defaultpresentation > NativePresentationFactory


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.presentations.defaultpresentation;
12
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.ui.internal.presentations.util.StandardEditorSystemMenu;
15 import org.eclipse.ui.internal.presentations.util.StandardViewSystemMenu;
16 import org.eclipse.ui.internal.presentations.util.TabbedStackPresentation;
17 import org.eclipse.ui.presentations.AbstractPresentationFactory;
18 import org.eclipse.ui.presentations.IStackPresentationSite;
19 import org.eclipse.ui.presentations.StackPresentation;
20
21 /**
22  * @since 3.1
23  */

24 public class NativePresentationFactory extends AbstractPresentationFactory {
25
26     /*
27      * (non-Javadoc)
28      *
29      * @see org.eclipse.ui.presentations.AbstractPresentationFactory
30      */

31     public StackPresentation createEditorPresentation(Composite parent,
32             IStackPresentationSite site) {
33         return new TabbedStackPresentation(site, new NativeTabFolder(parent), new StandardEditorSystemMenu(site));
34     }
35
36     /*
37      * (non-Javadoc)
38      *
39      * @see org.eclipse.ui.presentations.AbstractPresentationFactory
40      */

41     public StackPresentation createViewPresentation(Composite parent,
42             IStackPresentationSite site) {
43         return new TabbedStackPresentation(site, new NativeTabFolder(parent), new StandardViewSystemMenu(site));
44     }
45
46     /*
47      * (non-Javadoc)
48      *
49      * @see org.eclipse.ui.presentations.AbstractPresentationFactory
50      */

51     public StackPresentation createStandaloneViewPresentation(Composite parent,
52             IStackPresentationSite site, boolean showTitle) {
53         // TODO honour showTitle
54
return new TabbedStackPresentation(site, new NativeTabFolder(parent),
55                 new StandardViewSystemMenu(site));
56     }
57
58 }
59
Popular Tags