25
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2003, 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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.action.ICoolBarManager;
|
|
14
|
|
15 import dwtx.jface.action.IContributionManager;
|
|
16 import dwtx.jface.action.IToolBarManager;
|
|
17 import dwtx.jface.action.IMenuManager;
|
|
18
|
|
19 import dwt.widgets.CoolBar;
|
|
20
|
|
21 import dwt.dwthelper.utils;
|
|
22
|
|
23 /**
|
|
24 * The <code>ICoolBarManager</code> interface provides protocol for managing
|
|
25 * contributions to a cool bar. A cool bar manager delegates responsibility for
|
|
26 * creating child controls to its contribution items by calling
|
|
27 * {@link IContributionItem#fill(CoolBar, int)}.
|
|
28 * <p>
|
|
29 * This interface is internal to the framework; it should not be implemented
|
|
30 * outside the framework. This package provides a concrete cool bar manager
|
|
31 * implementation, {@link CoolBarManager}, which
|
|
32 * clients may instantiate or subclass.
|
|
33 * </p>
|
|
34 *
|
|
35 * @see ToolBarContributionItem
|
|
36 * @since 3.0
|
|
37 */
|
|
38 public interface ICoolBarManager : IContributionManager {
|
|
39
|
|
40 /**
|
|
41 * Property name of a cool item's size (value <code>"size"</code>).
|
|
42 * <p>
|
|
43 * The cool bar manager uses this property to tell its cool items to update
|
|
44 * their size.
|
|
45 * </p>
|
|
46 *
|
|
47 * @see IContributionItem#update(String) @issue consider declaring this
|
|
48 * constant elsewhere
|
|
49 */
|
|
50 public static const String SIZE = "size"; //$NON-NLS-1$
|
|
51
|
|
52 /**
|
|
53 * A convenience method to add a tool bar as a contribution item to this
|
|
54 * cool bar manager. Equivalent to <code>add(new ToolBarContributionManager(toolBarManager))</code>.
|
|
55 *
|
|
56 * @param toolBarManager
|
|
57 * the tool bar manager to be added
|
|
58 * @see ToolBarContributionItem
|
|
59 */
|
|
60 public void add(IToolBarManager toolBarManager);
|
|
61
|
|
62 /**
|
|
63 * Returns the context menu manager used by this cool bar manager. This
|
|
64 * context menu manager is used by the cool bar manager except for cool
|
|
65 * items that provide their own.
|
|
66 *
|
|
67 * @return the context menu manager, or <code>null</code> if none
|
|
68 * @see #setContextMenuManager
|
|
69 */
|
|
70 public IMenuManager getContextMenuManager();
|
|
71
|
|
72 /**
|
|
73 * Returns whether the layout of the underlying cool bar widget is locked.
|
|
74 *
|
|
75 * @return <code>true</code> if cool bar layout is locked, <code>false</code>
|
|
76 * otherwise
|
|
77 */
|
|
78 public bool getLockLayout();
|
|
79
|
|
80 /**
|
|
81 * Returns the style of the underlying cool bar widget.
|
|
82 *
|
|
83 * @return the style of the cool bar
|
|
84 */
|
|
85 public int getStyle();
|
|
86
|
|
87 /**
|
|
88 * Sets the context menu of this cool bar manager to the given menu
|
|
89 * manager.
|
|
90 *
|
|
91 * @param menuManager
|
|
92 * the context menu manager, or <code>null</code> if none
|
|
93 * @see #getContextMenuManager
|
|
94 */
|
|
95 public void setContextMenuManager(IMenuManager menuManager);
|
|
96
|
|
97 /**
|
|
98 * Locks or unlocks the layout of the underlying cool bar widget. Once the
|
|
99 * cool bar is locked, cool items cannot be repositioned by the user.
|
|
100 * <p>
|
|
101 * Note that items can be added or removed programmatically even while the
|
|
102 * cool bar is locked.
|
|
103 * </p>
|
|
104 *
|
|
105 * @param value
|
|
106 * <code>true</code> to lock the cool bar, <code>false</code>
|
|
107 * to unlock
|
|
108 */
|
|
109 public void setLockLayout(bool value);
|
|
110
|
|
111 }
|