Author(s): David Gallardo; Ed Burnette; Robert McGovern
Publisher: Manning
Year: 2003
Language: English
Pages: 366
City: Greenwich, Conn
Eclipse in Action......Page 1
contents......Page 3
1. Overview......Page 4
1.1 Where Eclipse came from......Page 5
1.1.2 The Eclipse organization......Page 6
1.1.3 Open source software......Page 7
1.2 What is Eclipse?......Page 8
1.2.1 The Eclipse architecture......Page 9
1.2.2 Language and platform neutrality......Page 11
1.4 Summary......Page 12
2. Getting started with the Eclipse Workbench......Page 14
2.1 Obtaining Eclipse......Page 15
2.2.1 Projects and folders......Page 16
2.2.2 The Eclipse Workbench......Page 17
2.3.1 Creating a Java project......Page 21
2.3.2 Creating a Java class......Page 23
2.3.3 Running the Java program......Page 26
2.3.4 Debugging the Java program......Page 28
2.3.5 Java scrapbook pages......Page 31
2.4 Preferences and other settings......Page 32
2.4.1 Javadoc comments......Page 33
2.4.3 Code generation templates......Page 34
2.4.4 Classpaths and classpath variables......Page 36
2.4.5 Exporting and importing preferences......Page 37
2.5 Summary......Page 38
3. The Java development cycle: test, code, repeat......Page 40
3.1 Java development tools methodology......Page 41
3.1.2 A sample application and working sets......Page 42
3.2 The JUnit unit testing framework......Page 44
3.2.1 Method stubs and unit tests......Page 45
3.2.2 Creating test cases......Page 50
3.2.3 How much testing is enough?......Page 55
3.2.4 Implementing the public methods......Page 59
3.3 Further adventures in debugging......Page 63
3.3.1 Setting breakpoint properties......Page 65
3.3.2 Finding and fixing a bug......Page 67
3.4 Logging with log4j......Page 69
3.4.1 Loggers, appenders, and pattern layouts......Page 70
3.4.2 Configuring log4j......Page 74
3.4.3 Using log4j with Eclipse......Page 76
3.5 Summary......Page 78
4. Working with source code in Eclipse......Page 80
4.1 Importing an external project......Page 81
4.2 Extending the persistence component......Page 84
4.2.2 Creating the unit test class......Page 85
4.2.3 Working with the astronomy classes......Page 86
4.2.4 The Star test case......Page 89
4.2.5 Creating a test suite......Page 90
4.2.6 Implementing the ObjectManager class......Page 91
4.3.1 Renaming a class......Page 97
4.3.2 Extracting an interface......Page 100
4.3.3 Future refactoring......Page 102
4.4 Summary......Page 103
5. Building with Ant......Page 104
5.1 The need for an official build process......Page 105
5.1.1 Creating the build directory structure......Page 106
5.2 Make: A retrospective......Page 110
5.3 The new Java standard: Ant......Page 113
5.3.1 A very brief introduction to XML......Page 114
5.3.2 A simple Ant example......Page 116
5.3.3 Projects......Page 119
5.3.5 Tasks......Page 120
5.3.6 Properties......Page 127
5.3.7 File sets and path structures......Page 129
5.4 A sample Ant build......Page 132
5.4.1 Creating the build file, build.xml......Page 133
5.4.2 Performing a build......Page 137
5.4.3 Debugging the build......Page 139
5.5 Summary......Page 141
6. Source control with CVS......Page 144
6.1 The need for source control......Page 145
6.2.1 Sharing a project with CVS......Page 147
6.2.2 Working with CVS......Page 154
6.3 Summary......Page 175
7. Web development tools......Page 178
7.1.1 The web, HTML, servlets, and JSP......Page 179
7.1.2 JSP overview......Page 180
7.2 Tomcat and the Sysdeo Tomcat plug-in......Page 182
7.2.1 Installing and testing Tomcat......Page 183
7.2.2 Installing and setting up the Sysdeo Tomcat plug-in......Page 184
7.2.3 Creating and testing a JSP using Eclipse......Page 186
7.2.4 Creating and testing a servlet in Eclipse......Page 188
7.2.5 Placing a Tomcat project under CVS control......Page 191
7.3.1 The web application directory structure......Page 192
7.3.2 Web application design and testing......Page 193
7.3.3 Programming with servlets and JSPs......Page 198
7.4 Wrapping up the sample application......Page 211
7.5 Summary......Page 216
8. Introduction to Eclipse plug-ins......Page 218
8.1.1 Anatomy of a plug-in......Page 219
8.1.2 The plug-in lifecycle......Page 220
8.1.3 Creating a simple plug-in by hand......Page 221
8.2 The Plug-in Development Environment (PDE)......Page 222
8.2.2 Importing the SDK plug-ins......Page 223
8.2.3 Using the Plug-in Project Wizard......Page 225
8.3 The “Hello, World” plug-in example......Page 227
8.3.1 The Plug-in Manifest Editor......Page 229
8.3.2 The Run-time Workbench......Page 230
8.3.3 Plug-in class (AbstractUIPlugin)......Page 232
8.3.4 Actions, menus, and toolbars (IWorkbenchWindowActionDelegate)......Page 236
8.3.5 Plug-ins and classpaths......Page 240
8.4 The log4j library plug-in example......Page 241
8.4.2 Including the source zip in the plug-in package......Page 243
8.5 Deploying a plug-in......Page 245
8.6 Summary......Page 246
9. Working with plug-ins in Eclipse......Page 248
9.1 The log4j integration plug-in example......Page 249
9.1.1 Project overview......Page 251
9.1.2 Preparing the project......Page 252
9.2 Editors (TextEditor)......Page 253
9.2.2 Defining the editor extension......Page 254
9.2.3 Adding an icon......Page 258
9.2.4 Adding color......Page 260
9.2.5 Token manager......Page 267
9.2.6 Content assist (IContentAssistProcessor)......Page 270
9.2.7 Putting it all together......Page 274
9.3 Views (ViewPart)......Page 278
9.3.1 Adding the view......Page 279
9.3.2 Modifying perspective defaults......Page 280
9.3.3 View class......Page 281
9.3.4 Table framework......Page 288
9.3.5 Label providers (LabelProvider)......Page 295
9.3.6 Models......Page 297
9.3.7 Receiver thread......Page 299
9.4 Preferences (FieldEditorPreferencePage)......Page 300
9.4.1 Main preference page......Page 301
9.4.2 Editor preference page......Page 302
9.5 Plugin class......Page 303
9.6 Summary......Page 304
A. Java perspective menu reference......Page 306
Table A.1 File menu options......Page 307
Table A.2 Edit menu options......Page 308
Table A.3 Source menu options......Page 309
Table A.4 Refactorings menu options......Page 311
Table A.5 Navigate menu options......Page 317
Table A.6 Search menu options......Page 318
Table A.8 Run menu options......Page 319
Table A.9 Window menu options......Page 320
Table A.10 Help menu options......Page 321
B. CVS installation procedures......Page 322
B.1 Installing CVS on UNIX and Linux......Page 323
B.1.1 Creating the CVS repository......Page 324
B.1.2 Setting up SSH remote access......Page 325
B.1.3 Setting up pserver remote access......Page 326
B.2 Installing CVS on Mac OS X......Page 327
B.3 Installing CVSNT on Windows......Page 328
B.4 Installing Cygwin CVS and SSH on Windows......Page 329
B.6 Backing up the CVS repository......Page 331
C. Plug-in extension points......Page 332
D. Introduction to SWT......Page 342
D.1 What is the Standard Widget Toolkit?......Page 343
D.2 SWT architecture......Page 344
D.2.2 Resource disposal......Page 345
D.3 SWT and events......Page 346
D.4 SWT and threads......Page 347
D.5 Building and running SWT programs......Page 349
D.6.1 The BasicFramework class......Page 352
D.6.2 The MainApp class......Page 355
D.6.3 Trying the example......Page 358
E. Introduction to JFace......Page 360
E.1 Architecture......Page 361
E.2 Building a JFace application......Page 362
E.2.1 JFaceExample class......Page 363
E.2.2 ExitAction class......Page 365