Address Book
Address Book is an example application for the Eclipse RCP platform. I’m working on it for my upcoming book about Eclipse RCP (in German) and my Eclipse RCP training courses (in German).
Screenshot

Project setup
-
Use Eclipse IDE for RCP/Plug-in developers version 3.5 or 3.6.
-
Download the latest source zip or clone the git repository:
git clone git://github.com/ralfebert/addressbook.git -
Import all projects into a fresh workspace using
File > Import > Existing Projects into workspace. -
Open
com.example.addressbook.site/rcp.target, wait till the dependencies are resolved and clickSet as target platform. All compile errors should disappear now. If not, restart Eclipse and repeat this step. -
Run
com.example.addressbook/Addressbook.launchto launch the application. -
Run
com.example.addressbook.uitests/AddressBookUITests.launchto run the UI test suite.
This example shows…
- How views are declared using the extension point
org.eclipse.ui.views(seeplugin.xmlandAddressListViewPartincom.example.addressbook). - How perspectives are declared using the extension point
org.eclipse.ui.perspectivesand how views are added to perspectives programmatically (seeplugin.xmlandAddressPerspectiveincom.example.addressbook). - How
TableViewerandTableColumnLayoutcan be used to set up tables (seeAddressListViewPartincom.example.addressbook). - How a JFace
TableViewercan be sorted and filtered by typing a search string in a text field (seeAddressListViewPartincom.example.addressbook). - How the extension point
org.eclipse.ui.menuscan be utilized to add workbench commands to the menu and toolbar (seeplugin.xmlandApplicationActionBarAdvisorincom.example.addressbook) - How a handler for general-purpose commands is declared by selection (see
AddressDeleteHandlerfor commandorg.eclipse.ui.edit.deleteincom.example.addressbook) - How a handler for general-purpose commands is declared for a view by id (see
AddressListRefreshHandlerfor commandorg.eclipse.ui.file.refreshincom.example.addressbook) - How a context menu can be created and extended using the extension point
org.eclipse.ui.menus(seeAddressListViewPartincom.example.addressbookandContextMenuinrcputils) - How JFace selections can be iterated using Java 5 foreach loops (see
AddressDeleteHandlerincom.example.addressbookandSelectionUtilsinrcputils) - How resources can be managed using
ResourceManagerand automatically disposed when a parent composite is disposed (seeAddressListViewPartincom.example.addressbook). - How applications can be translated using the Eclipse NLS mechanism (see
ÀddressBookMessagesincom.example.addressbook). - How packages can be structured to keep implementation classes internal and how workbench ids, messages and resources like images might be shared (see
com.example.addressbook.internalandcom.example.addressbookpackages incom.example.addressbook) - How an
OSGi servicecan be registered and used in a RCP application. The application utilizes a very simpleAddressServicewhich resembles how a service might look in a real application. Here, it just provides fake data (seecom.example.addressbook.services). - How custom
listenerscan be used in services to decouple workbench parts (seeAddressChangeListenerincom.example.addressbook.servicesand usage inAddressListViewPart). - How
OSGi servicescan be injected into view, editor and handler objects using theEclipse Riena Core Wiremechanism (seeAddressBookListViewincom.example.addressbookandde.ralfebert.rcputils.wired). - How plug-ins are used to extend RCP applications: All editing functionality is provided as a separate bundle
com.example.addressbook.editingand is completely optional. - How editors are declared (see
plugin.xmlincom.example.addressbook.editing) and implemented with load, change and save functionality. This also demonstrates how editor implementations might be simplified using abstract base classes (seeAddressIdEditorInput,AddressEditorPartandWiredModelDataBindingEditorPart). - How editors are opened from a command (see
OpenAddressEditorHandlerincom.example.addressbook.editing) - How own commands are declared and implemented using a handler (see
plugin.xmlincom.example.addressbook). - How simple forms can be layouted using SWT
GridLayout(seeAddressEditorPartincom.example.addressbook.editing). - How applications and feature-based products are declared using the extension points
org.eclipse.core.runtime.applicationsandorg.eclipse.core.runtime.productsfor RCP applications (seeplugin.xml,addressbook.productincom.example.addressbookandcom.example.addressbook.feature) - How to brand a RCP product with custom images (see
addressbook.product) - How JFace Data Binding can be utilized to bind forms to model objects (see
AddressEditorPart#onBind). - How Jobs and UIJobs can be utilized and simplified to load images without blocking the application (see
AddressEditorPartandde.ralfebert.rcputils.concurrent) - How validators can be added to the binding and how controls are decorated when validation errors occur using the provisional
ControlDecorationSupport(seeAddressEditorPart#onBindandZipValidator). - How the dirty flag for an editor can be set automatically from a
DataBindingContext(seeAddressEditorPart). - How themes can be used to customize the colors of the Eclipse workbench (see
plugin.xmlincom.example.addressbook) - How to setup a target platform to fetch features and bundles from different repositories (see
rcp.targetin com.example.addressbook.site). - How RCP projects can be built headless using Eclipse Buckminster (see
com.example.addressbook.sitefor the build configuration).
License
Licensed under Eclipse Public License - v1.0

