I am new to eclipse e4 application. I have a menu item open handler, when i click on it the filedialog appears and I can select the files and I should display the selected files on the view part.

Can anyone please help me how to update the view from the handler?

有帮助吗?

解决方案

You can use EPartService to find your part in the handler:

@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
}

where YourClass is the class you defined for the part. You then just need to add a method to YourClass that you can call to set the table input. "part id" is the id you specified for the MPart in the application model.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top