The Source for Java Technology Collaboration
User: Password:



Tim Boudreau

Tim Boudreau's Blog

NetBeans Modules for HTML Authoring

Posted by timboudreau on August 05, 2006 at 02:08 AM | Comments (15)

I write tutorials and articles quite a bit. NetBeans is an excellent editor for HTML, but there were a few things missing. So I wrote some modules to plug the gaps.

If you have a development build of NetBeans, you can get any of these from the development build update center off the Tools menu. They are:

  • HTML Projects - support for opening a directory of HTML files as a NetBeans project. By default it automatically recognizes directories named public_html and www as projects; with the New Project wizard you can just create a new HTML project over any other directory you have that contains HTML. The directories are simply remembered - nothing will be written into those directories disk to mark them as a project, and HTML projects have no settings - so there's no risk of adding project metadata into directories that might live on a web server.

    It provides a flattened logical view of all HTML files it finds, by HTML title. It will scan every subdirectory of the directory you choose, so you probably don't want to do this on the root of your hard drive (although it will do it in batches on a background thread, so if you really want to you can...).

    An open HTML Project in the Projects tab

  • Generic Navigator - this started as an HTML-specific Navigator panel, but it wasn't much more work to make it not specific to any particular file type. You can define named regular expressions and associate them with any file type, and the results will show up as list items in the Navigator, and you can select which regular expression to use.

    genericNavigator.png

    It has a customizer for adding and editing regular expressions, which also lets you test and preview matches:

    Generic Navigator Customizer

  • Folder To HTML - very often in a tutorial I need to show a directory tree and say something like "You should now have the following files on disk:" followed by a directory tree listing. Doing this stuff by hand as nested HTML list items is truly tedious. The Folder2Html module simply adds an action to all filesystem folders in NetBeans, Dump Folder as HTML. It will simply walk the directory tree and send the appropriate HTML to the output window, where you can copy/paste it into a tutorial. It includes some space and formatting for adding descriptions, e.g.
    • src/
      • syntaxtreenavigator/
        • IntrospectionTreeNode.java Tree node with children for all methods of the passed object
        • SyntaxTreeVisualizer.java Main frame
        • V.java Tree node for one element in a syntax tree
        • ViewPanel.java Inner panel
Anyway, if you write a lot of HTML, perhaps you'll also find these useful.

allOfTheAboveSmall.png
All of the above (click image for full size)

Addendum: For users of 5.0 and 5.5, here are NBM files for the modules. Simply download them to some folder, open Tools | Update Center and choose Install Manually Downloaded Modules and select them all and continue through the wizard to install them.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • It's great.

    you're using the 'Mark Occurrence' plugin too, whether the next major release will include it?


    Posted by: pprun on August 05, 2006 at 09:01 AM

  • Tim,These enhancements look great... but how do I go about installing them?Thanks,-JohnR

    Posted by: johnreynolds on August 05, 2006 at 10:23 AM

  • Let me be a bit more explicit... Can I install them on Netbeans 5.5 Bet 2?

    Posted by: johnreynolds on August 05, 2006 at 10:26 AM

  • I've attached NBM files to this blog.

    Posted by: timboudreau on August 05, 2006 at 11:10 AM

  • The generic navigator is quite nice, but where ca I define tose patterns? And I have registered *.vm files (Velocity templates) as HTML file objects in NetBeans, but the generic navigator does not accept them - what to do here?

    Posted by: fmmoser on August 09, 2006 at 03:13 AM

  • You can define the patterns in the Generic Navigator sub-panel of the Miscellaneous section of the Options dialog - it lists the existing ones by mime type and you can click edit to show the dialog in question.

    But first you'll need to make NetBeans recognize .vm files - for this, go into the *old* options dialog (click the Advanced Options button on the bottom right in the options dialog). Under the System node there's a folder called Object Types. You can pick a file type here and add the extension .va to the set of file types.

    There are also some modules that appear to support velocity templates, so that might make it easier - click here to google for it.

    Posted by: timboudreau on August 09, 2006 at 04:46 AM

  • Re 5.5 Beta two, it appears to work - these were all developed against the 5.0 codebase, so they should be fine. If something doesn't, let me know.

    Posted by: timboudreau on August 09, 2006 at 04:47 AM

  • That's what I did: adding "vm" as extension to HTML objects. I see my *.vm files formatted and higlighted as HTML, but the Generich Navigator says "No View Available".

    Posted by: fmmoser on August 09, 2006 at 10:27 AM

  • Tim -
    I was under the impressions that 'Delete Project' would delete the NB meta information about the HTML project, and NOT the actual HTML files. Since I was only testing, no harm was done. But somebody else might not be as lucky.

    Posted by: waffletchnlgy on August 22, 2006 at 09:43 AM

  • Can you share the src of HTML Projects?

    Posted by: qingyue on August 23, 2006 at 11:29 PM

  • All of the above are in contrib/ in NetBeans CVS.

    cvs -d:pserver:anoncvs@cvs.netbeans.org:/cvs co contrib
    cd contrib/htmlprojects

    Posted by: timboudreau on August 24, 2006 at 12:30 AM

  • Good point about the delete menu item - it's actually the folder's delete action being proxied. I definitely need to override that for the root folder of the project, as indeed, this is not obvious. Good catch.

    Posted by: timboudreau on August 24, 2006 at 12:31 AM

  • I've just updated HTMLProjects with a better delete confirmation - both the file linked above and the one on autoupdate (an update should be available for dev builds with the next nightly build).

    Posted by: timboudreau on August 24, 2006 at 03:01 PM

  • Get the source from contrib/htmlprojects rather than using the NBMs. That got rid of some exceptions I was getting.

    Posted by: err on February 22, 2007 at 10:19 PM

  • Electronic Cigarette-china travel-lapel pin-Plasma LCD StandWholesale Electronicsmp4 playeriPhone Skin |mp4 speakers |mp4 watch |mp4 earphones |Portable mp4 player |wholesale mp4 players |mp4 players |
    mp4 digital player |cheap mp4 players |iPod Nano Screen Protector |iPod Touch Screen Protector |Nintendo Wii skin网上购物

    Posted by: goodbye on April 18, 2008 at 12:23 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds