2 include "Simantics/Ontologies"
3 include "Simantics/SCL"
7 importJava "org.simantics.spreadsheet.common.TableCell" where
10 importJava "org.simantics.spreadsheet.common.TreeTableCell" where
13 importJava "org.simantics.spreadsheet.common.SpreadsheetCell" where
16 importJava "org.simantics.spreadsheet.graph.SCL" where
17 toVariant :: a -> Variant
18 modelsSourceContribution :: Resource -> <ReadGraph> [Variable]
19 modelsSourceContributionLabeler :: Variable -> <ReadGraph> String
21 importJava "org.simantics.spreadsheet.graph.SpreadsheetGraphUtils" where
22 @JavaName "fullSynchronization"
23 fullSynchronizeSheet :: Variable -> <ReadGraph> Boolean
24 evaluateAll :: Variable -> <ReadGraph> ()
25 saveInitialCondition :: Variable -> Resource -> String -> <WriteGraph> Resource
26 findCell :: Variable -> String -> <ReadGraph> Maybe Variable
27 invalidateAll :: Variable -> <ReadGraph> ()
29 importJava "org.simantics.spreadsheet.util.SpreadsheetUtils" where
30 createSheet :: Resource -> String -> <WriteGraph> Resource
31 queryCells :: a -> [TableCell]
32 modifyCells1 :: [TableCell] -> (TableCell -> TableCell) -> [TableCell]
33 modifyCells :: [TableCell] -> [(TableCell -> TableCell)] -> [TableCell]
34 organizeCells :: Integer -> [String] -> [TableCell] -> [TableCell]
35 applyFont :: IFont -> (TableCell -> Boolean) -> TableCell -> TableCell
36 applyAlign :: Integer -> (TableCell -> Boolean) -> TableCell -> TableCell
37 applyForeground :: IColor -> (TableCell -> Boolean) -> TableCell -> TableCell
38 applyBackground :: IColor -> (TableCell -> Boolean) -> TableCell -> TableCell
39 simpleFont :: String -> String -> Integer -> IFont
40 rgbColor :: Integer -> Integer -> Integer -> IColor
41 selectRow :: Integer -> TableCell -> Boolean
42 selectColumn :: Integer -> TableCell -> Boolean
43 setSCLLine :: Resource -> Integer -> String -> <WriteGraph> ()
44 sheetRun :: Resource -> Variable -> <ReadGraph> Variable
46 importJava "org.simantics.spreadsheet.graph.ExcelImport" where
47 importBook :: Resource -> File -> <Proc> ()
49 createSpreadsheetBookAction :: Resource -> <Proc> ()
50 createSpreadsheetBookAction res = do
51 syncWrite (\() -> createSpreadsheetBookDefault res)
54 createSpreadsheetSheetAction :: Resource -> <Proc> ()
55 createSpreadsheetSheetAction res = do
56 syncWrite (\() -> createSpreadsheetDefault res)
59 createSpreadsheetDefault :: Resource -> <WriteGraph> Resource
60 createSpreadsheetDefault library = createSheet library $ findFreshEscapedName "Sheet" library
62 createSpreadsheetBookDefault :: Resource -> <WriteGraph> Resource
63 createSpreadsheetBookDefault library = createSpreadsheetBook library $ findFreshEscapedName "Book" library
65 createRange :: Resource -> Resource -> String -> String -> <WriteGraph> Resource
66 createRange library type_ name expression = do
67 range = newResource ()
68 claim range L0.InstanceOf type_
69 claimRelatedValue range L0.HasName name
70 createSCLValue range SHEET.ExpressionRange.cells SHEET.SCLValue expression
71 claim range L0.PartOf library
74 createSpreadsheetBook :: Resource -> String -> <WriteGraph> Resource
75 createSpreadsheetBook library name = do
78 claim book L0.InstanceOf SHEET.Book
79 claimRelatedValue book L0.HasName name
80 claim book L0.PartOf library
81 createSheet book "Sheet"
82 addCommentMetadata ("Created Spreadsheet Book " + name)