|
|
|
|
Re: Do eclipse editors support what is called GUARD BLOCKS in netbeans? [message #438286 is a reply to message #438269] |
Sat, 19 June 2004 13:18 |
RD Messages: 5 Registered: July 2009 |
Junior Member |
|
|
Grant,
Interesting. Thanks for that tip.
I shall try that out and let the forum know, if that works out or not.
Regards,
-RD
Grant Gayed wrote:
> Right, so a verify listener is the way to do this. ie.-
> text.addVerifyListener(new VerifyListener() {
> public void verifyText(VerifyEvent e) {
> int changeStart = e.start;
> int changeEnd = e.end;
> // do some context-specific computation to determine if this
> // range intersects with a non-editable portion of the document
> // text and set e.doit and/or e.text accordingly
> }
> });
> There is not a way to pre-mark sections of text as read-only.
> Grant
> "RD" <rajan11@hotmail.com> wrote in message news:cassg8$868$1@eclipse.org...
> > Grant,
> >
> > Thanks for your response. I am writing my own editor. I understand that
> > setting doit to false in VerifyListener may work, but I want to disable
> > only part of the document non-editable. For example, I might have a token,
> > say SNGLE_LINE_COMMENT (// in java) and I want to make all such token
> > non-editable. Is it possible?
> >
> > Regards,
> > -RD
> >
> > Grant Gayed wrote:
> >
> > > If you're asking this about the eclipse java editor specifically (ie.-
> > > through a user menu or api on the java editor) then you should ask this
> on
> > > the eclipse.tools.jdt newsgroup, and if they say it's not available then
> log
> > > a Feature Request with JDT - UI.
> >
> > > Alternatively, if you're writing your own editor then you can hook a
> Verify
> > > listener to your underlying Text or StyledText and then veto any changes
> > > that are attempted within a logical protected area.
> >
> > > Grant
> >
> > > "RD" <rajan11@hotmail.com> wrote in message
> news:caiila$f7t$1@eclipse.org...
> > > > Netbeans Editor module has what is called GUARD BLOCK that prevents
> the
> > > > user from editing section of the text in the editor - typically used
> for
> > > > guard generated code. Does eclipse support that notion?
> > > >
> >
> >
|
|
|
Powered by
FUDForum. Page generated in 0.03144 seconds