2. • Miguel Pardal
– LEIC 2000
– Assistant Professor at Técnico Lisboa
– http://web.tecnico.ulisboa.pt/miguel.pardal
– Eclipse user since 2005
– Conditional fan
4. History
• Eclipse started out as proprietary technology
– Object Technology International (OTI)
– IBM’s goals:
• Reduce incompatible environments
• Increase reuse of common components
• Evolved from IBM VisualAge for
Smalltalk™ and for Java™
– Monolithic
http://wiki.eclipse.org/FAQ_Where_did_Eclipse_come_from%3F
5. History
• The Eclipse open source project was announced in November
2001 by a group of companies that formed the initial Eclipse
Consortium
– Eclipse Foundation since 2004
• Commercial-friendly open source license
– Wider audience and ecosystem
• Eclipse was designed from the ground up as an integration
platform for development tools
– Everything in Eclipse is a plug-in
– Uses SWT to bind to local platform GUI
– OSGi component model since 3.0
– Annual Simultaneous Release (…, Luna, Mars, Neon, …)
6. Install
• Simple:
– Download
– Unzip
– Run
• All configurations are file-based
– Workspace folder
• Settings
• Projects
– Project metadata files
• .project
• .classpath
9. View
• A view is a window that lets you examine
something
– Navigate a list or hierarchy of information
– Display properties for the active editor
• Modifications made in a view are saved
immediately
10. Editor
• Editors are used to edit or browse a
resource
– Rectangular area in the Workbench window
– Visual presentation might be text or a
diagram.
– Editors are launched by clicking on a resource
in a view
– Modifications made in an editor follow an
open-save-close lifecycle model
• * indicates unsaved data
11.
12. Perspective
• A perspective is a set of views, editors, and
toolbars, along with their arrangement within the
Workbench window.
• As you perform a task, you may rearrange windows,
new views, and so on.
– Saved under the current perspective.
– Next time, switch to perspective
– Within a window, each perspective may have a
different set of views but all perspectives share
the same set of editors.
• Built-in Java or Debug perspectives
27. Implicit class creation
– Write code as if the class already exists
• Write code referring to non-existing classes
– Use quick-fix to generate class
28. But beware…
• Quick-fix can become “quick-bug”
• Example
– Try-catch and ignore
• Worst solution
– Try-catch, print and continue
• As if nothing has happened… but it did!
– Think it through:
• Handle exception (try-catch)
• Or let someone else do it (throws)
31. Refactoring
• Refactoring is a process of software source code
transformation
– Should be performed when the code is working and
all of its tests are passing
– Does not involve rewriting or replacing large chunks
of code.
– Gradual, evolutionary process, intended to “preserve
the knowledge embedded in the existing code.”
• Examples
– Rename
– Extract method
33. Conclusions
• Very useful tool
• Can increase productivity
– Code formatting
– Especially in refactoring
• But…
– Does NOT replace critical thought and design
– Can increase the production of all code
• Bugs included!
38. 7. Maximize editor
• Maximizes current editor
Ctrl + M
• You can also double-click editor tab
39. 6. Editor navigation
• Jump to beginning / end of indentation. Twice to jump to beginning of line
– Home/End
• Jump to beginning / jump to end of source
– Ctrl+Home/End
• Jump one word to the left / one word to the right
– Ctrl+Arrow Right/Arrow Left
• Jump to previous / jump to next method
– Ctrl+Shift+Arrow Down/Arrow Up
• Jump to next / jump to previous compiler syntax warning or error
– Ctrl+./Ctrl+,
• Jump to last location edited
– Ctrl+q
• Jump to Line Number
– Ctrl+l
• Hide/show line numbers
– Ctrl+F10 and select 'Show Line Numbers'