It's all about the answers!

Ask a question

Is it possible to extend a context menu that is created programmatically by RTC?


Stephen Lai (134) | asked Apr 27 '15, 3:13 a.m.
 Hi, I'd like to add an "Restore" item to the history view of RTC. Unlucky, after debugging, I found the context menu is created programmactically by "com.ibm.team.process.internal.ide.ui.history.ProcessHistoryPage" and no matter how I config my plugin.xml, the new item will only appear in the eclipse common context menu. I know this is a eclipse development question, but wanna to check with you experts to see if there's any solution. Thanks in advance!

Attach my plugin.xml here as well
<extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            objectClass="com.ibm.team.process.common.IProcessContainer"
            id="SimplePopupMenu.contribution1">
         <action
               label="Restore"
               class="processtemplaterestore.popup.actions.NewAction"
               menubarPath="additions"
               enablesFor="1"
               id="SimplePopupMenu.newAction">
         </action>
      </objectContribution>
   </extension>

One answer



permanent link
Stephen Lai (134) | answered Apr 27 '15, 11:59 p.m.
 Let me clarify my question with more details. In the RTC component, it creates the popup menu in following way

MenuManager menuMgr = new MenuManager("#PopupMenu");
Action openFile = new Action(....);
menuMgr.add(openFile);
Action compare = new Action(...);
menuMgr.add(compare);
Menu menu = menuMgr.createContextMenu(fViewer.getControl());
fViewer.getControl().setMenu(menu);

so that no matter how I configure my plugin.xml, my menu item won't appear in this context menu. Is it possible to write a plugin with startup extension to change this popup menu during startup? or any other way to add my item in this menu?

Your answer


Register or to post your answer.