import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
import org.simantics.sysdyn.utils.SheetUtils;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.utils.ResourceAdaptionUtils;\r
\r
@Override\r
public void perform(WriteGraph graph) throws DatabaseException {\r
- SheetUtils.createSheet(graph, book, null, new String[] {}, new int[] {50});\r
+ graph.markUndoPoint();\r
+ Resource sheet = SheetUtils.createSheet(graph, book, null, new String[] {}, new int[] {50});\r
+ Layer0Utils.addCommentMetadata(graph, "Created new Spreadsheet " + NameUtils.getSafeName(graph, sheet) + " " + sheet.toString());\r
}\r
}); \r
return null;\r
import org.simantics.db.common.request.ObjectsWithType;\r
import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.util.Layer0Utils;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.db.layer0.variable.Variables;\r
import org.simantics.layer0.Layer0;\r
public class SheetUtils {\r
\r
public static Resource createSheet(WriteGraph graph, Resource book, String name, String[] colNames, int[] colWidths) throws DatabaseException {\r
- graph.markUndoPoint();\r
Layer0 L0 = Layer0.getInstance(graph);\r
SpreadsheetResource sr = SpreadsheetResource.getInstance(graph);\r
\r
// graph.claim(result, L0.HasChildVariables, L0.HasChildVariables_Inverse, newCell);\r
// \r
// }\r
- Layer0Utils.addCommentMetadata(graph, "Created new Spreadsheet " + name + " " + result.toString());\r
return result;\r
\r
}\r