没有合适的资源?快使用搜索试试~ 我知道了~
首页eclipse e4 教程
eclipse e4 教程
1星 需积分: 9 19 下载量 108 浏览量
更新于2023-03-16
1
收藏 813KB PDF 举报
eclipse e4 教程 介绍eclipse 4 模型,以及如何从Eclipse 3.x 迁移到eclipse 4
资源详情
资源推荐
Eclipse4(e4)Tutorial
TableofContents
1. Thee4ApplicationModel
2. ImplementingViews
3. ExtendingtheApplicationModel
4. DependencyInjectionBasics
5. BehaviorAnnotations
6. Services
7. Eclipse3.xvs.Eclipse4WhichPlatformtouse?
8. Softmigrationfrom3.xtoEclipse4(e4)
©2016Dres.JonasHelmingandMaximilianKögelEclipseSourceMunich 1/54
Thee4ApplicationModel
This tutorial series introduces the new concepts in the Eclipse 4 Application Platform, aka RCP
2.0. While some projects still use the compatibility layer, it is worthwhile to look at and benefit
from the new concepts. This tutorial and all other parts of the series are available as a
downloadablePDF.
We will start with the foundation of every Eclipse 4 application, the application model. In this first
part, we give an overview of the most important elements of this model to define the layout of
yourapplication.Subsequently,wetointroducethedifferentoptionsformodifyingthismodel.
ApplicationModelvs.Views
In Eclipse 4, the workbench is defined in the socalled Application Model. This includes
windows, views, perspectives, menu contributions, handlers and key bindings. Using the model
you define the general design or “skeleton” of your application. Defining a model doesn’t already
require that you implement the single components. For example, you can add a view to the
modelwithoutimplementingitscontents.
To show the resulting separation between the general workbench design and the
implementation of single parts, I will not show any SWT or JavaFX code in this section. Instead,
we’llfocusonthemodelandhowtoconnectthemodeltocode.
Windows,PartsandPartContainers
The cornerstones of the application model are windows, parts and part containers. Contrary to
the eclipse 3.x platform, e4 has combined views and editors into the concept of Parts, which
represent views inside a window. If you add a part in the model, you can later connect it to your
implementationoftheselectedview.
©2016Dres.JonasHelmingandMaximilianKögelEclipseSourceMunich 2/54
Thepartsofanapplicationmodelareconnectedlatertotheirimplementations
As parts cannot exist on their own, they are always contained in PartContainers. Those
PartContainers create an application layout. Besides windows, there are two elements which
can contain Parts: PartSashes and PartStacks. A PartSash will arrange contained elements
either vertically or horizontally. A PartStack adds an area, where the contained elements are
stacked behind each other, only one element is shown on top. PartSash and PartStack can
contain each other to create any kind of layout within a window. The following example shows
an example layout. The left side shows the respective Application Model, the right side the
rendered result. The first PartStack is set to “horizontal” orientation, the second one to “vertical”.
Please note, that part 5 would actually not be visible, if parts are not contained in PartStacks,
their label is not shown. For the example, we added an implementation for part 5, which shows
a label to make it identifiable in the screenshot. All other parts do not have any implementation,
yet, so you can design your application without already thinking about the contents of views. In
the following section, we describe how to create a first application model using Windows,
PartsSashes,PartStacksandParts,only.
©2016Dres.JonasHelmingandMaximilianKögelEclipseSourceMunich 3/54
Installation
The most convenient way to modify an Application Model is the e4 Model Editor, which will be
described in the following. Starting from Mars, it is already part of some Eclipse Packages
(Eclipse for RCP Developers, Eclipse Modeling Tools and Eclipse for Committers). For carrying
on with the tasks from this tutorial, we recommend you to download the latest version of “Eclipse
forRCPdevelopers”fromhere:https://eclipse.org/downloads/.
Creatingane4Application
The easiest way to get started is to use a template to create a new e4 application. This will
create a bundle containing all necessary artefacts for an Eclipse 4 Application including the
Application Model. To create such a project, choose the "Eclipse 4 Application Project" entry
within the "New Project" wizard. Give a name to your project on the first page of the wizard and
select the “Create sample content” checkbox on the last page. This option will already fill the
templateApplicationModelwithsomeelements.
©2016Dres.JonasHelmingandMaximilianKögelEclipseSourceMunich 4/54
Before we have a look at the Application Model, we will start the template application once. For
this purpose, the template wizard creates a product definition and you can start the application
simply by starting this product. To do so, open the *.product file and click on run or debug in the
upperrightcorneroftheeditor.
Clickheretostarttheproduct.
As you can see below, the generated template application already contains a window, two
menus, a toolbar and a PartStack and a Part within it. In fact, the model also already contains a
PerspectiveStackandaperspective,butthisiscurrentlynotvisible.
©2016Dres.JonasHelmingandMaximilianKögelEclipseSourceMunich 5/54
剩余53页未读,继续阅读
SACKings
- 粉丝: 2
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 保险服务门店新年工作计划PPT.pptx
- 车辆安全工作计划PPT.pptx
- ipqc工作总结PPT.pptx
- 车间员工上半年工作总结PPT.pptx
- 保险公司员工的工作总结PPT.pptx
- 报价工作总结PPT.pptx
- 冲压车间实习工作总结PPT.pptx
- ktv周工作总结PPT.pptx
- 保育院总务工作计划PPT.pptx
- xx年度现代教育技术工作总结PPT.pptx
- 出纳的年终总结PPT.pptx
- 贝贝班班级工作计划PPT.pptx
- 变电值班员技术个人工作总结PPT.pptx
- 大学生读书活动策划书PPT.pptx
- 财务出纳月工作总结PPT.pptx
- 大学生“三支一扶”服务期满工作总结(2)PPT.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功