56
20040215 1 On the On the Eclipse Eclipse Project Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from http://www.eclipse.org/eclipse/presentation/ec t Copyright (c) 2002, 2003 IBM Corporation and others. Copyright (c) 2002, 2003 IBM Corporation and others.

20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 1

On the On the Eclipse ProjectEclipse Project Mateusz Srebrny16 February 2004 Warszawa

Slides adapted from

http://www.eclipse.org/eclipse/presentation/eclipse-slides.pptCopyright (c) 2002, 2003 IBM Corporation and others.Copyright (c) 2002, 2003 IBM Corporation and others.

Page 2: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 2

Presentation Plan

■ What is EclipseWhat is Eclipse■ Brief history of EclipseBrief history of Eclipse■ Concept of Plug-insConcept of Plug-ins■ Platform ArchitecturePlatform Architecture■ WorkspaceWorkspace■ Workbench (SWT, JFace)Workbench (SWT, JFace)■ JDT (Refactoring)JDT (Refactoring)■ Other componentsOther components

Page 3: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 3

What is Eclipse?

Java VMStandard Java2Virtual Machine

PlatformEclipse Platform

Java development tools

JDT

PDEPlug-in developmentenvironment

■ Eclipse is a universal platformEclipse is a universal platformfor integrating development toolsfor integrating development tools

■ Open, Open, extensible architecture based on plug-insextensible architecture based on plug-ins

Page 4: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 4

Eclipse Origins

■ Eclipse created by Eclipse created by OTI and OTI and IBM teams responsible IBM teams responsible for IDE productsfor IDE products– IBM VisualAge/Smalltalk (Smalltalk IDE) IBM VisualAge/Smalltalk (Smalltalk IDE) – IBM VisualAge/Java (Java IDE)IBM VisualAge/Java (Java IDE)– IBM VisualAge/Micro Edition (Java IDE)IBM VisualAge/Micro Edition (Java IDE)

■ Initially staffed with 40 full-time developersInitially staffed with 40 full-time developers

■ Effort transitioned into open source projectEffort transitioned into open source project– IInitial Eclipse code basenitial Eclipse code base::

• Platform, JDT, PDEPlatform, JDT, PDE

Page 5: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 5

Brief History of Eclipse

19991999AprilApril - Work begins on Eclipse inside OTI/IBM- Work begins on Eclipse inside OTI/IBM

20012001OctoberOctober - Eclipse 1.0- Eclipse 1.0

20022002JuneJune - Eclipse 2.0- Eclipse 2.0

20032003

MarchMarch - Eclipse 2.1- Eclipse 2.1

20042004

FebruaryFebruary - Eclipse Foundation announced not-for-- Eclipse Foundation announced not-for-profitprofit

- EclipseCon- EclipseCon

- Eclipse 3.0 7- Eclipse 3.0 7th th milestonemilestone

Page 6: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 6

Who’s supporting Eclipse

■ BorlandBorland, , IBMIBM, MERANT, QNX Software Systems,, MERANT, QNX Software Systems, Red Hat, Red Hat, SuSE,SuSE, Webgain Webgain

■ Serena, SybaseSerena, Sybase, , FujitsuFujitsu■ Hitachi, Instantiations, MontaVista, Scapa TechnologiesHitachi, Instantiations, MontaVista, Scapa Technologies, , TelelogicTelelogic■ ETRI, HP, MKSETRI, HP, MKS,, SlickEdit SlickEdit■ OracleOracle■ Catalyst Systems, Flashline, Parasoft, SAP, teamstudioCatalyst Systems, Flashline, Parasoft, SAP, teamstudio, T, TimeSysimeSys■ Object Management Group (OMG) Object Management Group (OMG) ■ Fraunhofer Institute, Ericsson, LogicLibrary, M7 Corpororation,Fraunhofer Institute, Ericsson, LogicLibrary, M7 Corpororation,

QA SystemsQA Systems, , SilverMark, Inc SilverMark, Inc ■ Advanced Systems Concepts, GenuitecAdvanced Systems Concepts, Genuitec, ,

INNOOPRACT Informationssysteme GmbH. INNOOPRACT Informationssysteme GmbH. ■ CanyonBlue, Ensemble Systems, CanyonBlue, Ensemble Systems, IntelIntel, Micro Focus, Tensilica, Micro Focus, Tensilica, ,

Wasabi.Wasabi.

Page 7: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 7

Eclipse Plug-in Architecture

■ Plug-in - Plug-in - smallest unit of Eclipse functionsmallest unit of Eclipse function– Big example: HTML editorBig example: HTML editor– Small example: Action to create zip filesSmall example: Action to create zip files

■ Extension point Extension point - named entity for collecting - named entity for collecting “contributions”“contributions”– Example: extension point for workbench preference UIExample: extension point for workbench preference UI

■ Extension - Extension - a contributiona contribution– Example: specific HTML editor preferencesExample: specific HTML editor preferences

Page 8: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 8

Eclipse Plug-in Architecture

■ Each plug-inEach plug-in– Contributes to 1 or more extension pointsContributes to 1 or more extension points– Optionally declares new extension pointsOptionally declares new extension points– Depends on a set of other plug-insDepends on a set of other plug-ins– Contains Java code libraries and other filesContains Java code libraries and other files– May export Java-based APIs for downstream plug-insMay export Java-based APIs for downstream plug-ins– Lives in its own plug-in subdirectoryLives in its own plug-in subdirectory

■ Details spelled out in the Details spelled out in the plug-in manifestplug-in manifest– Manifest declares contributionsManifest declares contributions– Code implements contributions and provides APICode implements contributions and provides API– plugin.xml file in root of plug-in subdirectoryplugin.xml file in root of plug-in subdirectory

Page 9: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 9

Plug-in Manifest

<plugin id = “com.example.tool" name = “Example Plug-in Tool" class = "com.example.tool.ToolPlugin"> <requires> <import plugin = "org.eclipse.core.resources"/> <import plugin = "org.eclipse.ui"/> </requires> <runtime> <library name = “tool.jar"/> </runtime> <extension point = "org.eclipse.ui.preferencepages"> <page id = "com.example.tool.preferences" icon = "icons/knob.gif" title = “Tool Knobs" class = "com.example.tool.ToolPreferenceWizard“/> </extension> <extension-point name = “Frob Providers“ id = "com.example.tool.frobProvider"/></plugin>

Declare contributionthis plug-in makes

Declare new extension point open to contributions from other plug-ins

Location of plug-in’s code

Other plug-ins needed

Plug-in identification

plugin.xml

Page 10: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 10

Eclipse Plug-in Architecture

■ Plug-in APlug-in A– Declares extension point PDeclares extension point P– Declares interface I to go with PDeclares interface I to go with P

■ Plug-in BPlug-in B– Implements interface I with its own class CImplements interface I with its own class C– Contributes class C to extension point PContributes class C to extension point P

■ Plug-in A instantiates C and calls its I methodsPlug-in A instantiates C and calls its I methods

plug-in A plug-in B

class Cinterface I

extensionpoint P

extension

■ Typical arrangementTypical arrangement

contributes

creates, calls

implements

Page 11: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 11

Eclipse Platform Architecture

■ Eclipse Platform Runtime is micro-kernelEclipse Platform Runtime is micro-kernel– All functionality supplied by plug-insAll functionality supplied by plug-ins

■ Eclipse Platform Runtime handles start upEclipse Platform Runtime handles start up– Discovers plug-ins installed on diskDiscovers plug-ins installed on disk– Matches up extensions with extension pointsMatches up extensions with extension points– Builds global plug-in registryBuilds global plug-in registry– Caches registry on disk for next timeCaches registry on disk for next time

Page 12: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 12

Plug-in Activation

■ Contributions processed without plug-in activationContributions processed without plug-in activation– Example: Menu constructed from manifest info for Example: Menu constructed from manifest info for

contributed itemscontributed items

■ Plug-ins are activated only as neededPlug-ins are activated only as needed– Example: Plug-in activated only when user selects its Example: Plug-in activated only when user selects its

menu itemmenu item– Scalable for large base of installed plug-insScalable for large base of installed plug-ins– Helps avoid long start up timesHelps avoid long start up times

Page 13: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 13

Plug-in Install

■ FeaturesFeatures group plug-ins into installable chunks group plug-ins into installable chunks– Feature manifest fileFeature manifest file

■ Plug-ins and features bear version identifiersPlug-ins and features bear version identifiers– major . minor . servicemajor . minor . service– Multiple versions may co-exist on diskMultiple versions may co-exist on disk

■ Features downloadable from web siteFeatures downloadable from web site– Using Eclipse Platform update managerUsing Eclipse Platform update manager– Obtain and install new plug-insObtain and install new plug-ins– Obtain and install updates to existing plug-insObtain and install updates to existing plug-ins

Page 14: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 14

Plug-in Architecture - Summary

■ All functionality provided by plug-insAll functionality provided by plug-ins– Includes all aspects of Eclipse Platform itselfIncludes all aspects of Eclipse Platform itself

■ Communication via extension pointsCommunication via extension points– Contributing does not require plug-in activationContributing does not require plug-in activation

■ Packaged into separately installable featuresPackaged into separately installable features– DownloadableDownloadable

Eclipse has open, Eclipse has open, extensibleextensible architecture based on plug-insarchitecture based on plug-ins

Page 15: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 15

Eclipse Platform

■ Eclipse Platform is the common baseEclipse Platform is the common base■ Consists of several key componentsConsists of several key components

Platform Runtime

Eclipse Platform

Workspace

Workbench

SWTJFace

Team Help Debug

AntCore

UI

Page 16: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 16

Workspace Component

■ Tools operate on files in user’s Tools operate on files in user’s workspaceworkspace

■ Projects map to Projects map to directories in file systemdirectories in file system

■ {Files, Folders, Projects} {Files, Folders, Projects} termed termed resourcesresources

■ Workspace holds 1 or Workspace holds 1 or more top-level more top-level projectsprojects

■ Tools read, create, modify, and delete Tools read, create, modify, and delete resources in workspaceresources in workspace

■ Plug-ins access via workspace and Plug-ins access via workspace and resource APIsresource APIs

■ Tree of Tree of foldersfolders and and filesfiles

Page 17: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 17

Workspace and Resource API

■ Allows fast navigation of workspace resource treeAllows fast navigation of workspace resource tree■ Resource change listener for monitoring activityResource change listener for monitoring activity

– Resource deltas describe batches of changesResource deltas describe batches of changes■ Maintains limited history of changed/deleted filesMaintains limited history of changed/deleted files■ Several kinds of extensible resource metadataSeveral kinds of extensible resource metadata

– Persistent resource propertiesPersistent resource properties– Session resource propertiesSession resource properties– MarkersMarkers– Project naturesProject natures

■ Workspace session lifecycleWorkspace session lifecycle– Workspace save, exit, restoreWorkspace save, exit, restore

■ Incremental project buildersIncremental project builders

Page 18: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 18

Workbench Component

■ SWT – generic low-level graphics and widget setSWT – generic low-level graphics and widget set■ JFace – UI frameworks for common UI tasksJFace – UI frameworks for common UI tasks■ Workbench – UI personality of Eclipse PlatformWorkbench – UI personality of Eclipse Platform

Workbench

SWTJFace

Page 19: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 19

SWT

■ SWT = Standard Widget ToolkitSWT = Standard Widget Toolkit■ Generic graphics and GUI widget setGeneric graphics and GUI widget set

– buttons, lists, text, menus, trees, styled text...buttons, lists, text, menus, trees, styled text...

■ SimpleSimple■ SmallSmall■ FastFast■ OS-independent APIOS-independent API■ Uses native widgets where availableUses native widgets where available■ Emulates widgets where unavailableEmulates widgets where unavailable

Page 20: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 20

Why SWT?

■ Eclipse Platform on Windows XPEclipse Platform on Windows XP

Page 21: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 21

Why SWT?

■ Eclipse Platform on Windows XP (skinned)Eclipse Platform on Windows XP (skinned)

Page 22: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 22

Why SWT?

■ Eclipse Platform on Linux - GTK 2.0Eclipse Platform on Linux - GTK 2.0

Page 23: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 23

Why SWT?

■ Eclipse Platform on Linux - MotifEclipse Platform on Linux - Motif

Page 24: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 24

Why SWT?

■ Eclipse Platform on Mac OS X - CarbonEclipse Platform on Mac OS X - Carbon

Page 25: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 25

JFace

■ JFace is set of UI frameworks for common UI tasksJFace is set of UI frameworks for common UI tasks■ Designed to be used in conjunction with SWTDesigned to be used in conjunction with SWT■ Classes for handling common UI tasksClasses for handling common UI tasks■ API and implementation are window-system API and implementation are window-system

independentindependent

Page 26: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 26

JFace APIs

■ Image and font registriesImage and font registries■ Dialog, preference, and wizard frameworksDialog, preference, and wizard frameworks■ Structured viewersStructured viewers

– Model-aware adapters for SWT tree, table, list widgetsModel-aware adapters for SWT tree, table, list widgets■ Text infrastructureText infrastructure

– Document model for SWT styled text widgetDocument model for SWT styled text widget– Coloring, formatting, partitioning, completionColoring, formatting, partitioning, completion

■ ActionsActions– Location-independent user commandsLocation-independent user commands– Contribute action to menu, tool bar, or buttonContribute action to menu, tool bar, or button

Page 27: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 27

Workbench Component

■ Workbench is UI personality of Eclipse PlatformWorkbench is UI personality of Eclipse Platform

■ UI paradigm centered aroundUI paradigm centered around– EditorsEditors– ViewsViews– PerspectivesPerspectives

Page 28: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 28

Workbench Terminology

Tool bar

PerspectiveandFast Viewbar

ResourceNavigatorview

Stackedviews

Propertiesview

Tasksview

Outlineview

Bookmarksview

Menu bar

Messagearea

EditorStatusarea

Texteditor

Page 29: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 29

Editors

■ Editors appear in workbench editor areaEditors appear in workbench editor area■ Contribute actions to workbench menu and tool barsContribute actions to workbench menu and tool bars■ Open, edit, save, close lifecycleOpen, edit, save, close lifecycle■ Open editors are stackedOpen editors are stacked

■ Extension point for contributing new types of editorsExtension point for contributing new types of editors■ Example: JDT provides Java source file editorExample: JDT provides Java source file editor■ Eclipse Platform includes simple text file editorEclipse Platform includes simple text file editor■ Windows only: embed any OLE document as editorWindows only: embed any OLE document as editor■ Extensive text editor API and frameworkExtensive text editor API and framework

Page 30: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 30

Views

■ Views provide information on some objectViews provide information on some object■ Views augment editorsViews augment editors

– Example: Outline view summarizes contentExample: Outline view summarizes content■ Views augment other viewsViews augment other views

– Example: Properties view describes selectionExample: Properties view describes selection

■ Extension point for new types of viewsExtension point for new types of views■ Eclipse Platform includes many standard viewsEclipse Platform includes many standard views

– Resource Navigator, Outline, Properties, Tasks, Resource Navigator, Outline, Properties, Tasks, Bookmarks, Search, …Bookmarks, Search, …

■ View API and frameworkView API and framework– Views can be implemented with JFace viewersViews can be implemented with JFace viewers

Page 31: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 31

Perspectives

■ Perspectives are arrangements of views and editorsPerspectives are arrangements of views and editors■ Different perspectives suited for different user tasksDifferent perspectives suited for different user tasks■ Users can quickly switch between perspectivesUsers can quickly switch between perspectives■ Task orientation limits visible views, actionsTask orientation limits visible views, actions

– Scales to large numbers of installed toolsScales to large numbers of installed tools■ Perspectives controlPerspectives control

– View visibilityView visibility– View and editor layoutView and editor layout– Action visibilityAction visibility

■ Extension point for new perspectivesExtension point for new perspectives■ Eclipse Platform includes standard perspectivesEclipse Platform includes standard perspectives

– Resource, Debug, …Resource, Debug, …■ Perspective APIPerspective API

Page 32: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 32

Workbench Responsibilities

■ Eclipse Platform manages windows and Eclipse Platform manages windows and perspectivesperspectives

■ Eclipse Platform creates menu and tool barsEclipse Platform creates menu and tool bars– Labels and icons listed in plug-in manifestLabels and icons listed in plug-in manifest– Contributing plug-ins not activatedContributing plug-ins not activated

■ Eclipse Platform creates views and editorsEclipse Platform creates views and editors– Instantiated only as neededInstantiated only as needed

■ Scalable to large numbers of installed toolsScalable to large numbers of installed tools

Page 33: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 33

Eclipse Platform - Summary

■ Eclipse Platform is the nucleus of IDE productsEclipse Platform is the nucleus of IDE products■ Plug-ins, extension points, extensionsPlug-ins, extension points, extensions

– Open, Open, extensible architectureextensible architecture■ Workspace, projects, files, foldersWorkspace, projects, files, folders

– Common place to organize & store development Common place to organize & store development artifactsartifacts

■ Workbench, editors, views, perspectivesWorkbench, editors, views, perspectives– Common user presentation and UI paradigmCommon user presentation and UI paradigm

■ Key building blocks and facilitiesKey building blocks and facilities– Help, team support, internationalization, …Help, team support, internationalization, …

Eclipse is a universal platform Eclipse is a universal platform forfor

integrating development toolsintegrating development tools

Page 34: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 34

Java Development Tools

■ JDT = Java development toolsJDT = Java development tools■ State of the art Java development environmentState of the art Java development environment

■ Built atop Eclipse PlatformBuilt atop Eclipse Platform– Implemented as Eclipse plug-insImplemented as Eclipse plug-ins– Using Eclipse Platform APIs and extension pointsUsing Eclipse Platform APIs and extension points

■ Included in Eclipse Project releasesIncluded in Eclipse Project releases– Available as separately installable featureAvailable as separately installable feature– Part of Eclipse SDK dropsPart of Eclipse SDK drops

Page 35: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 35

JDT Goals

■ Goal: To be #1 Java IDEGoal: To be #1 Java IDE

■ Goal: To make Java programmers smileGoal: To make Java programmers smile

Page 36: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 36

Java Perspective

■ Java-centric view of files in Java projectsJava-centric view of files in Java projects– Java elements meaningful for Java programmersJava elements meaningful for Java programmers

Javaproject

package

class

field

method

Javaeditor

Page 37: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 37

Java Perspective

■ Browse type hierarchiesBrowse type hierarchies– ““Up” hierarchy to supertypesUp” hierarchy to supertypes– ““Down” hierarchy to subtypesDown” hierarchy to subtypes

Typehierarchy

Selectedtype’s

members

Page 38: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 38

Java Perspective

■ Search for Java elementsSearch for Java elements– Declarations or referencesDeclarations or references– Including libraries and other projectsIncluding libraries and other projects

Hitsflaggedin marginof editor

All search results

Page 39: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 39

Java Editor

■ Hovering over identifier shows Javadoc specHovering over identifier shows Javadoc spec

Page 40: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 40

Java Editor

■ Method completion in Java editorMethod completion in Java editor

List of plausible methods Doc for method

Page 41: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 41

Java Editor

■ On-the-fly spell check catches errors earlyOn-the-fly spell check catches errors early

Preview

Clickto seefixes

ProblemQuickfixes

Page 42: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 42

Java Editor

■ Code templates help with drudgeryCode templates help with drudgery

Statementtemplate Preview

Page 43: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 43

Java Editor

Method stub insertionfor inherited methods

Method stub insertion for anonymous inner types

■ Java editor creates stub methodsJava editor creates stub methods

Page 44: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 44

Java Editor

Variable namesuggestion

Argument hints andproposed argumentnames

JavaDoccode assist

■ Java editor helps programmers write good Java codeJava editor helps programmers write good Java code

Page 45: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 45

Java Editor

■ Other features of Java editor includeOther features of Java editor include– Local method historyLocal method history– Code formatterCode formatter– Source code for binary librariesSource code for binary libraries– Built-in refactoringBuilt-in refactoring

Page 46: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 46

Refactoring

■ JDT has actions for refactoring Java codeJDT has actions for refactoring Java code

Page 47: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 47

Refactoring

■ Refactoring actions rewrite source codeRefactoring actions rewrite source code– Within a single Java source fileWithin a single Java source file– Across multiple interrelated Java source filesAcross multiple interrelated Java source files

■ Refactoring actions preserve program semanticsRefactoring actions preserve program semantics– Does not alter what program doesDoes not alter what program does– Just affects the way it does itJust affects the way it does it

■ Encourages exploratory programmingEncourages exploratory programming■ Encourages higher code qualityEncourages higher code quality

– Makes it easier to rewrite poor codeMakes it easier to rewrite poor code

Page 48: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 48

Refactoring

■ Full preview of all ensuing code changesFull preview of all ensuing code changes– Programmer can veto individual changesProgrammer can veto individual changes

List of changes

“before” vs. “after”

Page 49: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 49

Refactoring

■ Growing catalog of refactoring actionsGrowing catalog of refactoring actions– Organize importsOrganize imports– Rename {field, method, class, package}Rename {field, method, class, package}– Move {field, method, class}Move {field, method, class}– Extract {method, local variable, interface}Extract {method, local variable, interface}– Inline {method, local variable}Inline {method, local variable}– Reorder method parametersReorder method parameters– Push members downPush members down

……

Page 50: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 50

Eclipse Java Compiler

■ Eclipse Java compilerEclipse Java compiler– JCK-compliant Java compiler (selectable 1.3 and 1.4)JCK-compliant Java compiler (selectable 1.3 and 1.4)– Helpful error messagesHelpful error messages– Generates runnable code even in presence of errorsGenerates runnable code even in presence of errors– Fully-automatic incremental recompilationFully-automatic incremental recompilation– High performanceHigh performance– Scales to large projectsScales to large projects

■ Multiple other uses besides the obviousMultiple other uses besides the obvious– Syntax and spell checkingSyntax and spell checking– Analyze structure inside Java source fileAnalyze structure inside Java source file– Name resolutionName resolution– Content assistContent assist– RefactoringRefactoring– SearchesSearches

Page 51: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 51

Eclipse Java Debugger

■ Run or debug Java programsRun or debug Java programs

Threads and stack

frames

Editor with breakpoint

marks

Console I/O

Local variables

Page 52: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 52

Eclipse Java Debugger

■ Run Java programsRun Java programs– In separate target JVM (user selectable)In separate target JVM (user selectable)– Console provides stdout, stdin, stderrConsole provides stdout, stdin, stderr– Scrapbook pages for executing Java code snippetsScrapbook pages for executing Java code snippets

■ Debug Java programsDebug Java programs– Full source code debuggingFull source code debugging– Any JPDA-compliant JVMAny JPDA-compliant JVM

■ Debugger features includeDebugger features include– Method and exception breakpointsMethod and exception breakpoints– Conditional breakpointsConditional breakpoints– WatchpointsWatchpoints– Step over, into, return; run to lineStep over, into, return; run to line– Inspect and modify fields and local variablesInspect and modify fields and local variables– Evaluate snippets in context of methodEvaluate snippets in context of method– Hot swap (if target JVM supports)Hot swap (if target JVM supports)

Page 53: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 53

JDT APIs

■ JDT APIs export functionality to other plug-insJDT APIs export functionality to other plug-ins

■ Java modelJava model– Java-centric analog of workspaceJava-centric analog of workspace– Tree of Java elements (down to individual methods)Tree of Java elements (down to individual methods)– Java element deltasJava element deltas– Type hierarchiesType hierarchies– Model accurate independent of buildsModel accurate independent of builds

■ Building blocksBuilding blocks– Java scannerJava scanner– Java class file reader Java class file reader – Java abstract syntax trees (down to expressions)Java abstract syntax trees (down to expressions)

■ Many others…Many others…

Page 54: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 54

Eclipse JDT - Summary

■ Java views, editor, refactoringJava views, editor, refactoring– Helps programmer write and maintain Java codeHelps programmer write and maintain Java code

■ Java compilerJava compiler– Takes care of translating Java sources to binariesTakes care of translating Java sources to binaries

■ Java debuggerJava debugger– Allows programmer to get inside the running programAllows programmer to get inside the running program

Eclipse Javaprogrammmers

Page 55: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 55

Other Components

■ CDT – C/C++ IDECDT – C/C++ IDE■ EMF – Eclipse Modeling FrameworkEMF – Eclipse Modeling Framework■ UML2 – modeling toolUML2 – modeling tool■ GEF – Graphical Editing FrameworkGEF – Graphical Editing Framework■ VE – Visual EditorVE – Visual Editor■ HyadesHyades■ CobolCobol

■ many community plug-ins:many community plug-ins:http://http://wwwwww..eclipseeclipse--pluginsplugins..infoinfo//eclipseeclipse//indexindex..jspjsp

Page 56: 20040215 1 On the Eclipse Project Mateusz Srebrny 16 February 2004 Warszawa Slides adapted from

20040215 56

Sources

■ http://www.eclipse.org/eclipse/presentation/eclipse-http://www.eclipse.org/eclipse/presentation/eclipse-slides.pptslides.ppt

■ http://www.eclipse.http://www.eclipse.orgorg

Dziekuję za uwagę!Dziekuję za uwagę!