Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Do eclipse editors support what is called GUARD BLOCKS in netbeans?
Do eclipse editors support what is called GUARD BLOCKS in netbeans? [message #437917] Sun, 13 June 2004 21:58 Go to next message
RD is currently offline RDFriend
Messages: 5
Registered: July 2009
Junior Member
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?
Re: Do eclipse editors support what is called GUARD BLOCKS in netbeans? [message #438111 is a reply to message #437917] Wed, 16 June 2004 14:23 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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?
>
Re: Do eclipse editors support what is called GUARD BLOCKS in netbeans? [message #438245 is a reply to message #438111] Thu, 17 June 2004 19:47 Go to previous messageGo to next message
RD is currently offline RDFriend
Messages: 5
Registered: July 2009
Junior Member
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?
> >
Re: Do eclipse editors support what is called GUARD BLOCKS in netbeans? [message #438269 is a reply to message #438245] Fri, 18 June 2004 12:26 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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?
> > >
>
>
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 Go to previous message
RD is currently offline RDFriend
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?
> > > >
> >
> >
Previous Topic:implmenting editors in 3.0
Next Topic:Can SWT run on BeOS?
Goto Forum:
  


Current Time: Thu Apr 25 07:11:28 GMT 2024

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

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

Back to the top