Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Command Contribution to search results
Command Contribution to search results [message #605783] Fri, 14 May 2010 10:57
Praveen Joseph is currently offline Praveen JosephFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

I have contributed a search result page in my RCP.

When the search results are displayed, i would like to have some commands available in the popup menu.

Within the search results page, in the createPartControl() , a menu manager is created :

Snippet :
MenuManager menuMgr = new MenuManager("#PopUp");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {

public void menuAboutToShow(final IMenuManager mgr) {
fillContextMenu(mgr);
}
});

// Create menu.
Menu menu = menuMgr.createContextMenu(this.viewer.getControl());
this.viewer.getControl().setMenu(menu);

// Register menu for extension.
getSite().registerContextMenu(getID(), menuMgr, this.viewer);

The fillContextMenu() is as shown :

private void fillContextMenu(final IMenuManager mgr) {
ISelection selection = this.viewer.getSelection();
if (selection instanceof IStructuredSelection) {
Object firstElement = ((IStructuredSelection) selection).getFirstElement();
if (firstElement instanceof PLComponentFragment) {
mgr.add(...
...

mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
}
}


Is it possible to now add commands to the search results page context menu from the plugin.xml.

Adding an object contribution action works, however there was no way to add a command to the same!!!!



Thanks a lot in advance
Previous Topic:Command Contribution to search results
Next Topic:Update Site Start to Finish
Goto Forum:
  


Current Time: Thu Mar 28 14:17:07 GMT 2024

Powered by FUDForum. Page generated in 0.02350 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top