]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCellEditable.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / solver / SpreadsheetCellEditable.java
similarity index 62%
rename from bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/SpreadsheetCellEditable.java
rename to bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCellEditable.java
index 81033f44cf15367b6da72ccc726267c0866126e5..246bd705b7a4cb0e585a992711f68a07e1603dd6 100644 (file)
@@ -1,14 +1,17 @@
-package org.simantics.spreadsheet.graph;
+package org.simantics.spreadsheet.solver;
 
 import java.util.Collections;
 import java.util.Map;
 
 import org.simantics.databoard.binding.mutable.Variant;
 
+@SuppressWarnings("rawtypes")
 public class SpreadsheetCellEditable implements SheetNode {
 
-    public final SpreadsheetCell cell;
+    private static final long serialVersionUID = -5078387091775971986L;
     
+    public final SpreadsheetCell cell;
+
     public SpreadsheetCellEditable(SpreadsheetCell spreadsheetCell) {
         this.cell = spreadsheetCell;
     }
@@ -27,7 +30,7 @@ public class SpreadsheetCellEditable implements SheetNode {
     public Map getProperties() {
         return Collections.emptyMap();
     }
-    
+
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -54,22 +57,22 @@ public class SpreadsheetCellEditable implements SheetNode {
     }
 
     public boolean editable() {
-        if (cell.content == null || cell.content instanceof SpreadsheetFormula || cell.content instanceof SpreadsheetSCLConstant)
+        if (cell.getContent() == null || cell.getContent() instanceof SpreadsheetFormula || cell.getContent() instanceof SpreadsheetSCLConstant)
             return false;
-        if (cell.content instanceof String) {
-               String content = (String) cell.content;
-               if (content.isEmpty())
-                       return false;
+        if (cell.getContent() instanceof String) {
+            String content = (String) cell.getContent();
+            if (content.isEmpty())
+                return false;
         }
-        if (cell.content instanceof Variant) {
-               Variant content = (Variant) cell.content;
-               if (content.getValue() == null)
-                       return false;
-               if (content.getValue() instanceof String) {
-                       String actualContent = (String) content.getValue();
-                       if (actualContent.isEmpty())
-                               return false;
-               }
+        if (cell.getContent() instanceof Variant) {
+            Variant content = (Variant) cell.getContent();
+            if (content.getValue() == null)
+                return false;
+            if (content.getValue() instanceof String) {
+                String actualContent = (String) content.getValue();
+                if (actualContent.isEmpty())
+                    return false;
+            }
         }
 //        System.out.println("content is " + cell.content);
         return true;