MCPcopy
hub / github.com/arduino/Arduino / createDocument

Method createDocument

app/src/processing/app/EditorTab.java:115–128  ·  view source on GitHub ↗
(String contents)

Source from the content-addressed store, hash-verified

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);

Callers 1

EditorTabMethod · 0.95

Calls 5

getIntegerMethod · 0.95
setModifiedMethod · 0.95
getPdeKeywordsMethod · 0.80
insertStringMethod · 0.80
printStackTraceMethod · 0.80

Tested by

no test coverage detected