diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java b/designer/src/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java index 993803407..9a5a7e4d2 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java @@ -12,6 +12,7 @@ import com.fr.json.JSONObject; * Created by XiaXiang on 2017/5/17. */ public class CellModelHelper { + private static final String RESULT = "result"; public static AlphaCellModel jsonToModel(JSONObject object) { int cellType = object.optInt("cellType"); switch (CellType.parse(cellType)) { @@ -30,17 +31,6 @@ public class CellModelHelper { } public static String getResultValueFromModel(AlphaCellModel cellModel) { - switch (cellModel.getType()) { - case ACTION: - return ((ActionModel)cellModel).getActionName(); - case DOCUMENT: - return ((DocumentModel)cellModel).getInformationUrl(); - case FILE: - return ((FileModel)cellModel).getFilePath(); - case REUSE: - case PLUGIN: - return ((PluginModel)cellModel).getInformationUrl(); - } - return null; + return cellModel.getStoreInformation(); } } diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/ActionModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/ActionModel.java index 2e8a4510b..26cf95bcf 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/ActionModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/ActionModel.java @@ -59,6 +59,11 @@ public class ActionModel extends AlphaCellModel implements Serializable { return object; } + @Override + public String getStoreInformation() { + return getActionName(); + } + public String getActionName() { return getAction().getClass().getName(); } diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/AlphaCellModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/AlphaCellModel.java index d39c7210d..8055c8812 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/AlphaCellModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/AlphaCellModel.java @@ -62,5 +62,6 @@ public abstract class AlphaCellModel { abstract public JSONObject ModelToJson() throws JSONException; + abstract public String getStoreInformation(); } diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/DocumentModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/DocumentModel.java index b5d29edc4..047bea152 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/DocumentModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/DocumentModel.java @@ -46,10 +46,13 @@ public class DocumentModel extends AlphaCellModel { return object; } + @Override + public String getStoreInformation() { + return getInformationUrl(); + } + @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof DocumentModel)) return false; DocumentModel that = (DocumentModel) o; diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/FileModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/FileModel.java index aa295a04c..bdcc57daf 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/FileModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/FileModel.java @@ -5,6 +5,7 @@ import com.fr.design.mainframe.alphafine.CellType; import com.fr.general.FRLogger; import com.fr.json.JSONException; import com.fr.json.JSONObject; +import org.apache.xerces.impl.xpath.regex.REUtil; /** * Created by XiaXiang on 2017/4/20. @@ -41,11 +42,14 @@ public class FileModel extends AlphaCellModel{ return object; } + @Override + public String getStoreInformation() { + return getFilePath(); + } + @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof FileModel)) return false; FileModel fileModel = (FileModel) o; diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/PluginModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/PluginModel.java index b9df4ab67..76225c827 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/PluginModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/PluginModel.java @@ -109,11 +109,14 @@ public class PluginModel extends AlphaCellModel { return object; } + @Override + public String getStoreInformation() { + return getInformationUrl(); + } + @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof PluginModel)) return false; PluginModel that = (PluginModel) o;