Changeset 402

Show
Ignore:
Timestamp:
09/25/08 21:14:34 (4 months ago)
Author:
tjas..@bitfauna.com
Message:

Tim Jasko
-Changed how 'Hide swank frames' is done.

-Removed it from the prefs panel
-Made it a button on the debugger to dynamically show or hide the frames.
-Your choice is still remembered.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/preferences/REPLPreferencePage.java

    r351 r402  
    3636                        "Show expression evaluated from file in REPL", parent)); 
    3737 
    38         addField(new BooleanFieldEditor(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES, 
     38        /*addField(new BooleanFieldEditor(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES, 
    3939                        "Clean up backtraces in debugger: don't show swank frames.",  
    40                         parent)); 
     40                        parent));*/ 
    4141 
    4242        addField(new StringFieldEditor( 
  • jasko.tim.lisp/src/jasko/tim/lisp/views/ReplView.java

    r399 r402  
    2626import org.eclipse.jface.dialogs.Dialog; 
    2727import org.eclipse.jface.dialogs.MessageDialog; 
     28import org.eclipse.jface.preference.IPreferenceStore; 
    2829import org.eclipse.jface.resource.*; 
    2930import org.eclipse.jface.text.*; 
     
    648649        private Action clearButton; 
    649650        private Action stepButton; 
     651        private Action showSwankFramesButton; 
    650652        private Action runTestsButton; 
    651653         
     
    672674                        tbm.add(stepButton); 
    673675                        stepButton.setEnabled(true); 
     676                        tbm.add(showSwankFramesButton); 
    674677                        tbm.add(connectButton); 
    675678                        tbm.update(true); 
     
    801804                clearButton.setToolTipText("Clear Repl and Reset Sash"); 
    802805                 
     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                 
    803828                stepButton = new Action("Step") { 
    804829                        public void run() { 
     
    806831                                if (currState != null 
    807832                                                && currState.getClass().getName() 
    808                                                                 .contains("DebugState")) { 
     833                                                                                .contains("DebugState")) { 
     834                                         
    809835                                        ((DebugState) currState).startDebug(); 
    810836                                        this.setEnabled(false); 
     
    13321358                                debugLabel.setSize(size.x, 50); 
    13331359                        } 
     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) { 
    13341394                        debugTree.removeAll(); 
    1335                          
    1336                         appendText(desc.car().value + "\n" + desc.cadr().value + "\n"); 
    1337                          
    13381395                        TreeItem slimeTopLevelOption = null; 
    13391396                        TreeItem breakContinueOption = null; 
     
    13421399                        for (int i=0; i<options.params.size(); ++i) { 
    13431400                                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                                } 
    13461405                                TreeItem item = new TreeItem(debugTree, 0); 
    13471406                                item.setText(i + ": [" + option.car().value + "] "  
     
    14011460                        bt.setExpanded(true); 
    14021461                         
    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); 
    14111462                        debugTree.setFocus(); 
    14121463                         
     
    14151466                        // select most often used (by me?) option 
    14161467                        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                         } 
    14341468                } 
    14351469