Eclipse - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Eclipse

Description:

get the Eclipse SDK download, latest release. be sure to install Java first ... Runtime Platform. Eclipse Modeling Framework (EMF) structured data. Graphical. Editor ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 27
Provided by: cyndi8
Category:

less

Transcript and Presenter's Notes

Title: Eclipse


1
Eclipse
  • Understanding the IDE

2
Excellent Reference
  • Eclipse Distilled
  • David Carlson, Addison Wesley
  • ISBN 0-321-2885-7
  • Download Eclipse
  • http//www.eclipse.org
  • get the Eclipse SDK download, latest release
  • be sure to install Java first
  • No installer, just unzip it and create a shortcut
    for eclipse.exe

3
Platform Architecture
Architecture is multi-platform, multi-language,
multi-role, but well just be focusing on its use
as an IDE for Java
Plug-in registry Resources User
Interface Update facility Help
Contributed Plug-Ins etc.
JDT
IDE
Runtime Platform
4
Eclipse Plug-Ins
Visual Editor (VE)
UML2
Test and Performance (Hyades)
Graphical Editor Framework
Eclipse Modeling Framework (EMF) structured data
Runtime Platform
5
Java IDE
Java Perspective views laid out for a
particular task
Perspective Switcher
Toolbar
Editor
Views
6
Using the IDE
New Java Class
New Java Project
New Java Package
Buttons on toolbar will bring up wizards that
walk you through creating a new project, package
or class.
7
Create Project Options
Using a fully qualified name would be better,
such as edu.mines.MyProject
Creates src and bin directories will be created
8
Create Class Options
warning wouldnt appear if we used a package
youll need to select a src if one isnt
highlighted
click to create main method
9
New Class
Default comments for a new class
10
New Class (continued
To change comments, select Window gt Preferences,
then in dialog box select Java gt Code Style gt
Code Templates gt New Java Files gt Edit
11
New Class (continued)
Notice the revised comments, that match what we
require for our course header comments.
12
Update HelloPrinter
13
Error in HelloPrinter
Errors identified in red immediately
Listed under Problems after save
14
Execution in Eclipse
Simplest way is to select RunAs from toolbar Be
sure the program with main is selected!
Output will appear in the Console view/window.
15
Exercise
  • Create a project and class in Eclipse
  • NOTE Your workspace should be a directory on the
    Z\ drive, do not just accept the default.
  • Test your understanding of print and println
  • Experiment with various syntax errors

16
Example class BankAccount
17
Generates Getters/Setters
Specify which ones to create
Specify location
Specify order of methods (pairs or
all getters/all setters)
Javadoc format by default
18
Updated BankAccount
19
Generate Constructor Using Fields
20
Generate Constructors from Superclass
21
BankAccount constructors
Need to add comments
Need to insert default values
call to parent constructor
this is the calling object (implicit
parameter) this can also be used to call one
constructor from within another (can be confusing)
22
Chapter 4 Productivity Hint
  • Avoid Unstable Layout
  • /
  • Computes the change due and
  • resets the cash register for the
  • next customer
  • /
  • Looks pretty, but tedious to rearrange
  • if program changes (and they usually do!)

23
Eclipse Aid
  • Edit gt Select All (Ctrl-A)
  • Source gt Correct Indentation (Ctrl-I)
  • All programs that are turned in for grading
    should be neatly formatted!

24
More on Eclipse Execution
Recently executed classes are listed on a
dropdown when you press the run icon on the
toolbar
The console will contain a message when the class
is terminated, or a red icon to allow you to
terminate if the class is still executing
25
More on Eclipse Workspaces Projects
  • Workspace is mapped to a file directory
  • contains .metadata folder with workspace info,
    including .log file
  • Java projects include .classpath and .project
    files
  • To conserve resources, projects can be closed
    (right-click, close project)
  • Closed projects can be hidden (click on
    down-arrow, select filter)

26
Eclipse Perspectives
  • A perspective is a set of views in a layout that
    is well-suited for a particular task.
  • Java - normal perspective for editing Java files
  • Debug include views useful during a debugging
    session
  • Resource shows all files included in project.
    NOTE Window gt preferences gt General gt Workspace
    gt Refresh automatically can be used if changes
    are made to project outside Eclipse
  • 5 others not covered here.
  • Can create you own!
Write a Comment
User Comments (0)
About PowerShow.com