MCPcopy Index your code
hub / github.com/benfry/processing4 / setTabContents

Method setTabContents

java/src/processing/mode/java/JavaEditor.java:1069–1087  ·  view source on GitHub ↗

Set text contents of a specific tab. Updates underlying document and text area. Clears Breakpoints. @param tabFilename the tab file name @param code the text to set

(String tabFilename, String code)

Source from the content-addressed store, hash-verified

1067 * @param code the text to set
1068 */
1069 protected void setTabContents(String tabFilename, String code) {
1070 // remove all breakpoints of this tab
1071 debugger.clearBreakpoints(tabFilename);
1072
1073 SketchCode currentTab = getCurrentTab();
1074
1075 // set code of tab
1076 SketchCode tab = getTab(tabFilename);
1077 if (tab != null) {
1078 tab.setProgram(code);
1079 // this updates document and text area
1080 // TODO: does this have any negative effects? (setting the doc to null)
1081 tab.setDocument(null);
1082 setCode(tab);
1083
1084 // switch back to original tab
1085 setCode(currentTab);
1086 }
1087 }
1088
1089
1090 public void clearConsole() {

Callers 1

Calls 6

getCurrentTabMethod · 0.95
getTabMethod · 0.95
setProgramMethod · 0.95
setDocumentMethod · 0.95
setCodeMethod · 0.95
clearBreakpointsMethod · 0.80

Tested by

no test coverage detected