Introduction to the Eclipse RCP This presentation is an introduction to creating applications using the Eclipse Rich Cli...
33 downloads
930 Views
689KB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Introduction to the Eclipse RCP This presentation is an introduction to creating applications using the Eclipse Rich Client Platform (RCP).
Kevin P. Taylor Focus on Java java.about.com September 2005
Who am I? ●
●
● ●
Java developer since 2000. C/C++ developer for several years before that. Currently in the middle of an 18-month Eclipse RCP project. Editor of Focus on Java, java.about.com. President of Obtiva Corporation, a training and consulting company, www.obtiva.com.
What is Eclipse? ●
Eclipse is a Java IDE.
●
Eclipse is an application platform.
●
Eclipse was donated to the Eclipse Foundation by IBM in 2004.
Eclipse Applications ●
●
●
SWT application – Similar to JFC/Swing applications. – Cannot use the Eclipse Workbench/RCP. Eclipse plug-in – Can uses the full Workbench/RCP. – Must be deployed within an RCP application. Eclipse RCP application – Bundles many plug-ins. – Is deployed as a standalone application.
Plug-ins are Components ●
● ●
Each plug-in represents a bundling of some welldefined functionality that may or may not extend another plug-in's functionality. A plug-in can be either UI- or non-UI- based. Each plug-in is defined by its own plugin.xml file and lives in its own subdirectory or jar file.
plugin.xml
RCP Architecture
Eclipse Widgets ●
SWT –
●
JFace –
●
Low-level widgets such as buttons, labels, spinners, tables. Provide an object-oriented framework around some SWT widgets such as tables and dialogs.
Workbench UI – –
Views, editors, perspectives. Only available via RCP.
Workbench Geography Menu Bar Toolbar View Toolbar View Menu Editors
Views Status Bar
Perspectives
Actions and Events ●
●
SWT widgets fire events, such as SelectionEvent and FocusEvent. JFace introduces actions. –
Actions can be fired by buttons, toolbars, and menus.
–
Actions simplify event handling by allowing more than one widget to fire the same action.
Define an Action ●
●
Define an action in either code or plugin.xml. actionSets group actions.
Creating a Plug-in ●
Create a new plug-in project.
Choose Plug-in Name ●
Choose plug-in name, “Hello Java Users”.
Plug-in Content ●
Choose not to create a Rich Client Application.
Choose Plug-in Template ●
We'll use a template that creates a menu item and action.
Configure Action ●
We'll have an action named SimpleAction that displays a message.
Plug-in Directory Structure ●
The wizard will create the following directory structure for a plug-in.
Review Generated Code
Review source code in Hello Java Users project.
Deploy to Eclipse IDE ●
Steps to deploy a plug-in: – – –
Export plug-in to a jar file. Drag jar file to Eclipse IDE's plugins directory. Restart Eclipse IDE.
Creating an RCP Application ●
Create a new plug-in project.
Name Plug-in Project ●
●
Choose a name, “Hello World”. Choose a project directory.
Define Plug-in Content ●
Choose to create a rich client application.
Create a Minimal RCP Application ●
Choose the “Hello RCP” minimal application.
Define the Application ●
●
Define the Window Title, “Hello World”. Click Finish.
RCP Directory Structure ●
The wizard will create the following directory structure for an RCP application.
Review Application Code
Review generated application code in the Hello World project.
Create a Product ●
Products are branded applications. – Create a Hello World product. – Bundle in Hello Java Users plug-in. – Configure Branding options: Program Launcher ● Splash Screen ● Window Images ● About Dialog ●
Pros and Cons of RCP ●
Pros – – –
“Free” powerful Workbench UI. Plug-in architecture. Advanced features such as help, update manager, preferences, problem markers, etc.
●
Cons – – –
Steeper learning curve. Memory-intensive. Larger deployment packages.
References ●
Books – –
●
“Eclipse: Building Commercial-Quality Plug-ins,” Clayberg and Rubel. “SWT/JFace in Action,” Scarpino, Holder, Ng, and Mihalkovic.
Websites –
Eclipse Foundation, www.eclipse.org.
–
Eclipse User Interface Guidelines, www.eclipse.org/articles/Article-UIGuidelines/Contents.html