Wednesday May 21, 2008

Comment/Uncomment Lines in HTML/JSP/XML Files

I demoed a small plugin I was working on yesterday to Ludo—it lets you toggle the comment/uncomment tags in HTML, JSP and XML files, which is possible by default in Java source files (and in Properties files) but not in HTML files, JSP files, and XML files. At the time, the plugin only worked for single lines and only via a shortcut or a contextual menu item. However, Ludo told me that he uses the editor's toolbar and that he'd also like multiline selections to be possible. Well, Ludo, both items have been added and now the plugin is available in the Plugin Portal:

http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=9609

Make sure you read the open issues below the screenshots there, so that you're aware of them before you run into them by accident. In short, you're able to select multiple lines, as below, but if you don't, the plugin assumes that you're only interested in the current line, even if you haven't selected anything in the current line. Then you invoke the action, via Ctrl-Shift-C (just like in the Java editor and the Properties editor), or choose the contextual menu item, shown below, or Ludo's button in the editor's toolbar.

And then you find yourself with the comment tags around the selection (as illustrated below) which, when you select the selection again and then invoke the action again, are removed so that the selection is returned to its original state.

Note that the plugin installs this functionality for HTML files, XML files, and JSP files. I have tried it out on Ubuntu and a colleague tried it out on Windows XP. It worked as expected in both environments. Comments/uncomments on this plugin are more than welcome...

GlassFish v3 is Agnostic

Today Ludo showed me that GlassFish v3 is IDE-agnostic, since it uses Maven as its build system:

Above, you see ALL the sources that make up GlassFish v3. You can simply check out the Maven projects via Subversion and then open the main pom.xml into the IDE of your choice which, in the case of IntelliJ, would result in views like this, for one of the Maven projects:

Here's the link to the relevant SVN site for GlassFish v3 which, when you check them out will result in the Maven projects you see above:

https://glassfish-svn.dev.java.net/source/browse/glassfish-svn/trunk/v3/

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« May 2008 »
SunMonTueWedThuFriSat
    
2
5
7
16
20
22
25
28
       
Today