Text Editor | composite [message #329186] |
Mon, 16 June 2008 15:23 |
Eclipse User |
|
|
|
Originally posted by: prasad.chand.gmail.com
Hi All,
I am trying to add a context menu to a TextEditor
(org.eclipse.ui.editors.text.TextEditor). I am trying to do this
dynamically by using MenuManager. When I call the createContextMenu() of
MenuManager I am required to pass the composite as the parameter. How do
I get the composite. For viewer I have been able to use the
TextViewer.getControl(). Is there a similar function that fetches the
composite for a textEditor.
I tried textEditor.getSite().getShell() but the menus are not getting
displayed.
I have attached the code below for greater context.
private void makePopupMenu(){
MenuManager menuMgr = new MenuManager("#PopupMenu");
Menu menu = menuMgr.createContextMenu(textEditor.getSite().getShell());
}
Stuck here for a while.
Thanks in advance,
Prasad
|
|
|
Powered by
FUDForum. Page generated in 0.04130 seconds