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