没有合适的资源?快使用搜索试试~ 我知道了~
首页eclipse e4 教程
eclipse e4 教程
1星 需积分: 9 19 下载量 39 浏览量
更新于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币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 基于嵌入式ARMLinux的播放器的设计与实现 word格式.doc
- 经典:大学答辩通过_基于ARM微处理器的嵌入式指纹识别系统设计.pdf
- 嵌入式系统课程设计.doc
- 基于飞思卡尔控制器的智能寻迹车设计ARM基础课程课程设计.doc
- 下载基于ARM7的压电陶瓷换能器导纳圆测量仪的研制PDF格式可编辑.pdf
- 课程设计基于ARM的嵌入式家居监控系统的研究与设计.doc
- 论文基于嵌入式ARM的图像采集处理系统设计.doc
- 嵌入式基于ARM9的中断驱动程序设计—课程设计.doc
- 在Linux系统下基于ARM嵌入式的俄罗斯方块.doc
- STK-MirrorStore Product Release Notes(96130)-44
- STK-MirrorStore Storage Connectivity Guide for StorageTek Disk A
- 龙虾养殖远程监控系统的设计与实现数据采集上位-机软件模块-本科毕业设计.doc
- 龙虾养殖远程监控系统的设计与实现数据采集上位-机软件模块-.doc
- 龙虾养殖远程监控系统的设计与实现数据采集上位-机软件模块-本科生毕业论文.doc
- 麻阳风貌展示网站的设计与实现毕业论文.pdf
- 高速走丝气中电火花线切割精加工编程设计.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功