[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
Menu's in the View Problem
|
- From: Erik Scofield <escofield@xxxxxxx>
- Date: Tue, 13 Aug 2002 12:24:53 -0400
- Newsgroups: eclipse.tools
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
I am trying to add menu's to the view.. The view consists of a tree
with different nodes. Each node has a popUp corresponding to it's
particular task. I would like to mimic this in the View's menu. How do
I get the menu to select what to display using the same/similar logic as
the popups <Filter> element that calls the testAttribute?
Erik
Example PopUp code.
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="myGenericTreeObjectClass"
id="myID1">
<filter
name="ObjectType"
value="MyObjectType">
</filter>
<action
label="Label"
icon="icons/file_obj.gif"
class="myPopupClass"
menubarPath="additions"
enablesFor="1"
id="myID2">
</action>
</objectContribution>
</extension>
notice the objectClass is the same for every objectContribution or
popup.. The filter applied is based on a class attribute named
ObjectType that is set during the load of the tree. The
myGenericTreeObjectClass implements IActionFilter and overrides
testAttribute. TestAttribute checks "ObjectType" for "MyObjectType" and
returns true if they are equal.
I cannot figure out how to get the view's menu to have similar logic.