- An
Eclipse workspace consists of any number of projects, each of which
consists of any number of files and/or folders. You can have several
workspaces,
each with different projects, and you can switch between them by selecting
File/Switch workspace..
- Different Perspectives give different views of the project. The two
most common ones are the Java Perspective and the Debug perspective
for working on Java projects. You can switch perspectives by selecting
Window/Open Perspective, and then the perspective (or choose Other...
and select the perspective form the list of available ones). The Java
Browsing perspective gives a quick way to browse a project, The
four
panes across
the top
are Project
- Package - Class - Class members.
- The Resource perspective gives a view of all the files associated
with a project, whereas the Java perspective hides unimportant files
(class files and the .project file in particular).
- The Package Explorer in the standard Java perspective shows the logical
view of the project. A project could be closed and reopened by right-clicking
the project and choosing Close Project or Open Project.
- The standard Java source file editor is run when a file is double-clicked
in the Package Explorer.
- The Java compiler is incremental and recompiles each file separately
whenever a change is made. In particular it recompiles when the file
is saved.
- Errors are shown with a wiggly red line under it and a bar in the
column at the right hand edge. By hovering the mouse over the item underlined,
or over the bar, a message is displayed showing the exact error.
- Hovering over an identifier (class, method, field) will show its package
and the Javadoc comment associated with it, if any.
- Clicking on an identifier and pressing F3 will bring up the declaration
of that item. You can also hold down Ctrl and click when the identifier
is underlined.
- Pressing Ctrl-Shift-T will bring up a window for Types. Typing the
first few letters will show the types that start with those letters.
Eventually a single type will be shown, and pressing Enter will show
the declaration of the type in the editor.
- Pressing Ctrl-O brings up a window showing all the members of that
class in the editor. Again typing the first few letters will narrow
the options.
- Pressing Ctrl-T brings up a window showing the place in the type hierarchy
of the class in the editor.
- When an error or warning is flagged, clicking on it and pressing Ctrl-1
will attempt a "quick fix". It will bring up a menu of options. For
instance, if an import statement is missing, it will insert one for
you. It can also removed unused imports, add a method return, create
a new method, handle uncaught exceptions, and remove unnecessary catches.
- When inputting new code, Content Assist can help in completing identifiers,
guessing a new name and inserting code templates. For instance, typing
"for" and the pressing Ctrl-Space will bring up a menu of choices for
for loops.
- To correct the indenting of code, place the cursor on a line or highlight
several lines, then press ctrl-I.
- Searching in Eclipse is very comprehensive. You a standard text search
by choosing Search/File... , typing the text to be searched for, and
checking the button for the scope of the search (whole workspace or
just the current project). Choosing Search/Java... will allow searches
for identifiers of particular kinds (types, methods, fields, etc.).
The results can be any references to the identifier, or their declarations.
The results of searches are shown in the output pane below the code
pane, on the Search tab.
- Clicking on an identifier and pressing Ctrl-Shift-G will find all
references to the identifer. Pressing Ctrl-G will find its declaration.
- Line numbers may be shown by checking the option in Preferences/General/Editors/Text
Editors. You can go to a particular line in the current file with Ctrl-L
and typing in the number.
- When an error occurs on entry of a standard Java class, you can insert
the relevant import declaration with Ctrl-Shft-O. If there is an ambiguity,
a message box will show the alternatives which you can then choose from.
- You can toggle comments on and off on a line or lines with Ctrl-/.
Highlight multiple lines if necessary.
- You can move lines up or down with Alt-Up arrow and Alt-Down arrow.
Highlight multiple lines if necessary.
- You can can go backwards and forwards in the edit position history
with Alt-Left arrow (back) and Alt-Right arrow (forwards).
- All the key bindings can be shown with Ctrl-Shft-L.
|