]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl
Spreadsheet changes
[simantics/platform.git] / bundles / org.simantics.spreadsheet.graph / scl / Spreadsheet / All.scl
index a6660e57bcfc8e0bdb089ca8221fd51943fdc773..b493d65f53b549a5380b52e8b674d4273b395f5b 100644 (file)
@@ -5,12 +5,41 @@ include "Simantics/UI"
 include "Document/All"
 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
 
@@ -47,6 +76,12 @@ importJava "org.simantics.spreadsheet.graph.SpreadsheetGraphUtils" where
     invalidateAll :: Variable -> <ReadGraph> ()
     extRefVariable :: Variable -> <ReadGraph> Variant
     extRefActiveVariable :: Variable -> <ReadGraph> Variant
+    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
 
 importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
     createSheet :: Resource -> String -> <WriteGraph> Resource
@@ -65,6 +100,9 @@ importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
     setSCLLine :: Resource -> Integer -> String -> <WriteGraph> ()
     sheetRun :: Resource -> Variable -> <ReadGraph> Variable
 
+sheetRunDefault :: Resource -> <ReadGraph> Variable
+sheetRunDefault sheet = sheetRun sheet (resourceVariable sheet)
+
 importJava "org.simantics.spreadsheet.graph.SpreadsheetSessionManager" where
     removeSpreadsheetSession :: Variable -> <Proc, WriteGraph> ()