Editor Hints on Development Update Center



Editor Hints aka Suggestions aka Quick Fixes can be found on update center. Download the latest daily build and install modules Editor Hints and Java Hints (both are necessary!). This is alpha version of the hints, we would like to provide the functionality so that we get early feedback. Comments should be sent to: dev-at-java-dot-netbeans-dot-org. Bugs should be filed in Issuezilla, component java, subcomponent hints.

Currently the following hints are available through update center (all of them are still under development):
  • Add Import
  • Add Throws Clause
  • Incompatible Types
  • Incorrect Arguments
  • Cast Parameter
  • Implement Abstract Methods
  • Unresolved Element
  • Initialize Variable
The up-to-date status of hints is kept here:

http://java.netbeans.org/hints/index.html

The light-bulb appears when appropriate error is detected in source code. You can activate the hint by mouse or by pressing Alt-Enter. It is necessary that your cursor is placed at the red-underlined part of code for the lightbulb to appear.

Before somebody will ask me through comments: yes, surround with try-catch hint will be developed as well, it will appear on the hints page soon ;-)

Screenshots:


Initialize variable


Add throws clause


Add import

Cast parameter
Comments:

Hi, how can I install thats module?? I have install NetBeans 4.1, and in my Update Center havent any "Editor Hints" ou "Java Hints". Please help me, I want go to NetBeans but Eclipse have many function more than NetBeans. bye

Posted by Giuliano on červen 03, 2005 at 10:38 dop. CEST #

As written in the post, this is alpha module, available for development version of NetBeans. So you need latest development build to install the module. Note that quality is not guaranteed with these builds. Some quality will be guaranteed with Q-builds, first will be available in few weeks.

Are there any other things which you miss in NetBeans compared to Eclipse? Thanks.

Posted by Roman Strobl on červen 03, 2005 at 10:47 dop. CEST #

I wait NetBeans have a Editor more powerfull, with QuickFix stable, highlighting improvements and plugins(modules) for webwork and Spring Frameworks. I work with frameworks and Eclipse have many plugins for easy development for this frameworks. (excuse me my poor english) thanks for information. ps. I read your blog every day!!

Posted by Giuliano on červen 03, 2005 at 10:55 dop. CEST #

Hey, it's nice to know that people using Eclipse are reading my blog as well ;-) Re: highlighting improvements - do you mean error highlighting? If yes, there is something already available for 4.1 through update center (stable module called error stripe, but you probably know that from my blog). Or did you mean other highlighting improvements? Stay tuned for support of other frameworks. Plugin development should be simplified as well, so we may get more plugins for NetBeans in the future.

Posted by Roman Strobl on červen 03, 2005 at 11:02 dop. CEST #

I've changed the post name to "Editor Hints on Development Update Center". So that readers know they need to use development builds to try hints.

Posted by Roman Strobl on červen 03, 2005 at 11:10 dop. CEST #

A feature I would like to see at NetBeans is, when a line like this is type: FileInputStream fi = new Fi<ctrl + space bar> The code completion will show only classes (not interfaces) who extends or implements FileInputStream. With this, unecessary classes, interfaces or constants are not displayed. I think this is very productive for day to day. Is there a way to configure "Fix Imports" to organizaze the level of imports, like: if there is more than 5 classes from same package, then it will import as wildcard. thanks

Posted by Claudio Miranda on červen 03, 2005 at 12:38 odp. CEST #

Claudio, good suggestion with code completion, I'll check on Monday if this is planned with the new completion. There's not such an option to organize the level of imports (or I don't know about it ;-). It seems to be a good idea, can you file it to Issuezilla?

Posted by Roman Strobl on červen 03, 2005 at 01:19 odp. CEST #

Can't remove the interfaces from the code complete since its possible to use Interfaces and implement it in the new clause as an anonymous class.

Posted by Navneet Karnani on červen 03, 2005 at 01:46 odp. CEST #

Agree with you that you can't remove the interfaces. But you can firstly propose classes (more chance it will be a class) and why not also propose firstly non abstract class, if possible. Also another remark with code completion is that it would firstly propose what belongs in my project. Vincent

Posted by vbrabant on červen 03, 2005 at 03:03 odp. CEST #

I searched issuezilla and found http://www.netbeans.org/issues/show_bug.cgi?id=8226 (wow, year 2000), which reflects the needs I said earlier

Posted by Claudio Miranda on červen 03, 2005 at 05:07 odp. CEST #

Feel free to vote for it.

Posted by Roman Strobl on červen 03, 2005 at 05:12 odp. CEST #

Pretty good, but it needs 1) more quick fixes (as listed in the URL) and 2) "quick" rename in file. In eclipse, that's ctrl+1 rename in file.

Posted by jrichard on červen 03, 2005 at 08:59 odp. CEST #

Roumen,

I have used NB for a year before moving to Eclipse about 2 years back. I started using NB and Eclipse together for about a month. Few features I love in Eclipse missing in NB:

1. Select a code block and use (pop up menu)Refactor --> Extract method.
2. Select a code block and use (pop up menu)Source --> Surround with Try/Catch Block.
3. A helpful hint to add Throws clause to method signate (I understand this is planed for 4.2 in hints).
4. Generate Getters/Setters in Eclipse is way better than Encapsulate Fields of NetBeans (You know sometimes I want to generate only getters but not setters for a variable).

There are few more but I am not sure whether this gets NB Teams attention to write up more :-)

I surely love to completely switch to NB because its great compared to Eclipse for many features. But NB Surely is lacking some simple features like mentioned above compared to Eclipse.

Posted by Kumar Mettu on červen 05, 2005 at 06:02 dop. CEST #

Kumar, here is status of these features:

Ad 1. Being developed as experimental refactoring, you can try it from development update center (with latest development build).
Ad 2. Planned, work will be started soon.
Ad 3. Being developed, you can try it from development Update Center.
Ad 4. Being developed, will be available through code completion (already works on the branch, will be merged in a few weeks - see demo here).

What are the other features your missing? ;-)

Posted by Roman Strobl on červen 05, 2005 at 06:32 dop. CEST #

To JRichard: I've just tried "quick" rename in Eclipse. This is very nice. I want it in NetBeans.

Posted by Roman Strobl on červen 05, 2005 at 07:10 dop. CEST #

Hi guys, for "Select a code block and use (pop up menu)Source --> Surround with Try/Catch Block." and others, like, if and so on, I develop the macros for this. Itś is so good. For named a property, for examplo, File, I create a macro to just captalise the class name. I think that IDE should make available, but I found a way to solve this. If you are intersting, send a email that I send this and others macros.

Posted by Michel Graciano on červen 07, 2005 at 03:51 odp. CEST #

Michel, superb, why not to post it here? If you agree, send it to me and I will place it to my blog and mention you as the author (and celebrate you).

Posted by Roman Strobl on červen 07, 2005 at 03:54 odp. CEST #

A nice feature from IDEA that I believe Netbeans is still missing is some sort of hierarchical select. In IDEA, if you hit Ctrl-W, you will select the current word. Hit ctrl-w again and it will select one level higher up, for example the current method call if the previous ctrl-w selected a method name. Hit ctrl-w again and you select an entire statement. Again and you select a block, again and you select a method, again and you select the class, and so on and so on. Also, having Ctrl-x delete the current line when nothing is selected is very handy.

Posted by guest on červen 07, 2005 at 05:06 odp. CEST #

NetBeans has it! It's called smart selection and can be activated by Alt-Shift-S, Alt-Shift-A works backwards. Ctrl-E is for delete line.

Posted by Roman Strobl on červen 08, 2005 at 12:58 dop. CEST #

Post a Comment:
Comments are closed for this entry.
About

Roman Strobl

Search

Archives
« duben 2014
PoÚtStČtSoNe
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today