01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.menus;
11:
12: import org.eclipse.core.expressions.Expression;
13: import org.eclipse.jface.action.IContributionItem;
14: import org.eclipse.jface.action.IContributionManager;
15:
16: /**
17: * Instances of this interface represent a position in the contribution
18: * hierarchy into which {@link AbstractContributionFactory} instances may insert
19: * elements. Instances of this interface are provided by the platform and this
20: * interface should <b>NOT</b> be implemented by clients.
21: *
22: *
23: * @since 3.3
24: */
25: public interface IContributionRoot {
26: /**
27: * Adds a given contribution item with provided visibility expression and
28: * kill-switch filtering as a direct child of this container. This should be
29: * called for all top-level elements created in
30: * {@link AbstractContributionFactory#createContributionItems(org.eclipse.ui.services.IServiceLocator, IContributionRoot)}
31: *
32: * @param item
33: * the item to add
34: * @param visibleWhen
35: * the visibility expression. May be <code>null</code>.
36: */
37: public void addContributionItem(IContributionItem item,
38: Expression visibleWhen);
39:
40: /**
41: * Registers visibilty for arbitrary {@link IContributionItem} instances
42: * that are <b>NOT</b> direct children of this container. Ie: children of a
43: * {@link IContributionManager} that has been previously registered with a
44: * call to {{@link #addContributionItem(IContributionItem, Expression)}.
45: *
46: * @param item
47: * the item for which to register a visibility clause
48: * @param visibleWhen
49: * the visibility expression. May be <code>null</code> in which
50: * case this method is a no-op.
51: */
52: public void registerVisibilityForChild(IContributionItem item,
53: Expression visibleWhen);
54: }
|