]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl
SCL API for direct access to SpreadsheetBooks
[simantics/platform.git] / bundles / org.simantics.spreadsheet.graph / scl / Spreadsheet / All.scl
index aa58a7f73c2f5654dffac51ce7e81accd1eee6be..22f8043ff90d6d82c5a24afd3b6058a48eab22dc 100644 (file)
@@ -3,43 +3,16 @@ include "Simantics/Ontologies"
 include "Simantics/SCL"
 include "Simantics/UI"
 include "Document/All"
+include "Spreadsheet/Solver"
 include "File"
 
-
-effect SpreadsheetTransaction 
-    "spreadsheetTransaction" 
-    "org.simantics.spreadsheet.Transaction"
-
-importJava "org.simantics.spreadsheet.graph.ExternalRef" where
-    data ExternalRef
-
 importJava "org.simantics.spreadsheet.common.TableCell" where
     data TableCell
 
-importJava "java.util.function.Consumer" where
-    data Consumer
-
-importJava "org.simantics.spreadsheet.CellEditor" where
-    data CellEditor
-    startTransaction :: CellEditor -> OperationMode -> <Proc> Transaction
-    @JavaName "edit"
-    editProperty_ :: CellEditor -> String -> String -> a -> Binding a -> Maybe Consumer -> <SpreadsheetTransaction> () 
-    @JavaName "edit"
-    editContent :: CellEditor -> String -> Variant -> Maybe Consumer -> <SpreadsheetTransaction> () 
-
 @inline
 editProperty :: Serializable a => CellEditor -> String -> String -> a -> Maybe Consumer -> <SpreadsheetTransaction> ()
 editProperty editor location property value consumer = editProperty_ editor location property value binding consumer
 
-importJava "org.simantics.spreadsheet.OperationMode" where
-    data OperationMode
-    OPERATION :: OperationMode
-    EDIT_MODE :: OperationMode
-
-importJava "org.simantics.spreadsheet.Transaction" where
-    data Transaction
-    commit :: Transaction -> <Proc> ()
-
 importJava "org.simantics.spreadsheet.common.TreeTableCell" where
     data TreeTableCell
 
@@ -58,9 +31,6 @@ importJava "org.simantics.spreadsheet.common.TreeTableCell" where
     treeTableCellRow :: TreeTableCell -> <Proc> Integer
     @JavaName getColumn
     treeTableCellColumn :: TreeTableCell -> <Proc> Integer
-    
-importJava "org.simantics.spreadsheet.common.SpreadsheetCell" where
-    data SpreadsheetCell
 
 importJava "org.simantics.spreadsheet.graph.SCL" where
     toVariant :: a -> Variant
@@ -76,12 +46,13 @@ importJava "org.simantics.spreadsheet.graph.SpreadsheetGraphUtils" where
     invalidateAll :: Variable -> <ReadGraph> ()
     extRefVariable :: Variable -> <ReadGraph> Variant
     extRefActiveVariable :: Variable -> <ReadGraph> Variant
+    forRows :: Variable -> String -> Integer -> Integer -> (Variable -> <ReadGraph,Proc> ()) -> <ReadGraph> ()
+    rowCell :: Variable -> Integer -> <ReadGraph> Maybe Variable
+    offsetCell :: Variable -> Integer -> Integer -> <ReadGraph> Maybe Variable
     cellEditor :: Resource -> <ReadGraph> CellEditor
     syncExec :: CellEditor -> OperationMode -> (<SpreadsheetTransaction, Proc> a) -> <Proc> a
     cellColumn :: Variable -> <ReadGraph> Integer
-
-importJava "org.simantics.spreadsheet.Spreadsheets" where
-     cellName :: Integer -> Integer -> String
+    spreadsheetBook :: Variable -> <Proc> SpreadsheetBook
 
 importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
     createSheet :: Resource -> String -> <WriteGraph> Resource
@@ -102,11 +73,10 @@ importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
     @JavaName "sheetRun"
     bookRun :: Resource -> Variable -> <ReadGraph> Variable
 
-sheetRunDefault :: Resource -> <ReadGraph> Variable
-sheetRunDefault sheet = sheetRun sheet (resourceVariable sheet)
+sheetRunDefault = bookRunDefault
 
-importJava "org.simantics.spreadsheet.graph.SpreadsheetSessionManager" where
-    removeSpreadsheetSession :: Variable -> <Proc, WriteGraph> ()
+bookRunDefault :: Resource -> <ReadGraph> Variable
+bookRunDefault book = bookRun book (resourceVariable book)
 
 importJava "org.simantics.spreadsheet.graph.ExcelImport" where
     importBook :: Resource -> File -> <Proc> ()