|
From: Markus B. <mba...@us...> - 2005-10-06 23:31:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21716/src/org/rubypeople/rdt/internal/debug/ui Modified Files: DebugModelPresentation.java RdtDebugUiMessages.properties Added Files: ModifyCatchpointDialog.java Log Message: RubyExceptionBreakpoints / catchpoints functionality added Index: DebugModelPresentation.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/DebugModelPresentation.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DebugModelPresentation.java 3 Jan 2005 18:06:35 -0000 1.8 --- DebugModelPresentation.java 6 Oct 2005 23:30:57 -0000 1.9 *************** *** 17,20 **** --- 17,21 ---- import org.eclipse.swt.graphics.Image; import org.eclipse.ui.IEditorInput; + import org.rubypeople.rdt.internal.debug.core.RubyExceptionBreakpoint; import org.rubypeople.rdt.internal.debug.core.RubyLineBreakpoint; import org.rubypeople.rdt.internal.debug.core.model.RubyThread; *************** *** 31,38 **** return breakpoint.getMarker().getResource().getName() + ":" + breakpoint.getLineNumber(); } catch (CoreException e) { ! e.printStackTrace(); return "--"; } } if (item instanceof RubyVariable) { RubyVariable variable = (RubyVariable) item ; --- 32,52 ---- return breakpoint.getMarker().getResource().getName() + ":" + breakpoint.getLineNumber(); } catch (CoreException e) { ! DebugUIPlugin.log(e) ; return "--"; } } + if (item instanceof RubyExceptionBreakpoint) { + RubyExceptionBreakpoint exceptionBreakpoint = (RubyExceptionBreakpoint) item ; + try { + if (exceptionBreakpoint.getException() == null || exceptionBreakpoint.getException().length() ==0) { + return "No Catchpoint defined" ; + } + else { + return "Suspend on exception: " + exceptionBreakpoint.getException() ; + } + } catch (CoreException e) { + DebugUIPlugin.log(e) ; + } + } if (item instanceof RubyVariable) { RubyVariable variable = (RubyVariable) item ; Index: RdtDebugUiMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.properties,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RdtDebugUiMessages.properties 7 Mar 2005 20:52:44 -0000 1.11 --- RdtDebugUiMessages.properties 6 Oct 2005 23:30:57 -0000 1.12 *************** *** 114,115 **** --- 114,118 ---- EvaluationExpressionsPreferencePage.export.error.canNotWrite= Export failed.\n{0} cannot be modified. EvaluationExpressionsPreferencePage.export.error.fileNotFound= Export failed:\n{0} + + ModifyCatchpointDialog.title=Define Catchpoint + ModifyCatchpointDialog.message=Enter the name of a ruby exception. The debugger halts when an exception of this type or a subclass is raised. --- NEW FILE: ModifyCatchpointDialog.java --- /* * Author: Markus Barchfeld * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. RDT is * subject to the "Common Public License (CPL) v 1.0". You may not use RDT except in * compliance with the License. For further information see org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.debug.ui; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.SelectionStatusDialog; public class ModifyCatchpointDialog extends SelectionStatusDialog { private String exception ; private Text exceptionTypeField ; public ModifyCatchpointDialog(Shell parent) { super(parent) ; } protected void computeResult() { exception = exceptionTypeField.getText() ; } protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super.createDialogArea(parent); GridLayout layout = new GridLayout(); layout.numColumns = 1; dialogArea.setLayout(layout); dialogArea.setLayoutData(new GridData(GridData.FILL_VERTICAL)); //GridData.FILL_HORIZONTAL // A label Label label = new Label(dialogArea, SWT.WRAP); if (this.getMessage() != null) { label.setText(getMessage()); } label.setFont(dialogArea.getFont()); GridData labelData = new GridData(GridData.FILL_HORIZONTAL); labelData.widthHint = 200; label.setLayoutData(labelData); // A text field exceptionTypeField = new Text(dialogArea, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); //data.widthHint = 200; exceptionTypeField.setLayoutData(data); return dialogArea ; } public String getException() { return exception ; } } |