Added "project" argument to OverlayModel methods, as suggested by Fadi Maali.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1439 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-10-06 20:47:11 +00:00
parent 76115a4edd
commit 90d1111ebc
3 changed files with 9 additions and 9 deletions

View File

@ -3,9 +3,9 @@ package com.google.refine.model;
import com.google.refine.Jsonizable; import com.google.refine.Jsonizable;
public interface OverlayModel extends Jsonizable { public interface OverlayModel extends Jsonizable {
public void onBeforeSave(); public void onBeforeSave(Project project);
public void onAfterSave(); public void onAfterSave(Project project);
public void dispose(); public void dispose(Project project);
} }

View File

@ -71,7 +71,7 @@ public class Project {
public void dispose() { public void dispose() {
for (OverlayModel overlayModel : overlayModels.values()) { for (OverlayModel overlayModel : overlayModels.values()) {
try { try {
overlayModel.dispose(); overlayModel.dispose(this);
} catch (Exception e) { } catch (Exception e) {
logger.warn("Error signaling overlay model before disposing", e); logger.warn("Error signaling overlay model before disposing", e);
} }
@ -95,7 +95,7 @@ public class Project {
public void saveToOutputStream(OutputStream out, Pool pool) throws IOException { public void saveToOutputStream(OutputStream out, Pool pool) throws IOException {
for (OverlayModel overlayModel : overlayModels.values()) { for (OverlayModel overlayModel : overlayModels.values()) {
try { try {
overlayModel.onBeforeSave(); overlayModel.onBeforeSave(this);
} catch (Exception e) { } catch (Exception e) {
logger.warn("Error signaling overlay model before saving", e); logger.warn("Error signaling overlay model before saving", e);
} }
@ -114,7 +114,7 @@ public class Project {
for (OverlayModel overlayModel : overlayModels.values()) { for (OverlayModel overlayModel : overlayModels.values()) {
try { try {
overlayModel.onAfterSave(); overlayModel.onAfterSave(this);
} catch (Exception e) { } catch (Exception e) {
logger.warn("Error signaling overlay model after saving", e); logger.warn("Error signaling overlay model after saving", e);
} }

View File

@ -24,16 +24,16 @@ public class Protograph implements OverlayModel {
} }
@Override @Override
public void onBeforeSave() { public void onBeforeSave(Project project) {
} }
@Override @Override
public void onAfterSave() { public void onAfterSave(Project project) {
} }
@Override @Override
public void dispose() { public void dispose(Project project) {
} }
static public Protograph reconstruct(JSONObject o) throws JSONException { static public Protograph reconstruct(JSONObject o) throws JSONException {