Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Text Editor | composite
Text Editor | composite [message #329186] Mon, 16 June 2008 15:23
Eclipse UserFriend
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
Previous Topic:Hardcoded 'plugins' dir name
Next Topic:Hide/unhide a toolbar inside a coolbar
Goto Forum:
  


Current Time: Tue Jul 16 13:37:55 GMT 2024

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

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

Back to the top