Generic Context Menus for StyledText Control [message #436849] |
Tue, 25 May 2004 17:21  |
Eclipse User |
|
|
|
Hi,
I am creating a StyledText control and was wondering is there a generic
context menu for this control like there is for the Text control (Undo,
Cut, Copy, Paste, Delete and SelectAll)??... Currently I am providing my
own context menu but I think I should re-use a generic one if there is one
as all I want to do are the standard operations and so want the StyledText
to behave exactky like the Text control in that respect!
Also I was wondering how the generic context menu for the Text control is
implemented as I was trying to debug and could not find out where the
actions in the generic context menu for the text control are implemented.
Cheers - Saurabh
|
|
|
|
Re: Generic Context Menus for StyledText Control [message #436951 is a reply to message #436852] |
Wed, 26 May 2004 11:55  |
Eclipse User |
|
|
|
Thanks for the quick response Henning. And your suggestion to look into
TextViewer.canDoOperation(int) and TextViewer.doOperation(int) helped me
re-implement my context menu in a better way :).
But the question that I wanted to ask was why there is no "out-of-the-box"
context menu for StyledText as there is for the Text widget. And if this
was the intended design that what was the reasoning behind not providing
for an "out-of-the-box" context menu for StyledText??
Futhermore I was wondering how is the "out-of-the-box" context menu for
the Text widget implemented??
Cheers - Saurabh
Henning Rogge wrote:
> Saurabh Bagrodia wrote:
> > I am creating a StyledText control and was wondering is there a generic
> > context menu for this control like there is for the Text control (Undo,
> > Cut, Copy, Paste, Delete and SelectAll)??... Currently I am providing my
> > own context menu but I think I should re-use a generic one if there is one
> > as all I want to do are the standard operations and so want the StyledText
> > to behave exactky like the Text control in that respect!
> IActionBars bars = getSite().getActionBars();
> bars.setGlobalActionHandler(...)
> is used to tell eclipse that it should call your action when a certain
> retargetable global menu ( cut/copy/paste/ect. ) is activated.
> > Also I was wondering how the generic context menu for the Text control is
> > implemented as I was trying to debug and could not find out where the
> > actions in the generic context menu for the text control are implemented.
> look for TextViewer.canDoOperation(int) and TextViewer.doOperation(int)
> Henning Rogge.
|
|
|
Powered by
FUDForum. Page generated in 0.03269 seconds