售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Mastering Eclipse Plug-in Development
Table of Contents
Mastering Eclipse Plug-in Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Plugging in to JFace and the Common Navigator Framework
JFace wizards
Creating a feeds wizard
Creating the classes
Adding pages to the wizard
Adding content to the page
Testing the wizard
Adding titles and images
Adding help
Finishing the wizard
Adding the FeedWizard to the newWizards extension point
Adding a progress monitor
Showing a preview
Common navigator
Creating a content and label provider
Integrating into Common Navigator
Binding content navigators to views
Adding commands to the common navigator
Reacting to updates
Optimizing the viewer updates
Linking selection changes
Opening an editor
Finding the line
Setting the selection
Summary
2. Creating Custom Extension Points
Extensions and extension points
Creating an extension point
Creating an IFeedParser interface
Creating a MockFeedParser class
Creating the extension point schema
Using the extension point
Caching extension points
Integrating the extension with the content and label providers
Showing a feed in the browser
Implementing a real feed parser
Adding support for Atom
Making the parser namespace aware
Priority and ordering
Executable extensions and data
Executable extension factories
Using the extension registry outside of OSGi
Using the extension registry cache
Loading all extensions from the classpath
Summary
3. Using OSGi Services to Dynamically Wire Applications
Overview of services
Registering a service programmatically
Creating an activator
Registering the service
Priority of services
Using the services
Lazy activation of bundles
Comparison of services and extension points
Registering a service declaratively
Declarative Services
Properties and Declarative Services
Service references in Declarative Services
Multiple components and debugging Declarative Services
Dynamic service annotations
Processing annotations at Maven build time
Blueprint
Installing Gemini Blueprint
Installing Aries Blueprint
Using the Blueprint service
Passing properties in Blueprint
Bean references and properties
Comparison of Blueprint and DS
Dynamic services
Resolving services each time
Using a ServiceTracker
Sorting services
Filtering services
Obtaining a BundleContext without using an activator
A note on ServiceReference
Dependent services
Dynamic Service Configuration
Installing Felix FileInstall
Installing Config Admin
Configuring Declarative Services
Config Admin outside of DS
Services and ManagedService
Creating an EmptyFeedParser class
Configuring the EmptyFeedParser
Service factories
Creating the EchoServer class
Creating an EchoServiceFactory class
Configuring EchoService
Summary
4. Using the Gogo Shell and Commands
Consoles in Equinox
Host OSGi Console
Running commands
Variables and pipes
Functions and scripts
Literals and objects
Calling and chaining methods
Control flow
Running Equinox from the command line
Understanding osgi.bundles and config.ini
Connecting remotely
Securing the connection
Creating a JAAS configuration
Understanding the configuration options
Launching the SSH daemon
Extending the shell
Adding commands from existing methods
Getting a class from an existing instance
Loading a class via a ClassLoader
Writing commands in Java
Creating the project
Using Declarative Services to register the command
Test the command
Processing objects with console commands
Adding the print bundles command
Returning a list of bundles
Processing a list with each
Calling functions from commands
Looping and iteration
Summary
5. Native Code and Fragment Bundles
Native code and Eclipse
Creating a simple native library
Mac OS X
Linux
Windows
Loading the native library
Library dependencies
Native code patterns
Native libraries in OSGi bundles
Optional resolution of native code
Multiple libraries for the same platform
Multiple libraries with the same name
Additional filters and constraints
Reloading native libraries
OSGi fragment bundles
Adding native code with fragments
Adding classes to a bundle
Patching bundles with fragments
Adding imports and exports with fragments
Extension bundles
Summary
6. Understanding ClassLoaders
Overview of ClassLoaders
ClassLoaders and inheritance
ClassLoaders in web application servers
ClassLoaders and garbage collection
OSGi and ClassLoaders
OSGi services and ClassLoaders
ThreadContextClassLoaders
Java ServiceLoader
Problems with ServiceLoader, OSGi, and Eclipse
Creating a service producer
Downloading the required bundles
Running the producer
Creating a service consumer
Running the consumer
OSGi upgrade strategies
Embedding the library directly
Wrapping the library with bnd
Upgrading the library to use services
Dealing with class resolution issues
Summary
7. Designing Modular Applications
Semantic versioning
Public APIs and version ranges
Baselining and automatic versioning
Eclipse API baselines
Bnd baseline
Bndtools
Maven baselining
Design patterns
The whiteboard pattern
The extender pattern
Best practices
Separate API and implementation
Decouple packages
Decouple services
Prefer Import-Package to Require-Bundle
Version packages and bundles
Avoid split packages
Import and export packages
Avoid start ordering requirements
Avoid long Activator start methods
Use configuration admin for configuration
Share services, not implementation
Loosely coupled and highly cohesive
Compile with the lowest level execution environment
Avoid Class.forName
Avoid DynamicImport-Package
Avoid BundleActivator
Consider thread safety
Test in different frameworks
Summary
8. Event-driven Applications with EventAdmin
Understanding the OSGi EventAdmin service
Sending e-mails
Creating an event
Posting an event
Receiving an event
Filtering events
Threading and ordering of event delivery
Comparison between EventAdmin and services
Framework events
Events and E4
Sending events with E4
Receiving events with E4
Subscribing E4 EventHandlers directly
Comparison between EventAdmin and IEventBroker
Designing an event-based application
Componentizing the application
Identifying the channels
Identifying the properties
Mapping the channels to topics
Simulating events
Versioning and loose typing
Event object contents
Comparison with JMS
Summary
9. Deploying and Updating with P2
Eclipse P2
Provisioning with the P2 director
Installing content into existing applications
Running P2 applications
Launching the JVM
Starting Equinox
P2 repositories
P2 artifacts and contents files
Binary and packed files
Creating P2 mirrors
Generating P2 metadata
Categorizing update sites
Composite update sites
The classic update manager
Touchpoints
Categorizing features with P2
Adding update sites automatically
Registering touchpoint actions
Adding JVM or program arguments
Custom touchpoints
Summary
10. User Assistance in Eclipse
Help pages in Eclipse
Adding help pages
Nested table of contents
Anchors and links
Linking to anchors in other plug-ins
Conditional enablement
Context-sensitive help
Active help
DocBook and Eclipse help
Mylyn WikiText and Eclipse help
Help Server and RCP
Help and Eclipse 3.x
Help and Eclipse 4.x
Running an InfoCenter standalone
Cheat sheets
Creating a cheat sheet
Adding commands
Optional steps
Responding to choice
Composite cheat sheets
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜