Beruflich Dokumente
Kultur Dokumente
Eclipse RCP - 2 of 71
Agenda
Introductions Motivation for Rich Client Platforms Architecture of Eclipse Rich Client Platform Dive into core components RCP specific issues This is not a step by step tutorial
http://www.google.com/search?q=Eclipse+RCP +Tutorial
Eclipse RCP - 3 of 71
Eclipse RCP - 4 of 71
Eclipse RCP - 5 of 71
Eclipse RCP - 6 of 71
Application with extensive use of windows, GUI and other features of an OS Widgets, Drag Drop, Platform look and feel Housekeeping functions
Eclipse RCP - 7 of 71
Eclipse RCP - 8 of 71
Possible Architectures
Rich Client Control View
Data and Logic
1 Tier
Local Data
ok
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 9 of 71
Possible Architectures
Rich Client Control View
Data and Logic
1 Tier
Local Data
ok
2 Tier
- mail clients - p2p applications
Remote Data
ok
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 10 of 71
Possible Architectures
Rich Client Control View
Data and Logic
1 Tier
Local Data
ok
2 Tier
- mail clients - p2p applications
Remote Data
ok
3 Tier
Rich Client Control View
web services, IIOP,
- browser
ok
Remote Data
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 11 of 71
Combination of Architectures
ok
Remote Data
Local Data
Remote Data
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 12 of 71
Combination of Architectures
ok
Remote Data
Local Data
Remote Data
Multi-tier architectures
- Outlook - Lotus Notes - Eclipse IDE
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 13 of 71
Eclipse RCP - 14 of 71
Much more than a rich client platform. But there is indeed an underlying platform
Eclipse RCP - 15 of 71
Native look and feel W indow management Standardized component model (Equinox)
Help system
State
of the art development tools Middleware for building rich client applications! Other Rcps
Netbeans, Spring Framework for Java Other Rcps: QT Toolkit for c++ (and also some form for java)
Eclipse RCP - 16 of 71
Use Plain old Java, Swing, VB, MFC etc. Assembly language..!!
Source on wikipedia
Eclipse RCP - 17 of 71
Use Plain old Java, Swing, VB, MFC etc. Assembly language..!!
Source on wikipedia
Eclipse RCP - 18 of 71
Use Plain old Java, Swing, VB, MFC etc. Assembly language..!!
Source on wikipedia
Eclipse RCP - 19 of 71
Use Plain old Java, Swing, VB, MFC etc. Assembly language..!!
Source on wikipedia
Eclipse RCP - 20 of 71
Use Plain old Java, Swing, VB, MFC etc. Assembly language..!!
Source on wikipedia
Eclipse RCP - 21 of 71
Because you dont want to build the Rocket, You want to focus on the payload..!!
Read: Foreword by Jeff Norris To the RCP Book by Jeff McAffer, and Jean-Michel
Eclipse RCP - 22 of 71
The minimal set of plug-ins needed to build a rich client application is collectively known as the Rich Client Platform
org.eclipse.ui org.eclipse.core.runtime
(prerequisites of above)
Eclipse RCP - 23 of 71
Eclipse RCP - 24 of 71
RCP Architecture
Plug-ins/Bundles Services
Widgets
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 25 of 71
Eclipse RCP - 26 of 71
Eclipse RCP - 27 of 71
Eclipse RCP - 28 of 71
Eclipse Runtime - Plug-in Model - Preferences - Scheduling - Core services OSGI Platform - Component model - Eclipse Adaptors - Registry Framework
Eclipse RCP - 29 of 71
Eclipse Runtime - Plug-in Model - Preferences - Scheduling - Core services OSGI Platform - Component model - Eclipse Adaptors - Registry Framework
Eclipse RCP - 30 of 71
Eclipse RCP - 31 of 71
Eclipse RCP - 32 of 71
Must have
Core Java Knowledge Understanding of eclipse plug-in architecture Basics of plug-in development A decent pc and a will to explore
Nice to have
Fluency with SWT/JFace Previous experience with eclipse runtime A good command on design patterns MVC, Interfaces, Abstractions .
Eclipse RCP - 33 of 71
Tools
JRE preferably 1.5+ Eclipse IDE Preferably latest A browser and a good internet connection (so u can have tutorials/articles at your disposal)
Eclipse RCP - 34 of 71
Create components
plug-ins of course.!! so eclipse platform can invoke your code on launch window layout, size, look and feel
3.
Provide branding information Create deployable for distribution Wait for user action to execute your RCP and trigger your application code
Anshu Jain IBM India Research Lab
Eclipse RCP - 35 of 71
Based on OSGi modules for the Java platform Dynamic and flexible Loose coupling of Java modules OSGi Bundles (Eclipse Plug-ins) Eclipse Features Important for Development and deployment lifecycle Enable multiple branding Enable product lines Ease of deployments and updates
Eclipse RCP - 36 of 71
Bundle Size Grouping of logical functionality Monolithic vs. Smaller granular bundles What goes into what features
Eclipse RCP - 37 of 71
org.eclipse.core.runtime.applications
Eclipse RCP - 38 of 71
org.eclipse.core.runtime.applications
Eclipse RCP - 39 of 71
IApplication
Eclipse RCP - 40 of 71
IApplication
Eclipse RCP - 41 of 71
Eclipse RCP - 42 of 71
public Object start(IApplicationContext context) { Display display = PlatformUI.createDisplay(); try { int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); if (returnCode == PlatformUI.RETURN_RESTART) { return IApplication.EXIT_RESTART; } return IApplication.EXIT_OK; } finally { display.dispose(); } }
Eclipse RCP - 43 of 71
public Object start(IApplicationContext context) { Display display = PlatformUI.createDisplay(); try { int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); if (returnCode == PlatformUI.RETURN_RESTART) { return IApplication.EXIT_RESTART; } return IApplication.EXIT_OK; Extends: - WorkbenchAdvisor } finally { Starting point to set up main workbench display.dispose(); window info - perspective info } - actions } - menubar
Eclipse RCP - 44 of 71
Source: Eclipse Con 2006 - RCP Tutorial - Jean-Michel Lemieux and Jeff McAffer
Eclipse RCP - 45 of 71
My product name My product icons My splash images My about info Launcher name Title bar label .on and on
Eclipse RCP - 46 of 71
Product Configuration
Extension point
Eclipse RCP - 47 of 71
Product Configuration
Extension point
Eclipse RCP - 48 of 71
Eclipse RCP - 49 of 71
Eclipse RCP - 50 of 71
Eclipse RCP - 51 of 71
Eclipse RCP - 52 of 71
Eclipse RCP - 53 of 71
Eclipse RCP - 54 of 71
Launch arguments
Eclipse RCP - 55 of 71
Launch arguments
Eclipse RCP - 56 of 71
Eclipse RCP - 57 of 71
Eclipse RCP - 58 of 71
Task 5: Packaging
Transformation
Development form Deployment form W orkspace projects Built JARs Stand-alone, runnable application in directory or archive Update site features and plug-ins JNLP/W ebStart application
For example
Possible outputs
Installers (e.g., InstallShield) not directly supported Eclipse IDE provides wizard for all the above
Eclipse RCP - 59 of 71
Sign jars to avoid unauthorized updates Signing jars imperative to run webstart with all security permissions on JVM IDE has out of the box support for signing jars Nice tool for keystore and certificate mgmt
Eclipse RCP - 60 of 71
Update Management
org.eclipse.update.core org.eclipse.update.ui
Setup features properly All base plug-ins which are not written by you go in one feature e.g.
<yourdomain>.eclipse.base.feature
yourdomain.eclipse.yourapplication.feature
Setup an update site using eclipses update site project. Build features into update site
Eclipse RCP - 61 of 71
Update Management
ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell( display, SWT.NONE)); dialog.run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { UpdateCommand command = new UpdateCommand( <yourdomain>.eclipse.<yourfeature>,name", "false"); command.run(monitor); } });
Snippet Link
Eclipse RCP - 62 of 71
Update Management
ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell( display, SWT.NONE)); dialog.run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { UpdateCommand command = new UpdateCommand( <yourdomain>.eclipse.<yourfeature>,name", "false"); command.run(monitor); } }); May not work in debug mode.
Snippet Link
Eclipse RCP - 63 of 71
Update Management
ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell( display, SWT.NONE)); dialog.run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { UpdateCommand command = new UpdateCommand( <yourdomain>.eclipse.<yourfeature>,name", "false"); command.run(monitor); } }); May not work in debug mode. New Update architecture based on Equinox P2 Provisioning System is available
Snippet Link
Eclipse RCP - 64 of 71
Update Management
ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell( display, SWT.NONE)); dialog.run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { UpdateCommand command = new UpdateCommand( <yourdomain>.eclipse.<yourfeature>,name", "false"); command.run(monitor); } }); May not work in debug mode. New Update architecture based on Equinox P2 Provisioning System is available
Snippet Link
Eclipse RCP - 65 of 71
Update Management
ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell( display, SWT.NONE)); dialog.run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { UpdateCommand command = new UpdateCommand( <yourdomain>.eclipse.<yourfeature>,name", "false"); command.run(monitor); } }); May not work in debug mode. New Update architecture based on Equinox P2 Provisioning System is available IMHO: Inno Setup, Installshield are also possible options
Snippet Link
Eclipse RCP - 66 of 71
Eclipse RCP - 67 of 71
Help
Very straightforward, like in eclipse IDE Article on using help with RCP Needs
Eclipse RCP - 68 of 71
Closing thoughts
In theory, there is no difference between theory and practice. But, in practice, there is
Eclipse RCP - 69 of 71
Official Eclipse RCP FAQs Eclipse RCP How-to Eclipse Con 2005 Tutorial Eclipse platform whitepaper Eclipse plug-in architecture article For advanced users > Advanced RCP Presentation
Eclipse RCP - 70 of 71
Recommended Reading
By Erich Gamma, Kent Beck Addison-Wesley Professional ISBN: 0321205758 By Jeff McAffer and Jean-Michel Lemieux Addison-Wesley Professional ISBN: 0321334612 By Steve Northover, Mike Wilson Addison-Wesley Professional ISBN: 0321256638
Eclipse RCP - 71 of 71
Thank you
Anshu Jain Technical Staff Member, IBM India Research Lab, Bangalore anshu.jain@in.ibm.com | anshu.n.jain@gmail.com