Jump to: navigation, search

Examples/Eclipse Business Expense Reporting Tool

This example is currently under development and is subject to change.

EBERT is a simple expense reporting tool that runs on the client, server, and embedded devices using Eclipse Rich Client Platform (RCP), Eclipse Rich Ajax Platform (RAP), and Embedded Rich Client Platform (eRCP) respectively.

Description

Here's a snapshot of the RCP version of EBERT:

EBERT-RCP.png

Here's what it looks like in RAP:

EBERT-RAP.png

Here's what it looks like in eRCP running on a Nokia E90:

EBERT-ERCP.png

You'll notice some similarities and some differences. Approximately 90% of the code is exactly the same across platforms. That 90%—the exact same code without recompiling, repackaging, or manipulation of any sort—is deployed on the desktop, the server, and a phone. This is one of the great things about Equinox and the various runtime platforms at Eclipse: the exact same component model, Equinox, is used everywhere.

Arch.png

The common bundles—those in the middle—contain most of the interesting behaviour. Specifically, these two bundles contain the basic business models (core), and the various views and custom widgets (ui). Underneath these common components are the various runtime platforms which all themselves sit on Equinox (actually, the E90 uses Prosyst’s implementation of OSGi).

At the top are the various "application" bundles. Each of these bundles pulls the pieces together for one of the platforms. The "application" bundles provide some customization of the views, and—in the case of the eRCP version—some navigation glue that manages the views in the absence of perspectives (which are not supported on eRCP due to screen space limitations).

Overview

Concepts

Shared Projects

These bundles are used in all three platforms. Most of these are Plug-in projects that conform to the CDC-1.1/Foundation-1.1 execution environment as this is the environment supported by many devices running ERCP (CDC-1.1/Foundation-1.1 is a subset of the Java SE 1.4 libraries).

  • org.eclipse.examples.expenses.application.general
    • This project defines the perspectives, and various advisors that RCP and RAP use to define the workbench window, toolbar, menus, etc. Not used by the ERCP version.
    • Provides some view customization that adds some push buttons to the BinderView and ExpenseReportView
    • Plug-in project. Uses Java SE 5 syntax and libraries.
  • org.eclipse.examples.expenses.core
    • Contains the domain model objects, ExpensesBinder, ExpenseReport, and LineItem along with supporting types.
    • Domain models are "JavaBean-like", leveraging Eclipse Platform events and listeners, since JavaBean support is not included with base CDC-1.1/Foundation-1.1 support.
    • Plug-in project. Uses Java SE 1.4 syntax CDC-1.1/Foundation-1.1 libraries.
  • org.eclipse.examples.expenses.core.tests
    • Intended to run against an RCP target only.
    • Fragment project. Uses Java SE 5 syntax and libraries.
  • org.eclipse.examples.expenses.views
    • Contains the three main views, BinderView, ExpenseReportView, and LineItemView along with supporting types.
    • Plug-in project. Uses Java SE 1.4 syntax CDC-1.1/Foundation-1.1 libraries.
  • org.eclipse.examples.expenses.views.tests
    • Intended to run against an RCP target only.
    • Fragment project. Uses Java SE 5 syntax and libraries.
  • org.eclipse.examples.expenses.context.standalone
    • Provides the user state service for RCP and ERCP (single-user) versions.
    • Plug-in project. Uses Java SE 1.4 syntax CDC-1.1/Foundation-1.1 libraries.
  • org.eclipse.examples.expenses.widgets.datefield.common
    • Provides common behaviour for DateField classes implemented in org.eclipse.examples.expenses.widgets.datefield.basic and org.eclipse.examples.expenses.widgets.datefield.nebula.
    • Plug-in project. Uses Java SE 1.4 syntax CDC-1.1/Foundation-1.1 libraries.
  • org.eclipse.examples.expenses.widgets.datefield.basic
    • Provides a DateField in the form of an SWT Text widget with some validation and conversion.
    • Intended for platforms, like ERCP that don't include an SWT DateTime widget
    • Plug-in project. Uses Java SE 1.4 syntax CDC-1.1/Foundation-1.1 libraries.
  • org.eclipse.examples.expenses.widgets.datefield.basic.tests
    • Intended to run against an RCP target only.
    • Fragment project. Uses Java SE 5 syntax and libraries.
  • org.eclipse.examples.expenses.widgets.datefield.nebula
    • Provides a DateField based on the CDateTime widget implementated by the Nebula Project.
    • Intended for platforms, like ERCP that don't include an SWT DateTime widget
    • Plug-in project. Uses Java SE 5 syntax and libraries.

RCP-specific Projects

  • org.eclipse.examples.expenses.application.rcp

RAP-specific Projects

  • org.eclipse.examples.expenses.application.rap
    • Bootstrapping code specific to RAP
    • Provides the user state service (implementation of IUserContextFactory) specific to RAP.
    • Plug-in project. Uses Java SE 5 syntax and libraries.

ERCP-specific Projects

The ERCP version is currently broken while we sort out some "split packages" issues
  • org.eclipse.examples.expenses.application.ercp
    • Bootstrapping code specific to ERCP.
    • Plug-in project. Uses Java SE 1.4 syntax CDC-1.1/Foundation-1.1 libraries.
  • org.eclipse.examples.expenses.feature.ercp
    • Feature project.

Setup

These instructions are very incomplete. In fact, this is little more than a stand-in for real instructions.

There are three different versions of this application. While the different versions share a considerable amount of code, they each run using different target platforms. In time, we will provide scripts that automate the creation of these platforms. For now, we provide very simple instructions.

The RCP version of this application can be built against Eclipse RCP 3.4.x or 3.5. Ideally, a separate target directory containing an RCP SDK (e.g. 3.4RC1) should be created. The RCP version includes some Java 5-specific code and so requires a Java 5 compatible JRE.

The RAP version requires a RAP 1.1.x target directory and some additional RAP development plug-ins. Instructions are available on the RAP Getting Started page. The RAP version includes some Java 5-specific code and so requires a Java 5 compatible JRE.

The eRCP version requires an eRCP target directory. Version 1.0.2 or later of eRCP is required. eRCP targets can be found on the eRCP downloads page. The eRCP version uses only Java 1.4 syntax and CDC-1.1/Foundation-1.1 class libraries.

Frequently Asked Questions

Why doesn't EBERT use JFace DataBinding?

JFace DataBinding is supported on RCP and RAP. Unfortunately, it's not available on ERCP, so we can't use it.

Does EBERT take a lowest-common-denominator approach to supporting all three platforms

No. The common parts do, by necessity, take a lowest-common-deminator approach, but offer customization through extension points. So, on RCP, cell editors are added to the tables; on RCP and RAP, push buttons are added to the views to make interaction with a mouse easier; and on RAP, the command buttons available on phones are leveraged.

We also use OSGi Package-Import style binding between bundles to facility dynamically switching custom widgets that leverage specific functionality on certain platforms.

See: