Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to add context menu in "Pending Changes" view in RTC?

 Hi all, 

My requirement is add new context menu in RTC pending changes view in RTC, but after writting my plugin it is not visible in view. following is my plugin.xml file

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

   <extension
         point="org.eclipse.ui.popupMenus">
     <viewerContribution
      id="com.ibm.team.filesystem.ui.changes.views.LocalWorkspaceChangesView_7"
      targetID="com.ibm.team.filesystem.ui.changes.views.LocalWorkspaceChangesView">
      <visibility>
            <or>
            <objectClass name="com.ibm.team.filesystem.rcp.core.internal.changes.model.IWorkspaceSyncContext"/>
            <objectClass name="com.ibm.team.filesystem.rcp.core.internal.changes.model.IComponentSyncContext"/>
            <objectClass name="com.ibm.team.filesystem.rcp.core.internal.changes.model.IIncomingRemoteActivity"/>
            <objectClass name="com.ibm.team.filesystem.rcp.core.internal.changes.model.IIncomingActivitySource"/>
            <objectClass name="com.ibm.team.filesystem.rcp.core.internal.changes.model.IIncomingBaselineGroup"/>
            </or>
            </visibility>  
     <action
      class="com.ibm.test.CustomAction" icon="/images/Component_obj.gif"
       id=" com.ibm.test.customaction"  label="Custom Menu..."  style="push"/>
     </viewerContribution>  
   </extension>
</plugin>

0 votes


Accepted answer

Permanent link

 This is really basically an Eclipse extension question. You should go to the Eclipse forums and search there. I have published something here: https://rsjazz.wordpress.com/2014/02/21/adding-context-menus-for-jazz-objects-to-the-rtc-eclipse-client/ that might be useful.

Ralph Schoon selected this answer as the correct answer

0 votes

Comments

@Ralph Schoon Thanks for your feedback, I did code with eclipse views and it works fine, but when I tried with RTC eclipse it does not work. I also go through your artocle mentioned above, its regarding object contribution, and I am looking for viewer contribution 

The "Additions" and menu contribution should work the same. I am missing all the information to add to an existing menu in your plugin.xml. See my example. Anyway, I don't have more at the moment. 

@Ralph Schoon Thanks for guiding me but I think you are unable to understand my problem statement, by using object contribution I added menu in context menu of one object, but now I want to add menu in view's context menu. You are referring org.eclise.ui.menus and my requirement is org.eclipse.ui.opoupmenus 

Question on: "by using object contribution I added menu in context menu of one object, but now I want to add menu in view's context menu."

What do you mean by "view's context menu"? If you mean the little down arrow in the view header bar, the current code snippet would not do that.
<objectContribution> and <viewerContribution> are very similar... objectContribution lets you add a context menu to a specific type 'anywhere' it appears in Eclipse, whereas <viewerContribution> lets to add a context menu action to all types, but only in a specific view (of course filters can further be used to determine on which types the action appears).
It's not straight foward to add actions to the view menu. I suspect you can find the Eclipse ViewPart object (the PC view ID is: "com.ibm.team.filesystem.ui.changes.views.LocalWorkspaceChangesView").
From there you'd get:
IMenuManager menuManager = pcViewPart.getViewSite().getActionBars().getMenuManager();
and then add the desired actions to the Menu.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936

Question asked: Mar 04 '19, 3:15 a.m.

Question was seen: 1,583 times

Last updated: Jun 11 '19, 9:48 a.m.

Confirmation Cancel Confirm