01: /*******************************************************************************
02: * Copyright (c) 2006 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.internal.menus;
11:
12: import org.eclipse.core.expressions.Expression;
13: import org.eclipse.jface.action.IContributionItem;
14: import org.eclipse.ui.internal.services.EvaluationResultCache;
15:
16: /**
17: * @since 3.3
18: *
19: */
20: public class MenuActivation extends EvaluationResultCache implements
21: IMenuActivation {
22:
23: private IContributionItem fItem;
24:
25: /**
26: * @param item
27: * this contribution ite
28: * @param visibleWhen
29: * when it's visible
30: * @param auth
31: * the menu authority responsible for this cache
32: */
33: public MenuActivation(IContributionItem item, Expression visibleWhen) {
34: super (visibleWhen);
35: fItem = item;
36: }
37:
38: /*
39: * (non-Javadoc)
40: *
41: * @see org.eclipse.ui.internal.menus.IMenuActivation#getContribution()
42: */
43: public IContributionItem getContribution() {
44: return fItem;
45: }
46: }
|