[b]创建插件项目[/b]
打开Eclipse并选择File->New->Project->Plug-in Project,Project name填"org.eclipse.ui.tutorials.rcp.helloworld",然后Next,对于"Would you like
to create a rich client application?"选择Yes,然后Next,Template选择Hello RCP,然后Next,然后Finish。
这时Eclipse会创建一些文件并打开MANIFEST.MF:
[img]http://www.eclipse.org/articles/Article-RCP-1/images/part1project_cs.png[/img]
点击该文件的Overview页面的Testing中的Launch an Eclipse application,你应该会看到如下PDE默认配置的启动:
[img]http://www.eclipse.org/articles/Article-RCP-1/images/part1_s.png[/img]
[b]配置该项目[/b]
在项目名上右键点击->New->Product Configuration,File name填"helloworld.product",然后Finish。
这时Eclipse创建并打开Product Configuration来让你控制你的产品并入插件和其他资源。
在Overview页面里,Product Name填"helloworld",Product ID选择"org.eclipse.ui.tutorials.rcp.helloworld.product",Application选择"org.eclipse.ui.
tutorials.rcp.helloworld.application"
然后点击Configuratin tab,点击Add,选择你刚才创建的插件org.eclipse.ui.tutorials.rcp.helloworld,然后点击Add Required Plug-ins,然后保存文件。
回到Overview页面,点击Launch the product,程序会像前面一样启动。
[b]在Eclipse外运行它[/b]
点击Product Configuration的Overview tab的Exporting中的Eclipse Product export wizard,Root directory填"helloworld",Directory填D:\deploy,然后
Finish,则会生成以下结构:
[code]
helloworld
| .eclipseproduct
| eclipse.exe
| startup.jar
+--- configuration
| config.ini
+--- plugins
org.eclipse.core.commands_3.1.0.jar
org.eclipse.core.expressions_3.1.0.jar
org.eclipse.core.runtime_3.1.2.jar
org.eclipse.help_3.1.0.jar
org.eclipse.jface_3.1.1.jar
org.eclipse.osgi_3.1.2.jar
org.eclipse.swt.win32.win32.x86_3.1.2.jar
org.eclipse.swt_3.1.0.jar
org.eclipse.ui.tutorials.rcp.helloworld_1.0.0.jar
org.eclipse.ui.workbench_3.1.2.jar
org.eclipse.ui_3.1.2.jar
[/code]
运行eclipse.exe即可看到helloworld程序成功启动,你也可以将eclipse.exe改为helloworld.exe。
打开Eclipse并选择File->New->Project->Plug-in Project,Project name填"org.eclipse.ui.tutorials.rcp.helloworld",然后Next,对于"Would you like
to create a rich client application?"选择Yes,然后Next,Template选择Hello RCP,然后Next,然后Finish。
这时Eclipse会创建一些文件并打开MANIFEST.MF:
[img]http://www.eclipse.org/articles/Article-RCP-1/images/part1project_cs.png[/img]
点击该文件的Overview页面的Testing中的Launch an Eclipse application,你应该会看到如下PDE默认配置的启动:
[img]http://www.eclipse.org/articles/Article-RCP-1/images/part1_s.png[/img]
[b]配置该项目[/b]
在项目名上右键点击->New->Product Configuration,File name填"helloworld.product",然后Finish。
这时Eclipse创建并打开Product Configuration来让你控制你的产品并入插件和其他资源。
在Overview页面里,Product Name填"helloworld",Product ID选择"org.eclipse.ui.tutorials.rcp.helloworld.product",Application选择"org.eclipse.ui.
tutorials.rcp.helloworld.application"
然后点击Configuratin tab,点击Add,选择你刚才创建的插件org.eclipse.ui.tutorials.rcp.helloworld,然后点击Add Required Plug-ins,然后保存文件。
回到Overview页面,点击Launch the product,程序会像前面一样启动。
[b]在Eclipse外运行它[/b]
点击Product Configuration的Overview tab的Exporting中的Eclipse Product export wizard,Root directory填"helloworld",Directory填D:\deploy,然后
Finish,则会生成以下结构:
[code]
helloworld
| .eclipseproduct
| eclipse.exe
| startup.jar
+--- configuration
| config.ini
+--- plugins
org.eclipse.core.commands_3.1.0.jar
org.eclipse.core.expressions_3.1.0.jar
org.eclipse.core.runtime_3.1.2.jar
org.eclipse.help_3.1.0.jar
org.eclipse.jface_3.1.1.jar
org.eclipse.osgi_3.1.2.jar
org.eclipse.swt.win32.win32.x86_3.1.2.jar
org.eclipse.swt_3.1.0.jar
org.eclipse.ui.tutorials.rcp.helloworld_1.0.0.jar
org.eclipse.ui.workbench_3.1.2.jar
org.eclipse.ui_3.1.2.jar
[/code]
运行eclipse.exe即可看到helloworld程序成功启动,你也可以将eclipse.exe改为helloworld.exe。