MCPcopy Index your code
hub / github.com/processing/processing / setCurrentCode

Method setCurrentCode

app/src/processing/app/Sketch.java:1411–1437  ·  view source on GitHub ↗

Change what file is currently being edited. Changes the current tab index. store the String for the text of the current file. retrieve the String for the text of the new file. change the text that's visible in the text area

(int which)

Source from the content-addressed store, hash-verified

1409 * </OL>
1410 */
1411 public void setCurrentCode(int which) {
1412// // for the tab sizing
1413// if (current != null) {
1414// current.visited = System.currentTimeMillis();
1415// System.out.println(current.visited);
1416// }
1417 // if current is null, then this is the first setCurrent(0)
1418 if (which < 0 || which >= codeCount ||
1419 ((currentIndex == which) && (current == code[currentIndex]))) {
1420 return;
1421 }
1422
1423 // get the text currently being edited
1424 if (current != null) {
1425 current.setState(editor.getText(),
1426 editor.getSelectionStart(),
1427 editor.getSelectionStop(),
1428 editor.getScrollPosition());
1429 }
1430
1431 current = code[which];
1432 currentIndex = which;
1433 current.visited = System.currentTimeMillis();
1434
1435 editor.setCode(current);
1436 editor.repaintHeader();
1437 }
1438
1439
1440 /**

Callers 15

loadMethod · 0.95
nameCodeMethod · 0.95
handleDeleteCodeMethod · 0.95
handlePrevCodeMethod · 0.95
handleNextCodeMethod · 0.95
addFileMethod · 0.95
mousePressedMethod · 0.95
findMethod · 0.95
switchToTabMethod · 0.95
checkFilesMethod · 0.80
statusErrorMethod · 0.80
highlightMethod · 0.80

Calls 10

setStateMethod · 0.80
repaintHeaderMethod · 0.80
getPrettyNameMethod · 0.80
getTextMethod · 0.45
getSelectionStartMethod · 0.45
getSelectionStopMethod · 0.45
getScrollPositionMethod · 0.45
setCodeMethod · 0.45
equalsMethod · 0.45
getFileNameMethod · 0.45

Tested by

no test coverage detected