blob: a91b0f51194be567da6608d7d6064bd59d4c0c7d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2003, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.tests.navigator.extension;
import junit.framework.Assert;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.CommonActionProviderConfig;
public class DependentActionProvider extends CommonActionProvider {
private IAction action = null;
public void init(CommonActionProviderConfig aConfig) {
action = new DependentAction(aConfig.getViewSite().getShell(), aConfig.getExtensionId());
}
public void fillContextMenu(IMenuManager menu) {
IMenuManager submenu = menu.findMenuUsingPath(TestActionProvider.GROUP_TEST_MENU);
Assert.assertNotNull("The submenu should have been added by TestActionProvider!", submenu);
submenu.insertAfter(TestActionProvider.GROUP_TEST_DEPENDENCY, action);
}
}