]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl
Importing of spreadsheets
[simantics/platform.git] / bundles / org.simantics.spreadsheet.graph / scl / Spreadsheet / All.scl
index 532331e55eec36fab7f7c36a3fbb4cc643eb354d..a6660e57bcfc8e0bdb089ca8221fd51943fdc773 100644 (file)
@@ -1,9 +1,13 @@
 include "Simantics/DB"
 include "Simantics/Ontologies"
 include "Simantics/SCL"
+include "Simantics/UI"
 include "Document/All"
 include "File"
 
+importJava "org.simantics.spreadsheet.graph.ExternalRef" where
+    data ExternalRef
+
 importJava "org.simantics.spreadsheet.common.TableCell" where
     data TableCell
 
@@ -14,6 +18,8 @@ importJava "org.simantics.spreadsheet.common.TreeTableCell" where
     getTreeTableCellData :: TreeTableCell -> <Proc> a
     
     createTreeTableCell :: String -> a -> Maybe b -> Integer -> Integer -> Integer -> Boolean -> <Proc> TreeTableCell
+
+    createTreeTableCell2 :: String -> a -> Maybe b -> a -> Integer -> Integer -> Boolean -> <Proc> TreeTableCell
     
     @JavaName getText
     treeTableCellText :: TreeTableCell -> <Proc> String
@@ -39,6 +45,8 @@ importJava "org.simantics.spreadsheet.graph.SpreadsheetGraphUtils" where
     saveInitialCondition :: Variable -> Resource -> String -> <WriteGraph> Resource
     findCell :: Variable -> String -> <ReadGraph> Maybe Variable
     invalidateAll :: Variable -> <ReadGraph> ()
+    extRefVariable :: Variable -> <ReadGraph> Variant
+    extRefActiveVariable :: Variable -> <ReadGraph> Variant
 
 importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
     createSheet :: Resource -> String -> <WriteGraph> Resource
@@ -56,10 +64,18 @@ importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
     selectColumn :: Integer -> TableCell -> Boolean
     setSCLLine :: Resource -> Integer -> String -> <WriteGraph> ()
     sheetRun :: Resource -> Variable -> <ReadGraph> Variable
-    
+
+importJava "org.simantics.spreadsheet.graph.SpreadsheetSessionManager" where
+    removeSpreadsheetSession :: Variable -> <Proc, WriteGraph> ()
+
 importJava "org.simantics.spreadsheet.graph.ExcelImport" where
     importBook :: Resource -> File -> <Proc> ()
 
+importSpreadsheetBookAction :: Resource -> <Proc> ()
+importSpreadsheetBookAction res = match fileDialog "foo" [("Excel file", "*.xls"), ("Excel File", "*.xlsx")] with
+  Nothing -> ()
+  Just file -> importBook res file
+
 createSpreadsheetBookAction :: Resource -> <Proc> ()
 createSpreadsheetBookAction res = do
   syncWrite (\() -> createSpreadsheetBookDefault res)