2, RCP Getting Started
(1) Steps to implement RCP applications
l Logo extension point
l Define the Plugin list file
l Implementation
l Definition perspective
l Define the WorkbenChadvisor class
l Defining the Application class
l Export application
(2) Creating a project
l File> New> Plug-in Project
l Enter the project name Google, keep other default values, click Next
l Type com.xqtu.google.googleplugin in the Class Name field
l Click Finish to complete the project creation
(3) Understand plug-in list
l Eclipse generates an item, there will be a lot of related files, where the most important thing is plugin list file plugin.xml
l Plugin.xml is located on the root directory of the project, which is responsible for defining the resource, dependency and extension of the Eclipse runtime environment.
l Eclipse provides a plug-in list editor, and each tab at the bottom provides an easy way to access and operate the plugin.xml specific part.
l The source file of Plugin.xml is displayed, the content of the plug-in list of the wizard initially generated is as follows
XML Version = "1.0" encoding = "UTF-8"?>
Eclipse Version = "3.0"?>
ID = "Google" Name = "Google Plug-in" Version = "1.0.0" Provider-name = "Nelson_tu" Class = "com.xqtu.google.googleplugin"> library> runtime> requires> plugin> l l id: Insert unique identifier; in order to reduce naming conflicts, it should be obtained from the plug-in author's Internet domain name, and its naming agreement and Java naming agreement are consistent, such as class package. l Name: Plugin General Name l Version - Plug-in version, format is Major.minor.Service l Provider-name: Plugin author l Class - Plug-in full path; although the plugin class is defined, the RCP application does not use this class when executed. l l l l (4) Understanding expansion l Eclipse platform provides high scalability using relatively small operating environment and its exquisite plug-in architecture l Add new features to the running environment by using plugins l Each plugin can contain any number of expansions using extended points L, the plugin can also define your own set of extensions so that other developers can use in their plug-in or RCP applications. l In this example, we have to define two extensions. XML Version = "1.0" encoding = "UTF-8"?> Eclipse Version = "3.0"?> ID = "Google" Name = "Google Plug-in" Version = "1.0.0" Provider-name = "Nelson_tu" Class = "com.xqtu.google.googleplugin"> library> runtime> requires> ID = "GoogleApplication" Point = "org.eclipse.core.runtime.Applications"> application> extension> Point = "Org.eclipse.ui.Perspectives"> Class = "com.xqtu.google.googlePerspective" Name = "Google" ID = "com.xqtu.google.googlePerspective" /> extension> plugin> l Define the first extension through org.eclixse.core.runtime.Applications, declare the entry point for the RCP application; ID attribute identifies the application l l Define the second extension through org.eclipse.ui.Perspectives, which defines a perspective of the RCP to the General Table l l