详细介绍Eclipse 3.2 M5新特性及下载地址

正如Eclipse所承诺的,Eclipse 3.2 M5 开始提供下载了。不过目前下载还是比较拥挤,所以成功下载还是需要好运气的。3.2 M5 提供了一些列新特性, 主要有:兼容JAVA SE 6.0,支持Mac OS X on x86/Intel....

正如Eclipse所承诺的,Eclipse 3.2 M5 开始提供下载了。不过目前下载还是比较拥挤,所以成功下载还是需要好运气的。

下载地址:http://download.eclipse.org/eclipse/downloads/drops/S-3.2M5-200602171115/index.php

M6 将会在3月底发布。

3.2 M5 提供了一些列新特性, 主要有:
兼容JAVA SE 6.0
支持Mac OS X on x86/Intel
Refactoring
等等...

JDT UI

Create and apply refactoring scripts

Support has been added to the refactoring framework to perform refactorings from scripts. Create a script from the refactoring history using Refactor > Create Script...

Later, apply the script on an arbitrary workspace using Refactor > Apply Script...


JAR file export with refactorings

During JAR export, you can also include refactoring information with the JAR file for the source files whose class files end up in the JAR.

When updating a project to a new and improved JAR, select a JAR in the Package Explorer and use Build Path > Replace JAR File...

This will automatically offer to replay the stored refactoring on the source files in the project.


New refactoring: 'Introduce Indirection'

The new 'Introduce Indirection' refactoring lets you redirect all callers of a method to a new method. The newly created static method just calls the original method.

Such a indirection is useful when new behavior needs to be introduced to a method but the method must not (or cannot) be changed as, for example, when it's an API method or from a library.

Use the indirection for bug fixes to the original method or as a quick way to add code before or after all calls to a method.

The method is added to the target class:

... and all references are updated:


Clean up wizard

The code clean up wizard has been extended with the following new options:

  • Remove unnecessary blocks
  • Remove unnecessary casts
  • Add serial version id to 'Serializable' and 'Externalizable' classes

Select a project, package, or file and start Source > Clean Up... to start this wizard.


Multiple quick fixes

Quick fix and quick assists (Ctrl+1) can now be told to also fix all similar problems in the same file.

Quick fixes that support multi quick fix are:

  • Change indirect static access to direct
  • Change non static access to static field using declaring type
  • Add '@Deprecated' annotation
  • Add '@Override' annotation
  • Add/remove '$NON-NLS$' tag
  • Infer type arguments
  • Remove unnecessary cast
  • Add 'this' to unqualified field access
  • Remove unused member/variable
  • Add serial version ID

Quick assists are:

  • Convert for loop to enhanced
  • Remove unnecessary brackets

Quick fix for raw accesses

A new quick fix helps you fix raw type accesses:

The quick fix gleans information from usages within the same file. For a more sophisticated analysis, use the 'Infer Generic Type Refactoring' refactoring.


Remove brackets quick assist

A new quick assist has been added which removes unnecessary brackets around single statements in 'if', 'for', 'while' and 'do' statement bodies.


Generate hashCode() and equals()

There is a new source action which generates method implementations for hashCode() and equals(). Select a type and invoke Source > Generate hashCode() and equals()...


Type selection history

Content assist, organize imports, and add import remember the most recently used types and sort the list of proposed types accordingly.

If java.util.List is selected, then java.util.List will be the top element in the list of proposed types the next time List has to be imported:


Extensible sorting for content assist

In addition to the existing content assist sort orders, extenders may contribute custom sorters to the org.eclipse.jdt.ui.javaCompletionProposalSorters extension point. The user may choose to use the sort order on the Java > Editor > Content Assist preference page.


Ruler support for Java files outside workspace

The Java editor now also shows vertical rulers for external Java files and Java files from repositories:



All members can be folded

When projection is enabled, fields and initializers and their comments can now be folded away the same way as methods.


Content assist respects formatting preferences

The content assistant respects your coding style when inserting a proposal. Any spaces between commas, parentheses, type and method parameters are inserted according to the formatting preferences.


JUnit view history

The JUnit view has been reworked to allow multiple concurrent test runs. You can now switch between active and recent test runs, and starting a new test run does not automatically stop running tests any more.


JDT Core


Scalability improvement

The Java model now better accommodates JAR files containing lots of packages. Before 3.2 M5, such JAR files would cause the Java model cache to overflow frequently, which induced poor performance, since the same JAR file kept being read over and over again. A workaround was to start Eclipse with more memory to enjoy good performance again (as the cache size is a function of the memory size).

JAR files are now read more selectively, and thus interesting portions remain in the cache longer without consuming lots of memory.

User editing experience is thus significantly improved on large workspaces containing big JARs. Our experiments show that the memory requirement for developing Eclipse in Eclipse can be lowered to 128MB only (i.e. passing -Xmx128m to the VM) as opposed to 256MB as currently specified in the eclipse.ini file.


Detection of method parameter assignments

Assigning to method parameters are considered poor practice by many. Enabling the Java > Compiler > Code style > Parameter assignment preference causes occurrences to be detected.


Detection of switch case fall through

The Java compiler can now detect if a case may be entered by falling through a previous case. Empty cases are allowed. This optional diagnosis can be enabled using the Java > Compiler > Errors/Warnings > Potential programming problems > Switch case fall through preference.


Grouping Java problems

Java problems can now be grouped into categories. This can be enabled using the Group by > Java Problem Type option in the Problems view.


Suppressing warnings for access restrictions

In 5.0 compliance mode, @SuppressWarnings("restriction") can now be used to suppress warnings for access restrictions.

The batch compiler also supports two warning options discouraged and forbidden, to suppress these warnings. One can specify "-warn:-discouraged,forbidden" on the batch compiler command line to suppress both warnings.


Command line code formatter

It is now possible to format source code without starting the Eclipse UI using the new headless formatter application. It works as a standard Eclipse application.

eclipse -application org.eclipse.jdt.core.JavaCodeFormatter -config d:/config.prefs c:/src

This will format the source files in the folder src with the options specified in the config.prefs file. See Help > Java Development User Guide > Tasks > Using the Formatter Application for details.


Code assist improvement

Variable name completion now tries to keep already typed characters even if they don't match a part of the type name. For example, Element rootE| is completed to Element rootElement.


Note: this enhancement was suggested in EclipseZone's discussion on "How Can Eclipse Become the Most Powerful Java IDE?".


Null reference analysis

Null reference analysis has been added for local variables. This optional diagnosis can be enabled using the Java > Compiler > Errors/Warnings > Potential programming problems > Null reference preference.

Note that the analysis is fairly conservative, aligned on definite assignment rules. Rather than complaining on all possible cases, it only considers cases where there is something suspicions (e.g., if later on a null check is performed). The analysis could be further improved by introducing annotations (@CanBeNull, @CannotBeNull) but these would need to get standardized first.

In 5.0 compliance mode, null reference warnings can be silenced using @SuppressWarnings("null").


Improved syntax recovery

The internal Java parser is now much more resilient to syntax errors. Before 3.2 M5, a syntax error would prevent subsequent errors from being displayed. The parser can now recover from statements with errors and go on to perform further analyses.

In the following example, the invalid reference to method bar() is detected despite the missing semicolon in the previous statement.


Java builder resilient with external tools

Java projects can now depend on other Java projects that have replaced the default builder with their own builder, such as an Ant builder. The Java builder will now trust that the Ant build was successful and propagate any changes to the affected class files.

Note that when projects are associated with the Java builder, it is able to track structural changes to class files (signatures, etc.) and only recompile dependents of structurally changed class files. In the absence of a Java builder on a prerequisite project, all modified class files will be considered as (potentially) structurally changed; this means that recompilation will be less than optimal (but not all that different from what one would get with a standard make tool).


Improved support for external Java files

Support for external Java files opened in the Java editor has been greatly improved. Noticeable features include:
  • Navigation (F3) now opens the referenced element
  • Code assist now offers proposals


Java SE 6.0 compliance

The Java SE 6.0 compliance is now fully supported. In particular, StackMapTable attributes (see JSR 202) are now generated in .class files with a 1.6 target.

Debug


Launch configuration filters

The launch dialog and launch history menus support a set of filters that can be configured on the Run/Debug > Launching > Launch Configurations preference page. You can filter configurations from closed, deleted, or unavailable projects. As well, you can filter specific kinds of configurations. The dialog and history menus optionally support the current workbench window working sets.

For resource-based filtering to work, you need to migrate your existing launch configurations. This can be done by pressing the Migrate button on the preference page.

The filters are also available for easy access in a new toolbar in the launch dialog.


Java thread groups

You can now display thread groups in the Debug View by toggling Show Thread Groups in the view menu.


Ant


Export to Ant buildfile

Exporting a Java project to an Ant buildfile has been improved. One of the notable changes is that the export no longer creates a build-user.xml file. Instead, user files are imported if marked with a processing instruction: . The task is used instead of the dated "entity includes" reference. See bug 122421 for full details of all the changes.


Ant launch configuration refactoring

Renaming buildfiles (or projects containing buildfiles) will correctly update the launch configurations associated with the buildfile.


SWT


New ExpandBar widget

The ExpandBar widget allows the user to show and hide collections of widgets by clicking on a header. The ExpandBar contains multiple items which each may have an image and title in the header.

For an example, see this SWT snippet.


Bullets in StyledText

StyledText can now show lists formatted in a variety of styles, including bullets, numbered, upper case or lower case letters, and custom-defined styles.

For an example, see this SWT snippet.


Mac OS X on X86/Intel

The Eclipse launcher and SWT libraries have been compiled as universal binaries so that you can run Eclipse on Mac OS X X86/Intel platforms using the Mac OS X (Mac/Carbon) downloads.


Platform UI


Tabbed properties framework

A tabbed properties framework has been added. The tabbed properties framework provides a replacement property sheet page, allowing properties to be shown in the Properties view using arbitrary controls, organized by tabs and sections that are contributed via the extension registry.

An Eclipse article for the tabbed properties view is coming soon; see the attachment to Bug 126363 in the interim.


Alternate file systems

Projects and Linked Resources can now be created with file systems other than the local file system, and JDT now supports these.

Alternate file systems are declared using the org.eclipse.ui.ide.filesystemSupport extension point.


Problems can be grouped

Problems in the Problems View can now be grouped several ways, by severity, type and Java problem type. These groups can be added to via the org.eclipse.ui.ide.markerSupport extension point.


Multiple problems can be fixed at once

The Problems View now allows you to add other problems that have the same potential resolution so that you may fix many at once.


Close unrelated projects

A new command, Close Unrelated Projects, is available in the context menu when a project is selected. This command is a great way to focus your workspace on what you are working on right now, eliminating the clutter and overhead of any unrelated projects in the workspace.

/


UA


Improved help in dialogs

Most dialogs in Eclipse now have a standard help button on the bottom left corner. This button summons context help, same as pressing F1 (on Windows). In addition, the help content will now appear in the same dialog in the dialog's tray instead of in a separate window. Custom dialogs can inherit this functionality by subclassing the new TrayDialog class rather than Dialog. Cheatsheets can also follow you into dialogs (in the tray) for those steps that involve opening dialogs.


Team/CVS


History view improvements

There is now a generic History view in Eclipse (introduced in 3.2 M4). Here are some improvements that have been made in M5:
  1. The view can show the history for any selected element and not just files.
  2. When in Link mode, the view links to editor and view selection and updates the contents in the background to avoid blocking the UI.
  3. Pinning the view will cause it to lock on to the current history being displayed. Another History view will be opened if the history is requested for another file or object.
  4. The CVS History page includes the local history of files. Toolbar buttons can be used to control whether local, remote, or both histories should be visible.
  5. CVS Compare with and Replace with Revision operations all populate the History view. Actions have been added to the CVS History page to launch comparisons and replace contents.


CVS shows model content in synchronizations

CVS can now be configured to include model content in synchronizations by enabling the associated option on the Team > CVS > Synchronize/Compare preference page.


Platform Search


Direct text search action

Select text in an editor and invoke Search > Text > Last Scope (Ctrl+Alt+G) to search in the last used scope.

Multiple search views

It is now possible to have more than one Search Results view open at a time. Pin a search view to avoid it being reused for the next search. Or select to open a search from the history in a new view.


PDE


Target definitions

You can now define a target in a .target file (File > New > Other... > Plug-in Development > Target Definition).

The .target file defines all aspects of a target including name, location, content (in terms of plug-ins, features, or both) and JRE.

More notably, you can specify and manage multiple plug-in sites in the target without the need for .link files.

The Plug-in Development > Target Platform preference page lets you browse, preview and apply existing target definitions.


Contributing targets

Targets can be contributed to an Eclipse product via the org.eclipse.pde.core.targets extension point.

The Eclipse SDK comes with two RCP-centric org.eclipse.pde.core.targets extensions, allowing you to easily switch the target platform back and forth between the SDK and the RCP subset.


Hierarchical view of plug-ins

The plug-ins on the Plug-in Development > Target Platform preference page can now be grouped by sites. This hierarchical view makes the management of large and distributed targets much easier.


New source lookup for debugging Eclipse applications

When debugging Eclipse applications, PDE now uses a custom source lookup mechanism that is tied to the OSGi class loader. This is both faster and more accurate than the standard linear Java source lookup.

The Source tab has been removed from the Eclipse/Equinox/Plug-in JUnit launch configurations as it is no longer needed.


Validate build.properties files

PDE now validates build.properties files to flag potential problems that would prevent your plug-in from being exported properly.

The severity level for problems in build.properties files can be set on the Plug-in Development > Compilers > Plug-ins preference page.


Organize plug-in manifest files

The Organize Manifests wizard is an appointment stop prior to shipping a plug-in.  It removes unused dependencies and property keys, and manages the exported packages ensuring they are marked with the right visibility.

This function can be invoked via PDE Tools > Organize Manifests... from the context menu of plug-in projects and MANIFEST.MF files.


Building products

PDE Build now supports building products from a .product file in a headless automated build. A feature will be automatically generated based on the contents of the product file.

Multiple repository support

The PDE Build generation of fetch scripts for headless builds is now extensible. Extenders may contribute support for fetching elements from additional repositories through the org.eclipse.pde.build.fetchFactories extension point. PDE Build provides the standard extension for fetching files from CVS.

The above features are just the ones that are new since the previous milestone build. Summaries for earlier 3.2 milestone builds:

  • New for Eclipse 3.2 milestone build M4 (December 16, 2005)
  • New for Eclipse 3.2 milestone build M3 (November 4, 2005)
  • New for Eclipse 3.2 milestone build M2 (September 23, 2005)
  • New for Eclipse 3.2 milestone build M1 (August 12, 2005)

 

你可能感兴趣的:(Eclipse,JAVA)