Eclipse Workbench - Politecnico di Torino

LAB guidelines (Eclipse)
Setup
ƒ Is there a desktop link to the Java
documentation?
♦
Skip this slide
ƒ Check whether Java tool are already
installed
ƒ Click on the “Add or Remove Programs”
desktop icon
ƒ Open the “Add New Program” tab
ƒ Select and install “Java 2 SDK …”
Politecnico di Torino
2
1
Installed base
ƒ Windows 2000 PCs
♦ Java
2 SDK, SE 1.4
♦ Eclipse 3.1
Politecnico di Torino
3
Desktop
Tool
API
Tutorial
Politecnico di Torino
4
2
Introduction
ƒ Eclipse is an open and extensible
platform to develop IDEs (Integrated
Development Environment)
ƒ Developed by eclipse.org consortium,
whose prospective members are
♦ Borland,
IBM, Rational, Red Hat
Politecnico di Torino
5
Politecnico di Torino
6
3
Workspace components
ƒ Material is organized in
a workspace
ƒ A workspace contains
one ore more top-level
projects, corresponding
to file-system folders
ƒ Tree-like structure
ƒ Files, Folders, and
Projects are called
resources
Politecnico di Torino
7
Workbench Terminology
Menu bar
Text
editor
Tool bar
Perspective
and
Fast View
bar
Outline
view
Resource
Navigator
view
Bookmarks
view
Properties
view
Message
area
Stacked
views
Tasks
view
Editor
Status
area
Politecnico di Torino
8
4
Java Perspective (1)
ƒ View focusing on elements meaningful to
Java programmers (packages, classes,
methods, attributes, etc.)
Java
project
package
class
field
method
Java
editor
Politecnico di Torino
9
Java Perspective (2)
ƒ Let the developer browse the class
hierarchy
Type
hierarchy
Selected
type’s
members
Politecnico di Torino
10
5
Java Perspective (3)
ƒ Search of Java elements
♦
♦
Point of declaration or
referencing points
Including libraries from other
projects
Hits
flagged
in margin
of editor
All search
results
Politecnico di Torino
11
New project
ƒ File menu
♦
New Project
ƒ Select “Java Project”
ƒ Type project name
ƒ Finish
Politecnico di Torino
12
6
New package
ƒ Right-click on project
ƒ New >
Politecnico di Torino
13
New class
ƒ Right-click on
package
ƒ New >
ƒ Type class name
ƒ Finish
Politecnico di Torino
14
7
Editor - Method auto-completion
List of available methods
Politecnico di Torino
15
Java Editor
ƒ On-the-fly syntactic check
Click
to see
fixes
Problem
Quick
fixes
Preview
Politecnico di Torino
16
8
Java Editor
ƒ Code templates quicken the writing of
common code fragments (e.g., for loops)
Statement
template
Ctrl
+
Space
Preview
Politecnico di Torino
17
How to compile/run
ƒ Compilation is transparent to the user
♦ Whenever
files are saved
ƒ Program are executed with the
following button
♦ Output
console is opened automatically
Politecnico di Torino
18
9