20-jun-15 eclipse. most slides from: 2 about ides an ide is an integrated development environment

23
Mar 25, 2 022 Eclipse

Post on 20-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

Apr 18, 2023

Eclipse

Page 2: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

2Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

About IDEs

An IDE is an Integrated Development Environment Different IDEs meet different needs

BlueJ, DrJava are designed as teaching tools Emphasis is on ease of use for beginners Little to learn, so students can concentrate on learning Java

Eclipse, JBuilder, NetBeans are designed as professional-level work tools Emphasis is on supporting professional programmers More to learn, but well worth it in the long run

We will use Eclipse, but other professional IDEs are similar The following slides are taken from

www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Page 3: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

3Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Workbench Terminology

Tool bar

PerspectiveandFast Viewbar

ResourceNavigatorview

Stackedviews

Propertiesview

Tasksview

Outlineview

Bookmarksview

Menu bar

Messagearea

EditorStatusarea

Texteditor

Page 4: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

4Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Help Component

Help is presented in a standard web browser

Page 5: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

5Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Perspective Java-centric view of files in Java projects

Java elements meaningful for Java programmers

Javaproject

package

class

field

method

Javaeditor

Page 6: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

6Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Perspective Browse type hierarchies

“Up” hierarchy to supertypes “Down” hierarchy to subtypes

Typehierarchy

Selectedtype’s

members

Page 7: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

7Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Perspective Search for Java elements

Declarations or references Including libraries and other projects

Hitsflaggedin marginof editor

All search results

Page 8: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

8Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

Hovering over identifier shows Javadoc spec

Page 9: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

9Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

Method completion in Java editor

List of plausible methods Doc for method

Page 10: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

10Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

On-the-fly spell check catches errors early

Preview

Clickto seefixes

ProblemQuickfixes

Page 11: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

11Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

Code templates help with drudgery

Statementtemplate Preview

Page 12: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

12Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

Method stub insertionfor inherited methods

Method stub insertion for anonymous inner types

Java editor creates stub methods

Page 13: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

13Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

Variable namesuggestion

Argument hints andproposed argumentnames

JavaDoccode assist

Java editor helps programmers write good Java code

Page 14: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

14Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Java Editor

Other features of Java editor include Local method history Code formatter Source code for binary libraries Built-in refactoring

Page 15: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

15Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Refactoring

JDT has actions for refactoring Java code

Page 16: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

16Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Refactoring

Refactoring actions rewrite source code Within a single Java source file Across multiple interrelated Java source files

Refactoring actions preserve program semantics Does not alter what program does Just affects the way it does it

Encourages exploratory programming Encourages higher code quality

Makes it easier to rewrite poor code

Page 17: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

17Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Refactoring Full preview of all ensuing code changes

Programmer can veto individual changes

List of changes

“before” vs. “after”

Page 18: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

18Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Refactoring

Growing catalog of refactoring actions Organize imports Rename {field, method, class, package} Move {field, method, class} Extract method Extract local variable Inline local variable Reorder method parameters

Page 19: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

19Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Eclipse Java Compiler

Eclipse Java compiler JDK-compliant Java compiler (selectable 1.3, 1.4, and 1.5) Helpful error messages Generates executable code even in presence of errors Fully-automatic incremental recompilation High performance Scales to large projects

Multiple other uses besides the obvious Syntax and spell checking Analyze structure inside Java source file Name resolution Content assist Refactoring Searches

Page 20: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

20Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Eclipse Java Debugger Run or debug Java programs

Threads and stack

frames

Editor with breakpoint

marks

Console I/O

Local variables

Page 21: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

21Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Eclipse Java Debugger Run Java programs

In separate target JVM (user selectable) Console provides stdout, stdin, stderr Scrapbook pages for executing Java code snippets

Debug Java programs Full source code debugging Any JPDA-compliant JVM

Debugger features include Method and exception breakpoints Conditional breakpoints Watchpoints Step over, into, return; run to line Inspect and modify fields and local variables Evaluate snippets in context of method Hot swap (if target JVM supports)

Page 22: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

22Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

Getting Eclipse If you Google for “Eclipse”:

The first hit is the home page, http://www.eclipse.org/ The second hit is “Eclipse Downloads,”

http://www.eclipse.org/downloads/index.php The current version (Nov. 28, 2005) is Eclipse SDK 3.1.1

Click on the download link You will get a zip file; unzip it No further “installation” is necessary (assuming your Java is installed

correctly) Run the eclipse.exe file

You will be asked to choose a folder for a “workspace” (mine is called workspace); do so

No further configuration is necessary

Page 23: 20-Jun-15 Eclipse. Most slides from:  2 About IDEs An IDE is an Integrated Development Environment

23Most slides from: www.eclipse.org/eclipse/presentation/eclipse-slides.ppt

The End