P+F AS-I 模块怎么在step7硬件组态中组态

西门子SM327模块6ES-0AB0-供求商机-西门子代理商(中国)有限公司
扫一扫访问手机站
西门子代理商(中国)有限公司
主营产品: 西门子变频器,西门子电缆,西门子软启动器,西门子PLC模块
您现在的位置: & & 西门子SM327模块6ES-0AB0
西门子代理商(中国)有限公司
上海市松江区思贤路1855弄91号
[供应]西门子SM327模块6ES-0AB0
最小起订量:
供货总量:
货物所在地:
发布时间:
已获点击:
【简单介绍】西门子SM327模块6ES-0AB0凡在公司采购西门子产品,均可质保一年,假一罚十联系电话:《吴工》花30秒询价,你会知道什么叫优势;花60秒咨询,你会知道什么叫服务;合作一次,你会知道什么叫质量!以质量求生存,以信誉求发展。我司将提供一流的质量,服务作为自已最重要的责任。
【详细说明】
西门子SM327模块6ES-0AB0西门子SM327模块6ES-0AB0 公司代理销售西门子的产品有:1、 SIMATIC S7 系列PLC、S7200、s71200、S7300、S7400、ET2002、 逻辑控制模块 LOGO!230RC、230RCO、230RCL、24RC、24RCL等3、 SITOP 系列直流电源 24V DC 1.3A、2.5A、3A、5A、10A、20A、40A4、HMI 触摸屏TD200 TD400C TP177,MP277 MP377 SMART700 SMART1000 我们在价格上有较大优势,更注重售后服务,现有大量现货销售,欢迎您来电咨询。我公司所有销售中产品均为西门子原装正品,质保一年,假一罚百! —————————————————————————————- 联系人:吴锦涛(吴工) 24小时销售技术服务热线 :
电话(Tel):021- 传真(Fax):021- 在线(QQ) : 地址(Add):上海市松江区思贤路1855弄91号 —————————————————————————————-
20个不同的CPU:7种标准型CPU(CPU&312,CPU&314,CPU&315-2 DP,CPU&315-2 PN/DP,CPU&317-2 DP,CPU 317-2 PN/DP,CPU&319-3 PN/DP)6 个紧凑型 CPU(带有集成技术功能和 I/O)(CPU 312C、CPU 313C、CPU 313C-2 PtP、CPU 313C-2 DP、CPU 314C-2 PtP、CPU 314C-2 DP)5 个故障安全型 CPU(CPU 315F-2 DP、CPU 315F-2 PN/DP、CPU 317F-2 DP、CPU 317F-2 PN/DP、CPU 319F-3 PN/DP)2种技术型CPU(CPU 315T-2 DP, CPU&317T-2 DP)18种CPU可在-25°C 至 +60°C的扩展的环境温度范围中使用具有不同的性能等级,满足不同的应用领域。Area of applicationSIMATIC S7-300 提供多种性能等级的 CPU。除了标准型 CPU 外,还提供紧凑型 CPU。同时还提供技术功能型 CPU 和故障安全型 CPU。下列标准型CPU&可以提供:CPU 312,用于小型工厂CPU 314,用于对程序量和指令处理速率有额外要求的工厂CPU 315-2 DP,用于具有中/大规模的程序量以及使用PROFIBUS DP进行分布式组态的工厂CPU 315-2 PN/DP,用于具有中/大规模的程序量以及使用PROFIBUS DP和PROFINET IO进行分布式组态的工厂,在PROFInet上实现基于组件的自动化中实现分布式智能系统CPU 317-2 DP,用于具有大容量程序量以及使用PROFIBUS DP进行分布式组态的工厂CPU 317-2 PN/DP,用于具有大容量程序量以及使用PROFIBUS DP和PROFINET IO进行分布式组态的工厂,在PROFInet上实现基于组件的自动化中实现分布式智能系统CPU 319-3 PN/DP,用于具有极大容量程序量何组网能力以及使用PROFIBUS DP和PROFINET IO进行分布式组态的工厂,在PROFInet上实现基于组件的自动化中实现分布式智能系统下列紧凑型CPU&可以提供:CPU 312C,具有集成数字量 I/O 以及集成计数器功能的紧凑型 CPUCPU 313C,具有集成数字量和模拟量 I/O 的紧凑型 CPUCPU 313C-2 PtP,具有集成数字量 I/O 、2个串口和集成计数器功能的紧凑型 CPUCPU 313C-2 DP,具有集成数字量 I/O 、PROFIBUS DP 接口和集成计数器功能的紧凑型 CPUCPU 314C-2 PtP,具有集成数字量和模拟量 I/O 、2个串口和集成计数、定位功能的紧凑型 CPUCPU 314C-2 DP,具有集成数字量和模拟量 I/O、PROFIBUS DP 接口和集成计数、定位功能的紧凑型 CPU下列技术型CPU&可以提供:CPU 315T-2 DP,用于使用 PROFIBUS DP进行分布式组态、对程序量有中/高要求、同时需要对8个轴进行常规运动控制的工厂。CPU 317T-2 DP,用于使用 PROFIBUS DP进行分布式组态、对程序量有高要求、又必须同时能够处理运动控制任务的工厂下列故障安全型CPU&可以提供:CPU 315F-2 DP,用于采用 PROFIBUS DP 进行分布式组态、对程序量有中/高要求的故障安全型工厂CPU 315F-2 PN/DP,用于具有中/大规模的程序量以及使用PROFIBUS DP和PROFINET IO进行分布式组态的工厂,在PROFInet上实现基于组件的自动化中实现分布式智能系统CPU 317F-2 DP,用于具有大容量程序量以及使用PROFIBUS DP进行分布式组态的故障安全工厂CPU 317F-2 PN/DP,用于具有大容量程序量以及使用PROFIBUS DP和PROFINET IO进行分布式组态的工厂,在PROFInet上实现基于组件的自动化中实现分布式智能系统CPU 319F-3 PN/DP,用于具有大容量程序量以及使用PROFIBUS DP和PROFINET IO进行分布式组态的故障安全型工厂,在PROFInet上实现基于组件的自动化中实现分布式智能系统Design所有 CPU 均具有坚固、紧凑的塑料机壳。在前面板上的部件有:状态和故障 LED模式选择开关MPI 端口CPU 还具有以下配置:SIMATIC 微型存储卡(MMC 卡)插槽;MMC 卡替代集成的装载存储器,因此是操作必备品。使用前连接器连接到集成的 I/O 端口(仅限紧凑型 CPU)连接 PROFIBUS 总线(仅限于DP型CPU)RS 422/485 的连接(仅 PtP CPU)连接 PROFINET(仅限于PN型CPU)FunctionsSIMATIC S7-300 CPU 具有高性能、所需空间小以及最小的维护成本,因此提高了性价比。高处理速度;例如,在 CPU 315-2 DP 中,位运算时,0.05 μs;浮点运算时,0.45 μs,在 CPU 319-3 PN/DP 中,位运算时,0.004 μs;浮点运算时,0.04 μs扩展数量作为装载存储器的 SIMATIC 微型存储卡(MMC):可在微型存储卡中存储一个完整的项目,包括符号和注释。RUN 模式下也可以进行读/写操作。这样可以降低服务成本无需电池即可在 MMC 上备份 RAM 数据编程使用STEP7中的 LAD、FBD STL 对 CPU 进行编程。可以使用下列编程工具:STEP 7 Basis 和 STEP 7 Professional。可以运行 CPU 314 的工程与组态工具(例如,S7-GRAPH、S7-HiGraph、SCL、CFC 或 SFC)。标准型CPU对标准型 CPU 进行编程时需要 STEP 7 V5.2+SP1 以上的软件。紧凑型 CPU对紧凑型 CPU 进行编程时需要 STEP 7 V5.3+SP2 以上的软件。老版本的STEP 7需要升级。PLC系统中干扰的主要来源及途径电气控制原理图的阅读分析方法与步骤S7-300SIMATIC S7-300 是模块化的微型 PLC 系统,可满足中、低端的性能要求。模块化、无风扇设计、易于实现分布式结构以及方便的操作,使得 SIMATIC S7-300 成为中、低端应用中各种不同任务的经济、用户友好的解决方案。SIMATIC S7-300 的应用领域包括:特殊机械,纺织机械,包装机械,一般机械设备制造,控制器制造,机床制造,安装系统,电气与电子工业及相关产业。多种性能等级的 CPU,具有用户友好功能的全系列模块,可允许用户根据不同的应用选取相应模块。任务扩展时,可通过使用附加模块随时对控制器进行升级。SIMATIC S7-300 是一个通用的控制器:具有高电磁兼容性和抗震性,可最大限度地用于工业领域。S7-300FSIMATIC S7-300F 故障安全自动化系统可使用在对安全要求较高的设备中。其可对立即停车过程进行控制,因此不会对人身、环境造成损害。S7-300F 满足下列安全要求:要求等级 AK 1 - AK 6 符合 DIN V 19250/DIN V VDE 0801安全要求等级 SIL 1 - SIL 3 符合 IEC 61508类别 1 - 4 符合 EN 954-1另外,标准模块还可用在 S7-300F 及故障安全模块中。因此它可以创建一个全集成的控制系统,在非安全相关和安全相关任务共存的工厂中使用。使用相同的标准工具对整个工厂进行组态和编程。DesignS7-300一般步骤S7-300自动化系统采用模块化设计。它拥有丰富的模块,且这些模块均可以独立地组合使用。一个系统包含下列组件:CPU:不同的 CPU 可用于不同的性能范围,包括具有集成 I/O 和对应功能的 CPU 以及具有集成 PROFIBUS DP、PROFINET 和点对点接口的 CPU。用于数字量和模拟量输入/输出的信号模块 (SM)。用于连接总线和点对点连接的通信处理器 (CP)。用于高速计数、定位(开环/闭环)及 PID 控制的功能模块(FM)。根据要求,也可使用下列模块:用于将 SIMATIC S7-300 连接到 120/230 V AC 电源的负载电源模块(PS)。接口模块 (IM),用于多层配置时连接中央控制器 (CC) 和扩展装置 (EU)。通过分布式中央控制器 (CC) 和 3 个扩展装置 (EU),SIMATIC S7-300 可以操作多达 32 个模块。所有模块均在外壳中运行,并且无需风扇。SIPLUS 模块可用于扩展的环境条件:适用于 -25 至 +60℃ 的温度范围及高湿度、结露以及有雾的环境条件。防直接日晒、雨淋或水溅,在防护等级为 IP20 机柜内使用时,可直接在汽车或室外建筑使用。不需要空气调节的机柜和 IP65 外壳。设计简单的结构使得 S7-300 使用灵活且易于维护:安装模块:只需简单地将模块挂在安装导轨上,转动到位然后锁紧螺钉。集成的背板总线:&背板总线集成到模块里。模块通过总线连接器相连,总线连接器插在外壳的背面。模块采用机械编码,更换极为容易:更换模块时,必须拧下模块的固定螺钉。按下闭锁机构,可轻松拔下前连接器。前连接器上的编码装置防止将已接线的连接器错插到其他的模块上。现场证明可靠的连接:对于信号模块,可以使用螺钉型、弹簧型或绝缘刺破型前连接器。TOP 连接:为采用螺钉型接线端子或弹簧型接线端子连接的 1 线 - 3 线连接系统提供预组装接线另外还可直接在信号模块上接线。规定的安装深度:所有的连接和连接器都在模块上的凹槽内,并有前盖保护。因此,所有模块应有明确的安装深度。无插槽规则:信号模块和通信处理器可以不受限制地以任何方式连接。系统可自行组态。扩展若用户的自动化任务需要 8 个以上的 SM、FM 或 CP 模块插槽时,则可对 S7-300(除 CPU 312 和 CPU 312C 外)进行扩展:中央控制器和3个扩展机架最多可连接32个模块:总共可将 3 个扩展装置(EU)连接到中央控制器(CC)。每个 CC/EU 可以连接八个模块。通过接口模板连接:每个 CC / EU 都有自己的接口模块。在中央控制器上它总是被插在 CPU 旁边的插槽中,并自动处理与扩展装置的通信。通过 IM 365 扩展:1 个扩展装置最远扩展距离为 1 米;电源电压也通过扩展装置提供。通过 IM 360/361 扩展:3 个扩展装置, CC 与 EU 之间以及 EU 与 EU 之间的最远距离为 10m。单独安装:对于单独的 CC/EU,也能够以更远的距离安装。两个相邻 CC/EU 或 EU/EU 之间的距离:长达 10m。灵活的安装选项:CC/EU 既可以水平安装,也可以垂直安装。这样可以最大限度满足空间要求。通信S7-300 具有不同的通信接口:连接 AS-Interface、PROFIBUS 和 PROFINET/工业以太网总线系统的通信处理器。用于点到点连接的通信处理器多点接口 (MPI), 集成在 CPU 中;是一种经济有效的方案,可以同时连接编程器/PC、人机界面系统和其它的 SIMATIC S7/C7 自动化系统。PROFIBUS DP进行过程通信SIMATIC S7-300 通过通信处理器或通过配备集成 PROFIBUS DP 接口的 CPU 连接到 PROFIBUS DP 总线系统。通过带有 PROFIBUS DP 主站/从站接口的 CPU,可构建一个高速的分布式自动化系统,并且使得操作大大简化。从用户的角度来看,PROFIBUS DP 上的分布式I/O处理与集中式I/O处理没有区别(相同的组态,编址及编程)。以下设备可作为主站连接:SIMATIC S7-300(通过带 PROFIBUS DP 接口的 CPU 或 PROFIBUS DP CP)SIMATIC S7-400(通过带 PROFIBUS DP 接口的 CPU 或 PROFIBUS DP CP)SIMATIC C7&(通过带 PROFIBUS DP 接口的 C7 或 PROFIBUS DP CP)SIMATIC S5-115U/H、S5-135U 和 S5-155U/H,带IM 308SIMATIC 505出于性能原因,每条线路上连接的主站不得超过 2 个。以下设备可作为从站连接:ET 200 分布式 I/O 设备S7-300,通过 CP 342-5CPU&313C-2 DP, CPU&314C-2 DP, CPU&314C-2&PN/DP, CPU&315-2 DP, CPU 315-2 PN/DP, CPU&317-2 DP, CPU&317-2 PN/DP and CPU&319-3 PN/DPC7-633/P DP, C7-633 DP, C7-634/P DP, C7-634 DP, C7-626 DP, C7-635, C7-636现场设备虽然带有 STEP 7 的编程器/PC 或 OP 是总线上的主站,但是只使用 MPI 功能,另外通过 PROFIBUS DP 也可部分提供 OP 功能。通过 PROFINET IO 进行过程通信SIMATIC S7-300 通过通信处理器或通过配备集成 PROFINET 接口的 CPU 连接到 PROFINET IO 总线系统。通过带有 PROFIBUS 接口的 CPU,可构建一个高速的分布式自动化系统,并且使得操作大大简化。从用户的角度来看,PROFINET IO 上的分布式I/O处理与集中式I/O处理没有区别(相同的组态,编址及编程)。可将下列设备作为 IO 控制器进行连接:SIMATIC S7-300(使用配备 PROFINET 接口或 PROFINET CP 的 CPU)SIMATIC ET 200(使用配备 PROFINET 接口的 CPU)SIMATIC S7-400(使用配备 PROFINET 接口或 PROFINET CP 的 CPU)可将下列设备作为 IO 设备进行连接:ET 200 分布式 I/O 设备ET&200S IM151-8&PN/DP&CPU, ET&200pro IM154-8&PN/DP&CPUSIMATIC S7-300(使用配备 PROFINET 接口或 PROFINET CP 的 CPU)现场设备通过 AS-Interface 进行过程通信S7-300 所配备的通信处理器 (CP 342-2) 适用于通过 AS-Interface 总线连接现场设备(AS-Interface 从站)。更多信息,请参见通信处理器。通过 CP 或集成接口(点对点)进行数据通信通过 CP 340/CP 341 通信处理器或 CPU 313C-2 PtP 或 CPU 314C-2 PtP 的集成接口,可经济有效地建立点到点连接。有三种物理传输介质支持不同的通信协议:20 mA (TTY)(仅 CP 340/CP 341)RS 232C/V.24(仅 CP 340/CP 341)RS 422/RS 485可以连接以下设备:SIMATIC S7、SIMATIC S5 自动化系统和其他公司的系统打印机机器人控制扫描器,条码阅读器,等特殊功能块包括在通信功能手册的供货范围之内。使用多点接口 (MPI) 进行数据通信MPI(多点接口)是集成在 SIMATIC S7-300 CPU 上的通信接口。它可用于简单的网络任务。MPI 可以同时连接多个配有 STEP 7 的编程器/PC、HMI 系统(OP/OS)、S7-300 和 S7-400。全局数据:“全局数据通信"服务可以在联网的 CPU 间周期性地进行数据交换。 一个 S7-300 CPU 可与多达 4 个数据包交换数据,每个数据包含有 22 字节数据,可同时有 16 个 CPU 参与数据交换(使用 STEP 7 V4.x)。&例如,可以允许一个 CPU 访问另一个 CPU 的输入/输出。只可通过 MPI 接口进行全局数据通信。内部通信总线(C-bus):CPU 的 MPI 直接连接到 S7-300 的 C 总线。因此,可以通过 MPI 从编程器直接找到与 C 总线连接的 FM/CP 模块的地址。功能强大的通信技术:多达 32 个 MPI 节点。使用 SIMATIC S7-300/-400 的 S7 基本通信的每个 CPU 有多个通信接口。使用编程器/PC、SIMATIC HMI 系统和 SIMATIC S7-300/400 的 S7 通信的每个 CPU 有多个通信接口。数据传输速率 187.5 kbit/s 或 12 Mbit/s灵活的组态选项:可靠的组件用于建立 MPI 通信: PROFIBUS 和“分布式 I/O"系列的总线电缆、总线连接器和 RS 485 中继器。使用这些组件,可以根据需求实现设计的最优化调整。例如,任意两个MPI节点之间最多可以开启10个中继器,以桥接更大的距离。通过 CP 进行数据通信SIMATIC S7-300 通过 CP 342 和 CP 343 通信处理器可以连接到 PROFIBUS 和工业以太网总线系统。可以连接以下设备:SIMATIC S7-300SIMATIC S7-400SIMATIC S5-115U/H、S5-135U 和 S5-155U/H编程器PC 机SIMATIC HMI 人机界面系统数控装置机器人控制工业PC驱动控制器其它厂商设备S7-300FS7-300F 能够以两种 I/O 设计的方式运行:ET 200M 中的 I/O 设计:故障安全数字量/模拟量输入和输出模块用于集中式或分布式应用(Cat.4/SIL3 只能与隔离模块一起使用)ET 200S PROFIsafe 中的 I/O 设计:故障安全数字量输入和输出模块可用于分布式应用西门子SM327模块6ES-0AB0用西门子PLC构成邮件分拣控制系统实训举例西门子S7-200系列PLC模拟量扩展模块型号及用途
*留言内容:
您的采购意向或是对我们的意见和建议,我们将在第一时间回复您...
已经是会员?点击这里
直接获取联系方式浏览:1339次
评论:0条 &时间:Extending the Eclipse IDE - Plug-in development - Tutorial
Quick links
Extending the Eclipse IDE - Plug-in development - Tutorial
Lars Vogel
Version 2.7
Eclipse Plug-ins tutorial
This article describes the creation and deployment of
plug-ins. The article is based on
4.4 (Luna)
Table of Contents
1.&Eclipse plug-ins and applications
1.1.&Eclipse software components - Plug-ins
An Eclipse application consists of several Eclipse
components. A
software component in Eclipse is called a
plug-in. The
Eclipse platform allows the developer to extend Eclipse
applications like the Eclipse IDE
with additional
functionalities
Eclipse applications use a runtime based on a specification called
component in OSGi is called a
An OSGi bundle is also always an Eclipse plug-in.
Both terms can be
interchangeably.
For example, a new plug-in can create new menu entries
or toolbar
1.2.&Advantages of developing Eclipse plug-ins
The Eclipse platform forms the basis of the most successful
therefore is very stable and broadly used. It uses native
components which are fast and reliable. It has a
modular approach based on the industry standard module system for
Java (OSGi) that
allows developers to design
Companies such as IBM, SAP and Google use the Eclipse framework
as a basis for
products and therefore need to ensure that Eclipse
flexible, fast
continues to evolve.
The Eclipse platform also fosters a large community of
individuals which
provide support, documentation and extensions to the
Eclipse framework.
Tapping into this ecosystem allows you to find
resources and information.
1.3.&What is the Eclipse Rich Client Platform (Eclipse RCP)?
The Eclipse IDE version 2.0 started as a modular IDE
application.
2004 Eclipse version 3.0 was released. Eclipse 3.0
supported reusing
components of the
Eclipse platform to build
stand-alone
applications
same technology as the Eclipse IDE.
At this point, the term
Eclipse RCP
coined. Eclipse RCP is
Eclipse Rich Client Platform
and indicates that the
Eclipse platform is used as a basis
feature-rich stand-alone
applications.
The release of Eclipse in version 4.x simplified and unified
programming model which is now based on state-of-the-art
technologies, like dependency
declarative styling via
Eclipse RCP applications benefit from the existing user
interface and the
internal framework, and can reuse existing plug-ins
and features.
2.&Extending the Eclipse IDE
The Eclipse IDE is basically an Eclipse RCP application to support development activities. Even core
functionality of the Eclipse IDE is provided via a plug-in, for example the Java development or the C
development tools
are contributed as a set of plug-ins. Only if these plug-ins are present the Java or C development
capabilities are
available.
The Eclipse IDE functionality is heavily based on the concept of extensions and extension points. For example the
Java Development Tools provide an extension point to register new code templates for the Java editor.
Via additional
plug-ins you can contribute to an existing
functionality, for example
entries, new
or provide
completely
new functionality. But you can also create completely new programming environments.
3.&Prerequisites
3.1.&Development
This tutorial assumes that you are already familiar with
and with the
3.2.&Model spy
to learn abou the model spy.
4.&Download the Eclipse SDK
If you plan to add functionalities to the Eclipse platform, you should download the latest Eclipse release.
Official releases have stable APIs, therefore are a good foundation for adding your plug-ins and features.
The Eclipse IDE is provided in different flavors. While you can
install the necessary tools in any Eclipse
package, it is typically
easier to download
the Eclipse Standard distribution which contains all
necessary tools
plug-in development. Other packages adds more tools
which are not required for Eclipse plug-in development.
Browse to the
download the
Eclipse Standard
Eclipse 4.5 provides also a new
installer. The installer is useful if you want to download several flavors of Eclipse, as it uses a shared
installation pool for common plug-ins.
5.&Installation the Eclipse IDE
5.1.&Install the Eclipse IDE
After you downloaded the
file with the Eclipse distribution, unpack it
to a local
directory.
Most operating systems can
zip or tar.gz
files in their file
Windows 7)
with a right-click
on the file and selecting
"Extract all...".
As a developer person you probably know how to extract a
compressed
search with
Google for "How
to extract a
zip (or tar.gz on Linux and Mac OS) file on ...",
"..." with
your operating system.
Extract Eclipse into a directory with no spaces in its path, and do not use mapped network drives. Also
have path names longer than 255 characters. Installations of Eclipse in directories with long path names
might cause
problems, as some Microsoft Windows tooling can not manage these long path names.
After you extracted the compressed file you can start Eclipse, no
additional
installation procedure is
5.2.&Solving exit code=13 while starting the Eclipse IDE
A common startup error happens when the user tries to launch a 64-bit version of Eclipse using a 32 bit JVM or vice
versa. In this
case Eclipse does not start and the user gets a message containing exit code=13. This happens when the
version of
Eclipse is not
matching the JVM version. A 32-bit Eclipse must run with Java 32 bit, and 64-bit Eclipse must
64-bit JVM.
java -version
on the command line and if the output does not contain the word "Server" you are using the 32 bit version of Java and
must use a 32 bit version of Eclipse.
6.&Adding e4 commands, menus and toolbars to a 3.x API based applications
6.1.&Adding e4 menu entries
Menus, handlers and commands can be contributed to an Eclipse application via
model fragments.
To do this, you only
the ID of the element to which you
contribute. The ID of the Eclipse IDE and Eclipse 3.x RCP
applications is hard coded to the
org.eclipse.e4.legacy.ide.application
You can use the model spy from
the e4 tools
to identify the ID of the element you want to
contribute
With the correct ID you can create model fragments that contribute to the corresponding application model element.
following screenshot demonstrate how to contribute to the
menuContributions
feature of the Eclipse IDE.
After you added a MenuContribution item you can contribute a menu.
must be the ID of the menu your are contributing
The model fragment must be registered in the plugin.xml file via an extension to the
org.eclipse.e4.workbench.model
extension point, as demonstrated in the following listing.
&?xml version="1.0" encoding="UTF-8"?&
&extension
point="org.eclipse.e4.workbench.model"&
apply="notexists"
uri="fragment.e4xmi"&
&/fragment&
&/extension&
6.2.&Error analysis
In case of problems, check the source code of plugin.xml and validate that your model fragment is included.
Verify the name of the referred model fragment and ensure all
the defined ID are available in the running
configuration.
6.3.&Adding e4 toolbar entries to the appliation window
Similar to menus you can contribute toolbar
contributions. This is demonstrated in
This approach does currently not work for view toolbars.
7.&Exercise: Add a e4 menu and toolbar to the Eclipse IDE
7.1.&Target of this exercise
In this exercise you create a plug-in which contributes
an e4 menu
entry to a
3.x based application menu.
7.2.&Creating a plug-in project
Create a new plug-in project called
com.vogella.plugin.first
File → New → Project... → Plug-in Development → Plug-in Project.
Enter the data as depicted in the following screenshots.
Select the
Hello, World Command
template and press the
button. This template uses the 3.x API, which you convert to the e4 API in
In the last page of the wizard you can customize some suggested values. You can leave the default values and
Eclipse may ask you if you want to switch to the plug-in
development
perspective. Answer
if you are prompted.
As a result the following project is created.
7.3.&Starting an Eclipse runtime IDE with your plug-in
Start a new Eclipse IDE instance and validate that your menu and toolbar entry are available. See
for more information on how to start an instance of the Eclipse IDE with additional plug-ins.
After launching the Eclipse IDE instance, you see the sample menu, contributed by your plug-in. After clicking
entry, you see a message box.
7.4.&Adding the plug-in dependencies for the e4 API
Add a dependency to the
org.eclipse.e4.core.di
plug-in in the manifest file of the newly created plug-in.
7.5.&Creating the handler class
Create the following class based on the generated handler class.
package com.vogella.plugin.first.
import org.eclipse.e4.core.di.annotations.E
import org.eclipse.jface.dialogs.MessageD
import org.eclipse.swt.widgets.S
public class SampleE4Handler {
public void execute(Shell shell) {
MessageDialog.openInformation(shell, "First", "Hello, e4 API world");
7.6.&Creating a model contribution
New → Other... → Eclipse 4 → Model → New Model Fragment
from the context menu of the plug-in project.
Create three model fragment entries in your new file, all of them should be contributing to the
org.eclipse.e4.legacy.ide.application
element id.
Use the following screenshots to define the new contribution.
7.7.&Adding a toolbar contribution
Also add a toolbar contribution for the same command.
When this document was written, the model editor had a bug.
to the toolbar contribution, that information is not persisted in the
Therefore, ensure
settings are
actually reflected in the
file. You can do this by closing the file and opening it again.
If you read this and the bug is still present, you have to enter the
Parent-ID directly in the xmi. For this switch
the XMI tab of the editor and enter the parent ID directly. Use the
org.eclipse.ui.main.toolbar
value. The file is only
saved, if you enter the information syntactically correct.
Add a toolbar and a handled tool item to your contribution.
7.8.&Validating the presence of the menu and toolbar contribution
Start a new instance of the Eclipse IDE and validate that your menu and the toolbar are is contributed. If they
are not visible in the window, check
via the model spy for potential issues.
8.&Local deployment of your plug-in
8.1.&Options for installing a plug-in
You have several options to make your plug-in available in your
Eclipse IDE. You can:
Install your plug-in directly into your current Eclipse installation, using your Eclipse IDE. This
useful for
installation and a test during development.
Export your plug-in and copy it into the
folder of your Eclipse installation. This option is useful for a simple distribution scenario,
where you only have
provide the exported plug-in to
your users. On
the other hand it is not very convenient for the end user as it
requires manual file copying and
provides no simple way to update
the plug-in.
Create an update site and use the Eclipse update manager
install it from this site. This is the simplest
approach for the end user. It also allows providing updates to all interested users.
8.2.&Installing your plug-in from your Eclipse IDE
You can install
your plug-in directly into your running Eclipse
The Eclipse plug-in export wizard has an option for this. Open the
export wizard via
File → Export → Plug-in Development → Deployable plug-ins and fragments.
In the export wizard
dialog select in this case
Install into host. Repository. This is depicted in the following screenshot.
8.3.&Export plug-in and put into dropins folder
If you export your plug-in locally, you can put it into the
folder of your Eclipse installation. After a restart
of your Eclipse
your plug-in should be available and ready for
Open again the
export wizard via
File → Export → Plug-in Development → Deployable plug-ins and fragments.
Select the plug-in you want to export and the folder to which
this plug-in should get exported.
This creates a
file with the exported plug-in in the selected directory.
directory in your Eclipse installation directory and
restart your
running Eclipse.
After this restart your new plug-in is available
installation and ready to be used.
8.4.&Deployment using an update site
You can create an update site for your plug-in. An update
consists of static files, which can be placed on a
file server or
server. Other users can install Eclipse plug-in from this update
by providing them a link to the
update site.
requires that you create a
feature project for the plug-in.
export this feature project and use the
Eclipse update manager
install the
feature (with the plug-in).
default, the
Eclipse update manager shows
only features
included into a
category. Therefore, you
should always
category for your
feature to make it
easy for the user to install your feature.
9.&Exercise: Create a feature for your plug-in
9.1.&Create a feature project
feature project
plug-in and add your plug-in to
feature. You create a feature project via
File → New → Other... → Plug-in Development → Feature Project.
Create the feature project according to the following screenshots.
9.2.&Create a category definition
In your feature project create a new category definition, via the menu entry
File → New → Other... → Plug-in development → Category Definition.
New Category
button and create a category with a name which
describes your
functionality. Add your feature to this category.
10.&Exercise: Create a feature for your plug-in
10.1.&Create an update site
You can create an update site for your feature in a local directory
on your machine. For this,
File → Export → Deployable features.
To use your category, switch to the
tab and select the path to your
category.xml
file in the
Categorize repository
10.2.&Install feature via the Eclipse update manager
Use the Eclipse update manager via
Help → Install New Software...
to install this new feature into
your Eclipse IDE.
to point to your local
directory. Then select
install your feature. In case you don't see your
feature, try
deselecting the
Group items by category
flag. In this case, you have forgotten to set your category during the
If you put the resulting files on a webserver under a public
accessible URL, your users could
install your
features from
10.3.&Validate installation
Restart the Eclipse IDE after the
installation.
Ensure that your
plug-in is available
installation and
can be used.
11.&Adding Eclipse 4.x parts and perspectives to 3.x based applications
11.1.&Adding Eclipse 4.x parts to Eclipse 3.x applications
As a reminder, the term POJO (Plan Old Java Object) is used to
describe a Java class without inheritance of a
framework class.
As of the Eclipse 4.4 release you can also use a POJO in an extension for the
org.eclipse.ui.views
extension point. Use the
entry in the context menu of the extension to archive this.
The resulting object is
created via dependency injection.
For such a kind of view the existing toolbar and view extension point contributions do not work. To add for example a
toolbar to
your e4view, get
injected into its implementation and construct the entries in your source code.
11.2.&Supporting part descriptors in an Eclipse 4.5 IDE
The Eclipse 4.5 IDE release will support the
contribution
of part descriptor
model elements
via fragments or
processors.
If you use the
org.eclipse.e4.legacy.ide.application
ID to contribute your part descriptors, the views can be opened via the
Window → Show View → Other...
dialog or via the
Quick Access. This requires that you add the
tag to such a part descriptor.
Eclipse 3.x API RCP applications running on
top of a 4.5 or higher runtime can use the same
11.3.&Adding perspectives to the Eclipse IDE via model snippets
Your model fragment or processor can also contribute a
perspective to
an Eclipse 4.x IDE. For this
add a perspective via
a snippet. This snippet must again contribute to the application via
org.eclipse.e4.legacy.ide.application ID.
This approach can also be used to contribute a perspective to
your Eclipse 3.x API based RCP application running
on top of an
Eclipse 4.x runtime but this depends on the specifics of your
application.
12.&Exercise: Adding e4view based parts to 3.x based applications
12.1.&Target
In this exercise you create an Eclipse 3.x RCP application and add a POJO part to it based on the e4view element
available to contribute an extension point based view.
12.2.&Using e4part and the org.eclipse.ui.views extension point
Create an Eclipse 3.x RCP application based on the
RCP application with a view
template via
File → New → Other... → Plug-in Project. Call the project
com.vogella.rcp.eclipse3x.e4view
and select the options similar to the following screenshots.
org.eclipse.e4.ui.di
as a dependency to the manifest of your new plug-in.
Create the following class.
package com.vogella.rcp.eclipse3x.e4
import javax.annotation.PostC
import org.eclipse.e4.ui.di.F
import org.eclipse.jface.viewers.ArrayContentP
import org.eclipse.jface.viewers.LabelP
import org.eclipse.jface.viewers.TableV
import org.eclipse.swt.SWT;
import org.eclipse.
public class ViewEclipse4x
private TableV
@PostConstruct
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new LabelProvider());
viewer.setInput(new String[] {"One", "Two", "Three"});
public void setFocus() {
viewer.getControl().setFocus();
Afterwards add an
extension for the
org.eclipse.ui.views
extension point. For this use the
Extensions
plugin.xml
12.3.&Add the view to a perspective extension
To be able to see the new view, add it to the existing perspective extension as depicted in the following
screenshot.
12.4.&Validating
Start your Eclipse 3.x application and validate that the new part is displayed.
13.&Exercise: Adding e4 part descriptors to 3.x based applications
13.1.&Target
In this exercise you add a model based part contribution to an Eclipse 3.x RCP application.
13.2.&Adding a part descriptor
Create a simple plug-in called
com.vogella.plugin.partdescriptor.
Add the following dependencies to your manifest file.
org.eclipse.core.runtime
org.eclipse.jface
org.eclipse.e4.ui.model.workbench
org.eclipse.e4.ui.di
Create the following class
package com.vogella.plugin.
import javax.annotation.PostC
import org.eclipse.e4.ui.di.F
import org.eclipse.jface.viewers.ArrayContentP
import org.eclipse.jface.viewers.LabelP
import org.eclipse.jface.viewers.TableV
import org.eclipse.swt.SWT;
import org.eclipse.
public class PartEclipse4x
private TableV
@PostConstruct
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new LabelProvider());
viewer.setInput(new String[] {"One", "Two", "Three"});
public void setFocus() {
viewer.getControl().setFocus();
Add a new model fragment to this plug-in via
File → New → Other... → Eclipse 4 → Model → New Model Fragment.
13.3.&Validating
Start an instance of the Eclipse IDE and validate that you can open the parts via the Quick Access box (shortcut
In Eclipse 4.4 the part descriptor can only be opened via the Quick Access box. In Eclipse
is planned that it
can also be opened via the
Window → Show View
menu entry.
14.&Adding model addons to 3.x based applications
Similar to
you can add model add-ons to your Eclipse 3.x application. This allows you to register for the event service.
15.&Contribute a menu to existing Part
15.1.&Overview
In this example we will add a new context menu entry to the
Package Explorer
part. The context menu is displayed if
package explorer via a right mouse click.
the option
create a HTML page from a Java source file.
To contribute to an existing menu or toolbar, you need to know the
corresponding ID. This ID can be found via the
Menu Spy. To start the Menu Spy use ALT + Shift + F2 and click on the menu entry you are interested in.
15.2.&Contribute to the Package Explorer
Create a new plug-in project called
de.vogella.plugin.htmlconverter.
Do not use a template.
META-INF/MANIFEST.MF
file. Select the
Dependencies
and add the following dependencies to your plug-in.
org.eclipse.jdt.core
org.eclipse.core.runtime
org.eclipse.core.resources
org.eclipse.core.expressions
Extensions
tab in your editor, or if the tab is not visible, click the
Extensions
link on the
Add a command with the ID
de.vogella.plugin.htmlconverter.convert
the default handler
de.vogella.plugin.htmlconverter.handler.ConvertHandler
to your plug-in.
this command to the menu via the extension point
org.eclipse.ui.menus
popup:org.eclipse.jdt.ui.PackageExplorer
locationURI. Set the label to
Create HTML
for this contribution.
The resulting file
plugin.xml
should look like the following.
&?xml version="1.0" encoding="UTF-8"?&
&?eclipse version="3.4"?&
point="org.eclipse.ui.menus"
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer"
commandId="de.vogella.plugin.htmlconverter.convert"
label="Create HTML" style="push"
point="org.mands"
defaultHandler="de.vogella.plugin.htmlconverter.handler.ConvertHandler"
id="de.vogella.plugin.htmlconverter.convert" name="Convert"
Eclipse allows to
save additional information for each file. You
interface and the
setPersistentProperty()
getPersistentProperty()
methods. With these functions you can save Strings on files.
these functions to save a directory for Java source
files which
already exported via HTML.
Create the following
ConvertHandler
package de.vogella.plugin.htmlconverter.
import java.io.BufferedW
import java.io.FileW
import java.io.IOE
import org.mands.AbstractH
import org.mands.ExecutionE
import org.mands.ExecutionE
import org.eclipse.core.resources.IR
import org.eclipse.core.runtime.CoreE
import org.eclipse.core.runtime.QualifiedN
import org.eclipse.jdt.core.ICompilationU
import org.eclipse.jdt.core.JavaModelE
import org.eclipse.jface.dialogs.MessageD
import org.eclipse.jface.viewers.IS
import org.eclipse.jface.viewers.IStructuredS
import org.eclipse.swt.widgets.DirectoryD
import org.eclipse.swt.widgets.S
import org.eclipse.ui.handlers.HandlerU
public class ConvertHandler extends AbstractHandler {
private QualifiedName path = new QualifiedName("html", "path");
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = HandlerUtil.getActiveShell(event);
ISelection sel = HandlerUtil.getActiveMenuSelection(event);
IStructuredSelection selection = (IStructuredSelection)
Object firstElement = selection.getFirstElement();
if (firstElement instanceof ICompilationUnit) {
createOutput(shell, firstElement);
MessageDialog.openInformation(shell, "Info",
"Please select a Java source file");
private void createOutput(Shell shell, Object firstElement) {
ICompilationUnit cu = (ICompilationUnit) firstE
IResource res = cu.getResource();
boolean newDirectory =
directory = getPersistentProperty(res, path);
if (directory != null && directory.length() & 0) {
newDirectory = !(MessageDialog.openQuestion(shell, "Question",
"Use the previous output directory?"));
if (newDirectory) {
DirectoryDialog fileDialog = new DirectoryDialog(shell);
directory = fileDialog.open();
if (directory != null && directory.length() & 0) {
setPersistentProperty(res, path, directory);
write(directory, cu);
protected String getPersistentProperty(IResource res, QualifiedName qn) {
return res.getPersistentProperty(qn);
} catch (CoreException e) {
return "";
protected void setPersistentProperty(IResource res, QualifiedName qn,
String value) {
res.setPersistentProperty(qn, value);
} catch (CoreException e) {
e.printStackTrace();
private void write(String dir, ICompilationUnit cu) {
cu.getCorrespondingResource().getName();
String test = cu.getCorrespondingResource().getName();
String[] name = test.split("\\.");
String htmlFile = dir + "\\" + name[0] + ".html";
FileWriter output = new FileWriter(htmlFile);
BufferedWriter writer = new BufferedWriter(output);
writer.write("&html&");
writer.write("&head&");
writer.write("&/head&");
writer.write("&body&");
writer.write("&pre&");
writer.write(cu.getSource());
writer.write("&/pre&");
writer.write("&/body&");
writer.write("&/html&");
writer.flush();
} catch (JavaModelException e) {
} catch (IOException e) {
e.printStackTrace();
If you start this plug-in, you should be able to create
output from a Java source file.
15.3.&Restrict the extension - Visible When
Currently our context menu is displayed all the time.
it only if a source
file is selected. For
this we will use
"visible-when" definition.
org.eclipse.core.expressions
plug-in as dependency to your plug-in. Select your menu
contribution.
Using the right mouse add the condition to the
command that it should
only be visible if a file is selected
which represents a
ICompilationUnit
org.eclipse.jdt.core
For this exercise you use the
predefined variable
activeMenuSelection
which contains the selection in the menu and iterate over
it. If the
selection can get adapted to
ICompilationUnit,
then the contribution will be visible.
This will result in the following
plugin.xml.
&?xml version="1.0" encoding="UTF-8"?&
&?eclipse version="3.4"?&
point="org.eclipse.ui.menus"
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer"
commandId="de.vogella.plugin.htmlconverter.convert"
label="Create HTML"
style="push"
checkEnabled="false"
variable="activeMenuSelection"
ifEmpty="false"
operator="or"
type="org.eclipse.jdt.core.ICompilationUnit"
point="org.mands"
defaultHandler="de.vogella.plugin.htmlconverter.handler.Convert"
id="de.vogella.plugin.htmlconverter.convert"
name="Convert"
If you now start your plug-in, the menu entry should only be
visible if at least one compilation unit has been
16.&Accessing the IEclipseContext from 3.x API
The Eclipse 4.x IDE uses the
IEclipseContext
data structure
to store central
information about the IDE. You can access this information also via
the Eclipse 3.x API.
This approach
is demonstrated with the following snippets. These code snippets assume that you are familiar
with the 3.x
API, if that is not the case you can skip this section.
For example, to access the context from an Eclipse 3.x API view, you can use the
following snippet.
IEclipseContext partContext =
(IEclipseContext) getViewSite().getService(IEclipseContext.class);
EModelService service =
(EModelService) getViewSite().getService(EModelService.class);
This snippet demonstrates the access via an Eclipse 3.x API handler.
IEclipseContext windowCtx =
(IEclipseContext)
HandlerUtil.getActiveWorkbenchWindow(event).
getService(IEclipseContext.class);
IEclipseContext ctx =
(IEclipseContext) HandlerUtil.getActivePart(event).
getSite().getService(IEclipseContext.class);
17.&Resources and Marker
Eclipse represents Resources like
IResource.
Marker represent additional information for resources,
error marker. Every marker can have attributes (key / value
combination). Markers can be displayed in the standard view, e.g., the
or the Problems view.
To be displayed in these views,
you have to use predefined attributes.
The following will demonstrate how to create marker for a
selected resource.
18.&Tutorial: Create Markers for resources
Create a plug-in project "de.vogella.plugin.markers". Add the
dependency to org.eclipse.core.resources", "org.eclipse.jdt.core" and
"org.eclipse.jdt.ui". Create the command
"de.vogella.plugin.markers.AddMarker" with the default handler
AddMarkerHandler
de.vogella.plugin.markers.handler
class and add
this command to
Create the following code.
package de.vogella.plugin.markers.
import org.mands.AbstractH
import org.mands.ExecutionE
import org.mands.ExecutionE
import org.eclipse.core.resources.IM
import org.eclipse.core.resources.IR
import org.eclipse.jdt.core.IJavaP
import org.eclipse.jface.viewers.IStructuredS
import org.eclipse.ui.handlers.HandlerU
public class AddMarker extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection selection = (IStructuredSelection) HandlerUtil
.getActiveSite(event).getSelectionProvider().getSelection();
if (selection == null) {
Object firstElement = selection.getFirstElement();
if (firstElement instanceof IJavaProject) {
IJavaProject type = (IJavaProject) firstE
writeMarkers(type);
private void writeMarkers(IJavaProject type) {
IResource resource = type.getUnderlyingResource();
IMarker marker = resource.createMarker(IMarker.TASK);
marker.setAttribute(IMarker.MESSAGE, "This a a task");
marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
} catch (Exception e) {
e.printStackTrace();
If you run, you can create a marker in the TODO list if you
select a Java project and click your menu entry.
19.&Adapters
19.1.&What are adapters?
Adapters help to display information about objects in view
without having to adjust the existing views. In this
example we will
create a small view which allows to select objects and use the
properties view to display them.
Adapters are used on several places, for example, you can use an
adapter to display your data in the outline view. See
on how to do this.
19.2.&Example
We will simply use an adapter to show our data in the property
view. Create a new plug-in project
de.vogella.plugin.adapter. Use
Plug-in with a view
template with the following settings.
dependency
org.eclipse.ui.views
in tab dependencies of
plugin.xml.
Create the following data model.
package de.vogella.plugin.adapter.
public class Todo {
public String getSummary() {
public void setSummary(String summary) {
this.summary =
public String getDescription() {
public void setDescription(String description) {
this.description =
Change the code of
SampleView.java
to the following. After this
change, you should be able to run your project, open your view and see
your to-do items.
package de.vogella.plugin.adapter.
import org.eclipse.jface.viewers.ArrayContentP
import org.eclipse.jface.viewers.ITableLabelP
import org.eclipse.jface.viewers.LabelP
import org.eclipse.jface.viewers.TableV
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.I
import org.eclipse.
import org.eclipse.ui.ISharedI
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewP
import de.vogella.plugin.adapter.model.T
public class SampleView extends ViewPart {
public static final String ID = "de.vogella.plugin.adapter.views.SampleView";
private TableV
class ViewLabelProvider extends LabelProvider implements
ITableLabelProvider {
public String getColumnText(Object obj, int index) {
Todo todo = (Todo)
return todo.getSummary();
public Image getColumnImage(Object obj, int index) {
return getImage(obj);
public Image getImage(Object obj) {
return PlatformUI.getWorkbench().getSharedImages()
.getImage(ISharedImages.IMG_OBJ_ELEMENT);
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
getSite().setSelectionProvider(viewer);
viewer.setInput(getElements());
public void setFocus() {
viewer.getControl().setFocus();
private Todo[] getElements() {
Todo[] todos = new Todo[2];
Todo todo = new Todo();
todo.setSummary("First Todo");
todo.setDescription("A very good description");
todos[0] =
todo = new Todo();
todo.setSummary("Second Todo");
todo.setDescription("Second super description");
todos[1] =
To displays its values in the property view, add the extension
org.eclipse.core.runtime.adapters
to your project. The data
of the extension point should be like the following.
point="org.eclipse.core.runtime.adapters"
adaptableType="de.vogella.plugin.adapter.model.Todo"
class="de.vogella.plugin.adapter.TodoAdapterFactory"
type="org.eclipse.ui.views.properties.IPropertySource"
Implement the factory and the new class
TodoPropertySource
which implements
IPropertySource.
package de.vogella.plugin.
import org.eclipse.core.runtime.IAdapterF
import org.eclipse.ui.views.properties.IPropertyS
import de.vogella.plugin.adapter.model.T
public class TodoAdapterFactory implements IAdapterFactory {
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType== IPropertySource.class && adaptableObject instanceof Todo){
return new TodoPropertySource((Todo) adaptableObject);
public Class[] getAdapterList() {
return new Class[] { IPropertySource.class };
package de.vogella.plugin.
import org.eclipse.ui.views.properties.IPropertyD
import org.eclipse.ui.views.properties.IPropertyS
import org.eclipse.ui.views.properties.TextPropertyD
import de.vogella.plugin.adapter.model.T
public class TodoPropertySource implements IPropertySource {
private final T
public TodoPropertySource(Todo todo) {
this.todo =
public boolean isPropertySet(Object id) {
public Object getEditableValue() {
return this;
public IPropertyDescriptor[] getPropertyDescriptors() {
return new IPropertyDescriptor[] {
new TextPropertyDescriptor("summary", "Summary"),
new TextPropertyDescriptor("description", "Description") };
public Object getPropertyValue(Object id) {
if (id.equals("summary")) {
return todo.getSummary();
if (id.equals("description")) {
return todo.getDescription();
public void resetPropertyValue(Object id) {
public void setPropertyValue(Object id, Object value) {
String s = (String)
if (id.equals("summary")) {
todo.setSummary(s);
if (id.equals("description")) {
todo.setDescription(s);
If you run your workbench and open your view
Windows → Show → View → Others → Sample Category → Sample View
and if you select a data element in your viewer you should see your data in the Properties view.
20.&Eclipse Resources
You can register
IResourceChangeListener
on resources in Eclipse. For example, if you have a project, you can add
or remove a resource listener to or from it.
project.getWorkspace().addResourceChangeListener(listener);
project.getWorkspace().removeResourceChangeListener(listener);
private IResourceChangeListener listener = new IResourceChangeListener() {
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE || event.getType() == IResourceChangeEvent.PRE_DELETE) {
if (event.getResource().equals(project)) {
if (resource == null)
IResourceDelta delta = event.getDelta().findMember(new Path(resource.getURI().toPlatformString(false)));
if (delta == null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
21.&Early startup actions
The Eclipse platform provides the
org.eclipse.ui.startup
extension point via the
org.eclipse.ui
This extension point is not used for Eclipse 4 RCP applications,
use a life cycle hook or model add-on to archive
similar behavior.
To implement an extension to this extension point, select
Extensions
tab of the
plugin.xml
editor and point to a class implementing the
interface.
22.&About this website
23.&Links and Literature
23.1.&Links and Literature
23.1.1.&Eclipse plug-in development resources
Eclipse Plug-in Development FAQ
23.1.2.&Special Eclipse plug-in development topics
Adapters in Eclipse
How to react to Eclipse resource deltas

我要回帖

更多关于 s120制动模块硬件组态 的文章

 

随机推荐