Home > Store

Java  Developer's Guide to Eclipse, The

Register your product to gain access to bonus material or receive a coupon.

Java Developer's Guide to Eclipse, The

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2003
  • Edition: 1st
  • Book
  • ISBN-10: 0-321-15964-0
  • ISBN-13: 978-0-321-15964-9

"This book does an excellent job of helping you learn Eclipse. The practical examples and exercises included have been proven in real-life course situations and are invaluable in helping you to get up and running quickly."

—Dave Thomson, Eclipse Project Program Director, Object Technology International, Inc.

Eclipse is a world-class Java IDE, a platform for building and integrating application development tools, and an open source project and community. Written by members of the IBM Eclipse Jumpstart team, The Java™ Developer's Guide to Eclipse is the definitive Eclipse companion. Drawing on their considerable experience teaching Eclipse and mentoring developers, the authors provide guidance on how to customize Eclipse for increased productivity and efficiency and how to avoid common pitfalls.

Key coverage includes:

  • Eclipse navigation and terminology
  • Eclipse and the Java development environment
  • Extending Eclipse, the plug-in architecture, and Eclipse frameworks
  • Those new to Eclipse will benefit from the directed exercises on using the Eclipse platform. Advanced developers can learn how to extend Eclipse and use this book as a reference to the Eclipse frameworks.

    The accompanying CD-ROM contains Eclipse SDK Version 2.0, as well as exercise solutions and many code examples for easier learning. Whether you want to use Eclipse and Eclipse-based offerings as your integrated development environment (IDE), or customize Eclipse further, this book is your definitive reference.



    0321159640B04102003

    Sample Content

    Online Sample Chapter

    Using Java Development Tools in Eclipse

    Downloadable Sample Chapter

    Download Sample Chapter 3 related to this title.

    Table of Contents



    Foreword.


    Preface.

    Origin of the Book.

    Goals.

    Intended Audience and Prerequisites.

    How the Book Is Organized.

    Coding Conventions.

    CD-ROM.



    Acknowledgments.


    About the Authors.

    I. RUNNING ECLIPSE.

    1. Getting Started.

    Software Challenge and Eclipse.

    What Is Eclipse?

    Java Development Environment.

    Tool Integration Platform.

    Open Source Community.

    What Is the Common Public License?

    Getting and Installing Eclipse.

    The Eclipse Look: Editors, Views, and Perspectives.

    Working in Eclipse.

    A Word to IBM VisualAge Users.

    Chapter Summary.

    References.

    2. Using Eclipse.

    Getting Started.

    Oops!

    Creating Your First Project.

    Overview of the User Interface.

    Introducing Preferences.

    Manipulating the User Interface.

    Fundamental Eclipse Use.

    Working with Tasks.

    Working with Bookmarks.

    Getting Help.

    Resource Management.

    Your Workspace.

    More on Projects.

    Importing and Exporting Resources.

    Moving Resources.

    Text Editor.

    Printing.

    Customizing Eclipse.

    Perspectives.

    Running Multiple Eclipse Windows.

    Customizing Your JRE.

    Using Other Computer Programs with Eclipse.

    Help System.

    Performance.

    More on Preferences.

    Workbench.

    External Tools.

    Exercise Summary.

    Chapter Summary.

    3. Using Java Development Tools.

    Getting Started.

    Overview of the JDT User Interface.

    The Fundamentals.

    Searching.

    Writing Java Code.

    Content Assist.

    Code Generation.

    Navigating Java Errors and Warnings.

    Fixing Java Errors with Quick Fix.

    Refactoring.

    Browsing Javadoc.

    Using Code Templates.

    Externalizing Strings.

    Generating Javadoc.

    Writing Java for Nondefault JREs.

    Running Java Code.

    Using the Run Action.

    Managing Launch Configurations.

    Evaluating Expressions in Scrapbook Pages.

    Working with Java Elements.

    More on Java Projects.

    Creating Java Projects.

    Creating Folders.

    Creating Classes and Interfaces.

    Importing Java Elements.

    Local History for Java Elements.

    Tuning the Performance of JDT.

    More on JDT Views and Perspectives.

    Filtering View Contents.

    Package Explorer View.

    Hierarchy View.

    Tasks View.

    Search View.

    Java Type Hierarchy Perspective.

    Java Browsing Perspective.

    Exercise Summary.

    Chapter Summary.

    4. Debugging Java.

    Overview.

    The Fundamentals.

    Setting a Breakpoint.

    Starting a Debugging Session.

    Controlling Program Execution.

    Examining an Executing Program.

    Additional Debugging Capabilities.

    Evaluating Expressions.

    Changing Variable and Field Values.

    Debugging with the Java Editor.

    Manipulating the Programs You're Debugging.

    More on Breakpoints.

    Java Exception Breakpoints.

    Method Breakpoints.

    Watchpoints.

    Program Output in the Console View.

    Debug Launch Configurations.

    Associating a Source with Your Programs.

    Hot Code Replace.

    Remote Debugging.

    Exercise Summary.

    Chapter Summary.

    5. Teaming Up with Eclipse.

    Eclipse Support for CVS.

    General Team Support by Eclipse.

    Common Principles of Eclipse Team Support.

    Configuring Team Support.

    An Overview of CVS for the Novice.

    Some Key CVS Design Principles.

    Revisions: Nothing Ever Goes Away.

    Updating: Keeping Up with the Team.

    Committing: Your Turn to Share.

    Versioning: Capturing the Moment.

    Branching and Merging: Support for Parallel Development.

    What Happens to Revision Numbers During Branching and Merging.

    Managing Binary Files Using CVS.

    The CVS User Interface in Eclipse.

    CVS Repository Exploring Perspective: Your Repository Home Page.

    The CVS Repositories View.

    The CVS Resource History View.

    The CVS Console View.

    How CVS Managed Projects Appear in Your Workspace.

    CVS Actions Available from the Team Menu.

    The Very Important CVS Synchronize View.

    Handling Concurrent Updates to the Same File.

    Special Situations and How to Handle Them.

    Renaming, Moving, and Deleting Project Resources.

    Backing Out a Change: Using Replace and Compare.

    Setting up Branches for Maintenance and New Release Development.

    Additional Features.

    Patches: Sharing Changes Quickly and Easily.

    Project Sets: Getting That New Workspace Up to Speed.

    Disconnecting or Reassigning a CVS Project.

    Exercise Summary.

    Chapter Summary.

    References.

    6. Eclipse Configuration Management.

    Structure of an Eclipse Installation.

    Eclipse Directory Content.

    The Role of Plug-ins.

    The Role of Features.

    Update Manager.

    Identifying Features in the Run-Time Platform.

    Update Manager-An Introduction.

    The Configuration, Install Sites, and Update Sites.

    Viewing Your Configuration.

    Install Configuration View.

    Preview View.

    Feature Updates View.

    Managing Configuration Processing.

    Eclipse Startup-the First Time.

    Beyond the First Time-Subsequent Platform Launches.

    Establishing a Default Configuration.

    Preloading Features on a Default Configuration.

    Sharing the Platform with Others-Multi-User Install.

    Exercise Summary.

    Chapter Summary.

    II. EXTENDING ECLIPSE.

    7. Overview of the Eclipse Architecture.

    Extensibility.

    The Eclipse Platform.

    User Interface Frameworks.

    Standard Widget Toolkit.

    JFace UI.

    Workbench UI.

    Resources and Workspace API.

    Chapter Summary.

    References.

    8. Getting Started: Plug-in Development.

    Getting Started with Plug-ins.

    Integration Scenarios.

    Distributing Your Eclipse-Based Tool.

    Getting Started with Extensions and Extension Points.

    Basic Steps of Implementing a Plug-in.

    Declaring Your Plug-in Manifest.

    Defining Your Plug-in Class 216Installing Your Plug-in.

    Using the Plug-in Development Environment.

    PDE Views and Editors.

    Managing the Run-Time and Development Environment.

    Creating and Running a Plug-in.

    Developing Eclipse with Eclipse: Standalone Versus Distributed Self-Hosting.

    Exercise Summary.

    Chapter Summary.

    References.

    9. Action Contributions: The Integration Fast Track.

    Action Contribution Extension Points.

    The Fundamentals of Action Contributions.

    The Contribution Action API.

    Specifying Contributions in the Plug-in Manifest File.

    Specifying Actions in Menus and Toolbars.

    Using Filters to Refine Where Your Actions Appear.

    The Class Selection Filter.

    Creating Elaborate Filters Using Action Expressions.

    Contributing to the Workbench Menu Bar and Toolbar.

    Defining Menu and Toolbar Actions Independent of Perspectives.

    Contributing to the View's Menu and Toolbar.

    Contributing to an Editor's Menu and Toolbar.

    Contributing Context Menus to Views and Editors.

    Contributing a Context Menu to a View.

    Contributing a Context Menu to an Editor.

    Contributing a Context Menu to an Object in a View.

    Chapter Summary.

    References.

    10. The Standard Widget Toolkit: A Lean, Mean Widget Machine.

    The Basic Structure of an SWT Application.

    Common SWT Widgets.

    Refining a Widget's Appearance Using Style Bits.

    Responding to Widget Events.

    How to Arrange SWT Widgets Using Layout Managers.

    Fill Layout.

    Row Layout.

    Grid Layout.

    Form Layout.

    Error Handling.

    Widgets Have Special Disposal Requirements.

    Using Threads to Separate UI and non-UI Activities.

    An Overview of SWT Packages.

    Exercise Summary.

    Chapter Summary.

    References.

    11. Dialogs and Wizards.

    Dialogs-You Can Find Them Everywhere.

    Point of Reference-The UI Framework.

    Workbench Extension Points for Dialogs and Wizards.

    Common Reusable Dialogs.

    Extending the Preferences Dialog to Add Your Own Tool Options.

    Defining a Preference Page Extension.

    Implementing a Preference Page.

    Defining the Preference Page User Interface.

    Preference Management in a Plug-in.

    Establishing Default Preference Setting Values.

    Adding Preference Value Logic to Preference Page.

    Reacting to Preference Setting Changes.

    Building a Field Editor Preference Page.

    Using Property Pages to Remember Something Special About a Resource.

    Defining a Property Page Extension.

    Implementing a Property Page.

    Defining the Property Page User Interface.

    Adding Resource Property Access Logic.

    Resource Generic Memories-Using the Inherited Preferences Implementation.

    Implementing Your Own Properties Dialog.

    Using Wizards to Extend Workbench Resource Creation and Import/Export Support.

    Adding Wizards to the Workbench User Interface by Extension.

    Implementing a Wizard.

    Implementing a Wizard Page.

    Customizing the Wizard.

    Controlling Wizard Page Progression.

    Reusable Specialized Wizard Pages.

    Directly Opening a Wizard Dialog.

    Using a Dialog Setting.

    Exercise Summary.

    Chapter Summary.

    References.

    12. Views.

    View Behavior and Architecture.

    Basic Implementation Steps.

    Designing the Look of the View.

    Declaring the View Extension.

    Creating the View Class.

    Creating the Content Provider.

    Creating the Label Provider.

    Associating the Viewer and the Model.

    Synchronizing the Model and View.

    Handling User Selections.

    Filtering the View.

    Sorting the View.

    Adding View Actions.

    Supporting Global Actions in Views.

    Adding Label Decorations on Objects in a View.

    Interacting with Other Views.

    Properties View.

    Exercise Summary.

    Chapter Summary.

    References.

    13. Editors.

    Editor Behavior and Architecture.

    Basic Implementation Steps.

    Designing the Look of the Editor.

    Creating a New Wizard for the Editor Input (Optional).

    Declaring the Editor Extension Point.

    Creating the Editor Class.

    Instantiating the Model Using the Editor Input.

    Creating the Content Provider.

    Creating the Label Provider.

    Handling User Modifications of the Editor Input.

    Handling the Saving of the Editor Input.

    Associating the Viewer and the Model.

    Synchronizing the Model and the Editor.

    Handling User Selections.

    Adding Editor Actions.

    Linking an Editor and the Outline View.

    Exercise Summary.

    Chapter Summary.

    References.

    14. Perspectives.

    Perspectives.

    Creating a Perspective.

    Using the perspective extensions Extension Point.

    Exercise Summary.

    Chapter Summary.

    References.

    15. Workspace Resource Programming.

    Resource Concepts.

    Physical View.

    Logical View.

    Resource Model and File System Interaction.

    Workspace API.

    Workspace and Workspace Root-Entry Point for Services and Resources.

    Resource Containers.

    Workspace Resource Handles-Understanding What You Get When You Ask.

    Working with Projects.

    Working with Resources.

    Working with Paths.

    Working with Folders and Files.

    Processing the Resource Tree.

    Resource Properties.

    Session Properties.

    Persistent Properties.

    Processing Workspace Change Events.

    Tracking Changes Using the Workspace API.

    Adding Resource Change Listeners.

    Visiting the Resource Delta.

    Resource Delta Content.

    Resource Modification Event Management.

    Using Workspace Save Events to Save Critical Data.

    Save Events-What and When.

    Save Participant API.

    Exercise Summary.

    Chapter Summary.

    References.

    16. Managing Resources with Natures and Builders.

    Customizing Project Processing.

    Extending the Workspace Resource Processing Framework.

    Projects and Project Descriptions.

    Defining and Implementing Natures.

    Creating Natures to Support Project Configuration.

    Adding a Nature to a Project.

    Managing Nature-Builder Relationships.

    Using a Custom Image to Identify Your Project Nature.

    Implementing a Custom Builder.

    Builder Concepts-The How and When of Build Processing.

    Builder Requirements-Why You Should, or Should Not, Create a Builder.

    Defining Builders for Incremental Resource Transformation.

    Exercise Summary.

    Chapter Summary.

    References.

    17. Resource Tagging Using Markers.

    Marker Concepts.

    Creating Markers for Customized Resource Tagging.

    Creating New Marker Types.

    Extending Markers with Help and Resolution Support.

    Exercise Summary.

    Chapter Summary.

    References.

    18. Contributions Revisited.

    Sample Contributions.

    A Few More Contribution Nuggets.

    Chapter Summary.

    19. Advanced Plug-in Development.

    Plug-in Class Loader.

    Run-Time Discovery and Delayed Loading.

    Plug-in Granularity.

    Plug-in Fragments.

    Fragments as Language Packs.

    Fragments as Platform-Specific Content.

    Chapter Summary.

    References.

    20. Creating New Extension Points: How Others Can Extend Your Plug-ins.

    Overview of the Eclipse Architecture, Revisited.

    Relationship Between Extension Points and Extensions.

    Plug-in Registry: The Official List of Enabled Plug-ins, Extensions, and Extension Points.

    How to Define New Extension Points.

    Choosing the Existing Code You Want to Enable Others to Extend or Configure.

    Declaring the Existence of the New Extension Point.

    Defining an Interface for Expected Behavior.

    Processing the Plug-in Registry Entries for Your Extension Points.

    Invoking the Appropriate Methods Per the Previously Defined Interface Contract.

    How to Enable the Schema-Based New Extension Wizard.

    Why Define a Schema?

    Schema Editor.

    Exercise Summary.

    Chapter Summary.

    References.

    21. Serviceability.

    Plug-in Diagnostics: System and Configuration Information.

    Workbench Status Objects: A Status Collector.

    MultiStatus Example.

    Exception Handling: Error Detection.

    Error Dialogs: Providing Detailed Status in Error Messages.

    Error Dialog Example.

    Run-Time Tracing: A Run-Time Diagnostic Tool.

    Tracing Example.

    Using Tracing in a Production Environment.

    Diagnostics: A Comprehensive Error Log.

    Error Logging: Writing to the Workbench Error Log.

    Adding Error Logging.

    Exercise Summary.

    Chapter Summary.

    22. Developing Features.

    All About Features.

    Types of Features.

    Creating Structure with Features.

    Feature Definition.

    Feature Manifest.

    Identifying Prerequisites, Included Features, and Plug-ins.

    Prerequisite Version-Matching Rules.

    Servicing Your Features.

    Feature Branding.

    Branding Content in a Feature and Plug-in.

    Identifying the Primary Feature.

    Product and Feature Branding in the User Interface.

    Building on Eclipse.

    Creating an Installable Feature.

    Building Your Own Product on the Eclipse Platform.

    Building Extensions to Other Products.

    Delivering Features for Installation Using Update Manager.

    Using the PDE for Feature Development and Deployment.

    Exercise Summary.

    Chapter Summary.

    References.

    23. Providing Help.

    Integrating Your Online Documentation.

    Creating Help Content as HTML Content.

    Declaring the Help Extension.

    Creating Table of Contents Files.

    Eclipse Online Documentation.

    Creating Context-Sensitive Help.

    Declaring the Help Context Extension.

    Defining the Contents of the Infopop.

    Associating the Infopop with the UI Context.

    Running Nonintegrated Help.

    Customizing Your Help System.

    Exercise Summary.

    Chapter Summary.

    References.

    24. OLE and ActiveX Interoperability.

    COM Support in Eclipse.

    In-Place OLE Documents.

    In-Place ActiveX Controls.

    COM Container Support.

    Creating an OleFrame Object.

    Creating an OleClientSite Object.

    Activating an OLE Object.

    Deactivating an OLE Object.

    Eclipse OLE Editor Support.

    Creating an OleControlSite Object.

    Activating the OleControlSite Object.

    OLE Automation-Accessing Extended Behavior.

    OLE exec Command.

    IDispatch Interface.

    Methods.

    Invocation Without Parameters.

    Variant Types.

    Invocation with Parameters.

    Properties.

    Events and Property Listeners.

    Exercise Summary.

    Chapter Summary.

    References.

    25. Swing Interoperability.

    Background on Integration of Swing and SWT.

    Launch and Edit Integration.

    Modes of Invocation.

    Improving the End User Experience.

    ABCEditor Example-In-Process Invocation.

    Implementation Details-In-Process Invocation.

    Exercise Summary.

    Chapter Summary.

    References.

    26. Extending the Java Development Tools.

    What Is the JDT and What Does It Do?

    Java Model.

    Accessing Reusable JDT Functionality.

    JavaCore Class.

    JavaUI Class.

    ToolFactory Class.

    Compiling Java Source Code.

    Analyzing Java Source Code.

    JDT Abstract Syntax Tree.

    Finer-Grain Parsing of Java Source Code.

    Manipulating Java Source Code.

    Simple Java Element Source Code Manipulations.

    More Complex Source Code Manipulations.

    Where the JDT Extends Eclipse.

    Extending the JDT User Interface.

    Contributing View Actions.

    Contributing Editor Actions.

    Contributing to Java Element Context Menus.

    Contributing to Specific View or Editor Context Menus.

    Contributing to Global Actions.

    Reusing Common JDT Selection Dialogs.

    Exercise Summary.

    Chapter Summary.

    References.

    27. Building a Custom Text Editor with JFace Text.

    Standard Text Editor Functions.

    Text Editing and Viewing.

    Standard Menus and Toolbar Items.

    Standard Marker Representation.

    Editor Configuration: Customization Points.

    What Is Content Assist?

    What Is Syntax Highlighting?

    What Is Content Formatting?

    Miscellaneous Customizations.

    Under the Covers of the Text Editor.

    AbstractTextEditor Class.

    TextViewer Class.

    AbstractTextEditor Class Relationships.

    Document Class.

    DocumentProvider Class.

    Model-View-Controller Relationship.

    DocumentPartitioner Class.

    SourceViewerConfiguration Class.

    How to Create a Basic Source Editor.

    Phase 1: Creating a Basic Editor.

    Phase 2: Adding Content Assist to Your Basic Editor.

    Phase 3: Adding Syntax-Based Color Highlighting.

    Phase 4: Defining Content Formatting.

    Exercise Summary.

    Chapter Summary.

    References.

    III. EXERCISES.

    28. Exercise 1: Using Eclipse.

    Section 1: Your First Eclipse Project.

    Section 2: Editors and Views.

    Section 3: Working with Resources.

    Section 4: Perspectives.

    Section 5: Using Multiple Eclipse Windows.

    Section 6: Getting Help.

    29. Exercise 2: Using the Java Development Tools.

    Section 1: Hello World.

    Section 2: Quick Fix.

    Section 3: Code Generation.

    Section 4: Refactoring.

    Section 5: Launch Configurations.

    Section 6: JRE 1.4 Code.

    30. Exercise 3: Debugging Java.

    Section 1: Debugging.

    Section 2: Debugging Threads.

    Section 3: Remote Debugging.

    31. Exercise 4: Using CVS with Eclipse.

    Exercise Setup.

    Creating Your Workspace Project.

    Section 1: Getting Started.

    Setting Your Team and CVS Preferences.

    Defining a CVS Repository Location.

    Putting the Project Under CVS Control.

    Storing the Project Contents in CVS.

    Versioning the Project.

    Section 2: Updating, Committing, and Resolving Conflicts.

    Modifying the Code in Your Project.

    Storing Your Changes in CVS.

    Making Additional Changes in Your Project.

    Resolving Conflicts with CVS.

    Section 3: Branching and Merging.

    Branch and Merge Process Using Eclipse.

    Updating Your Project and Storing the Changes in a CVS Branch.

    Merging Your Project Changes from the Branch Back to CVS HEAD.

    Exercise Activity Review.

    32. Exercise 5: Modifying Your Configuration with Update Manager.

    Section 1: Installing New Features.

    Section 2: Disabling Features.

    Section 3: Pending Changes-Discovering Direct Configuration Modification.

    Section 4: Searching for New or Updated Features.

    33. Exercise 6: Using the Plug-in Development Environment.

    Exercise Setup.

    Exercise Instructions.

    Section 1: "Hello, World" in Five Minutes or Less.

    Section 2: "Hello, World" with Detailed Step-by-Step Instructions.

    Section 3: Testing with the Run-Time Workbench.

    Section 4: Debugging with the Run-Time Workbench.

    Section 5: Exploring (and Sometimes Correcting) the Eclipse Platform Code.

    Section 6: Correcting Common Problems.

    Exercise Activity Review.

    34. Exercise 7: Feature Development and Deployment.

    Exercise Concepts.

    Exercise Setup.

    Exercise Instructions.

    Section 1: Tasks of an Eclipse Feature Developer.

    Generating JAR Files for Selected Plug-ins.

    Packaging the Function Provided by Your Plug-ins as a Feature.

    Adding Product and Feature Branding to the Feature.

    Repackaging the Feature.

    Extracting an Installable Feature from Workspace and Implementing an Update Site.

    Section 2: Tasks of an Eclipse User.

    Installing a New Feature as an Extension to an Existing Product.

    Adding a Feature to an Existing Product Configuration from an Update Site.

    Section 3: Tasks of a Product Developer.

    Implementing a Branded Product.

    Launching and Reviewing a Branded Product Installation.

    Exercise Activity Review.

    Index. 0321159640T05052003

    Preface

    Origin of the Book

    In 2000, the authors formed the core of a group within IBM called the Jumpstart team. Our team was created to share knowledge of the Eclipse technology throughout IBM and with its business partners, that is, to 'jumpstart' the IBM and partner development community on Eclipse. Part of this effort included the creation of a set of presentations, lecture materials, and accompanying exercises. Over the ensuing months, as the Eclipse technology matured, the presentation and exercises matured as well. As the Eclipse community grew to include various companies and academic institutions, requests for this information grew as well. After every class taught, we revised and improved the materials. When our schedules could not keep pace with the demand, we adapted the materials and made them available to use in a self-study mode. This was the genesis of this book. You can think of each chapter in the book as a lesson in class. The exercises and solutions reinforce the concepts of the chapter and provide you with practice using or extending an aspect of Eclipse.

    Goals

    Our goals in bringing you this book are to:

    1. Provide information for those new to Eclipse.

    A new user can leverage this book as a tutorial, starting with the first chapter and progressing sequentially through the book. We do not assume prior Eclipse knowledge.

    2. Explore the capabilities of Eclipse

    The book will cover both using Eclipse as your development environment and extending Eclipse. The chapters on using Eclipse start with its use as a general development environment and then progress on to developing and debugging Java and more advanced usage topics, for example using Eclipse in a team environment. In the chapters in extending Eclipse in Part II, we cover the most common classes for each Eclipse framework. References to design patterns, where applicable, illustrate the architectural relationships among the classes. The intent is not to replace the Javadoc that is included with Eclipse, but to compliment the documentation by focusing on how to bring a set of classes together to complete a task.

    3. Provide exercises and working examples that are simple and focused on the chapter topic.

    Our intent is not to provide a single, "real world" example or that the completion of all exercises will result in a single, functioning Eclipse-based tool. Instead, the exercises compliment the chapter topics and illustrate key points. The chapter text will concentrate on the concepts, outline the basic steps to accomplish a task while providing small sections of code or screen captures to best illustrate the point. The exercises will provide detailed coding instructions and screen captures to apply the concepts described in the chapter. The CD-ROM that comes with this book contains solutions to the step-by-step exercises plus additional working examples to supplement chapters in the book.

    4. Provide reference material for those experienced in using Eclipse.

    Since the material in this book is in a modular form, you can explore each chapter individually. You may use this book as a reference guide; jumping to the chapter you are interested in exploring.

    5. Promote the Eclipse community

    Provide you with the basic knowledge of Eclipse so that you can become an active participant and help grow the Eclipse open source community.

    Though the term "Eclipse" conveys the image of a solar eclipse causing darkness, the intent of this book is to shed light, add clarity, and focus on a powerful new platform. Whether you are new to Eclipse or one of the early adopters, we welcome you to the Eclipse community.

    Intended Audience and Prerequisites

    The audience for this book includes Java programmers who plan to use Eclipse as their integrated development environment (IDE), those who will use Eclipse-based offerings, advanced users who want to customize Eclipse further, and tool providers that seek to develop tools that will integrate with Eclipse and other Eclipse-based offerings. This book assumes that you are familiar with the Java programming language. While it describes how to use the Java development tools, it does not teach the syntax and semantics of the Java programming language.

    How the Book Is Organized

    Part I of the book applies to those using Eclipse as their development environment. The book begins by covering the basic navigation and terminology of Eclipse. You will learn about the Java development environment including secrets to becoming a power user. You will learn how to use the flexibility of Eclipse to maximize your productivity and fit your own personal style. Students who are studying the Java programming language may find using Eclipse, instead of simply a command line environment, a much more productive and exciting way to learn the richness and power of the Java programming language. Instructors may discover how using Eclipse in the classroom will accelerate the student's mastery of the language and be a productive tool to use in research.

    If you are interested in extending the Eclipse base with additional capabilities or building an offering based on Eclipse, then continue on reading Part II. The chapters describe how to build a plug-in and the various Java frameworks provided to make contributing additional function to Eclipse easier and more consistent. It will cover how to add menu choices, toolbar buttons, views, editors, dialogs, and online documentation to Eclipse.

    Learning in a programming environment without actually writing code is difficult. Part III contains a series of detailed exercises to reinforce the concepts presented in the chapters. Part III depends on the files included on the CD-ROM. Template files that provide scaffolding code accompany some of the exercises. During the completion of the exercises, you will fill in the missing code. The template files include Eclipse Scrapbook Page files with the file extension of .jpage. These files can be used to copy and paste into the .java files to complete the exercises without doing a lot of typing. In addition, the CD-ROM contains solutions to all of the exercises plus many code samples augmenting the material in the chapters. The samples do not depend on one another, so you can study them in any order.

    There are many Eclipse-based tools available today and more under development, including ones for C++, Web services, J2EE programming, and UML modeling. This book focuses on the use of Eclipse by the Java developer. However, the fundamentals of Eclipse covered in the first few chapters can be used across all types of tools.

    CD-ROM

    This book includes a CD-ROM with the following:

    1. Eclipse SDK version 2.0
    2. Eclipse Examples version 2.0
    3. Exercise template files
    4. Exercise solutions and other samples

    To complete the exercises, you must install Eclipse SDK version 2.0. The Eclipse SDK requires that you install a Java Development Kit (JDK) version 1.3 or higher. You may download a JDK from http://www.ibm.com/java/jdk or http://java.sun.com. The files on the CD-ROM are designed for Windows2000 and WindowsXP. Because the examples are written in the Java programming language, you can use them on other operating systems as well, as long as the code or instructions do not depend on Windows specific function. See the file readme.html on the CD-ROM for more information.



    0321159640P01242003

    Foreword

    Download Foreword related to this title.

    Index

    Download the Index file related to this title.

    Updates

    Errata

    The Java Developer’s Guide to Eclipse
    Errata and Additions

     

    Updated: 10, September 2003

    Send feedback on the book to: JDG2E@yahoogroups.com


    CD-ROM Errors and Additions

     

    The following is a listing of errors found on the CD_ROM plus additional, new content.

    Error 1 - SQL Editor (JFace Text), Missing Properties File

    The SQL editor contained on the CD-ROM in the project, com.ibm.lab.soln.sqleditor.SQLEditorPlugin_1.0.0, is
    missing the properties file.  When running the solution without the properties file, the following error messages appear.

     

     

    The corresponding console message is:

    Unable to create editor contributor: com.ibm.lab.soln.sqleditor.editor

    Reason:

    Plug-in "com.ibm.lab.soln.SQLEditor" was unable to instantiate class
    "com.ibm.lab.soln.sqleditor.SQLEditorContributor".

     

    Fix 1 – Download Instructions

    Download sqltexteditorproperties.zip , unzip the file and copy SQLEditorPluginResources.properties into the package; com.ibm.lab.soln.sqleditor.


    Addition 1 – SQL Editor Eclipse 2.1 Compatibility Fixes

    The key binding API changed considerably from 2.0 to 2.1. Retargetable actions require an explicit binding of your editor's action to the platform
    action. The platform changes broke two functions in the original version of the SQL Editor.  The content assist key Ctl+Space is not enabled.  In
    addition the global editor actions; Copy, Cut, Paste, Undo, Redo, and Revert are disabled.  Note that not all the following fixes are backward
    compatible. 

    Change Summary of 2.1 compatibility fixes

    1.      Each action created in the SQLEditor.createActions() method must set the action definition id of the action.  The
    IAction.setActionDefinition()
    method is used for this purpose.  See the pertinent code in the createActions() method in
    the SQLEditor class.

     

          a.setActionDefinitionId(

                ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);

                setAction("ContentAssistProposal", a);

     

    2.      Each RetargetTextEditorAction created in TextEditorActionContributor extensions must set the action definition id.
      The setActionDefinitionId() method of RetargetTextEditorAction is used for this purpose.  See the affected code in the
    constructor of the SQLEditorContributor class.

     

    fContentAssistProposal.setActionDefinitionId(               ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);

     

    3.      When implementing custom actions in a JFace text editor, enabling the global editor actions; Copy, Cut, Paste, Undo, Redo, and
    Revert requires calling the createActions() method in the super class, AbstractTextEditor. See the first line of code in the
    createActions() method in the SQLEditor class.

     

                protected void createActions() {

                super.createActions();

     

    Addition 1 – Download Instructions

    Download sqltexteditor2_1_1.zip, unzip the file and from Eclipse perform File > Import… External Plug-ins and Fragments

     

     

     

     

     

    Submit Errata

    More Information

    InformIT Promotional Mailings & Special Offers

    I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

    Overview


    Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

    This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

    Collection and Use of Information


    To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

    Questions and Inquiries

    For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

    Online Store

    For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

    Surveys

    Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

    Contests and Drawings

    Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

    Newsletters

    If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

    Service Announcements

    On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

    Customer Service

    We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

    Other Collection and Use of Information


    Application and System Logs

    Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

    Web Analytics

    Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

    Cookies and Related Technologies

    This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

    Do Not Track

    This site currently does not respond to Do Not Track signals.

    Security


    Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

    Children


    This site is not directed to children under the age of 13.

    Marketing


    Pearson may send or direct marketing communications to users, provided that

    • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
    • Such marketing is consistent with applicable law and Pearson's legal obligations.
    • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
    • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

    Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

    Correcting/Updating Personal Information


    If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

    Choice/Opt-out


    Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

    Sale of Personal Information


    Pearson does not rent or sell personal information in exchange for any payment of money.

    While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

    Supplemental Privacy Statement for California Residents


    California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

    Sharing and Disclosure


    Pearson may disclose personal information, as follows:

    • As required by law.
    • With the consent of the individual (or their parent, if the individual is a minor)
    • In response to a subpoena, court order or legal process, to the extent permitted or required by law
    • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
    • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
    • To investigate or address actual or suspected fraud or other illegal activities
    • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
    • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
    • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

    Links


    This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

    Requests and Contact


    Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

    Changes to this Privacy Notice


    We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

    Last Update: November 17, 2020