Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Text editing
Text editing [message #116047] Mon, 25 August 2003 11:05 Go to next message
Eclipse UserFriend
Originally posted by: didier.besset.ch.sogeti.biz

Is there a quick way to assign edit standard menu (Del, Cut, Copy, Paste
and Select All) to a text control? I only found the Global or Retargetable
actions which must be assigned one by one.

Also, I found cut(), paste() and copy() methods in the Text class, but no
delete(). How comes?

Cheers,

Didier
Re: Text editing [message #116147 is a reply to message #116047] Mon, 25 August 2003 11:23 Go to previous messageGo to next message
Eclipse UserFriend
There is good article describing how to add actions (including menu bar
actions):


http://www.eclipse.org/articles/Article-action-contribution/ Contributing%20A
ctions%20to%20the%20Eclipse%20Workbench.html

To delete a region in a text, you could use

text.insert("");

This replaces the current selection with an empty string (which is what you
want).
You can set an arbitrary selection using text.setSelection(start, end)

Chris


"Didier Besset" <didier.besset@ch.sogeti.biz> wrote in message
news:bid8jo$spj$1@eclipse.org...
> Is there a quick way to assign edit standard menu (Del, Cut, Copy, Paste
> and Select All) to a text control? I only found the Global or Retargetable
> actions which must be assigned one by one.
>
> Also, I found cut(), paste() and copy() methods in the Text class, but no
> delete(). How comes?
>
> Cheers,
>
> Didier
>
Re: Text editing [message #116512 is a reply to message #116147] Tue, 26 August 2003 03:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: didier.besset.ch.sogeti.biz

Thanks for the tip on how to delete text. I was too thick to think about
it by myself...

Thanks for the pointer to the article too. However, I have been able to
add the contribution to the edit menu. It is just that it seems to me
adding standard cut&paste support to a text field is soooo mundane that it
ought to be solve within the Eclipse API, something like
aText.linkToEditorMenu. I ended doing something of the sort (certainly not
as general as one would hope), but I am surprised it does not exist as a
standard feature.

For example, a default cell text editor does not permit cut&paste
operations. This is quite weird...

Anyone else has suggestions?

Cheers,

Didier
Re: Text editing [message #116673 is a reply to message #116512] Tue, 26 August 2003 13:57 Go to previous messageGo to next message
Eclipse UserFriend
You are right about the mundane aspects of controlling the menus from an
editor.

The Eclipse 3.0 plan has lots of attention to improving the usage of
editors.
However, how this is done is considered "implementation details".

Customer is King, developers are just flipping burgers :-)

Chris


"Didier Besset" <didier.besset@ch.sogeti.biz> wrote in message
news:bif3nt$g74$1@eclipse.org...
> Thanks for the tip on how to delete text. I was too thick to think about
> it by myself...
>
> Thanks for the pointer to the article too. However, I have been able to
> add the contribution to the edit menu. It is just that it seems to me
> adding standard cut&paste support to a text field is soooo mundane that it
> ought to be solve within the Eclipse API, something like
> aText.linkToEditorMenu. I ended doing something of the sort (certainly not
> as general as one would hope), but I am surprised it does not exist as a
> standard feature.
>
> For example, a default cell text editor does not permit cut&paste
> operations. This is quite weird...
>
> Anyone else has suggestions?
>
> Cheers,
>
> Didier
>
Re: Text editing [message #123481 is a reply to message #116047] Fri, 05 September 2003 16:56 Go to previous message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

"Didier Besset" <didier.besset@ch.sogeti.biz> wrote in message news:bid8jo$spj$1@eclipse.org...
> Is there a quick way to assign edit standard menu (Del, Cut, Copy, Paste
> and Select All) to a text control? I only found the Global or Retargetable
> actions which must be assigned one by one.

org.eclipse.ui.actions.TextActionHandler seems to be what you want.

Knut
Previous Topic:working sets & resource filters
Next Topic:Save as don'work in M3
Goto Forum:
  


Current Time: Thu May 08 18:20:34 EDT 2025

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

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

Back to the top