KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > menus > LegacyContributionItem


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.ui.internal.menus;
13
14 import org.eclipse.jface.action.IContributionItem;
15 import org.eclipse.jface.action.IContributionManager;
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.swt.widgets.CoolBar;
18 import org.eclipse.swt.widgets.Menu;
19 import org.eclipse.swt.widgets.ToolBar;
20
21 /**
22  * <p>
23  * A wrapper around the new command-based menu services that speaks in terms of
24  * the old contribution item interface.
25  * </p>
26  * <p>
27  * This class is not intended to be used outside of the
28  * <code>org.eclipse.ui.workbench</code> plug-in.
29  * </p>
30  *
31  * @since 3.2
32  *
33  */

34 final class LegacyContributionItem implements IContributionItem {
35
36     /**
37      * The layout node representing this contribution item; never
38      * <code>null</code>.
39      */

40     private final ILayoutNode node;
41
42     /**
43      * Constructs a new instance of <code>LegacyContributionItem</code>.
44      *
45      * @param node
46      * The node to wrapper; must not be <code>null</code>.
47      */

48     LegacyContributionItem(final ILayoutNode node) {
49         if (node == null) {
50             throw new NullPointerException JavaDoc(
51                     "A legacy contribution item requires a non-null layout node"); //$NON-NLS-1$
52
}
53         this.node = node;
54     }
55
56     /*
57      * (non-Javadoc)
58      *
59      * @see org.eclipse.jface.action.IContributionItem#dispose()
60      */

61     public void dispose() {
62         // TODO Auto-generated method stub
63

64     }
65
66     /*
67      * (non-Javadoc)
68      *
69      * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Composite)
70      */

71     public void fill(Composite parent) {
72         // TODO Auto-generated method stub
73

74     }
75
76     /*
77      * (non-Javadoc)
78      *
79      * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.CoolBar,
80      * int)
81      */

82     public void fill(CoolBar parent, int index) {
83         // TODO Auto-generated method stub
84

85     }
86
87     /*
88      * (non-Javadoc)
89      *
90      * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Menu,
91      * int)
92      */

93     public void fill(Menu parent, int index) {
94         // TODO Auto-generated method stub
95

96     }
97
98     /*
99      * (non-Javadoc)
100      *
101      * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.ToolBar,
102      * int)
103      */

104     public void fill(ToolBar parent, int index) {
105         // TODO Auto-generated method stub
106

107     }
108
109     public final String JavaDoc getId() {
110         return node.getId();
111     }
112
113     /*
114      * (non-Javadoc)
115      *
116      * @see org.eclipse.jface.action.IContributionItem#isDirty()
117      */

118     public boolean isDirty() {
119         // TODO Auto-generated method stub
120
return false;
121     }
122
123     /*
124      * (non-Javadoc)
125      *
126      * @see org.eclipse.jface.action.IContributionItem#isDynamic()
127      */

128     public boolean isDynamic() {
129         // TODO Auto-generated method stub
130
return false;
131     }
132
133     /*
134      * (non-Javadoc)
135      *
136      * @see org.eclipse.jface.action.IContributionItem#isEnabled()
137      */

138     public boolean isEnabled() {
139         // TODO Auto-generated method stub
140
return false;
141     }
142
143     /*
144      * (non-Javadoc)
145      *
146      * @see org.eclipse.jface.action.IContributionItem#isGroupMarker()
147      */

148     public boolean isGroupMarker() {
149         // TODO Auto-generated method stub
150
return false;
151     }
152
153     /*
154      * (non-Javadoc)
155      *
156      * @see org.eclipse.jface.action.IContributionItem#isSeparator()
157      */

158     public boolean isSeparator() {
159         // TODO Auto-generated method stub
160
return false;
161     }
162
163     /*
164      * (non-Javadoc)
165      *
166      * @see org.eclipse.jface.action.IContributionItem#isVisible()
167      */

168     public boolean isVisible() {
169         // TODO Auto-generated method stub
170
return false;
171     }
172
173     /*
174      * (non-Javadoc)
175      *
176      * @see org.eclipse.jface.action.IContributionItem#saveWidgetState()
177      */

178     public void saveWidgetState() {
179         // TODO Auto-generated method stub
180

181     }
182
183     /*
184      * (non-Javadoc)
185      *
186      * @see org.eclipse.jface.action.IContributionItem#setParent(org.eclipse.jface.action.IContributionManager)
187      */

188     public void setParent(IContributionManager parent) {
189         // TODO Auto-generated method stub
190

191     }
192
193     /*
194      * (non-Javadoc)
195      *
196      * @see org.eclipse.jface.action.IContributionItem#setVisible(boolean)
197      */

198     public void setVisible(boolean visible) {
199         // TODO Auto-generated method stub
200

201     }
202
203     /*
204      * (non-Javadoc)
205      *
206      * @see org.eclipse.jface.action.IContributionItem#update()
207      */

208     public void update() {
209         // TODO Auto-generated method stub
210

211     }
212
213     /*
214      * (non-Javadoc)
215      *
216      * @see org.eclipse.jface.action.IContributionItem#update(java.lang.String)
217      */

218     public void update(String JavaDoc id) {
219         // TODO Auto-generated method stub
220

221     }
222     
223     public final String JavaDoc toString() {
224         final StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
225         buffer.append("LegacyContributionItem("); //$NON-NLS-1$
226
buffer.append(node);
227         buffer.append(')');
228         return buffer.toString();
229     }
230 }
231
Popular Tags