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)
| 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 | /** |
no test coverage detected