]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/creator/TextBlockCellCreator.java.keep
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.spreadsheet.graph / src / org / simantics / spreadsheet / graph / creator / TextBlockCellCreator.java.keep
index 089aec4e675a3f26702edc48e6b3a4d48ada2bf0..8dc598a9f219955435ef32ae2290f4d82079249a 100644 (file)
@@ -1,54 +1,54 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.spreadsheet.graph.creator;\r
-\r
-import java.util.Collection;\r
-\r
-import org.simantics.databoard.Bindings;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.Layer0;\r
-import org.simantics.spreadsheet.ModelCellManager.CellCreationData;\r
-import org.simantics.spreadsheet.common.cell.Parsers;\r
-import org.simantics.spreadsheet.graph.request.RowsColumnsIndex;\r
-import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
-\r
-public class TextBlockCellCreator extends CellCreatorBase {\r
-\r
-    public TextBlockCellCreator(Resource realization) {\r
-        super(realization);\r
-    }\r
-\r
-    @Override\r
-    public void create(WriteGraph graph, final RowsColumnsIndex rowIndex, final RowsColumnsIndex columnIndex, final Collection<CellCreationData> data) throws DatabaseException {\r
-\r
-        Layer0 l0 = Layer0.getInstance(graph);\r
-        SpreadsheetResource sr = SpreadsheetResource.getInstance(graph);\r
-\r
-        Resource spreadsheet = graph.getPossibleObject(realization, l0.Represents);\r
-\r
-        for(CellCreationData datum : data) {\r
-            Resource newCell = graph.newResource();\r
-            graph.claim(newCell, l0.InstanceOf, null, sr.TextBlockCell);\r
-            String label = getProperty(datum, Parsers.LABEL_PROPERTY, Bindings.STRING);\r
-            Resource rowResource = rowIndex.getResource(datum.row);\r
-            Resource columnResource = columnIndex.getResource(datum.column);\r
-            graph.claim(newCell, sr.HasRow, sr.RowOf, rowResource);\r
-            graph.claim(newCell, sr.HasColumn, sr.ColumnOf, columnResource);\r
-            graph.addLiteral(newCell, sr.Label, sr.LabelOf, l0.String, label, Bindings.STRING);\r
-            graph.claim(spreadsheet, l0.ConsistsOf, l0.PartOf, newCell);\r
-        }\r
-\r
-    }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.spreadsheet.graph.creator;
+
+import java.util.Collection;
+
+import org.simantics.databoard.Bindings;
+import org.simantics.db.Resource;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.layer0.Layer0;
+import org.simantics.spreadsheet.ModelCellManager.CellCreationData;
+import org.simantics.spreadsheet.common.cell.Parsers;
+import org.simantics.spreadsheet.graph.request.RowsColumnsIndex;
+import org.simantics.spreadsheet.resource.SpreadsheetResource;
+
+public class TextBlockCellCreator extends CellCreatorBase {
+
+    public TextBlockCellCreator(Resource realization) {
+        super(realization);
+    }
+
+    @Override
+    public void create(WriteGraph graph, final RowsColumnsIndex rowIndex, final RowsColumnsIndex columnIndex, final Collection<CellCreationData> data) throws DatabaseException {
+
+        Layer0 l0 = Layer0.getInstance(graph);
+        SpreadsheetResource sr = SpreadsheetResource.getInstance(graph);
+
+        Resource spreadsheet = graph.getPossibleObject(realization, l0.Represents);
+
+        for(CellCreationData datum : data) {
+            Resource newCell = graph.newResource();
+            graph.claim(newCell, l0.InstanceOf, null, sr.TextBlockCell);
+            String label = getProperty(datum, Parsers.LABEL_PROPERTY, Bindings.STRING);
+            Resource rowResource = rowIndex.getResource(datum.row);
+            Resource columnResource = columnIndex.getResource(datum.column);
+            graph.claim(newCell, sr.HasRow, sr.RowOf, rowResource);
+            graph.claim(newCell, sr.HasColumn, sr.ColumnOf, columnResource);
+            graph.addLiteral(newCell, sr.Label, sr.LabelOf, l0.String, label, Bindings.STRING);
+            graph.claim(spreadsheet, l0.ConsistsOf, l0.PartOf, newCell);
+        }
+
+    }
+
+}