KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > IObjectActionContributor


1 /*******************************************************************************
2  * Copyright (c) 2000, 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;
12
13 import java.util.List JavaDoc;
14
15 import org.eclipse.jface.action.IMenuManager;
16 import org.eclipse.jface.viewers.ISelectionProvider;
17 import org.eclipse.ui.IWorkbenchPart;
18
19 /**
20  * This interface must be implemented in order to contribute
21  * to context (pop-up) menu for an object. Classes
22  * that implement this interface must register
23  * with the popup menu manager.
24  */

25 public interface IObjectActionContributor extends IObjectContributor {
26     /**
27      * Implement this method to add actions that deal with the currently
28      * selected object or objects. Actions should be added to the
29      * provided menu object. Current selection can be obtained from
30      * the given selection provider.
31      *
32      * @return <code>true</code> if any contributions were made, and <code>false</code> otherwise.
33      */

34     public boolean contributeObjectActions(IWorkbenchPart part,
35             IMenuManager menu, ISelectionProvider selProv,
36             List JavaDoc actionIdOverrides);
37
38     /**
39      * Implement this method to add menus that deal with the currently
40      * selected object or objects. Menus should be added to the
41      * provided menu object. Current selection can be obtained from
42      * the given selection provider.
43      *
44      * @return <code>true</code> if any contributions were made, and <code>false</code> otherwise.
45      */

46     public boolean contributeObjectMenus(IMenuManager menu,
47             ISelectionProvider selProv);
48
49     /**
50      * Contribute to the list the action identifiers from other contributions that
51      * this contribution wants to override. Actions of these identifiers will
52      * not be contributed.
53      */

54     public void contributeObjectActionIdOverrides(List JavaDoc actionIdOverrides);
55 }
56
Popular Tags