Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Pop up menus Java UI Plugin Development(Pop up menus Java UI Plugin Development issues)
Pop up menus Java UI Plugin Development [message #902691] Sun, 19 August 2012 12:36 Go to next message
shalini Pachineela is currently offline shalini Pachineela
Messages: 2
Registered: August 2012
Junior Member
Hi,

I am working on Java UI Plug in development for Lotus notes. I want to add context menus based on the type of document that I have selected. Typically, different menus should be visible based on appointment, mail or contact document that I right click on.

I followed the Java UI exerciser and I noticed that an instance of "com.ibm.notes.java.ui.documents.NotesUIDocument" can find what document I currently am in. I followed the java UI exerciser project and it din't work for me. The menu always appears greyed out. And also, all the pop up menus added in the exerciser having an instance of com.ibm.notes.java.ui.documents.NotesUIDocument" is greyed out.

I attached a part of my plugin.xml related to this problem for your reference too.


<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?after=additions"> <command
commandId="com.sap.sod.ln.shelf.addon.testmenu"
style="push">
<visibleWhen>
<count
value="1">
</count>
<iterate>
<instanceof
value="com.ibm.notes.java.ui.documents.NotesUIDocument">
</instanceof>
</iterate>
</visibleWhen>
</command>
</menuContribution>


<command
id="com.sap.sod.ln.shelf.addon.testmenu"
name="test menu">
</command>

<handler
class="com.sap.sod.ln.shelf.addon.contextmenu.TestClass"
commandId="com.sap.sod.ln.shelf.addon.testmenu">
<enabledWhen>
<iterate>
<instanceof
value="com.ibm.notes.java.ui.documents.NotesUIDocument">
</instanceof>
</iterate>
</enabledWhen>
<activeWhen>
<count
value="1">
</count>
</activeWhen>
</handler>
<handler
class="com.sap.sod.ln.shelf.addon.contextmenu.TestClass"
commandId="com.sap.sod.ln.shelf.addon.tool.tools">
</handler>
Re: Pop up menus Java UI Plugin Development [message #902855 is a reply to message #902691] Mon, 20 August 2012 14:19 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

What if you insert a with element into your core expressions:

<visibleWhen>
<with variable="activeMenuSelection">
<count
value="1">
</count>
<iterate>
<instanceof
value="com.ibm.notes.java.ui.documents.NotesUIDocument">
</instanceof>
</iterate>
</with>
</visibleWhen>

Apply the same logic to your handler activeWhen (leave out the enabledWhen for now).

PW


Previous Topic:PullDown item in tool bar with dynamic options
Next Topic:Which bmp represents the icon associated with the rcp executable in a .product file.
Goto Forum:
  


Current Time: Thu Aug 21 18:20:44 EDT 2014

Powered by FUDForum. Page generated in 0.01539 seconds