RE: [nbusers] Custom Syntax Coloring

Miguel Munoz <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.tasklist.devel
Message-ID <7DF9F59DFDDD7D45905597D1E2EE0BC6900AE8__6314.96145292676$1054569867@exchg4.corp.p4pnet.net>
Tor,

  Thanks for the new feature. It's a very elegant extension of the existing
tools. I'm looking forward to using it whenever it comes out.

  While I appreciate the new feature, I still want the ability to customize
my syntax coloring. I like to add the main awt, swing, and util classes to
the syntax coloring, as well as our in-house standard classes. Finally, my
example was intended to illustrate how we can solve common problems with
creative use of syntax coloring.

-- MM


-----Original Message-----
From: Tor Norbye [mailto:[email protected]]
Sent: Tuesday, December 31, 2002 12:28 AM
To: [email protected]
Cc: [email protected]
Subject: RE: [nbusers] Custom Syntax Coloring


On Mon, 2002-12-30 at 13:32, Miguel Munoz wrote:
> I want to add words to the syntax coloring, and I'd like to see a good,
> simple interface to do this in NetBeans. For example, I have a bad habit
of
> typing the following:
> 
>   instanceOf
>   HashTable
>   Hashmap
>   hashcode
>   subString

Interesting problem. I can't help you with the editor, but I just
(as a result of your above post) added a new feature to the tasklist
module which catches 4 of the above 5 cases (it doesn't catch the
first one - the wrongly cased keyword).

NetBeans 3.4 and above has a feature which runs background compilation.
The tasklist module will list the errors found by the background
compilation for you, and (when it can) offer suggestions for how the
error can be fixed. By double clicking on the suggestion it will perform
the fix for you.

Back to the above problem.

When it finds an unresolved method or class name, it will now check for
to see if there are other methods or classes with the same name, but
different capitalization. If one is found, it offers a suggestion to
fix it.

Thus, if you write
   "HashTable t = null"
you'll get the suggestion
   "Change HashTable to Hashtable"
and double clicking it will replace the reference on the above line
to Hashtable - and it will import java.util.Hashtable as well (if
necessary).

As another example, if you refer to String.subString(5), it will
see that there is another method named substring, and offer that: 
   "Change subString to substring".
Again double clicking performs the substitution (after a confirmation
dialog).

Hope that helps. (Warning - the tasklist feature is not a standard
part of NetBeans and is not yet stable. This is for those of you
willing to play around with (and provide feedback on) the development
version.)

-- Tor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.