KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > internal > provisional > action > IToolBarContributionItem


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.jface.internal.provisional.action;
13
14 import org.eclipse.jface.action.IContributionItem;
15 import org.eclipse.jface.action.IContributionManager;
16 import org.eclipse.jface.action.IToolBarManager;
17
18 /**
19  * The intention of this interface is to provide in interface for
20  * ToolBarContributionItem so that the implementation can be replaced.
21  *
22  * <p>
23  * <strong>EXPERIMENTAL</strong>. This class or interface has been added as
24  * part of a work in progress. There is a guarantee neither that this API will
25  * work nor that it will remain the same. Please do not use this API without
26  * consulting with the Platform/UI team.
27  * </p>
28  *
29  * @since 3.2
30  */

31 public interface IToolBarContributionItem extends IContributionItem {
32
33     /**
34      * Returns the current height of the corresponding cool item.
35      *
36      * @return the current height
37      */

38     public int getCurrentHeight();
39
40     /**
41      * Returns the current width of the corresponding cool item.
42      *
43      * @return the current size
44      */

45     public int getCurrentWidth();
46
47     /**
48      * Returns the minimum number of tool items to show in the cool item.
49      *
50      * @return the minimum number of tool items to show, or <code>SHOW_ALL_ITEMS</code>
51      * if a value was not set
52      * @see #setMinimumItemsToShow(int)
53      */

54     public int getMinimumItemsToShow();
55     
56     /**
57      * Returns whether chevron support is enabled.
58      *
59      * @return <code>true</code> if chevron support is enabled, <code>false</code>
60      * otherwise
61      */

62     public boolean getUseChevron();
63     
64     /**
65      * Sets the current height of the cool item. Update(SIZE) should be called
66      * to adjust the widget.
67      *
68      * @param currentHeight
69      * the current height to set
70      */

71     public void setCurrentHeight(int currentHeight);
72
73     /**
74      * Sets the current width of the cool item. Update(SIZE) should be called
75      * to adjust the widget.
76      *
77      * @param currentWidth
78      * the current width to set
79      */

80     public void setCurrentWidth(int currentWidth);
81
82     /**
83      * Sets the minimum number of tool items to show in the cool item. If this
84      * number is less than the total tool items, a chevron will appear and the
85      * hidden tool items appear in a drop down menu. By default, all the tool
86      * items are shown in the cool item.
87      *
88      * @param minimumItemsToShow
89      * the minimum number of tool items to show.
90      * @see #getMinimumItemsToShow()
91      * @see #setUseChevron(boolean)
92      */

93     public void setMinimumItemsToShow(int minimumItemsToShow);
94
95     /**
96      * Enables or disables chevron support for the cool item. By default,
97      * chevron support is enabled.
98      *
99      * @param value
100      * <code>true</code> to enable chevron support, <code>false</code>
101      * otherwise.
102      */

103     public void setUseChevron(boolean value);
104     
105     /**
106      * Returns the internal tool bar manager of the contribution item.
107      *
108      * @return the tool bar manager, or <code>null</code> if one is not
109      * defined.
110      * @see IToolBarManager
111      */

112     public IToolBarManager getToolBarManager();
113     
114     /**
115      * Returns the parent contribution manager, or <code>null</code> if this
116      * contribution item is not currently added to a contribution manager.
117      *
118      * @return the parent contribution manager, or <code>null</code>
119      *
120      * TODO may not need this, getToolBarManager may be enough.
121      */

122     public IContributionManager getParent();
123     
124 }
125
Popular Tags