Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Lock Lines in TextEditor
Lock Lines in TextEditor [message #663657] Wed, 06 April 2011 05:49 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
I want to lock lines in an text editor. The text editor is the standard java editor (CompilationUnitEditor).

I want the user just to be able to write for example code in a method. Everything else in the editor should be locken. The user should really just be able to code the method body, nothing else.

I've seen editors locking lines, but I do not want to overwrite the hole javaeditor.
Is there any possibility to block lines just via the IEditorPart object of the editor?

Thanks in advance
Alex
Re: Lock Lines in TextEditor [message #663677 is a reply to message #663657] Wed, 06 April 2011 07:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 06.04.2011 07:49, Alexander Mack wrote:
> Hello,
> I want to lock lines in an text editor. The text editor is the
> standard java editor (CompilationUnitEditor).
>
> I want the user just to be able to write for example code in a method.
> Everything else in the editor should be locken. The user should really
> just be able to code the method body, nothing else.
>
> I've seen editors locking lines, but I do not want to overwrite the
> hole javaeditor.
> Is there any possibility to block lines just via the IEditorPart
> object of the editor?
No.

Dani
>
> Thanks in advance
> Alex
Re: Lock Lines in TextEditor [message #663855 is a reply to message #663657] Wed, 06 April 2011 16:09 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Oh I got it implicit by adding a IEventConsumer to the TextViewer.

Within the IEVentConsumer, I set the event.doit = false if I am within a region which I do not want to be enabled for editing.

Thanks anyway for your help!

Kind regards
Alex

[Updated on: Wed, 06 April 2011 16:10]

Report message to a moderator

Re: Lock Lines in TextEditor [message #764827 is a reply to message #663855] Mon, 12 December 2011 23:03 Go to previous message
M Dahlem is currently offline M DahlemFriend
Messages: 6
Registered: November 2011
Junior Member
Dear Alex,

I have the same problem with my Editor.

Can you please explain, where you added the listener, and how you found out the current partition, where the event occured?

Thanks!
Previous Topic:Creating problem markers referring to files outside workspace
Next Topic:System property https.proxyPort is not set but should be 3128
Goto Forum:
  


Current Time: Thu Apr 25 21:26:22 GMT 2024

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

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

Back to the top