Changeset 402
- Timestamp:
- 09/25/08 21:14:34 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jasko.tim.lisp/src/jasko/tim/lisp/preferences/REPLPreferencePage.java
r351 r402 36 36 "Show expression evaluated from file in REPL", parent)); 37 37 38 addField(new BooleanFieldEditor(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES,38 /*addField(new BooleanFieldEditor(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES, 39 39 "Clean up backtraces in debugger: don't show swank frames.", 40 parent)); 40 parent));*/ 41 41 42 42 addField(new StringFieldEditor( jasko.tim.lisp/src/jasko/tim/lisp/views/ReplView.java
r399 r402 26 26 import org.eclipse.jface.dialogs.Dialog; 27 27 import org.eclipse.jface.dialogs.MessageDialog; 28 import org.eclipse.jface.preference.IPreferenceStore; 28 29 import org.eclipse.jface.resource.*; 29 30 import org.eclipse.jface.text.*; … … 648 649 private Action clearButton; 649 650 private Action stepButton; 651 private Action showSwankFramesButton; 650 652 private Action runTestsButton; 651 653 … … 672 674 tbm.add(stepButton); 673 675 stepButton.setEnabled(true); 676 tbm.add(showSwankFramesButton); 674 677 tbm.add(connectButton); 675 678 tbm.update(true); … … 801 804 clearButton.setToolTipText("Clear Repl and Reset Sash"); 802 805 806 showSwankFramesButton = new Action("Show Swank Frames", Action.AS_CHECK_BOX) { 807 public void run() { 808 State currState = currState(); 809 if (currState != null 810 && currState.getClass().getName().contains("DebugState")) { 811 IPreferenceStore prefs = LispPlugin.getDefault().getPreferenceStore(); 812 boolean hide = prefs.getBoolean(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES); 813 hide = !hide; 814 prefs.setValue(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES, hide); 815 ((DebugState) currState).fillDebugTree(false); 816 this.setChecked(!hide); 817 } 818 } 819 }; 820 showSwankFramesButton.setImageDescriptor( 821 CuspResources.getImageDescriptor(CuspResources.SORT_POSITION)); 822 showSwankFramesButton.setToolTipText("Show Swank Frames"); 823 IPreferenceStore prefs = LispPlugin.getDefault().getPreferenceStore(); 824 boolean hide = prefs.getBoolean(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES); 825 showSwankFramesButton.setChecked(!hide); 826 827 803 828 stepButton = new Action("Step") { 804 829 public void run() { … … 806 831 if (currState != null 807 832 && currState.getClass().getName() 808 .contains("DebugState")) { 833 .contains("DebugState")) { 834 809 835 ((DebugState) currState).startDebug(); 810 836 this.setEnabled(false); … … 1332 1358 debugLabel.setSize(size.x, 50); 1333 1359 } 1360 1361 1362 appendText(desc.car().value + "\n" + desc.cadr().value + "\n"); 1363 1364 fillDebugTree(true); 1365 1366 debugTree.addSelectionListener(this); 1367 debugTree.addTreeListener(this); 1368 debugTree.addMouseListener(this); 1369 debugTree.addKeyListener(this); 1370 debugView.addKeyListener(this); 1371 1372 hideFrame(mainView); 1373 showFrame(debugView); 1374 1375 LispNode condExtras = desc.caadr(); 1376 1377 if (condExtras.getNumberOfSubSexps() > 0) { 1378 for (int i = 0; i < condExtras.getNumberOfSubSexps(); i++) { 1379 LispNode extra = condExtras.get(i); 1380 if (extra.car().value.equals(":show-frame-source")) { 1381 String frame = extra.cadr().value; 1382 getSwank().sendGetFrameSourceLocation(frame, thread, 1383 new SwankRunnable() { 1384 public void run() { 1385 processFrameSourceLocationResult(result); 1386 } 1387 }); 1388 } 1389 } 1390 } 1391 } 1392 1393 public void fillDebugTree(boolean print) { 1334 1394 debugTree.removeAll(); 1335 1336 appendText(desc.car().value + "\n" + desc.cadr().value + "\n");1337 1338 1395 TreeItem slimeTopLevelOption = null; 1339 1396 TreeItem breakContinueOption = null; … … 1342 1399 for (int i=0; i<options.params.size(); ++i) { 1343 1400 LispNode option = options.get(i); 1344 appendText("\t" + i + ": [" + option.car().value + "] " 1345 + option.cadr().value + "\n"); 1401 if (print) { 1402 appendText("\t" + i + ": [" + option.car().value + "] " 1403 + option.cadr().value + "\n"); 1404 } 1346 1405 TreeItem item = new TreeItem(debugTree, 0); 1347 1406 item.setText(i + ": [" + option.car().value + "] " … … 1401 1460 bt.setExpanded(true); 1402 1461 1403 debugTree.addSelectionListener(this);1404 debugTree.addTreeListener(this);1405 debugTree.addMouseListener(this);1406 debugTree.addKeyListener(this);1407 debugView.addKeyListener(this);1408 1409 hideFrame(mainView);1410 showFrame(debugView);1411 1462 debugTree.setFocus(); 1412 1463 … … 1415 1466 // select most often used (by me?) option 1416 1467 debugTree.setSelection(quickOption); 1417 1418 LispNode condExtras = desc.caadr();1419 1420 if (condExtras.getNumberOfSubSexps() > 0) {1421 for (int i = 0; i < condExtras.getNumberOfSubSexps(); i++) {1422 LispNode extra = condExtras.get(i);1423 if (extra.car().value.equals(":show-frame-source")) {1424 String frame = extra.cadr().value;1425 getSwank().sendGetFrameSourceLocation(frame, thread,1426 new SwankRunnable() {1427 public void run() {1428 processFrameSourceLocationResult(result);1429 }1430 });1431 }1432 }1433 }1434 1468 } 1435 1469
