KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > presentations > DefaultActionBarPresentationFactory


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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;
12
13 import org.eclipse.jface.action.IToolBarManager;
14 import org.eclipse.jface.internal.provisional.action.CoolBarManager2;
15 import org.eclipse.jface.internal.provisional.action.ICoolBarManager2;
16 import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem;
17 import org.eclipse.jface.internal.provisional.action.IToolBarManager2;
18 import org.eclipse.jface.internal.provisional.action.ToolBarContributionItem2;
19 import org.eclipse.jface.internal.provisional.action.ToolBarManager2;
20 import org.eclipse.swt.SWT;
21 import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory;
22
23 /**
24  * The intention of this class is to allow for replacing the implementation of
25  * the cool bar and tool bars in the workbench.
26  * <p>
27  * <strong>EXPERIMENTAL</strong>. This class or interface has been added as
28  * part of a work in progress. There is a guarantee neither that this API will
29  * work nor that it will remain the same. Please do not use this API without
30  * consulting with the Platform/UI team.
31  * </p>
32  *
33  * @since 3.2
34  */

35 public class DefaultActionBarPresentationFactory implements IActionBarPresentationFactory {
36
37     /* (non-Javadoc)
38      * @see org.eclipse.ui.internal.presentations.IActionBarPresentationFactory#createCoolBarManager()
39      */

40     public ICoolBarManager2 createCoolBarManager() {
41         return new CoolBarManager2(SWT.FLAT);
42     }
43
44     /* (non-Javadoc)
45      * @see org.eclipse.ui.internal.presentations.IActionBarPresentationFactory#createToolBarManager()
46      */

47     public IToolBarManager2 createToolBarManager() {
48         return new ToolBarManager2(SWT.FLAT | SWT.RIGHT);
49     }
50
51     /* (non-Javadoc)
52      * @see org.eclipse.ui.internal.presentations.IActionBarPresentationFactory#createViewToolBarManager()
53      */

54     public IToolBarManager2 createViewToolBarManager() {
55         return new ToolBarManager2(SWT.FLAT | SWT.RIGHT | SWT.WRAP);
56     }
57
58     /* (non-Javadoc)
59      * @see org.eclipse.ui.internal.presentations.IActionBarPresentationFactory#createToolBarContributionItem(org.eclipse.jface.action.IToolBarManager, java.lang.String)
60      */

61     public IToolBarContributionItem createToolBarContributionItem(
62             IToolBarManager toolBarManager, String JavaDoc id) {
63         return new ToolBarContributionItem2(toolBarManager, id);
64     }
65 }
66
Popular Tags