package org.dynaresume.eclipse.ui.editors;

import org.dynaresume.domain.hr.Resume;
import org.dynaresume.services.ResumeService;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

import fr.opensagres.xdocreport.eclipse.ui.editors.ModelAndEntryEditorInput;
import fr.opensagres.xdocreport.eclipse.ui.editors.ReportingFormEditor;

public class ResumeFormEditor extends ReportingFormEditor<Resume> {

	public static final String ID = "fr.opensagres.xdocreport.eclipse.demo.resume.editor.ResumeFormEditorPart";

	@Override
	protected void doAddPages() {
		try {
			addPage(new OverviewPage(this));
			addPage(new EducationsPage(this));
			addPage(new ExperiencesPage(this));
			addPage(new SkillsPage(this));
			addPage(new HobbiesPage(this));
		} catch (PartInitException e) {
			e.printStackTrace();
		}
	}

	@Override
	protected Resume onLoad(ModelAndEntryEditorInput<Resume> input) {
		
		ResumeService resumeService=(ResumeService)PlatformUI.getWorkbench().getService(ResumeService.class);
		return resumeService.findById(
				input.getModel().getId());
	}

	@Override
	protected Resume onSave(Resume resume, IProgressMonitor monitor) {
		ResumeService resumeService=(ResumeService)PlatformUI.getWorkbench().getService(ResumeService.class);
		return resumeService.save(resume);
	}

}

@@ -223,43 +223,8 @@
 on;%0D
-%0Aimport org.eclipse.ui.PlatformUI;%0D
 %0A%0D%0Ai
@@ -556,16 +556,166 @@
 Part%22;%0D%0A
+%09%0D%0A%09private ResumeService resumeService;%0D%0A%0D%0A%09public void setResumeService(ResumeService resumeService) %7B%0D%0A%09%09this.resumeService = resumeService;%0D%0A%09%7D%0D%0A%09
 %0D%0A%09@Over
@@ -1101,16 +1101,16 @@
 t) %7B
-%0D%0A
 %09%09%0D%0A%09%09
+//
 Resu
@@ -1363,16 +1363,18 @@
 r) %7B%0D%0A%09%09
+//
 ResumeSe

Use DI to consume ResumeService in the resume form editor.