ebook img

Eclipse in Action: A Guide for the Java Developer PDF

402 Pages·2003·9.33 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Eclipse in Action: A Guide for the Java Developer

Eclipse in Action Eclipse in Action A GUIDE FOR JAVA DEVELOPERS DAVID GALLARDO ED BURNETTE ROBERT MCGOVERN With contributions to appendixes by STEVEN HAINES MANNING Greenwich (74° w. long.) For electronic information and ordering of this and other Manning books, go to www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 209 Bruce Park Avenue Fax: (203) 661-9018 Greenwich, CT 06830 email: [email protected] ©2003 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books they publish printed on acid-free paper, and we exert our best efforts to that end. Manning Publications Co. Copyeditor: Tiffany Taylor 209 Bruce Park Avenue Typesetter: Denis Dalinnik Greenwich, CT 06830 Cover designer: Leslie Haimes ISBN 1-930110-96-0 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – VHG – 08 07 06 05 04 03 To my wife Eni and my son Alejandro D.J.G. To Lisa, Michael, and Christopher E.B.B. To my wife Roberta for putting up with this insane trip R.M. brief contents PART 1 USING ECLIPSE............................................................. 1 1 ■ Overview 3 2 ■ Getting started with the Eclipse Workbench 13 3 ■ The Java development cycle: test, code, repeat 39 4 ■ Working with source code in Eclipse 79 5 ■ Building with Ant 103 6 ■ Source control with CVS 143 7 ■ Web development tools 177 PART 2 EXTENDING ECLIPSE................................................ 217 8 ■ Introduction to Eclipse plug-ins 219 9 ■ Working with plug-ins in Eclipse 249 vii contents foreword xvii preface xxi acknowledgments xxiii about this book xxv about the title xxix about the cover illustration xxx PART 1 USING ECLIPSE........................................................... 1 1 Overview 3 1.1 Where Eclipse came from 4 A bit of background 5 ■ The Eclipse organization 5 Open source software 6 1.2 What is Eclipse? 7 The Eclipse architecture 8 ■ Language and platform neutrality 10 1.3 What’s next 11 1.4 Summary 11 ix x CONTENTS 2 Getting started with the Eclipse Workbench 13 2.1 Obtaining Eclipse 14 2.2 Eclipse overview 15 Projects and folders 15 ■ The Eclipse Workbench 16 2.3 The Java quick tour 20 Creating a Java project 20 ■ Creating a Java class 22 Running the Java program 25 ■ Debugging the Java program 27 ■ Java scrapbook pages 30 2.4 Preferences and other settings 31 Javadoc comments 32 ■ Format style 33 ■ Code generation templates 33 ■ Classpaths and classpath variables 35 Exporting and importing preferences 36 2.5 Summary 37 3 The Java development cycle: test, code, repeat 39 3.1 Java development tools methodology 40 Testing is job 1 41 ■ A sample application and working sets 41 3.2 The JUnit unit testing framework 43 Method stubs and unit tests 44 ■ Creating test cases 49 How much testing is enough? 54 ■ Implementing the public methods 58 3.3 Further adventures in debugging 62 Setting breakpoint properties 64 Finding and fixing a bug 66 3.4 Logging with log4j 68 Loggers, appenders, and pattern layouts 69 ■ Configuring log4j 73 ■ Using log4j with Eclipse 75 3.5 Summary 77 4 Working with source code in Eclipse 79 4.1 Importing an external project 80 4.2 Extending the persistence component 83 Creating a factory method 84 ■ Creating the unit test class 84 Working with the astronomy classes 85 ■ The Star test case 88 Creating a test suite 89 ■ Implementing the ObjectManager class 90 CONTENTS xi 4.3 Refactoring 95 Renaming a class 96 ■ Extracting an interface 99 Future refactoring 101 4.4 Summary 102 5 Building with Ant 103 5.1 The need for an official build process 104 Creating the build directory structure 105 5.2 Make: A retrospective 109 5.3 The new Java standard: Ant 112 A very brief introduction to XML 113 ■ A simple Ant example 115 ■ Projects 118 ■ Targets 119 ■ Tasks 119 Properties 126 ■ File sets and path structures 128 Additional Ant capabilities 131 5.4 A sample Ant build 131 Creating the build file, build.xml 132 ■ Performing a build 136 ■ Debugging the build 138 5.5 Summary 140 6 Source control with CVS 143 6.1 The need for source control 144 6.2 Using CVS with Eclipse 146 Sharing a project with CVS 146 ■ Working with CVS 153 Versions and branches 170 6.3 Summary 174 7 Web development tools 177 7.1 Developing for the Web 178 The web, HTML, servlets, and JSP 178 ■ JSP overview 179 Servlet overview 181 7.2 Tomcat and the Sysdeo Tomcat plug-in 181 Installing and testing Tomcat 182 ■ Installing and setting up the Sysdeo Tomcat plug-in 183 ■ Creating and testing a JSP using Eclipse 185 ■ Creating and testing a servlet in Eclipse 187 ■ Placing a Tomcat project under CVS control 190 xii CONTENTS 7.3 Building a web application 191 The web application directory structure 191 ■ Web application design and testing 192 ■ Programming with servlets and JSPs 197 7.4 Wrapping up the sample application 210 7.5 Summary 215 PART 2 EXTENDING ECLIPSE.............................................. 217 8 Introduction to Eclipse plug-ins 219 8.1 Plug-ins and extension points 220 Anatomy of a plug-in 220 ■ The plug-in lifecycle 221 Creating a simple plug-in by hand 222 8.2 The Plug-in Development Environment (PDE) 223 Preparing your Workbench 224 ■ Importing the SDK plug-ins 224 ■ Using the Plug-in Project Wizard 226 8.3 The “Hello, World” plug-in example 228 The Plug-in Manifest Editor 230 ■ The Run-time Workbench 231 ■ Plug-in class (AbstractUIPlugin) 233 Actions, menus, and toolbars (IWorkbenchWindowActionDelegate) 237 ■ Plug-ins and classpaths 241 8.4 The log4j library plug-in example 242 Attaching source 244 ■ Including the source zip in the plug-in package 244 8.5 Deploying a plug-in 246 8.6 Summary 247 9 Working with plug-ins in Eclipse 249 9.1 The log4j integration plug-in example 250 Project overview 252 ■ Preparing the project 253 9.2 Editors (TextEditor) 254 Preparing the editor class 255 ■ Defining the editor extension 255 ■ Adding an icon 259 ■ Adding color 261 Token manager 268 ■ Content assist (IContentAssistProcessor) 271 ■ Putting it all together 275

Description:
I was kind of expected this book to give lots of detailed information about configuring and using Eclipse. Most of the first seven chapters were useful -- if you were new to using Eclipse as an IDE. However, if you have a few years of Eclipse behind you these chapters are very introduction type. If
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.