我想知道如何在纯 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/