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)
| 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() { |
no test coverage detected