This chapter continues our coverage of the JDT, exploring actions such as refactoring , as well as searching, building, and launching applications. You perform such actions everyday in Eclipse, and they're essential skills.

We'll start this chapter with a look at how to handle refactoring in Eclipsespecifically, how to rename and move elements. One of the major advantages of using a good Java IDE such as Eclipse is that when you rename and move Java elements, the IDE automatically updates all references to those items throughout your code.

Besides renaming and moving elements, Eclipse supports many other refactoring operations. Here's the whole list:

  • Rename elements

  • Move elements

  • Change a method's signature

  • Convert an anonymous class to a nested class

  • Convert a nested type to a top-level type

  • Push down or pull up elements in terms of nesting level

  • Convert methods and static fields to inline

  • Convert local variables to fields

  • Extract methods, variables, or constants

  • Encapsulate fields

All of these are helpful while codingif you know how they work and what they do.

Eclipse 3.0

In addition to the preceding list, Eclipse 3.0 adds these refactoring options:

  • Move members to a new file

  • Generalize types

  • Create factory methods

Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: