X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet.graph%2Fscl%2FSpreadsheet%2FAll.scl;h=22f8043ff90d6d82c5a24afd3b6058a48eab22dc;hb=HEAD;hp=8898ce10a9a306d58b0ea796e6d96653987fd132;hpb=2993f438f049233534c33dd51a3d2bb381657954;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl b/bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl index 8898ce10a..22f8043ff 100644 --- a/bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl +++ b/bundles/org.simantics.spreadsheet.graph/scl/Spreadsheet/All.scl @@ -1,12 +1,18 @@ include "Simantics/DB" include "Simantics/Ontologies" include "Simantics/SCL" +include "Simantics/UI" include "Document/All" +include "Spreadsheet/Solver" include "File" importJava "org.simantics.spreadsheet.common.TableCell" where data TableCell +@inline +editProperty :: Serializable a => CellEditor -> String -> String -> a -> Maybe Consumer -> () +editProperty editor location property value consumer = editProperty_ editor location property value binding consumer + importJava "org.simantics.spreadsheet.common.TreeTableCell" where data TreeTableCell @@ -25,9 +31,6 @@ importJava "org.simantics.spreadsheet.common.TreeTableCell" where treeTableCellRow :: TreeTableCell -> Integer @JavaName getColumn treeTableCellColumn :: TreeTableCell -> Integer - -importJava "org.simantics.spreadsheet.common.SpreadsheetCell" where - data SpreadsheetCell importJava "org.simantics.spreadsheet.graph.SCL" where toVariant :: a -> Variant @@ -41,6 +44,15 @@ importJava "org.simantics.spreadsheet.graph.SpreadsheetGraphUtils" where saveInitialCondition :: Variable -> Resource -> String -> Resource findCell :: Variable -> String -> Maybe Variable invalidateAll :: Variable -> () + extRefVariable :: Variable -> Variant + extRefActiveVariable :: Variable -> Variant + forRows :: Variable -> String -> Integer -> Integer -> (Variable -> ()) -> () + rowCell :: Variable -> Integer -> Maybe Variable + offsetCell :: Variable -> Integer -> Integer -> Maybe Variable + cellEditor :: Resource -> CellEditor + syncExec :: CellEditor -> OperationMode -> ( a) -> a + cellColumn :: Variable -> Integer + spreadsheetBook :: Variable -> SpreadsheetBook importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where createSheet :: Resource -> String -> Resource @@ -58,13 +70,22 @@ importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where selectColumn :: Integer -> TableCell -> Boolean setSCLLine :: Resource -> Integer -> String -> () sheetRun :: Resource -> Variable -> Variable + @JavaName "sheetRun" + bookRun :: Resource -> Variable -> Variable -importJava "org.simantics.spreadsheet.graph.SpreadsheetSessionManager" where - removeSpreadsheetSession :: Variable -> () +sheetRunDefault = bookRunDefault + +bookRunDefault :: Resource -> Variable +bookRunDefault book = bookRun book (resourceVariable book) importJava "org.simantics.spreadsheet.graph.ExcelImport" where importBook :: Resource -> File -> () +importSpreadsheetBookAction :: Resource -> () +importSpreadsheetBookAction res = match fileDialog "foo" [("Excel file", "*.xls"), ("Excel File", "*.xlsx")] with + Nothing -> () + Just file -> importBook res file + createSpreadsheetBookAction :: Resource -> () createSpreadsheetBookAction res = do syncWrite (\() -> createSpreadsheetBookDefault res)