在Eclipse E4 中 Editor Part 和 View Part 是同一个意思,都是Part,即 View Part.
创建动态Part
1. 选择 Eclpse 4 > View Part
![](https://app.yinxiang.com/shard/s11/res/1b111ce4-fb3a-4e76-871e-76039c8af430.png)
2. 输入 Part 的类名
![](https://app.yinxiang.com/shard/s11/res/030d9c07-b192-4f43-b726-c6692e37cbec.png)
3. 打开 Application.e4xmi
![](https://app.yinxiang.com/shard/s11/res/696df47d-e628-4d90-ae9c-ec960eaa9996.png)
4. 选择 Part Descriptors > 选择 Add 按钮
![](https://app.yinxiang.com/shard/s11/res/9245fcfb-7eac-43e2-b375-5f1fb00af5cf.png)
5。 完成了配置
6。 使用时:
引用
EPartService partService;//这个是从环境中获取
MPart part = partService.createPart("smart.desktop.editor.partdescriptor.smarteditor");//刚才创建的Editor ID
part.setLabel(path);
partService.showPart(part, PartState.ACTIVATE);