]> 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 9ca65f8d100da2d9c9586a7d795df80133fa99be..a6660e57bcfc8e0bdb089ca8221fd51943fdc773 100644 (file)
@@ -1,6 +1,7 @@
 include "Simantics/DB"
 include "Simantics/Ontologies"
 include "Simantics/SCL"
+include "Simantics/UI"
 include "Document/All"
 include "File"
 
@@ -70,6 +71,11 @@ importJava "org.simantics.spreadsheet.graph.SpreadsheetSessionManager" where
 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)