]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/cell/TextStringCellParser.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.spreadsheet.common / src / org / simantics / spreadsheet / common / cell / TextStringCellParser.java
diff --git a/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/cell/TextStringCellParser.java b/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/cell/TextStringCellParser.java
new file mode 100644 (file)
index 0000000..3eb2bb8
--- /dev/null
@@ -0,0 +1,24 @@
+package org.simantics.spreadsheet.common.cell;\r
+\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.layer0.variable.VariableSpaceManipulator.PropertyCreationData;\r
+import org.simantics.scl.reflection.OntologyVersions;\r
+\r
+public class TextStringCellParser implements StringCellParser {\r
+\r
+       final static String TYPE = OntologyVersions.getInstance().currentVersion("http://www.simantics.org/Spreadsheet-0.0/TextCell"); \r
+       \r
+    @Override\r
+    public Collection<PropertyCreationData> parse(String text) {\r
+        return Collections.singletonList(PropertyCreationData.build(Parsers.CONTENT_PROPERTY, Variant.ofInstance(text)));\r
+    }\r
+    \r
+    @Override\r
+    public String getType() { \r
+       return TYPE;\r
+    }\r
+    \r
+}
\ No newline at end of file