Search |
Views |
Code Assist |
Wizards |
Templates |
Debugging |
Refactoring |
Local History |
Misc |
| Select a method,class or field in the editor and F3
will open the declaration, F4 opens the type in type hierarchy. To go back, you can use ctrl+F6, the default switch is the last used editor. |
search |
| you can open a type hierarchy with F4 in the packages view on a package or project. [By: Erich Gamma] |
search |
| Selecting a method or class in editor and right click Search leads to a very useful reference searching feature. It can answer questions like which methods call this method or which methods access this field. | views |
| Search for methods with a certain return type. Open the search dialog in edit search, use Java-Search 1. Type in the search expression: '* X' (without the quotes, and with a space between the wild-card and X, where X is your return type) 2. Select Method and Declarations 3. Use a working set to make the search faster. 4. Press Search [By: Jerome Lanneluc] |
search |
| There is an override indicator in the outline view for
methods.
[By: jdt-ui team] |
views |
| Package name compression to show only important parts of an
package name
[By: jdt-ui team] |
views |
| You can set the priority of an user defined task. Click once in the !-column. | views |
| You can set a view to fastview. That means this view is hidden at the left side and only shown if you click at the icon there. Nice if your display size is small. Right click at the title of a view and select fast view. | views |
| Typing Runnable r= new Runnable(<ctrl+space> offers an Anonymous Type completion that inserts the corresponding method stubs. [By: Erich Gamma] |
code assist |
| JavaDoc code assist not only works for the tags you can also do code as follows: @see TestCase#<code assist> proposes the TestCase methods as completions @exception <code assist> proposes the thrown exceptions by the method [By: Erich Gamma] |
code assist
|
| code assist in method declarations public class Subclass extends SuperClass { <code assist> proposes all the methods that can be overridden and inserts corresponding method declarations. [By: Erich Gamma] |
code assist
|
| Activate code assist (ctrl+space) in the class body (not in a method)
offers you to insert inherited methods.
[By: jdt-ui team] |
code assist |
| If you type a new declaration e.g. jtable(ctrl + space) the import statement is inserted at the start of your class. | code assist |
| There is a code assist in javadoc too,
start with @ and ctrl+space between /** */. You can use it also to e.g. link to method names ClassName#ctrl+space. |
code assist |
| There is a code assist feature for field declaration. JTable ctrl+space will suggest you table as field name. | code assist |
| You can use the override wizard to implement interfaces. Type implements YourFavoriteInterfaceHere, then right click in th editor| Source| Override methods | wizard |
| The getter/setter wizard is
on the editor context menu. Right click, Source| Generate getter and setter. If you use prefixes for your field names (JTable fTable) - they are automatically removed. Settings are in the preferences to use your favorite prefix and suffix as well. |
wizard |
|
You can add a standard java-doc including return values and parameters, right
click a method in outline view, choose add javadoc comment.
[By: Adam Kiezun] |
wizard |
| Templates try to guess right variable
names.
[By: jdt-ui team] |
template |
| There are default templates for class- and method comments in java - perspective - templates. file comment for instance is used whenever you create a new class. |
template |
| For builds >150802 it is possible to wrap a piece
of code with a template. E.g System.out.println("hello"); [ use code assist and select the 'if' template, you get ] if (condition) System.out.println("hello"); } |
template |
| You can use HotSwap (also called HCR) to change code during debugging. | debugging |
| in the Display view and in the toString subview you can use code assist [By: Erich Gamma] |
debugging |
| During debugging you can hoover over a
variable to read it's value.
[By: jdt-ui team] |
debugging |
| You can run arbitary statements in display view to
change variable values. Enter statement, select it and choose Inspect by context menu.
[By: jdt-ui team] |
debugging |
| Automatic suspend in debugger when error
is encountered (preferences | java | debug | stop on uncatched
exceptions).
[By: jdt-ui team] |
debugging |
| Variable changed indication in Variables
view.
[By: jdt-ui team] |
debugging |
| In debug perspective the variables view can be set, to show the toString()-String of an object. Show detail panel does the job. And you have to override toString() of course to show something useful. | debugging |
| Double-clicking on a stack-trace in the console open an editor to the method
selected.
[By: Randy Hudson] |
debugging |
| Here is a overview
for the different types of breakpoints
[By: Darin Swanson] |
debugging |
|
Surround with try/catch [select the statement(s) which throws a exception and use the context menu|Source surround with try/catch] [By: Stein M. Eliassen] |
refactor |
| If you want to rename classes, methods or fields, select the thing you want to rename and choose Refactor - Rename .. all references a changed automatically. | refactor |
Structured selection in the java editor: [By: Adam Kiezun] |
refactor |
| renaming an instance variable provides the option to rename the corresponding getters and
setters
[By: Erich Gamma] |
refactor |
| In builds >0425 it is possible to add deleted files and folders. Right click at the project in package view and choose Add from local history. | local history |
| There is a local history. All changes to your classes are saved. You can use 'Compare with' or 'Replace with ' to get your old code back. There are settings in preferences - workspace - local history. I suggest to set higher values if you don’t have a cvs server running. | local history |
|
You can get the local history of an individual method. Select a method in
the Outline or Hierarchy View and execute Replace With>Local history. This will show you the history of this particular method and you can select which version should replace the one in the workspace. Simliarly you can add a deleted method by the local history. Select a type in the outliner and execute Add by Local History. [By: Erich Gamma] |
local history |
| You can compare to files with each other (imagine you have to merge 2 files without a cvs). Use ctrl left click to select the two files. And right click into the outline view and choose compare|with each other. | compare |
| You can can convince the compare view to ignore the whitespaces. Great if one of your coworkers insists to use spaces instead tabs. | compare |
| You can change the behavior of Organize imports in preferences - java - Organize imports. Using 0 in the number field creates all imports with *. | preferences |
| you can run code with syntax errors, so you don't have to wait running code until the compiler gives you permission <g> [By: Erich Gamma] |
??? |
| When comparing Java compilation units (e.g. in the
Synchronize View) you can double click on the changed file to see the changes at the method rather than file level (we will remove the need for a double click soon) [By: Erich Gamma] |
team |
| You have to enable Highlight problems in
preferences|java|editor to use it newer builds have the option to show an icon at the ruler to indicate a fixable problem |
Quick fix |
| Quick fix helps you to correct for example simple spelling error. Just enter "a".lengh() // note the missing "t" in some editor. You'll see a red unline denoting that something is wrong here. Place the text cursor on that word and press Ctrl+1. Eclipse will offer to change the spelling to "length" [By: Stefan Matthias Aust] |
Quick fix |
| Quick fix can create method stups iDoNotExist(); If you now press Ctrl+1, Eclipse will offer to create a stub for that method. [By: Stefan Matthias Aust] |
Quick fix |
|
Quick fix can create fields, local variables and even arguments |
Quick fix |