Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » protecting regions of java code from editing
protecting regions of java code from editing [message #181341] Thu, 07 October 2004 09:08 Go to next message
Eclipse UserFriend
Originally posted by: edoardoATenigmatecDOTnet.no.spam

Hi

how could I prevent some "parts" of a java source from being
edited/changed while leaving the rest of the file normally editable ??

TIA,
Edo

PS - I had defining a custom annotation and a custom marker,
and then lattaching listsners to the sourceviewer to set doit=false to
verify events.
this only stops some typing in the java editor, while other actions (eg
text move/up and down) are still doable and "screw" the source.

So I am looking at some "veto" coming frm the Document or ... the Java
Model/Java DOM/AST ?
Re: protecting regions of java code from editing [message #181352 is a reply to message #181341] Thu, 07 October 2004 09:41 Go to previous messageGo to next message
Tom Hofmann is currently offline Tom HofmannFriend
Messages: 770
Registered: July 2009
Senior Member
See the thread at

news://news.eclipse.org:119/cj1ici$cng$1@eclipse.org

-tom

Edoardo Comar wrote:
> Hi
>
> how could I prevent some "parts" of a java source from being
> edited/changed while leaving the rest of the file normally editable ??
>
> TIA,
> Edo
>
> PS - I had defining a custom annotation and a custom marker,
> and then lattaching listsners to the sourceviewer to set doit=false to
> verify events.
> this only stops some typing in the java editor, while other actions (eg
> text move/up and down) are still doable and "screw" the source.
>
> So I am looking at some "veto" coming frm the Document or ... the Java
> Model/Java DOM/AST ?
Re: protecting regions of java code from editing [message #181365 is a reply to message #181352] Thu, 07 October 2004 10:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: edoardoATenigmatecDOTnet.no.spam

Tom,

(don't know how to get to that thread using the hyperlink you posted,
anyway)
that was a thread I started some time ago and I thank you for your answer.

The problem I have is that there are lots of "actions" (*)
that do not fire VerifyEvent event and so I can't block them.

I must also worry about refactorings - as my source would be changed
even if there is no editor open on it!!

this is why I am tring to block these changes at a different level.

any ideas (from anyone in the community) ?

Edo

(*)e.g. cut (this may be a bug I submitted in bugzilla),
move selected lines up/down etc
refactorings!


Tom Eicher wrote:
> See the thread at
>
> news://news.eclipse.org:119/cj1ici$cng$1@eclipse.org
>
> -tom
>
> Edoardo Comar wrote:
>
>> Hi
>>
>> how could I prevent some "parts" of a java source from being
>> edited/changed while leaving the rest of the file normally editable ??
>>
>> TIA,
>> Edo
>>
>> PS - I had defining a custom annotation and a custom marker,
>> and then lattaching listsners to the sourceviewer to set doit=false to
>> verify events.
>> this only stops some typing in the java editor, while other actions
>> (eg text move/up and down) are still doable and "screw" the source.
>>
>> So I am looking at some "veto" coming frm the Document or ... the Java
>> Model/Java DOM/AST ?
Re: protecting regions of java code from editing [message #181383 is a reply to message #181365] Thu, 07 October 2004 12:46 Go to previous message
Tom Hofmann is currently offline Tom HofmannFriend
Messages: 770
Registered: July 2009
Senior Member
Edoardo Comar wrote:
> The problem I have is that there are lots of "actions" (*)
> that do not fire VerifyEvent event and so I can't block them.

That is why I suggested blocking the events from inside a custom
document, which is the model behind what you see in the editor and
receives all changes, including refactorings and others that operate
directly on the document.

The problem with this is that there is no veto-mechanism similar to the
one offered by VerifyEvent - I am afraid there is currently no easy
solution for this.

-tom
Previous Topic:Extending content-assist
Next Topic:How do you tell if a CompilationUnit is in error?
Goto Forum:
  


Current Time: Tue Jul 16 07:27:09 GMT 2024

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

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

Back to the top