<<

Gamma-Beck.book Page 381 Tuesday, October 14, 2003 7:27 PM

Index

A APIs Abstract classes, 114, 150 abstract-based v. interface-based, 114 Abstract syntax tree (AST), 319–323 compatibility, preserving, 143 Accessibility, 261–262 Debug Model API, 357 Actions Defensive API Rule, 266 bookmark, 351–352 Explicit API Rule, 266 Command pattern, JFace, 342–343 ground rules, 272 context menus, creating, 121–123 plug-ins, publishing, 263–264 contributing, 127 Program to API Contract Rule, 117 ExcludeTestAction, 224–227 subclassing, 329 filtering, 128, 354 Architecture global, 216 contributions in, 15–16 invoking, 26 overview of, 5–7 items to run tests, 39–44 Arguments, passing to builders, 159 repository, 346–347 Arrays, configuring builders, 155 run, 347 assertEditor() helper methods, 211 set apart associations, 228 AST (Abstract syntax tree), 319–323 sets, 23–24 ASTVisitor, 321–323 Shared ActionContributor, 220 asyncExec() method, 209 submenus, 57 Attributes, markers, 131–134 Active help, 255 Auto-test properties Adapt To IResource Rule, 353 controls, adding, 165–168 AdapterFactories, 289–294 dialog implementors, finding, 166 Adapters forward pointers, 170 factories, 288–294 overview, 161, 169 IAdaptable. See IAdaptable property pages, 161–164 pluggable, JFace, 336–340 run-time workbench, 168–169 resources to Java elements, 308–309 AutoTestBuilder, 179, 375–377 SelectionAdapter, 212 Auto-testing workbench-provided, 353–354 builders, installing, 154–159 Add CVS Repository, 346–347 editors, excluding tests with. See Editors, Anchors, 250–251 excluding tests

381

Gamma-Beck.book Page 382 Tuesday, October 14, 2003 7:27 PM

382 Index

Auto-testing, continued Circle Three help, 250–251 defined, 5 natures, 154–159 overview, 281–282 AutoTestPropertyPage, 173 Circle Two closing, 275–280 defined, 4 B introducing as new feature, 104–106 Basic widgets, 326, 328. See also Standard overview, 93–94 (SWT) test-driven plug-in development. See Batching resource changes, 302–305 Test-driven plug-in development Beeping plug-in, 277–278 Circle Zero, 4 Binary projects, 11–14 Class creation wizard, 110, 117 Bindings, AST, 318–319 Class loaders, 54–55, 265 Black-box reuse, 342 Class path files, 307 Bookmarks Classes externalizing strings from code, 258 action invocation, 26 IResourceAdapter, 351–352 contributor implementation, 224–227 view, 194–195 exporting, 264–265 Bridge file-system resources, 296–299, 310 IAdaptable, 286 Browsing, source, 12–14 loading, 16 Bruce Anderson’s Architecture Handbook plug-in, 40 workshop, 3 Classpath, 26–27 Bugzilla, 359 Code assist engine, 318–319 build. properties, 20 Collector views, 221 BuildCommand, 153 Colors Builders changing, 113–118 configuring using natures, 154–159 listening to testing progress, 111–113 forward pointers, 159 resetting, 235–238 marker resolution, 186–187 testing, 231–232 order dependency, 152–154 view contribution, 107–111 overview, 151 Commands passing arguments to, 159 BuildCommand, 153 resource listeners v. builders, 152 JFace actions as, 342–343 results, collecting, 317–319 Committers, 2 Bundling Plug-Ins into features, 83–86 “Common State,” 131 Compact maps, 132 Compare component, 358 C Compile errors, 129–130 Caches, Java element, 311–312 Composite Change Method Signature, 135–136 Eclipse components using, 355 changeColor() helper method, 209–210 Java element trees, 313–314 Circle One Standard Widget Toolkit (SWT), 326–330 closing, 89–90 , 300–301 defined, 4 Compound widgets, 326, 328. See also Stan- overview, 33–34 dard Widget Toolkit (SWT)

Gamma-Beck.book Page 383 Tuesday, October 14, 2003 7:27 PM

Index 383

Configurers, 2 Core v. user interface (UI) functionality, 268 Conformance Rule, 26, 48 Core workspace Content providers accessing file-system resources, 296–299 ContentProvider, 232–233 batching changes, 305–306 outlines, 228 composites, 300–301 TableViewer, 195 Execute Around Method, 302–305 TestReportContentProvider, 204–210 overview, 295 Context menus resource changes, tracking, 302–305 creating, 119–124 resource trees, traversing, 301–302 extending, 124–128 CoreException, 172–173, 188–190 forward pointers, 128 createImage() helper method, 226 targeting, 126 createPartControl() view method, 200 Context-sensitive help, 251–255 CVS Repository, 346–347, 358 Contributed actions, UI workbench, 346–347 Contributed classes, 276 Contribution Circles D Circle One, 4, 33–34, 89–90 Debugging Circle Three, 5, 281–282 components, 356–357 Circle Two, 4, 93–94, 275–280 options, 179–183 Circle Zero, 4 perspectives, 241 closing, 355–360 Declarations completing, 9, 33 Auto-test properties, 162–164 defined, 3–5 Declaration Definition (manifest), 17 Contribution Rule, 15, 247 extension points, 69–71 Contributions implementation/declaration split, 16 actions, 57, 127 Defensive API Rule, 266 extensions, 124–128 Deltas, resource contributors, 224–228 listeners v. builders, 152 declaration/implementation split, 16 resetting colors, 235–238 Eclipse architecture, 15–16 tracking Java element changes, 316–317 editors, 219–223 tracking resource changes, 304–305 extending, 2–3 Der Plan, 35 Hello , 15–16 Design patterns. See Patterns, design invitation to make, 359–360 dev.eclipse.org, 359 JUnit plug-ins, testing, 100–103 Dialog implementors, 166 Lazy Loading Rule, 16, 44 DirtyListener, 234 menu. See Menu contributions Diversity Rule, 67 objects, 40, 125, 353 Doc.zip files, 255 overcoming inertia in making, 9 Domain objects, 207 plug-ins, publishing, 86–88 Dynamic enablement, menu item behavior, 57 precision, 45 Dynamic registration, listeners, 263 Relevance Rule, 43 RunTestAction, 254–255 submenus, 57 E views, 107–111 Eclipse Core runtime, 283–287 architecture, 5–7

Gamma-Beck.book Page 384 Tuesday, October 14, 2003 7:27 PM

384 Index

Eclipse, continued Error dialog, 173–175 basics, 3 Events, JFace, 210–215 design principles, 4 Exception handling feature structure, 84 CoreException, 172–173 host, 94–95 error dialogs, 173–175 Java development tools (JDT), 5–7 IStatus, 172–173 JUnit. See JUnit logging errors, 175–177 learning about, 3–4 overview, 171–172 levels of applying, 1–3 ExcludeTestAction, 224–227 plug-in activation, 75 Excluding tests. See Editors, excluding tests plug-in architecture, 5 Execute Around Method, 302–305 Plug-In Development Environment (PDE), Explicit API Rule, 266 5–7 Explicit Extension Rule, 66–67 Run-Time, 94–95, 100 Extenders, 2 startup times, 89 Extensible Markup Language (XML), 16–17 test-driven plug-in development. See Extension Interface, 285–287, 294 Test-driven plug-in development “Extension Interface,” 285 user programming, enabling, 1 Extension Object, 285–287, 294 viewing test results. See Viewing test results Extension point schemas, 197–199, Editors 268–272 Rerun Marker Resolution, 187 Extension points, 74–75 test cases, 210–212 declaring, 69–71, 355 user interface (UI) workbench, 350–351 defined, 5 workbench, saving, 187, 192 Diversity Rule, 67 Editors, excluding tests explicit declaration, 355 contributing contributors, 224–228 Explicit Extension Rule, 66–67 contributing editors, 219–223 Fair Play Rule, 66 forward pointers, 228–229 Invitation Rule, 65–66 overview, 217–219 listeners, 68–69, 71–74 User Arbitration Rule, 222 loading, 71–74 views v. editors, 221 markerImageProvider, 142 Element trees overview, 65 composite, 313–314 property pages, 162 Extension Point, 270 publishing, 268–272 Grammar, 270 searching for, 40–42 scalability issues, 310 team component, 358 storing resource information, 299 Extensions Elements, Java context menus, 124–128 (virtual) proxies, 309–313 contributions, 16 Adapters, 308–309 defined, 5 filtering, 341–342 IExecutableExtension, 75 resources, 308–309 instantiation, 74 ResultView changes, listening to, 232–233 notifying, 77–78 tracking changes using Observer, 316–317 perspective, 241–244 trees. See Element trees test report view, 197 Enablers, defined, 2 Externalize String Wizard, 259

Gamma-Beck.book Page 385 Tuesday, October 14, 2003 7:27 PM

Index 385

F Test Report View, 215–216 Factories test results, displaying, 63 adapters, 288–294 tracing, 179–183 IElementFactory, 350 Fragments, 260 Failed tests, 129–130. See also Markers FTP Plug-Ins, 88 Fair Play Rule, 66, 120, 122 Feature Plug-Ins, 88 feature.properties file, 280 G Features getAdapter() method, 287–288, 292 bundling plug-ins, 83–86 Global actions, 216 publishing plug-ins, 86–87 Good Fences Rule, 77–78 File-system resources, 296–299 Grammar, element, 270–271 FileWithProperties, 289 Granularity, 152 FillLayout algorithm, 332 GridLayout Filters algorithm, 332 actions, 128, 354 auto-testing property pages, 167 elements, 341 defining SWT layout strategy, 331 IActionFilter, 354 Resource Navigator, 341–342 test result view, 215 H tests, 218–219 Handles Finding tests, 147–150 resources, 296–299 Fixtures, creating with TestProject, 98–100 virtual proxies, 309–310 Flexibility v. performance, 355 Handling events. See Events, JFace FormLayout algorithm, 332 Heartbeat, 152 Forward pointers Hello button accessibility, 262 action implementation, 25–26 adding button to , 31 action sets, 23–24 auto-test properties, 170 Conformance Rule, 26 builders, 159 default implementations, 27 context menus, 128 forward pointers, 31 editors, excluding tests with, 228–229 Lazy Loading Rule, 29–30 extension points, defining, 74–75 manifest file, 21 final, 354–359 overview, 15–16 help, 255 plug-in project, creating, 18–20 instrumenting, 179–183 proxy actions, 29–30 Internationalization, 262 run-time workbench, 22–24 linked v. copied contents, 14 Sharing Rule, 23–24 marker resolution, 192 Spider Navigator, 28–29 menu contributions, 128 HelloAction.java, 30–31 menu item behavior, implementing, 57 Help menu items for running tests, contributing, context-sensitive, 251–255 44–45 forward pointers, 255 natures, 159 integrated, 250–251 perspectives, 244–245 overview, 247 publishing plug-ins, 88, 272–273 top-level, 247–250 ResultView, 238 Hierarchies, type. See Type hierarchies

Gamma-Beck.book Page 386 Tuesday, October 14, 2003 7:27 PM

386 Index

Host Eclipse, 94–95, 100 Incremental builds Host workbench, 21 AutoTestBuilder, 159 marker resolution, 187, 192 Independence, resource listeners v. builders, I 152 I*2 Interfaces, 143. See also Interfaces Infopops IActionBars, 214, 216 context-sensitive help, 252 IActionFilter, 354 help, 255 IAdaptable links, 247 interfaces, adding to existing types, test results, 253 289–294 Information/Detail views, 221 interfaces, surfacing, 288 Installing PDE JUnit, 93 overview, 283–285 Instantiation, extensions, 74 UI workbench, 349–354 Integrated help, 250–251 IBM WebSphere Application Developer, 15 Integration in Eclipse/JUnit, 37 ICommand, 153 Integration Rule IContainers, 300–301 defined, 129–130 IContentOutlinePage, 354 views in perspective, 240, 252 IContentProvider, 337–340 Interfaces IDocuments, 227–228 I*2, 143 IDs adding, 289–294 action sets, 23 extension, 285–287, 294 manifests, 21 interface-based APIs,, 114 IEditorInput, 211 surfacing using IAdaptable, 288 IExecutableExtension, 75 Internationalization IFile forward pointers, 262 AdapterFactories, 289 fragments, 260 Composite pattern, 300 overview, 257 proxy and bridge patterns, 297 strings, externalizing from code, 258–260 IJavaElement, 308–310 strings, externalizing from manifest files, IJavaProject, deleting markers, 140 257–258 ILabelProvider, 201–204, 337–340 InterrupedException, 188–190 Images, 140–141, 159 Invitation Rule, 65–66, 119 IMarker InvocationTargetException, 188–190 creating markers, 137 IParent interface, 313–314, 315 marker resolution, 142–145 IPersistableElement, 354 testing for markers, 132–134 IPerspectiveFactory, 244 IMemento, 348–351 IProgressMonitor, 147–150, 188–191 Implementation IProject, 158–159, 164 actions, 25–26 IPropertySource, 288, 353–354 extensions, 27–29 IResource interfaces, 27 Adapters, 308–309 Lazy Loading Rule, 29–30 getParent() method, 301 menu items for running tests, 39 proxy and bridge patterns, 296–298 Implementation/declaration split, 16–17 IResource Adapter, 351–352 Implementation patterns. See Patterns, IResourceProxy, 302 implementation. IResourceVisitor, 301

Gamma-Beck.book Page 387 Tuesday, October 14, 2003 7:27 PM

Index 387

IRunnableContext, 188–191 Java editor, 359 ISafeRunnable, 75, 77–78 Java elements IShowInTarget, 354 (virtual) proxies, 309–313 IStatus, 172–173 Adapters, 308–309 IStructuredContentProvider, 204 filtering, 341–342 ITaskListResourceAdapter, 354 resources, 308–309 ITestRunListener ResultView changes, 232–233 accessibility, 263–264 tracking changes, 316–317 Change Method Signature, 136 trees. See Element trees creating markers, 136–137 Java model structure, 308–309 published API, 268 JavaUI, 216 ITreeContentProvider, 337–340 JDT (Java development tools), 5–7, 15. IType See also Plug-In Development Environ- defined, 42 ment (PDE) finding tests, 147–150 JDT Debug UI, 357 menu item behavior, 55 JFace ITypeHierarchy Command pattern, 342–343 avoiding performance penalties, 149 event handling, 210–215 objectifying associations, 315 decorations, 338–339 tracking element changes, 317 ListenerList, 63 IViewPart, 110 pluggable Adapter, 336–340 IWorkbenchAdapter, 351 source documents, 358–359 IWorkspaceRunnable Test Report View, 193–195 batching changes, 305–306 TestReportContentProvider, 204–210 configuring builders, 157 TestReportLabelProvider, 201–204 deleting markers, 140–141 TestResult, 195–196 error handling, 191–192 tests, writing, 196–197 TextEditor, 229 user interface framework, 335–336 J viewers, customizing, 341–342 Java Archive (JAR) files, 16–17 views, creating, 196–197 Java core JUnit abstract syntax tree analysis, 319–323 Contributed JUnit plug-ins, testing, Adapters, 308–309 100–103 Builder, 317–319 example, 35–37 element changes, 316–317 integration, 37 element trees, composite, 313–314 object invocation, 48 objectifying associations, 314–315 test results, displaying, 59–60 Observer, 316–317 test-driven plug-in development, 92–97 overview, 307 TestProject, creating fixtures with, 98–100 resources to elements, 308–309 TestRunner, 62–63, 100 traversing Java model, 315 JUnitCore, 264, 268 type hierarchies, 314 JUnitPlugin, 134 Visitor, 319–323 Java development tools (JDT), 5–7, 15. See also Plug-In Development Environment K (PDE) Keyboard access, 261

Gamma-Beck.book Page 388 Tuesday, October 14, 2003 7:27 PM

388 Index

L M Label providers Manifest files contributing contributors, 227 Declaration Definition (manifest), 17 TableViewer, 195 exploring, 21 TestReportLabelProvider, 201–204 extension points, 41 Labels plugin.xml, 20 changes, 57 shadow creation, 49 decorations, 338–339 strings, externalizing, 257–258 defined, 115 Marker resolution , 117 build and rerun, 186–187 Layout definition strategy, Standard Widget forward pointers, 192 Toolkit (SWT), 330–333 overview, 185–186 Lazy Loading Rule progress, 188–191 defined, 16, 25 rerunning tests, 191–192 menu item behavior, implementing, testing, 186 47, 57 Markers menu items for running test, 44 configuring builders, 157 toolbar buttons, adding, 29–30 creating, 136–139 UI workbench, 346–347 defined, 130 verification, 52–53 deleting, 140–141 Libraries images, 141–143 classes, 264–265 logging errors, 175 plug-ins, 96–97 passing projects, 134–136 License Rule, 85 resolution, 142–145 Linked contents, 14 test failures as, 131 Listeners testing for, 131–134 BeepingListener, 278 Memento, 347–351 context menus, 120–122 Menu contributions Contributed JUnit plug-ins, 100–103 creating context menus, 119–124 dynamic registration, 263 extending context menus, 124–128 extension point schemas, 270 overview, 119 extension points, defining, 68–70 Menu item behavior extension points, loading, 71–74 build class path, updating, 51 ListenerList, 63 forward pointers, 57 progress testing, 111–113 interface implementation, 48–49 registering with widgets, 333–334 Lazy Loading Rule, 47, 52–53, 57 resource listeners v. builders, 152–154 overview, 47 ResultView changes, 232–235, 238 plug-in classes, 54–57 SelectionListener, 212 selection storage, 50–51 test results, 60–63 shadow creation, 49 Log String technique, 102 stub for running tests, 56–57 Logging errors, 175–177 Menu items for running tests Long-running operations, invoking. See forward pointers, 44–45 Marker resolution Monkey See/Monkey Do Rule, 39–40

Gamma-Beck.book Page 389 Tuesday, October 14, 2003 7:27 PM

Index 389

Object Contributions, 40–45 Observer overview, 39 SWT events, 333–334 Relevance Rule, 43–44 test results, 59–60 Safe Platform Rule, 44 tracking element changes, 316–317 Menus tracking resource changes, 302–305 actions, 127 OOPSLA-93, 3 context, 127 Open Type dialog, 142–145, 166 editors, 229 Open-in-editor function, 213–214 Run As, 93–95, 97 Option path, tracing, 180–183 Show View, 242–244 org.junit, 96–97 TaskList, 121 Other Rule, 242 MessageDialog, 173 Outline view, 221 Metadata, 218 Milestone 3 of Eclipse 3.0 development stream, 93 P Mnemonics, 261–262 Package Explorer Monkey See/Monkey Do Rule, 39–40 auto-test property pages, 164 MultiPageEditorPart, 228 extension points, 41 IResource Adapter, 351–352 Java model structure, 308–309 N object contributions, 353 Naming Plug-Ins, 21 PackageExploreContentProvider, Natures 232–233 auto-test property pages, 168 perspective, 241 builders, 151, 154–159 ResultView, 232–233 Navigation history, workbench editors, 228 views, 221 Navigator Packages, published v. internal, 266 IMemento, 349 Packaging Plug-Ins, 79–82 UI workbench, 354 Parents views, 221 class loaders, 54 Navigator, Spider. See Spider Navigator handles, 298 New Dialog, 229 interfaces, 313–314 New file wizard, 219 widgets, 329 New Repository action, 346–347 Pattern stories NotificationManager, 302–303 contributing, 281–282 Notifying extensions, 77–78 core runtime, 283–287 NullProgressMonitor, 148 core workspace. See Core workspace IAdaptable. See IAdaptable Java core. See Java core O JFace. See JFace Object Contributions, 40–45, 125 Standard Widget Toolkit (SWT). See Objectifying associations, type hierarchies, Standard Widget Toolkit (SWT) 314–315 Patterns. See Patterns, design; Patterns, Objects, extension, 285–287, 294 implementation

Gamma-Beck.book Page 390 Tuesday, October 14, 2003 7:27 PM

390 Index

Patterns, design extension point schema files, 74–75 Adapter, 337 extension points, publishing, 269–272 Bridge, 296, 299 JUnit, 92–97 Builder, 317, 318 site creation wizard, 86–87 Command, 342 TestProject, 98–100 Composite, 300, 327, 328, 355 user documentation, 248 Decorator, 339 workspace, 11–12 Extension Object, 285. See also Extension plugin.xml Interface editors, excluding tests, 220 Façade, 109 extension points, 41–42 Factory Method, 74 menu items, contributing, 125 Interpreter, 318 plug-ins, redeploying, 278 Memento, 313, 348 refactoring and updating, 267 Observer, 59, 60, 303 strings, externalizing, 257–258 Proxy, 47, 296, 350. See also virtual proxies test report view, 197–198 Singleton, 56 toolbar buttons, 31 Special Case, 148 Plug-Ins Strategy, 330, 341 accessibility, 257, 261–262 Value Object, 297 activation, 75 Visitor, 301, 319, 320 architecture, 5 Patterns, implementation auto-test properties. See Auto-test properties Collecting Parameter, 148 beeping, 277–278 Common State, 131 builders. See Builders Complete Constructor, 329 class, 40 Execute Around Method, 306 compile errors, 129–130 Safe Copy, 303 diagnosing, 69 Self Delegation, 347 downloading, 359 Variable State, 131, 330 Eclipse source, 12–14 PDE (Plug-In Development Environment). See editors for excluding tests. See Editors, Plug-In Development Environment (PDE) excluding tests Persistent attribute, 139 exception handling. See Exception handling Perspectives exporting imported, 273 Debug, 357 extension notification, 77–78 forward pointers, 244–245 extension points. See Extension points Other Rule, 242 fragments, 260 overview, 239 help. See Help Show View menus, 242–244 instrumenting, 179–183 views, 239–242 Internationalization. See Internationalization Platform JFace. See JFace Eclipse architecture, 5–7 JUnit, 35–37 Platform UI.getWorkbench, 187, 192 library, 96–97 plug-in shadows, 49 marker resolution. See Marker resolution Plug-In Development Environment (PDE) markers. See Markers build. properties, 20 menu contributions. See Menu contributions debug options, 180 menu item behavior. See Menu item behavior Eclipse architecture, 5–7 menu items for running tests. See Menu Eclipse setup, 11–14 items for running tests

Gamma-Beck.book Page 391 Tuesday, October 14, 2003 7:27 PM

Index 391

metadata, 218 forward pointers, 88, 272–273 natures, 151, 154–159 License Rule, 85 overview, 33–34 overview, 79, 263 packaging, 79–82 packaging plug-ins, 79–82 perspectives. See Perspectives plugin.xml, refactoring and updating, 267 publishing. See Publishing plug-ins separating core and UI, 268 redeploying, 278–280 separating published and internal packages, ResultView. See ResultView 266 servicing, reducing costs, 177 Stability Rule, 266 shadow creation, 49 Pull model, 303 structure, 16 Push model, 303 Test Report View. See Test Report View test results, 59–63 test-driven. See Test-driven plug-in Q development QuickFix, 114, 142 tests, creating, 98 tests, failed, 129–130 tests, finding, 147–150 R toolbar buttons, 18–20 Redeployment, plug-ins, 278–280 tracing, 179–183 References, 379 Pop-up menus, 40–43 refresh() method, 206 Preferences Relevance Rule, 43–44, 163 editors for excluding tests, 217 Repositories, 346–347 pages, 170 Rerun Marker Resolution. See also Marker Primary features, 88 resolution Program to API Contract Rule, 117 invoking long-running operations, 185–192 ProgressMonitorDialog, 189 marker generator, 144–145 Project order dependency, 152–154, 157 RerunTest method, 124 ProjectDescription, 153 Resolution, marker. See Marker resolution Properties Resource Navigator, 232–233, 341–342 auto-testing pages, 162–167 Resources core runtime views, 284–285 batching changes, 302–305 editors for excluding tests, 217–218 defined, 130 workbench-provided adapters, 353–354 deltas. See Deltas, resource Proxies, virtual. See Virtual proxies Execute Around Method, 302–305 Proxy actions, 29–30 IResourceAdapter, 351–352 Proxy file-system resources, 296–299 Java elements, 308–309 Publishers, 2 proxy and bridge access patterns, 296–299 Publishing plug-ins resource listeners v. builders, 152–154 API, 263–264 resource trees, traversing, 301–302 bundling plug-ins into features, 83–86 ResultView changes, 232–233 contributing, 86–88 Responsibility Rule, 171–172 Defensive API Rule, 266 Result/Output views, 221 Explicit API Rule, 266 ResultView exporting classes, 264–265 forward pointers, 238 extension points, 268–272 help, 247 Gamma-Beck.book Page 392 Tuesday, October 14, 2003 7:27 PM

392 Index

ResultView continued S observing changes, 231, 232–235 Safe copies, 303 reacting to changes, 235–238 Safe Platform Rule, 44 testing colors, 231–232 Scope, resource listeners v. builders, 152 RowLayout algorithm, 332 Screen readers, 261 Rules Searching Adapt To IResource, 353 Eclipse source, 12–14 Conformance, 26, 48 extension points, 40–42 Contribution, 15, 247 org.eclipse.search plug-in, 358 Defensive API, 266 TestSearcher, 147–149 Diversity, 67 traversing Java model, 315 Explicit API, 266 Selection linking, 215 Explicit Extension, 66–67 SelectionAdapter, 212 Fair Play, 66, 120, 122 SelectionListener, 212, 333–334 Good Fences, 77–78 Self Delegation, 347 Integration, 129–130, 240, 243 Separators, 122 Invitation, 65–66, 119 Shadow world, 49 Lazy Loading, 16, 57, 346–347 Shared images, test result view, 215 License, 85 SharedActionContributor, 220 Monkey See/Monkey Do, 40 Sharing Rule, 24 Other, 242 Sharing, resource listeners v. builders, 152 Program to API Contract, 117 Shortcuts Relevance, 43–44, 163 editor actions, 228 Responsibility, 171–172 perspective contributions, 244 Safe Platform, 44 Sites Sharing, 24 creation wizard, 86–87 Stability, 266 workbench parts, 123 Strata, 356 Smalltalk, defined, 1 User Arbitration, 222, 339 SocketTestRunner details, 368–370 User Continuity, 348 Sorters, 215 Run action, 347 Sorting viewers, 341 RunTestAction, 254–255 Source, browsing and searching, 12–14 Runtime Spider Navigator component, 6 Bookmarks view, 194–195 core, 283–287 click function, 120 Run-Time Eclipse, 100 mapping between domain objects and SWT Run-time kernel, 16, 17 widgets, 340 Run-time workbench providing, 28–29 hello action, 26–30 Stability Rule, 266 Plug-In Development Environment (PDE), Standard Widget Toolkit (SWT) 21–22 API definition, 114 Run-Time Workbench launching option, beeping plug-in, 277–278 94–95 Composite, 326–330 Run-time workspace example codes, 359 run-time Eclipse started from, 94–96 JFace. See JFace test project fixtures, 98–100 layout definition strategy, 330–333 Gamma-Beck.book Page 393 Tuesday, October 14, 2003 7:27 PM

Index 393

opening test cases in editor, 210–212 TestReportContentProvider, 204–210 overview, 325–326 TestReportLabelProvider, 201–204 Plug-In Development Environment TestReportView, 199–201 (PDE), 6 TestResult, 195–196 posting events, 209 writing tests, 196–197 responding to events, 333–334 Test-driven plug-in development subclassing, 329 Contributed JUnit plug-ins, testing, test report view, 200, 207–208 100–103 Startup time, 89 overview, 91–92 Storage, Memento, 348–351 PDE JUnit, 92–97 Strata Rule, 356 Run-Time Workspace, 100 String literals, updating references, 267 Test-Driven Development (TDD) defined, Strings, externalizing 91–92 from code, 258–260 TestProject, 98–100 from manifest files, 257–258 TestRunner, 103 Structured views, 215 TestProject Style bits idiom, 329 creating fixtures, 98–100 Subclassing source code, 371–374 Eclipse API, 329 test report view, 196–197 viewer customizing, 341–342 TestReportContentProvider, 204–210 SubProgressMonitors, 192 TestReportLabelProvider, 201–204 Supertypes, 149 TestReportView, 247 Surfacing interfaces using IAdaptable, 288 TestResult, 195–196 SWT (Standard Widget Toolkit). See Standard TestRunner Widget Toolkit (SWT) contributed JUnit plug-ins, 103 syncExec() method, 209 details, 363–368 SocketTestRunner details, 368–370 test failures as markers, 135 T test project fixtures, 100 Table of contents (toc) trees, 247, 251 test results, 60, 62–63 Table widget Tests event handling, 210 excluding. See Editors, excluding tests opening test cases in editors, 212 failures as markers. See Markers TestReportView, 200–201 finding, 147–150 TableViewer perspectives, 240 Bookmarks, 194–195 plug-ins, 98 test report view, 200–201 TextEditor, 229 Target run-time, 180 Timing operations, tracing, 183 Targeting context menus, 126 Task List, 121, 135 actions, 127 Team component, 358 contributing to editors, 229 Test Report View open-in-editor function, 213–214 creating views, 197–201 Top-level help, 247–250 event handling, 210–215 Tracing forward pointers, 215–216 forward pointers, 179–183 overview, 193–195 Java element, 312–313 Gamma-Beck.book Page 394 Tuesday, October 14, 2003 7:27 PM

394 Index

Tracing continued overview, 345 plug-ins, 179–183 persisting UI state, 347–351 ResultView, 237–238 restoring editors, 350–351 Trees restoring views, 350–351 element, 299, 310 virtual proxies, 346–347 Element Grammar, 270 workbench-provided adapters, 353–354 Extension Point Element, 270 User programming resource deltas, 152 Eclipse supporting, 1–3 table of contents (toc), 247, 251 Smalltalk, 1 traversing resources, 301–302 widget, 327, 330 TreeViewer, 336–340 V Type hierarchies Value Objects, 297 finding tests, 149 Variable State, 131 objectifying associations, 314–315 ViewColorTest, 231–232 views, 221 Viewers Type Hierarchy. See also ITypeHierarchy customizing without subclassing, 341–342 IAdaptable, 286–287 object contributions, 125 IResource, 296 pluggable Adapter, 336–340 Java element changes, tracking, 316–317 updating, test report view, 206–208 Typed listeners, 333–334 Viewing test results abstract-based v. interface-based APIs, 114 changing colors, 113–118 U contributing views, 107–111 UI (user interface). See User interface (UI) overview, 107 Untyped listeners, 333–334 Program to API Contract Rule, 117 Updating testing progress, 111–113 build class path, 51 ViewPart, 110 plugin.xml, 267 Views sites, 86–88 Bookmarks, 194–195 viewers, 206–208 contributing, 107–111 views, 215 editors v., 221 User Arbitration Rule, 222, 339 open-in-editor function on toolbar, User Continuity Rule, 348 213–214 User interface (UI) perspectives, 239–242 Debug UI, 357 Show View menus, 242–244 Eclipse architecture, 6–7 structured, 215 Lazy Loading Rule, 346–347 Test Report. See Test report view object contributions, 353 UI workbench, 350–351 publishing plug-ins, 268 Virtual proxies restoring editors, 350–351 IResourceProxy, 302 UI v. core functionality, 268 Java elements, 309–313 virtual proxies, 346–347 UI workbench, 346–347 User interface (UI) workbench Visitor IAdaptable, 350–354 abstract syntax tree analysis, 319–323 object contributions, 353 traversing resource trees, 301–302 Gamma-Beck.book Page 395 Tuesday, October 14, 2003 7:27 PM

Index 395

W Workspace WebDav Plug-Ins, 88 browsing and searching Eclipse source, 12–14 Widgets. See also Standard Widget Toolkit core. See Core workspace (SWT) linked contents, 14 accessibility, 207–208 Plug-In Development Environment (PDE), 6 auto-test property pages, 166–167 root, 133 JFace actions, 343 Run-Time, 94–95 layout definition strategy, 330 setting up, 11–12 registering listeners, 333–334 Wrappers, property-sheet, 289 table, 200–201, 210, 212 www.dev.eclipse.org, 93 trees, 327, 330 www.eclipse. org Wizards accessibility requirements, 262 class creation, 110 builders, 159 creating, 228 downloading plug-in examples, 359 Externalize String, 259 Eclipse API ground rules, 272 new file, 219 Eclipse developer articles, 359 Plug-In Project, 18–20 evolving Java APIs, 272 schemas used in, 269 perspectives, 245 showing progress embedded in wizard preference pages, 170 dialog, 189 resource deltas, 238 test report view, 197 shared images, 215 Workbench SWT design principles, 325 host v. run-time, 21 SWT layout support, 332 Spider Navigator, 28–29 testing internationalized plug-ins, 262 page providing access to editor and viewer UI guidelines, 7 preferences, 350–351 www.section508gov/, 262 Plug-In Development Environment (PDE), 6–7 Rerun Marker Resolution, 187 X Run-Time, 94–95 XML (Extensible Markup Language), 16–17 UI. See User interface (UI) workbench views in perspective, 239–242 WorkbenchContentProvider, 232–233 Z Working with v. working on, 11 Zip files, help, 255