我是 eclipse e4 应用程序的新手。 我有一个菜单项打开处理程序,当我单击它时,会出现文件对话框,我可以选择文件,并且应该在 View 部分显示所选文件。
任何人都可以帮助我如何从处理程序更新 View 吗?
最佳答案
您可以使用EPartService
在处理程序中查找您的部分:
@Execute
void execute(EPartService partService)
{
MPart part = partService.findPart("part id ");
// TODO use FileDialog
YourClass yourClass = (YourClass)part.getObject();
// TODO call a method in YourClass to set the table input
}
其中 YourClass
是您为该部件定义的类。然后,您只需向 YourClass
添加一个方法即可调用该方法来设置表输入。 “part id”是您在应用程序模型中为 MPart 指定的 ID。
关于java - 从 eclipse e4 中的处理程序更新 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21733128/