1 / 73

Eclipse Rich Client Platform (RCP)

Eclipse Rich Client Platform (RCP). Richard C. Gronback Borland Software Corporation November 8, 2005. Agenda. Delivered in FAQ* format: What is the Eclipse Rich Client Platform (RCP)? What is this OSGi thing? Why do I care? What is a plug-in? What is a feature? What is a fragment?

wells
Télécharger la présentation

Eclipse Rich Client Platform (RCP)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Eclipse Rich Client Platform (RCP) Richard C. GronbackBorland Software CorporationNovember 8, 2005

  2. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP? * Inspired by the RCP FAQs located here: http://www.eclipse.org/rcp/faq.html Goal: not to repeat too much of the many other RCP presentations

  3. Before we get started…

  4. Do you speak Eclipse? • Terminology… lots of vocabulary to master: • Plug-in, Feature, Extension, Product, Builders, Application, OSGi, Fragment, Natures, Activity, Perspective, View, Capability, Bundle, Actions, Workbench, JFace, SWT, RCP, PDE, Workspace, Team Project Set, Context, Manifests, Patches, Quick Fix, Decorator, Marker, Job, Contribution, Extension Point, Cool Bar, Language Packs, ICU4J, Cheat Sheet, Dynamicity, EPL, … • Not to mention the Eclipse projects: • GMF, GEF, JDT, EMF, EMFT, TPTP, WTP, WST, JST, BIRT, Hyades, Equinox, Higgins, ETF, ECF, Lepido, Mylar, JSR220-ORM, eRCP, Buckminster, GMT, AJDT, AspectJ, ECESIS, Pollinate, PTP, MDDi, Phoenix, UML2, CDT, VE, COBOL, FTP, Photran, ERD, ECE, ERE, WRD, DTP, DSDP, ALF, EJB3.0-ORM, Laszlo, BPEL, JSF, JWT, OHF, WSVT, XSD, SDO, …

  5. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  6. Rich Client Platform (RCP) • From the RCP website: • “While the Eclipse platform is designed to serve as an open tools platform, it is architected so that its components could be used to build just about any client application. The minimal set of plug-ins needed to build a rich client application is collectively known as the Rich Client Platform.” • New to Eclipse in 3.0 • Grew out of a need for non-IDE application development • Eclipse 2.1 was very much still a Java IDE • Reference Bugzilla #36967 • Represents the future for Eclipse • Essentially, all Eclipse applications are RCP applications!

  7. Technically, the RCP1 includes the following plug-ins: org.eclipse.swt2 org.eclipse.jface org.eclipse.ui org.eclipse.ui.workbench org.eclipse.update.configurator Core RCP • org.eclipse.core.commands • org.eclipse.core.expressions • org.eclipse.core.runtime • org.eclipse.osgi • org.eclipse.help • Notes: • RCP download doesn’t run by itself… don’t try it. • SWT has fragments for the following systems: • win32.x86, gtk.linux.x86, gtk.solaris.sparc, gtk.linux.ppc, gtk.linux.x86_64, carbon.macosx.ppc, motif.aix.ppc, motif.hpux.PA_RISC, motif.linux.x86, gtk.linux.ia64, motif.solaris.sparc, photon.qnx.x86, motif.hpux.ia64_32

  8. To the RCP, the Platform adds the following plug-ins: org.eclipse.help.ui org.eclipse.help.appserver org.eclipse.ltk.core.refactoring org.eclipse.ltk.ui.refactoring org.eclipse.platform org.eclipse.platform.doc.user org.eclipse.search org.eclipse.team.core org.eclipse.team.cvs.* org.eclipse.team.ui org.eclipse.tomcat org.eclipse.text org.eclipse.jface.text org.eclipse.ui.console org.eclipse.ui.presentations.r21 Eclipse Platform • org.apache.ant • org.apache.lucene • org.eclipse.ant.core • org.eclipse.compare • org.eclipse.core.boot • org.eclipse.core.filebuffers • org.eclipse.core.resources1 • org.eclipse.core.runtime • org.eclipse.osgi.services • org.eclipse.osgi.util • org.eclipse.core.variables • org.eclipse.debug.core • org.eclipse.debug.ui • org.eclipse.help.webapp • org.eclipse.help.base • org.eclipse.ui.intro • org.eclipse.ui.cheatsheets • org.eclipse.ui.browser • org.eclipse.workbench.texteditor • org.eclipse.ui.views • org.eclipse.ui.forms • org.eclipse.ui.externaltools • org.eclipse.ui.ide • org.eclipse.update.core • org.eclipse.update.scheduler • org.eclipse.update.ui • org.eclipse.workbench1 • org.eclipse.core.resources2 • org.eclipse.ui.* • org.eclipse.update.core.* • Notes: • Provide *.compatibility counterparts for backward compatibility • Provides fragments for: hpux, linux, macosx, qnx, win32

  9. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  10. OSGi • Originally developed for residential applications • Internet gateways for home appliances • Now, used in smart phones, automobiles (BMW 5-series), consumer electronics, and Eclipse • Provides a small layer to allow multiple Java-based components to efficiently cooperate in a single VM • Extensive security model • Dynamic service discovery and usage • Lifecycle support for continuous computing • Install, start, stop, update, and uninstall bundles • Remote management capability • Optional services • Logging, configuration, HTTP, IO, User authentication/authorization, etc. OSGi represents “an abstract attribute label (modifier) for objects associated with the Organization known as ‘the OSGi Alliance,’” but is sometimes referred to as standing for “Open Services Gateway Initiative.”

  11. OSGi in Eclipse • Eclipse “plug-in” is synonymous with OSGi “bundle” • June 2005 draft of OSGi R4.0 framework specification is fully implemented in Eclipse 3.1 • Eclipse 3.0 implemented OSGi R3.0 • Contribution to the Platform by the Equinox technology project • The org.eclipse.osgi plug-in is used to run Eclipse • But, can also be run standalone

  12. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about licensing? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  13. Plug-ins (Bundles) • An encapsulated bit of data and/or functionality that interoperates with other plug-ins in the runtime environment. • Minimally, just a plugin.xml • May contain no Java classes (e.g. documentation plug-in) • Technically, a plug-in.xml file is not required • With no extensions, only a Manifest.mf file is needed • The plugin.xml (and optionally Manifest.mf*) file(s) define(s): • Plug-in name*, version*, and ID* • Dependencies* (other plug-ins or libraries) • Extension-points (what it provides to others) • Extensions (what it uses from others) • Extension-points are core to developing in Eclipse • “Everything is a contribution”

  14. Plug-in Example • Simple plugin.xml • Complemented by OSGi MANIFEST.MF file (next slide) <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.0"?> <plugin> <extension-point id="generated_package" name="%_UI_PackageRegistry_extensionpoint" schema="schema/generated_package.exsd" /> <extension-point id="protocol_parser" name="%_UI_URIProtocolParserRegistry_extensionpoint" schema="schema/protocol_parser.exsd" /> <extension-point id="uri_mapping" name="%_UI_URIMappingRegistry_extensionpoint" schema="schema/uri_mapping.exsd" /> <extension point="org.eclipse.emf.ecore.generated_package"> <package uri="http://www.eclipse.org/emf/2002/Ecore" class="org.eclipse.emf.ecore.EcorePackage" genModel="model/Ecore.genmodel" /> </extension> . . . <extension id="diagnostic" name="%_UI_EMFDiagnostic_marker" point="org.eclipse.core.resources.markers"> <super type="org.eclipse.core.resources.problemmarker" /> <persistent value="true" /> <attribute name="uri" /> </extension> </plugin>

  15. Plug-in Example • Manifest.mf file: Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.ecore; singleton:=true Bundle-Version: 2.1.0 Bundle-ClassPath: . Bundle-Activator: org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.emf.ecore, org.eclipse.emf.ecore.impl, org.eclipse.emf.ecore.plugin, . . . Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.common;visibility:=reexport, org.eclipse.core.resources;resolution:=optional Eclipse-AutoStart: true

  16. Plug-ins • 4 Levels of Dynamicity: • Non-dynamic • May be loaded and unloaded, but potentially with side-effects • Dynamic-aware • Support other plug-ins being dynamic, but themselves may not be dynamically loaded or unloaded • Dynamic-enabled • Support being dynamically loaded and unloaded, but may not support other plug-ins from doing so • Fully dynamic • Plug-in is both dynamic-aware and dynamic-enabled • The Holy Grail and purpose of basing Eclipse on OSGi • Platform is “self healing” with no need to shutdown

  17. Extension-point Schema • Defines the elements and attributes of your extension-points • Used in development of extensions to ensure validity • Provides documentation for your extension-point via XSL:

  18. Fragments • Used to augment plug-in functionality • Typically used for language or maintenance packs • Also used for platform-specific features (OS and window system) • When loaded, fragment libraries, extensions, extension-points are merged with the parent • Think of as “limited plugin-ins” • No lifecycle of their own

  19. Features • Officially, “the smallest unit of separately downloadable and installable functionality.” • The Update Manager works with Features • Essentially, a collection of plug-ins • Can include other Features, in addition to Plug-ins • Some Features can be marked as “optional” • Can import other Features and Plug-ins • Note that “Primary” Feature use is deprecated • Use products extension point instead

  20. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  21. SWT • Standard Widget Toolkit • Source of endless debate re: Swing/AWT • Provides a thin native wrapper of underlying OS user interface API • Widgets look and feel like native UI • No Java emulation, unless native widget doesn’t exist • Toolkit contains common low-level widgets and functionality: • Label, List, Menu, CoolBar, Combo • Drag-n-drop • Browser • Printing • Etc. • Can be used outside of Eclipse

  22. JFace • UI Framework atop SWT • Provides commonly used components: • Viewers • Dialogs • Actions • Preferences • Wizards • Can also be used outside Eclipse

  23. Mascara • A proposed new Technology project • Real project name is “Supplemental Widgets for SWT” • http://www.eclipse.org/proposals/mascara/ • Goal is to provide a broader array of widgets for improved usability and branding • Expandable group widget • Hyperlink widget • Combo widget • Etc. • See examples at http://www.swtplus.com

  24. Mascara

  25. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  26. Getting Help • Help System • Can be run standalone • Can be run as an infocenter • Help index can be prebuilt • Dynamic Help • Context-sensitive help displayed in new Help view • Assigned statically to widgets, or dynamically using context providers • Cheat Sheets • Let’s come back to this one… Note: these 3 systems will be refactored under a common base in 3.2

  27. Globalization • Eclipse Message Bundles • Overcomes inefficient space characteristics in Java ResourceBundles • Simple and generic • Create messages.properties file with corresponding Java class • Set public static Strings on load, purge message.properties • To reference, simply reference the field (no lookup) • Language Packs • Platform and key projects provided by IBM • Does Eclipse need a community-supported project for this? • ICU4J (International Components for Unicode in Java) • Accepted by the Foundation for incorporation into Eclipse • Overcomes Java deficiencies in globalization support • Twice as many (230+) locales as Java, among other enhancements

  28. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  29. Applications • Provides a main entry point to the platform • Gives control of all aspects of execution • Use the –application switch at startup, point to your class • Can be used to run headless Eclipse-based applications • Used by the products extension point • Identifies the application to launch <extension id="coolApplication“ point="org.eclipse.core.runtime.applications"> <application> <run class="com.xyz.applications.Cool"> <parameter name="optimize“ value="true"/> </run> </application> </extension>

  30. Products • Completely declarative (no code), unlike Application • Configure your application for deployment • Select application(s) • Select plug-ins or features • Set branding options • Splash, window icons, About dialog, etc. • Set launcher properties • Executable name, directory name <extension point="org.eclipse.core.runtime.products" id="product"> <product name="%productName" application="org.eclipse.ui.examples.rcp.browser.app"> <property name="windowImages" value="icons/eclipse.gif,icons/eclipse32.gif"/> ...</extension>

  31. Update Manager

  32. Update Manager • Update Site creation • Install, Disable, Enable, Uninstall • Policy files • Platform.xml file • Configurator • Multiple configuration locations allowed • .eclipseextension vs. .eclipseproduct • Command line operability • WebStart (JNLP) • Yoxos

  33. Update Manager • Prefer to install features over archive downloads • Can easily set up local mirror for re-installs • Local mirrors beneficial to entire organization • Policy files for better config management • See command line update manager usage in Help • Can uninstall, unlike unzipping into install directory • Default locations for updates located in platform.xml file • Located in /configuration/org.eclipse.update directory • Customize for your product • Update site lists can be exported for reuse/sharing <config date="1119537273686" transient="false" version="3.0"> <site enabled="true" policy="USER-EXCLUDE" updateable="true" url="platform:/base/"> <feature application="org.eclipse.ui.ide.workbench" id="org.eclipse.platform" primary="true" url="features/org.eclipse.platform_3.0.2/" version="3.0.2"/> <feature id="org.eclipse.platform.source" url="features/org.eclipse.platform.source_3.0.2/" version="3.0.2"/> … </site> </config>

  34. Update Policy • Features you install with Update Manager contain a URL for updates • For example, EMF’s: • If using internal mirror, need to redirect • Define a policy file and point to from preferences or plugin_customization.ini file • Used in conjunction with shared configurations for security • Example policy: <url> <update label="EMF/SDO/XSD Secondary Update Site" url="http://download.eclipse.org/tools/emf/updates/"/> <discovery label="EMF/SDO/XSD Secondary Update Site" url="http://download.eclipse.org/tools/emf/updates/"/> </url> <?xml version="1.0" encoding="UTF-8"?> <update-policy> <url-map pattern="org.eclipse" url="URL1"/> <url-map pattern="org.eclipse.jdt" url="URL2"/> </update-policy>

  35. Update Manager • Options • Policies

  36. Update Manager • Automation

  37. Product Configuration • View configurations, disable, uninstall, view history, etc.

  38. Multi-user Installations • There are 3 locations to understand: • Install area • Where Eclipse platform is installed • Can be read-only and shared • Configuration area • Where metadata and cached data is stored • Holds data that spans workspaces • Can be made read-only after initialization • Instance area (a.k.a. workspace) • Where user data is maintained • Contains a .metadata directory for plug-in data • All information relative to the workspace

  39. Multi-user Installations • Installation scenarios • Private install • Actually a single-user installation (need full access rights to dir) • Configuration maintained under eclipse root • Shared install • Install directory shared among many users • Config directory in base install used only for original config.ini • Never initialized • Each user has a local configuration directory • Shared configuration • Users share base install and a read-only configuration (initialized) • Users maintain a cascaded local configuration at • <user-home-dir>/.eclipse/<product-id>_<product-version>/configuration • Can be overidden in launcher.ini or osgi.configuration.area system property

  40. Agenda • Delivered in FAQ* format: • What is the Eclipse Rich Client Platform (RCP)? • What is this OSGi thing? Why do I care? • What is a plug-in? What is a feature? What is a fragment? • What is SWT? What is JFace? • What about help, globalization, etc.? • How do I manage and configure my RCP application? • How do I improve the usability of my RCP application? • OK, “got it”… now, how do I get started? • What about working with resources and data? • What is there besides SWT and JFace? • What does the future hold for RCP?

  41. Improving Usability • Perspectives • Look and Feel • Incrementality • Natures and Builders • Feedback • Decorators • Markers • Capabilities (a.k.a. Activities) • Contexts • Key mappings • Mylar

  42. Perspectives • Creating a custom perspective • Start with one that is close • Open/Close views and arrange as you’d like • Window  Customize Perspective… • Make selections on what you want to appear in New, Open Perspective, and Show View menus • Select what you want to appear on Menus and Toolbar • Window  Save Perspective As… • Reset any perspective with Window  Reset Perspective • Defines the initial set and layout of Views • Control what appears on certain menus and toolbars

  43. Perspectives Standard “Plug-in Development” Perspective (with contributions from other projects!) Custom “My Plug-in Development” Perspective

  44. Look and Feel • Within the preferences dialog, you will find this page:

  45. Look and Feel • Two main APIs for dealing with appearance: • Presentations API • Determines the overall look and feel of the workbench • Including how views and editors are presented • Themes API • Allows for the definition of color and font entities • Themes can override the defaults <extension point="org.eclipse.ui.presentationFactories"> <factory class="org.eclipse.ui.workbench.ExampleWorkbenchPresentationFactory"/> </extension> <theme id="com.xyz.HarshTheme“ label="Harsh Colors for XYZ"> <colorOverride id="com.xyz.Forground“ value="COLOR_CYAN"/> <colorOverride id="com.xyz.Background“ value="COLOR_MAGENTA"/> <data name="com.xyz.EditorMarginWidth“ value="1"/> </theme>

  46. Natures • Natures • Associate lifecycle behavior with a project • e.g. Java nature, modeling nature, etc. • Specifies associated incremental project builders (if any) <extension id="snowNature“ name="Snow Nature“ point="org.eclipse.core.resources.natures“> <runtime> <run class="com.xyz.natures.Snow"> <parameter name="installBuilder“ value="true"/> </run> </runtime> <requires-nature id="com.xyz.coolplugin.waterNature"/> <builder id="com.xyz.snowMaker"/> </extension>

  47. Builders • Builders • Process a set of changes incrementally using change deltas • e.g. Java compiler in JDT… no need to explicitly build • Eliminates (or reduces) time spent waiting for batch processes • Unobtrusive feedback of state typically through markers and decorators <extension id="coolbuilder“ name="Cool Builder“ point="org.eclipse.core.resources.builders"> <builder hasNature="false“> <run class="com.xyz.builders.Cool"> <parameter name="optimize“ value="true"/> <parameter name="comment“ value="Produced by the Cool Builder"/> </run> </builder> </extension>

  48. Decorators and Markers • Decorators • Used to annotate view elements with user information • Can be icons, or textual • Markers • Used to tag resources with user information

  49. Usability • Activities • Activities are intended to be leveraged by integrators • Perspectives are explicit, Activities can be implicit • Activities offer a higher level of organization • Begin with minimal UI • Use Welcome screen to determine what is active based on role or anticipated tasks • Enable Activities using trigger points to expose functionality • Note that “Activities” are referred to as “Capabilities” in the UI

  50. Activities • Activities can change the displayed list of available Perspectives and Views • Note difference after deselecting Development and Team • Note the new “Show all” checkbox • This is better… but still not there, as TPTP and others have not leveraged Activities

More Related