KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > action > ICoolBarManager


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  *******************************************************************************/

11 package org.eclipse.jface.action;
12
13 import org.eclipse.swt.widgets.CoolBar;
14
15 /**
16  * The <code>ICoolBarManager</code> interface provides protocol for managing
17  * contributions to a cool bar. A cool bar manager delegates responsibility for
18  * creating child controls to its contribution items by calling
19  * {@link IContributionItem#fill(CoolBar, int)}.
20  * <p>
21  * This interface is internal to the framework; it should not be implemented
22  * outside the framework. This package provides a concrete cool bar manager
23  * implementation, {@link CoolBarManager}, which
24  * clients may instantiate or subclass.
25  * </p>
26  *
27  * @see ToolBarContributionItem
28  * @since 3.0
29  */

30 public interface ICoolBarManager extends IContributionManager {
31
32     /**
33      * Property name of a cool item's size (value <code>"size"</code>).
34      * <p>
35      * The cool bar manager uses this property to tell its cool items to update
36      * their size.
37      * </p>
38      *
39      * @see IContributionItem#update(String) @issue consider declaring this
40      * constant elsewhere
41      */

42     public static final String JavaDoc SIZE = "size"; //$NON-NLS-1$
43

44     /**
45      * A convenience method to add a tool bar as a contribution item to this
46      * cool bar manager. Equivalent to <code>add(new ToolBarContributionManager(toolBarManager))</code>.
47      *
48      * @param toolBarManager
49      * the tool bar manager to be added
50      * @see ToolBarContributionItem
51      */

52     public void add(IToolBarManager toolBarManager);
53
54     /**
55      * Returns the context menu manager used by this cool bar manager. This
56      * context menu manager is used by the cool bar manager except for cool
57      * items that provide their own.
58      *
59      * @return the context menu manager, or <code>null</code> if none
60      * @see #setContextMenuManager
61      */

62     public IMenuManager getContextMenuManager();
63
64     /**
65      * Returns whether the layout of the underlying cool bar widget is locked.
66      *
67      * @return <code>true</code> if cool bar layout is locked, <code>false</code>
68      * otherwise
69      */

70     public boolean getLockLayout();
71
72     /**
73      * Returns the style of the underlying cool bar widget.
74      *
75      * @return the style of the cool bar
76      */

77     public int getStyle();
78
79     /**
80      * Sets the context menu of this cool bar manager to the given menu
81      * manager.
82      *
83      * @param menuManager
84      * the context menu manager, or <code>null</code> if none
85      * @see #getContextMenuManager
86      */

87     public void setContextMenuManager(IMenuManager menuManager);
88
89     /**
90      * Locks or unlocks the layout of the underlying cool bar widget. Once the
91      * cool bar is locked, cool items cannot be repositioned by the user.
92      * <p>
93      * Note that items can be added or removed programmatically even while the
94      * cool bar is locked.
95      * </p>
96      *
97      * @param value
98      * <code>true</code> to lock the cool bar, <code>false</code>
99      * to unlock
100      */

101     public void setLockLayout(boolean value);
102
103 }
104
Popular Tags