KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > menus > IContributionRoot


1 /*******************************************************************************
2  * Copyright (c) 2007 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.menus;
13
14 import org.eclipse.core.expressions.Expression;
15 import org.eclipse.jface.action.IContributionItem;
16 import org.eclipse.jface.action.IContributionManager;
17
18 /**
19  * Instances of this interface represent a position in the contribution
20  * hierarchy into which {@link AbstractContributionFactory} instances may insert
21  * elements. Instances of this interface are provided by the platform and this
22  * interface should <b>NOT</b> be implemented by clients.
23  *
24  *
25  * @since 3.3
26  */

27 public interface IContributionRoot {
28     /**
29      * Adds a given contribution item with provided visibility expression and
30      * kill-switch filtering as a direct child of this container. This should be
31      * called for all top-level elements created in
32      * {@link AbstractContributionFactory#createContributionItems(org.eclipse.ui.services.IServiceLocator, IContributionRoot)}
33      *
34      * @param item
35      * the item to add
36      * @param visibleWhen
37      * the visibility expression. May be <code>null</code>.
38      */

39     public void addContributionItem(IContributionItem item,
40             Expression visibleWhen);
41
42     /**
43      * Registers visibilty for arbitrary {@link IContributionItem} instances
44      * that are <b>NOT</b> direct children of this container. Ie: children of a
45      * {@link IContributionManager} that has been previously registered with a
46      * call to {{@link #addContributionItem(IContributionItem, Expression)}.
47      *
48      * @param item
49      * the item for which to register a visibility clause
50      * @param visibleWhen
51      * the visibility expression. May be <code>null</code> in which
52      * case this method is a no-op.
53      */

54     public void registerVisibilityForChild(IContributionItem item,
55             Expression visibleWhen);
56 }
57
Popular Tags