(String contents)
| 113 | } |
| 114 | |
| 115 | private RSyntaxDocument createDocument(String contents) { |
| 116 | RSyntaxDocument document = new RSyntaxDocument(new ArduinoTokenMakerFactory(editor.base.getPdeKeywords()), RSyntaxDocument.SYNTAX_STYLE_CPLUSPLUS); |
| 117 | document.putProperty(PlainDocument.tabSizeAttribute, PreferencesData.getInteger("editor.tabs.size")); |
| 118 | |
| 119 | // insert the program text into the document object |
| 120 | try { |
| 121 | document.insertString(0, contents, null); |
| 122 | } catch (BadLocationException bl) { |
| 123 | bl.printStackTrace(); |
| 124 | } |
| 125 | document.addDocumentListener(new DocumentTextChangeListener( |
| 126 | () -> setModified(true))); |
| 127 | return document; |
| 128 | } |
| 129 | |
| 130 | private RTextScrollPane createScrollPane(SketchTextArea textArea) throws IOException { |
| 131 | RTextScrollPane scrollPane = new RTextScrollPane(textArea, true); |
no test coverage detected