Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Oracle Updates NetBeans for HTML5

Oracle Updates NetBeans for HTML5

Leia em Português

This item in japanese

With the latest 7.3 release of NetBeans, Oracle has updated the IDE so developers can more easily build HTML5-based user interfaces for mobile and web applications.

A new HTML5 project type automatically allows you to include popular JavaScript frameworks such as Backbone and jQuery, which are downloaded from public CDNs. Several sample HTML5 applications can also be opened directly from the New Project wizard. Some of these are included in NetBeans, whilst others are downloaded from GitHub on the fly.

The IDE also includes a wizard that can generate JavaScript client code to access a server's Java-based REST services. The result of the wizard is generated JS code using the Backbone.js library and (optionally) an HTML file. The HTML includes a skeleton that provides some indication as to how the generated code can be customised. If the REST service has an interface around data collection and the Tablesorter UI has been chosen, then the REST data is rendered as a table grid using the Tablesorter jQuery plugin.

When coding, the editor offers completion capabilities for HTML5, JavaScript, jQuery, and CSS3 (Project Easel). The JavaScript editor and debugger has been completely re-written using Oracle's Nashorn JavaScript engine, which will replace Rhino as Java's default JavaScript engine in Java 8. The editor includes support for the common JavaScript documentation options ScriptDoc, Ext-Doc and JsDoc.

The IDE aims to help developers when debugging web interfaces. HTML previews in the IDE are provided by an internal WebKit-based browser, whilst a Chrome browser extension uses the WebKit remote debugging protocol to allow debugging of web applications from within NetBeans. The debugger supports debugging both local files that are included in the HTML5 application, as well as remote JavaScript files that are linked to the application, but are not included in its sources. It offers four views:

  • Breakpoints: Line breakpoints (triggered when the script reaches a particular code line), DOM breakpoints (triggered when there is a change to a particular DOM node), Event breakpoints (triggered when particular events in the page happen), and XMLHttpRequest breakpoints (triggered when network communication using XMLHttpRequest is performed).
  • Call stack: displays the current execution stack of a JavaScript program. The Call Stack window has three context actions: "Make Current" (which changes the current frame in which variables are evaluated), "Go to Source" and "Copy Stack" (which copies the stack trace to clipboard).
  • Variables: Variables that are valid in the current scope can be inspected in the Variables window. An evaluator is also included, making it possible to evaluate arbitrary expressions.
  • The Browser Log: shows all exceptions, errors, warnings, etc. as they happen in browser.

JavaScript unit testing is also supported with the js-test-driver (which is also supported in Eclipse and IntelliJ). Running and debugging JavaScript unit tests is the same as in other languages.

Beyond Web programming, NetBeans 7.3 includes a new stand-alone JPQL (Java Persistence Query Language) editor that allows developers to test JPQL queries directly from the IDE. Finally, the new version supports the profiling of Java applications on Linux ARM systems, including the Raspberry Pi.

NetBeans is an open source IDE, licensed under licensed CDDL v1.0 and GPLv2. As well as Java, it supports Groovy (support for Groovy 2.0 has been added in this version), PHP, C, and C++. It is available for download for the Windows,OS X, Solaris and Linux platforms.

Rate this Article