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