01: /*******************************************************************************
02: * Copyright (c) 2005, 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.tests.navigator;
11:
12: import org.eclipse.jface.action.Action;
13: import org.eclipse.jface.action.IAction;
14: import org.eclipse.jface.action.IMenuManager;
15: import org.eclipse.ui.navigator.CommonActionProvider;
16: import org.eclipse.ui.navigator.ICommonActionExtensionSite;
17:
18: public class TestOverrideableActionProvider extends
19: CommonActionProvider {
20:
21: private IAction action;
22:
23: public TestOverrideableActionProvider() {
24:
25: }
26:
27: /* (non-Javadoc)
28: * @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
29: */
30: public void init(ICommonActionExtensionSite site) {
31:
32: action = new Action() {
33:
34: };
35: action.setText(site.getExtensionId());
36: }
37:
38: /* (non-Javadoc)
39: * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
40: */
41: public void fillContextMenu(IMenuManager menu) {
42: menu.add(action);
43: }
44:
45: }
|