Eclipse 3.1 - New and Noteworthy

JDT (continued)


Organizing workspace with many projects

Use Show > Working Sets in the Package Explorer's view menu to enable a new mode that shows working sets as top level elements. This mode makes it much easier to manage workspaces containing lots of projects.

Package Explorer in Working Set mode

Use Select Working Sets from the Package Explorer's view menu to configure which working sets get shown. The dialog lets you create new Java working sets, define which working sets are shown and in what order. Working sets can also be rearranged directly in the Package Explorer using drag and drop and copy/paste.


Improved source folder page for new Java project wizard

An improved source folder configuration page in the Java project creation wizard assists you in creating projects from existing source. You can define source folder entries, include/exclude folders directly on the tree, and test the results of your action right away.

New source folder page


Sharing Java project settings

Each Java project can carry custom settings for compiler options and code style. These settings are stored in the project itself, and automatically applied when the project is loaded (or updated) from the repository.

Modifying the settings of a Java project via the UI automatically writes the settings to a file in the .settings directory. (The contents of the setting file are auto-generated, and not intended to be edited directly).

Shareable compiler settings


New Quick Assists

Several Quick Assists (Ctrl+1) have been added to the Java Editor:
  • Invert boolean expressions:
    Picture of invert conditions quick assist
  • Invert a conditional expression:
    Invert condition quick assist
    results in:
    Inverted result
  • Convert conditional expression (? operator) to if-else statement, or vice versa
  • Introduce a new local variable after an instanceof check:
    Assign cast to local before invocation
    results in:
    Result after quick assist invocation
  • Break out single substring literal:
    Pick out string quick assist
    results in:
    Result of 'Pick out string' quick assist

Refactoring Undo/Redo available from Edit menu

Refactoring Undo/Redo is now available from the Edit menu, and the separate Refactor Undo/Redo actions have been removed from the global menu bar. Additionally, refactoring Undo/Redo operations are now integrated with the Java editor Undo/Redo, resulting in a more transparent undo story in the editor. For example, a refactoring triggered from within the editor is now undoable in the editor by simply pressing Ctrl+Z.

Undo action in editor context menu


New Eclipse default built-in formatter profile

Although Eclipse's default 3.0 code formatter profile was named "Java Conventions", formatting a file using this profile used tabs for indentation rather than spaces. In 3.1, A new default profile, named "Eclipse" has been added, that matches the default formatter options in previous releases (and thus uses tabs for indentation). To use settings that match the current, generally accepted Java conventions, simply switch the formatter profile to "Java Conventions" using the Java > Code Style > Formatter preference page.

Rerun failed tests first

There's a new action in the JUnit view that allows you to rerun failing tests before any of the ones that were passing.

Rerun last failed tests


Debugging locks and deadlocks

The locks owned by a thread as well as the lock a thread is waiting for can both be displayed inline in the Debug view by toggling the Show Monitors menu item in the Debug view drop-down menu. Threads and locks involved in a deadlock are highlighted in red.

A deadlock displayed in the Debug view


Breakpoint organization

The Breakpoints view allows breakpoints to be grouped by type, project, file, or working sets, and supports nested groupings. You can use breakpoint working sets to group breakpoints into problem-specific sets that can be quickly enabled and disabled as a whole. Newly-created breakpoints are automatically placed into the default breakpoint working set (displayed in bold). You can copy and paste or drag and drop breakpoints between breakpoint working sets, and a breakpoint can be placed in more than one breakpoint working set.

Breakpoints view showing working sets


Navigating stack traces

Copy and paste a stack trace into the Java Stack Trace Console and use hyperlinks to navigate the trace. The Java Stack Trace Console can be opened from the Open Console drop-down menu in the Console view. Pasted stack traces can be formatted via the standard Format key binding.

Java Stack Trace Console


New features in the Debugger Variables view

Several enhancements have been made to the Variables view, including:

  • The toString()-computed value of a variable can be displayed inline in the Variables view tree, as well as in the details area. The Java Detail Formatters... command in the view drop-down menu is used for configuring how this feature works.
  • The Java debugger now lets you control what gets shown in the variables view for different types of objects. For example, collections can be displayed as a simple array of values, instead of the gory details on how that particular collection object is implemented. This is done from the Java > Debug > Logical Structures preference page, where you associate with a specific class or interface either a single expression (for example, this.toArray()) or a series of named expressions. When the object is to be shown in the variables view, the expressions are evaluated to produce the values to display.
  • The Java debugger now lets you change the value of variables by entering an expression into either the Change Value dialog or into the details area of the variables view and pressing Save.
  • The Find Variable action in the Variables view allows you to type in the name of a variable you are looking for. As you type, the Variables view selects the next visible variable matching the entered text. As well, the Find variable dialog shows variables matching the text entered so far.

Inline toString() example


Previous     Next