01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.presentations;
11:
12: import org.eclipse.jface.action.IToolBarManager;
13: import org.eclipse.jface.internal.provisional.action.CoolBarManager2;
14: import org.eclipse.jface.internal.provisional.action.ICoolBarManager2;
15: import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem;
16: import org.eclipse.jface.internal.provisional.action.IToolBarManager2;
17: import org.eclipse.jface.internal.provisional.action.ToolBarContributionItem2;
18: import org.eclipse.jface.internal.provisional.action.ToolBarManager2;
19: import org.eclipse.swt.SWT;
20: import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory;
21:
22: /**
23: * The intention of this class is to allow for replacing the implementation of
24: * the cool bar and tool bars in the workbench.
25: * <p>
26: * <strong>EXPERIMENTAL</strong>. This class or interface has been added as
27: * part of a work in progress. There is a guarantee neither that this API will
28: * work nor that it will remain the same. Please do not use this API without
29: * consulting with the Platform/UI team.
30: * </p>
31: *
32: * @since 3.2
33: */
34: public class DefaultActionBarPresentationFactory implements
35: 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 id) {
63: return new ToolBarContributionItem2(toolBarManager, id);
64: }
65: }
|