sandip chitale's blog    Sandip Chitale's blog (scblog)
NOTE: I have moved many of my modules to NetBeans Plugin Portal . Please check there for latest versions of modules described on this blog.
20061029 Sunday October 29, 2006

Getting started with the new Java language support inrastructure in NetBeans 6.0

There is going be a complete overhaul of Java editor in NetBeans 6.0. There are going to be a lot of cool, new features. Jan Lahoda has already blogged about some of those features. All those new features are supported by a javac based Java language support infrastructure. The Jackpot technology is also part of it. If you want to learn more about the new infrastucture go here.

WhichElement Module

I have developed a simple module - WhichElement - based on the new Java language support infrastructure APIs ( we need a good name for this ;) ). This blog may help/inspire you to get started with the new APIs.

The WhichElement module shows information about the Element under the caret in a read-only text field (40 column) in the IDE status bar. The tool tip shows the full text so that it can be seen when is wider than 40 columns. The text field contents can be copied using standard keybinding (e.g. on windows - Ctrl+A Ctrl+C).

This module demonstrates/makes use of:

  • CaretAwareJavaSourceTaskFactory - a factory for creating a task which is run every time the caret position in the Java editor changes. This factory is registered using the: META-INF/services/org.netbeans.api.java.source.JavaSourceTaskFactory file.
  • CancellableTask<CompilationInfo> - a caret sensitive task which finds the Element under the caret and displays information about it in the status bar.

I have uploaded the WhichElements Module to my Netbeans update center described here.

You will need a NetBeans IDE dev build dated after 10/25/2006. As pointed out by Jesse Glick you can get the latest dev build here. You can also build the NetBeans IDE using the sources checked out after 10/25/2006 from the NetBeans CVS repository. (How to get NetBeans CVS Access?).

Sources

If you want to hack the above project you will need to check out the NetBeans sources from the NetBeans CVS repository.

DISCLAIMER: This module is experimental. So no guarantees. Use the module at your own risk.


Posted by sandipchitale ( Oct 29 2006, 04:07:03 PM PST ) Permalink Comments [8]










« October 2006 »
SunMonTueWedThuFriSat
1
2
4
6
7
8
10
11
12
13
15
17
18
20
21
22
23
24
25
26
27
28
30
31
    
       
Today

Get NetBeans 5.5

Locations of visitors to this page

Today's Page Hits: 341


XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

scblog
scblog