1 /******************************************************************************* 2 * Copyright (c) 2005, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.ui.internal.menus; 12 13 /** 14 * <p> 15 * Provides a hook by which third-party code can modify the contents of a menu 16 * or group before it is shown. This is mainly used by the workbench to allow 17 * third-party plug-ins to dynamic modify the contents of a menu. For example, 18 * a dynamic menu might be a list of recently opened files. 19 * </p> 20 * <p> 21 * Clients may implement this interface, but they must not extend it. 22 * </p> 23 * <p> 24 * <strong>PROVISIONAL</strong>. This class or interface has been added as 25 * part of a work in progress. There is a guarantee neither that this API will 26 * work nor that it will remain the same. Please do not use this API without 27 * consulting with the Platform/UI team. 28 * </p> 29 * <p> 30 * This class will eventually exist in <code>org.eclipse.jface.menus</code>. 31 * </p> 32 * 33 * @since 3.2 34 */ 35 public interface IDynamicMenu { 36 37 /** 38 * Called just before the given menu is about to show. This allows the 39 * implementor of this interface to modify the list of menu elements before 40 * the menu is actually shown. 41 * 42 * @param menu 43 * The menu that is about to show. This value is never null. 44 */ 45 public void aboutToShow(IMenuCollection menu); 46 } 47