creating "read only" code lines in Net Beans

K

Ken Kafieh

Does anyone know how to do this?

Whenever you create a form in Net Beans and then manually edit the code, you
may have noticed that most of automatically generated code is shaded in
light blue, and it cannot be modified in the Net Beans editor. Does anyone
know of a way that we can mark our own code as read only like this? This
would be especially useful when used in a template.


-Ken
 
F

Flip

light blue, and it cannot be modified in the Net Beans editor. Does
anyone
My guess is there is an object behind the code and in conjunction with the
IDE, it enforces read only properties on those lines. I personally don't
know of any way to do this and make it IDE specific. What I'm getting at is
you might want to take a look at the editor object in Net Beans and see what
data structure it's using and the methods in there. JB doesn't have
something like this at the moment.

What happens when you save the file to the filesystem? Is the file in a
native .java format? Can you run a javac on it outside of NetBeans? If you
can, see if there is any special formatting in there that NetBeans would be
using to interpret special blocks of code was read only. If the code you're
looking at is in an xml format, then you might want to look for a
corresponding NetBeans xslt? Or at the editor methods again.

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,235
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top