NewAndNoteworthyNB71

Revision as of 12:16, 24 January 2012 by Peathal (Talk | contribs)

New And Noteworthy in NetBeans IDE 7.1

Contents


Java Editor

Inspect And Refactor

Brand new feature in NetBeans allows you to run selected java hint on selected project(s). You can create your own configurations (group of hints). Tasks like "Convert to JDK 7", "Remove System.outs" are now simplified.

Image:jackpot1.png

Image:jackpot2.png

Custom declarative hints can also be specified:

Image:custom-hint.png

New Refactorings

Inline

The Inline refactoring is added to the set of refactorings.

Inline Temp

File:InlineTemp.png


File:InlineTempResult.png


Inline Method

File:InlineMethod.png


File:InlineMethodResult.png


Inline Constant

File:InlineConstant.png


File:InlineConstantResult.png

Introduce Parameter

Set of "Introduce..." refactorings is now complete with "Introduce Parameter"

Image:introduceparameter.png

New Replace Bar

There is a new Find and Replace UI.

Image:NewReplaceBar.png

Improvements

Find Usages

More Scopes

You can choose two more scopes (Current File and Current Package) when using Find Usages.

File:FindUsagesScopes.png


To have more control over the Find Usages search scope, you can now specify a custom scope.

File:FindUsagesCustomScope.png


Tab Reuse

There is a new option to reuse Find Usages tabs.

Change Method Parameters

The Change Method Parameters configuration dialog has a number of improvements.

  • code completion in parameter name, parameter type and return type fields
  • find type dialog for parameter type and return type fields
  • better keyboard navigation

The following enhancements have been added to the change method refactoring

  • change method name
  • change method return type
  • change existing parameters type
  • generate or update javadoc

Image:ChangeMethodParameters.png

Javadoc Highlighting and Formatting

Javadoc comments highlighting was improved as well as formatting.

Image:javadoc1.png

Rename

Rename Refactoring has new options

  • rename property's getters and setters
  • rename corresponding Test Class

Image:RenamePropertyGetSet.pngImage:RenameTestClass.png

Hints

Introduce Variable/Field/Constant

The Introduce Variable/Field/Constant action now shows list of possible expressions if there is no explicit selection.

File:introduce-variable-pick.png

Unused Assignment

A new pair of hints, Unused Assignment and Dead Branch, was introduced. The Unused Assignment finds values that are computed and assigned to a variable, but never used by reading the variable. The Dead Branch hint searches for branches of code that can never be executed.

File:unused-assignment.png

Change Method Return Type

In case the type of the expression after a return statement does not match the return type of the method, a new fix is proposed that adjusts the return type of the method.

File:change-method-return-type.png

Transferring Types Through Copy&Paste

When a Java code is copied, the types that are used by the snippet are recorded. When the snippet is pasted, the user is given opportunity to automatically import these types.

Organize Imports Hint

A set of code style rules for managing imports can be specified via 'Tools->Options' dialog.

File:import-options.png

If the imports section of a compilation unit does not follow the code style rules, the 'Organize imports' hint allowing user to re-organize imports appears.

File:organize-imports-hint.png File:imports-organized.png

Organize imports can also be run on whole project using the Inspect and Refactor dialog with the Organize Imports configuration.

File:organize-imports-bulk.png

Double/Triple Click Selection Improvements

When double clicking and still holding the left mouse button the selection now extends by words when dragging the mouse.
Similarly for triple click the selection extends by rows.

Rectangular Block Selection

It's necessary to first press a "Toggle Rectangular Selection" icon in editor toolbar (or press Ctrl+Shift+R):

File:rectangular-selection-icon.png

Then the selection may be created by mouse dragging or by cursor keys with Shift:

File:rectangular-selection.png

Possible actions:

  • Del key to remove the selected text
  • Type characters - they will be replicated to all lines
  • Cut/Copy/Paste actions


JavaFX 2 Support

NetBeans 7.1 introduces JavaFX 2.0 support. JavaFX 2.0 is a major update to the JavaFX platform. Starting with this version, developers can create JavaFX applications completely in the Java programming language using standard Java development tools, and the JavaFX Script programming language will not be supported in JavaFX 2.0 and future releases.

FXML

FXML is a scriptable, XML-based markup language for constructing Java object graphs. It provides a convenient alternative to constructing such graphs in procedural code, and is ideally suited to defining the user interface of a JavaFX application, since the hierarchical structure of an XML document closely parallels the structure of the JavaFX scene graph.

More info: http://fxexperience.com/2011/07/introducing-fxml/

CSS3 support

JavaFX 2.0 UI controls can be customized using CSS3. NetBeans 7.1 supports CSS3.

Preloaders

JavaFX application may contain optional preloader that can be used to improve application loading experience (especially in the applet or webstart execution mode). A preloader is a small application that is started before the main application to customize the startup experience.

Project Features

JavaFX2.0 introduces a wealth of new or updated properties that specify in detail the application run environment as well as deployment options. All key JavaFX2.0-specific properties are surfaced in NetBeans 7.1 Project Properties Panels.

Run

  • configurations
  • application class selection
  • preloader class selection
  • named/unnamed parameters and VM options
  • run in NetBeans settings

image:FX_Run_Panel.png

Deployment

  • jnlp/html generation settings
  • double-clickable jar settings
  • signing settings – including embedded cert
  • JavaScript callbacks

image:FX_Deploy_Panel.png

Packaging

  • binary css settings

GUI Builder

Gap Support in GridBagLayout Customizer

The redesigned GridBagLayout customizer now features Gap Support. With the new feature switched on the user can easily maintain gap columns/rows of specified width/height between components without any effort. There is no need any more to waste time by manually inserting fillers between components to create visually compelling layouts.

Image:GridDesigner71_2.png

GridBagLayout Customizer Enhancements

The redesigned GridBagLayout customizer now features improved layout editing capabilities. Important component properties are now marked visually: insets (see jFormattedTextField1 and the slider), internal padding (see jTextField1 and JButton1), REMAINDER size (see right edge of jTextField1 and the slider).

Image:GridDesigner_71_1.png

Java EE

GlassFish

Cluster and Instance Deployment - see more information in Vince Kraemer's blog at http://blogs.oracle.com/vkraemer/entry/prototype_of_cluster_and_instance.

Web Services

  • Jersey binaries are updated to version 1.8 ( see issue 198777 )
  • IDE Registered WS ( Saas ) is available for WS Client creation.

Image:wsclient.png

  • OWSM support is added for WL server: "Insert Code" editor popup menu action -> "Call Web Service Operation..." generates OWSM related code if applicable.
  • OWSM support is added for web service (with WL as target JEE server ): "Edit Web Service Attributes" popup menu action shows dialog with OWSM security policy list.

Image:owsmpolicies.png

CDI

  • Generate interceptor for interceptor binding ( see issue 195412 ): editor popup menu "Insert Code..."

Image:interceptor.png

  • Decorator resolution : extended context for Inspect CDI action (for class element)

Image:decorator.png

  • Interceptor resolution: extended context for Inspect CDI action (for class or method with interceptor bindings )

Image:InspectInterceptor.png

  • Warnings and error detection

Java editor was enhanced with more than 50 CDI specific warnings to help users realize potential problems early. These warnings cover for example initialization of injectable field, wildcard return type in producer method, combinations of conflicting CDI annotations, wrong usage of @Inject annotation, missing beans.xml, when static/abstract fields/methods can and cannot be used; etc. For full low level list of these warnings and errors see the specification.

Image:errors.png

  • Editor annotations for CDI artifacts: injection point, delegate injection point, event, observer, decorated bean, intercepted element. For each annotation there is an action attached to it. It works as GoTo ( for injection/delegate point, decorated bean ) or Inspect CDI ( for event, observer, intercepted element ).

Image:injection-delegate-event.png.png

Image:intercepted-observer.png.png

Image:decorated-bean.png

JavaServer Faces

  • Extended possibilities for JSF component libraries

Image:NB71JsfComponentLibraries.png

  • Basic support for RichFaces4 and ICEfaces2 component libraries

Spring

  • Code completion in EL offers Spring beans and their properties

Image:NB71SpringBeanBackend.png

Image:NB71SpringBeanFrontend.png

EJB

  • Wizard for creating sample Timer SessionBean

Image:NB71TimerBeanWizard.png

Image:NB71TimerBeanEditor.png

JPA

  • code completion for table names, column names and pu names

File:JPACompletion1.png

File:JPACompletion2.png

File:JPACompletion3.png

File:JPACompletion4.png

  • persistence.xml design view editor enhancement, properties panel is added and support to add and edit recognized properties for jpa 2.0 eclipselink and hibernate providers.

File:jpaprop.png

WebLogic

  • Development and deployment of Java EE 6 applications to the new WebLogic 12c.

Image:Wls12_ee6.png

wiki page.

Image:WebLogicJMS_Mdb_step_1.png

Maven

  • Deploy on Save is now set by default.
  • There is a possibility to choose server when creating new EE Maven based project.

Image:MavenServerSelectionInWizard.png

PHP

(S)FTP client

Debugger improvements

PHPUnit

Editor

Frameworks

  • Support for Smarty templates

image:NB71PhpSmartySupport.png

CSS

Support for CSS3

CSS3 features are now supported by the Netbens CSS editor. New syntax, properties, pseudo classes, elements etc. are now properly colored, offered by code completion and reflected in other features. Most of the CSS3 modules specifications are reflected.

image:Css3syntax.png

All the existing features like refactoring, semantic highlighting, mark occurrences etc are adapted to the css3 code.

Code Completion

CSS code completion completes html elements, CSS3 properties and their values, new pseudo classes and pseudo elements, namespace prefixes and other elements already supported by the previous version

image:Nscompletion.png

The code completion documentation shows browsers compatibility for each css3 property.

Vendor specific properties

Vendor specific properties (dash prefix properties) has been added to the code completion. The completion also offers their values in most cases. For the properties with the value definition the editor error checking verifies their values.

File:Webkit-completion.png

Mozilla Firefox (Gecko), Google Chrome and Apple Safari (Webkit), Opera (Presto) and Microsoft Explorer (trident) specific properties are supported.

Code navigator

Code navigator has been improved so it shows css classes, ids, elements, namespaces and rules in separate elements sets.

image:Css3navigator.png

Extensibility of css.editor module

New friend SPI org.netbeans.modules.css.editor.module.spi has been added so the css editor support functionality can be very easily extended.

Project System

--open-group, --close-group

You can now open and close project groups as the IDE starts, using new command-line options. As usual, --help gives details.

Maven

Find Usages

The Find Usages dialog will now show references to classes (or other types) from among artifacts in the local Maven repository. (If your user directory predates this feature you may need to reindex the local repository in the Maven Repository Browser tab.)

Generated test sources

Test source roots matching the pattern target/generated-test-sources/somedir are now included alongside src/test/java.

Also, special test source roots may be configured via build-helper-maven-plugin:add-test-source.

Code completion

The POM editor and a few dialogs offered completion on plugin goals, parameters, and similar information. Formerly this was based on a badly outdated static index; completion is now based on the regular repository indices.

Merged JAR handling

Earlier versions of the IDE had difficulty with dependencies on "shaded" JARs, because the IDE normally looks to the owning source project for authoritative information for background compilation, code completion, etc. - so imports of transitively included classes did not appear correctly in the editor.

Now the IDE treats the actual dependency JAR as authoritative, even if a source project is available, when the project uses the Shade or Bundle plugins. (If you make a change to a transitively included class, rebuild the shaded JAR to make the IDE's editor recognize the change.)

Missing dependencies

The IDE now does a better job of locating artifacts (dependencies or parents) not yet in the local repository but available in the reactor, and immediately refreshes projects missing other artifacts (including plugins) once those become available in the local repository. For best results, open the root aggregator POM project first, then modules.

"Reloading online" is gone; it was difficult to control and did not correct all problems. Now when you open some projects from a reactor which seem to be missing artifacts, a notification icon appears with a suggested "priming" build step.

Repository management

Maven Repository Browser used to add a permanent repository definition when you opened a project with a custom repository, leading to clutter. Now only Local is predefined; any remote repositories defined in your projects will be displayed when those projects are opened, and disappear when closed.

You can still manually add custom repositories if you want, but generally it is better to define them in your projects (or profiles in settings.xml). Custom repository definitions defined in NetBeans 7.0.1 and earlier will not be carried over automatically.

The IDE is also smarter about detecting repositories: only one repository with a given URL will be shown even if there are conflicting IDs (e.g. "java.net2" vs. "java.net"); and a mirrored repository is displayed using the canonical public URL (while the mirror is used for actual downloads and indexing).

Loading settings.xml

The IDE will now consider conf/settings.xml from the currently selected Maven installation as well as ~/.m2/settings.xml, just like command-line Maven would.

There is no longer a separate setting for a local repository. You may however use <localRepository> in either the global or local settings.xml.

Miscellaneous

There are numerous other minor enhancements in the Maven support, including:

  • support for Type and Classifier in the Add Dependency dialog (and classifier code completion in the POM)
  • Add Module action from the Modules node of a POM project
  • Open POM action on subnode of Modules
  • Maven Settings button in Output Window
  • button to restart a build using --resume-from
  • model building problems are hyperlinked, and show warnings in POM editor
  • Java Dependencies node
  • improved detection of proxy issues: FaqMavenProxySettings

Ant

Code completion

Code completion on tasks (and types) will display documentation from the Ant Manual when this add-on is installed.

Hudson

Test Results window integration

"Show Test Failures" now displays results in the Test Results window as well as the Output Window.

Task List

Warnings collected by the static code analysis plugins will now be displayed in the Task List when "open projects" scope is selected.

Authentication

You can now log in to a server without being prompted. This is useful especially for servers which have some private jobs that are hidden from anonymous users.

Git support

Team > Create Build Job now recognizes a local project using Git.

The IDE can also show the changelog for a Git-based project (though without hyperlinks to the Diff window for details).

Versioning

Shelve Changes

Allows you to put your local changes aside (shelve) and start working on a different feature. Is available for Mercurial and Subversion.

File: UnshelveChanges1.png

When you finish the new feature you can apply the old changes (unshelve) and continue working on them.

File: UnshelveChanges2.png

VCS SPI

It is possible now to register a Versioning System via the @VersioningSystem.Registration annotation. See javadoc for more information.

Git Support Finalized

Complete Git Version Control support is now part of the standard distribution and available right after installation of the IDE. It allows users to work with local clones as well as provides possibility to clone, fetch, pull or push remote repositories. See Git main page for more information.

File:Git1.png

File:Git2.png

File:Git3.png

File:Git4.png

Subversion

Lock Feature

User actions allowing locking and unlocking files were added to the menu. It is also possible to enable on demand locking for files with svn:needs-lock property set.

Mercurial

Redesigned Changeset Picker Dialogs

Merge, Update, Revert and other similar dialogs were redesigned to be more user-friendly. It is now possible to filter display changesets, the changesets are labeled with tags or branch names if they have one and they are displayed in a list instead of a combo.

File:MercurialChangesetPickers.png

Branching/Tagging

Basic support for branches and tags added. Projects are now labeled with a branch/tag name, it is possible to create branches or tags, close branches, manage tags and switch between branches

File:MercurialBranching.png

Local History

Revert Deleted

Its possible now to pick particular files to be undeleted

File:LH_Undelete.png

History Tab

Use the History tab in a files editor to easily access its Local History view

File:HT_History.png

File:HT_Source.png

Issue Tracking

Issue Views

  • undo/redo facility in text areas
  • improved issue comment UI and functionality (expand/collapse,...)

File:Bugtracking_comments.png

Bugzilla

Added Time tracking, Reset Assignee to Default, Open web browser directly from URL field

Platform & NetBeans Module Development

Separate cache directory

You may now use --cachedir to specify an alternate location for the var/cache/ portion of the user directory (--userdir). If your userdir is on a slow or network filesystem, it is a good idea to use a cachedir on a fast local disk.

Soon the Windows launcher will be modified to use standard Windows locations for both the userdir and cachedir, which should behave well with networked profiles.

Window System

API: New WindowSystemListener to receive notifications before/after the window system loads/saves.

API: Support for multiple window layouts (aka perspectives or roles), see WindowManager.setRole(String)

Usability: Close/minimize/float/drag the whole window group.

Window main menu:

File:Main_menu.png

Context menu of non-document window:

File:Context_menu1.png

Context menu when clicking outside non-document tab:

File:Context_menu2.png

Context menu of document window:

File:Context_menu3.png

Context menu when clicking outside document tab:

File:Context_menu4.png

Ant-based Apps

It is now possible to download the platform (and harness) from your suite's build script, so you do not need to either define a platform location externally or check the platform into source control. See harness/README for details. (No GUI customization support yet.)

Maven-based Apps

<this layer in context> and the Branding dialog now work directly on dependencies in the repository, so there is no need to do a build of your application before using these features. (The IDE will however download any required module JARs not yet in your local repository.)

XML Layer

New projects are now created without an XML layer, but there is now a New File wizard to add a layer to a project without one if you need it. (Many modules can do without an explicit layer, since Java annotations can produce common registrations such as menu items.)

Templates

@TemplateRegistration is now available for file and project templates.

Window Wizard

There is now a special design mode for window layout.

Visual Debugger

The Visual Debugger is introduced. It allows to debug the application without looking into the source code and helps to control the execution flow in terms of high-level structures.

Visual Debugger is a part of ordinary Java debugging session in NetBeans. Action Debug -> Take GUI Snapshot in the main menu is enabled when the debugged application opens a Swing GUI. The action take screenshot of the application GUI that serves as a basis of the Visual Debugger functionality.

File:ScreenshotAnagrams.png

Screenshot of Anagram Game application taken by Visual Debugger is displayed in Editor area. Individual components can be selected and their properties are visible in Properties window.

File:ComponentHierarchyAnagrams.png

Component hierarchy of Anagram Game application is visible in Navigator.

File:EventsAnagrams.png

Events window displays currently attached listeners to the selected component and allows to add a logging listener whose output will be displayed under the Event Log node.

Profiler

Compare heap dumps

It is now possible to compare two heapdumps. There is new "compare with another heap dump" link in the classes tab of opened heap dump(see the image) which serves as an entry point for this functionality.

File:comparehd.png

Sampling profiler

This new profiler mode is using regular sampling of target application instead of instrumentation. This method is much faster but less precise. It is intended for initial estimate of where the possible problem can be. This knowledge can than be used for better configuration of instrumented profiling(root methods, profiling points, etc.). Usage is easy - when analyzing performance, select the default "Sample application" radio(see the image below).

File:SampledProfiling.png

C/C++

Experimental support of new C++ Standard (C++11)

Certain features of the new C++ standard are supported. For example, there is code completion and navigation support for declarations with the "auto" type.

Code Assistance Automatic adjustments

In previous releases it was difficult to configure code assistance for projects created from existing sources/binaries. In 7.1, the IDE automatically makes code assistance available when a project is "built from the IDE", without requiring it to be built with debug info or any other special options because the IDE recognizes the exact compile options for any file. For example, if you add a new file to a project that uses custom build scripts or makefiles, you can invoke the Build action in the IDE and the compile file options will be recognized and used to set up code assistance for the file.

Compile File

As soon as a project created from existing sources/binaries with a custom build script is built from the IDE, the Compile File (F9) action will be available for any file within the project. Invoking this action forces compilation of a file with exactly the same options used during the full build of the project, so that the user has the ability to check compilation errors without needing to compile the whole project.

Enhanced Remote Development (Full Remote)

In addition to the currently supported capabilities for remote development, NetBeans IDE 7.1 provides a new mechanism. If the user has a local project at work on a Unix workstation, remote host access can be set up from a laptop at home, opening through the file system view in the Favorites window or Services window. A project of this kind will be opened in the context of the user's remote workstation, while working from the laptop at home. All the changes in files and project are saved to the remote host and will be seen when the user is back at work.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo