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?

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top