java - 在 Eclipse RCP 4 中打开一个编辑部分(作为以前 eclipse 版本中的编辑器)

标签 java eclipse-plugin eclipse-rcp e4

我想知道如何在纯 RCP 4 应用程序中打开带有输入(或从 View 传递数据的替代方法)的 e4 编辑器。

如果有帮助,这是一个包含所有需要的东西的应用程序(实际的编辑器除外) https://www.dropbox.com/s/zamn1t2kqr0525c/com.test.pureE4.zip?dl=0

提前致谢!

最佳答案

您可以在零件的 transient 数据中为零件设置数据。

类似于:

@Inject
EPartService partService;


// Create the part

MPart part = partService.createPart("editor id");

// Set the input

part.getTransientData().put("input key", inputData);

// Add to editor part stack

MPartStack editorStack = ... find your part stack for the editor

editorStack.getChildren().add(part);

// Show

partService.showPart(part, PartState.ACTIVATE);

在您的编辑器代码中:

@Inject
MPart part;


inputData = part.getTransientData().get("input key");

关于java - 在 Eclipse RCP 4 中打开一个编辑部分(作为以前 eclipse 版本中的编辑器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26912078/

相关文章:

java - 突出显示 ListCell 时 float 矩形

java - 更新某些字段以防止覆盖

eclipse-plugin - 资源不是本地的 - 在 Eclipse 插件中创建文件

java - 如何在 Eclipse 中以编程方式打开查找类型对话框

java - 可滚动复合 - 自动调整大小 - swt

java - 我可以对 Android 组件(例如 Activity 和服务)使用控制反转吗?

java - 使用 Spring Data 中的 CassandraRepository 为 Cassandra 实现分页的正确方法

java - Eclipse API : Get IFile or fully-qualified name from IJavaProject using only the file's name string

java - 从Eclipse控制台获取数据

eclipse - 在 Eclipse 中从 CNF(通用导航器框架)中删除 popUpMenus