diff --git a/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/AgreementFileRenderer.java b/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/AgreementFileRenderer.java index 01da79835..15bf368c4 100644 --- a/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/AgreementFileRenderer.java +++ b/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/AgreementFileRenderer.java @@ -14,6 +14,7 @@ package org.eclipse.passage.loc.agreements.emfforms.renderers; import java.io.File; +import java.nio.file.Files; import java.util.Optional; import javax.inject.Inject; @@ -24,7 +25,9 @@ import org.eclipse.emfforms.spi.common.report.ReportService; import org.eclipse.emfforms.spi.core.services.databinding.EMFFormsDatabinding; import org.eclipse.emfforms.spi.core.services.label.EMFFormsLabelProvider; +import org.eclipse.passage.loc.internal.equinox.AgreementsService; +@SuppressWarnings("restriction") public final class AgreementFileRenderer extends BaseAgreementFileRenderer { @Inject @@ -38,4 +41,12 @@ protected Optional locatedAgreementFile() { return new LocatedAgreementFile().get(); } + @Override + protected String residentAgreementResource(File file) throws Exception { + String name = file.getName(); + new AgreementsService().get().located(name, getViewModelContext().getDomainModel()) + .write(Files.readAllBytes(file.toPath())); + return name; + } + } diff --git a/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/BaseAgreementFileRenderer.java b/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/BaseAgreementFileRenderer.java index 5d4d52c63..c6d35024e 100644 --- a/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/BaseAgreementFileRenderer.java +++ b/bundles/org.eclipse.passage.loc.agreements.emfforms/src/org/eclipse/passage/loc/agreements/emfforms/renderers/BaseAgreementFileRenderer.java @@ -14,7 +14,6 @@ package org.eclipse.passage.loc.agreements.emfforms.renderers; import java.io.File; -import java.nio.file.Files; import java.util.Optional; import org.eclipse.core.databinding.observable.IDecoratingObservable; @@ -31,14 +30,12 @@ import org.eclipse.emfforms.spi.core.services.databinding.EMFFormsDatabinding; import org.eclipse.emfforms.spi.core.services.label.EMFFormsLabelProvider; import org.eclipse.passage.lic.agreements.model.api.Agreement; -import org.eclipse.passage.loc.internal.equinox.AgreementsService; import org.eclipse.passage.loc.workbench.emfforms.renderers.TextWithButtonRenderer; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -@SuppressWarnings("restriction") /** *
  * TODO:
@@ -80,7 +77,7 @@ protected final void locateAgreementContentFile() {
 			return;
 		}
 		try {
-			reflect(reside(file.get()));
+			reflect(residentAgreementResource(file.get()));
 		} catch (Exception e) {
 			getReportService().report(new RenderingFailedReport(e));
 		}
@@ -88,12 +85,7 @@ protected final void locateAgreementContentFile() {
 
 	protected abstract Optional locatedAgreementFile();
 
-	private String reside(File file) throws Exception {
-		String name = file.getName();
-		new AgreementsService().get().located(name, getViewModelContext().getDomainModel())
-				.write(Files.readAllBytes(file.toPath()));
-		return name;
-	}
+	protected abstract String residentAgreementResource(File file) throws Exception;
 
 	private void reflect(String name) {
 		if (definedName().orElse("").equals(name)) { //$NON-NLS-1$