Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top