mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
'DebugException' handling in the 'Signals' view.
This commit is contained in:
parent
658eff89d3
commit
e275d2ac53
2 changed files with 18 additions and 0 deletions
|
@ -19,6 +19,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
|
|||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.dialogs.ErrorDialog;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.viewers.IContentProvider;
|
||||
|
@ -98,6 +99,7 @@ public class SignalsView extends AbstractDebugEventHandlerView
|
|||
vv.setContentProvider( new SignalsViewContentProvider() );
|
||||
vv.setLabelProvider( new SignalsViewLabelProvider() );
|
||||
vv.setUseHashlookup( true );
|
||||
vv.setExceptionHandler( this );
|
||||
|
||||
// listen to selection in debug view
|
||||
getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
|
||||
|
@ -161,6 +163,7 @@ public class SignalsView extends AbstractDebugEventHandlerView
|
|||
*/
|
||||
public void handleException( DebugException e )
|
||||
{
|
||||
ErrorDialog.openError( getSite().getShell(), "Error", e.getMessage(), null );
|
||||
}
|
||||
|
||||
protected void setViewerInput( IStructuredSelection ssel )
|
||||
|
|
|
@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.internal.ui.views.signals;
|
|||
|
||||
import org.eclipse.cdt.debug.core.model.ICSignal;
|
||||
import org.eclipse.cdt.debug.internal.ui.PixelConverter;
|
||||
import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.jface.viewers.CellEditor;
|
||||
import org.eclipse.jface.viewers.ComboBoxCellEditor;
|
||||
|
@ -36,6 +37,8 @@ public class SignalsViewer extends TableViewer
|
|||
private static final String CP_SUSPEND = "suspend";
|
||||
private static final String CP_DESCRIPTION = "description";
|
||||
|
||||
private IDebugExceptionHandler fExceptionHandler = null;
|
||||
|
||||
/**
|
||||
* Constructor for SignalsViewer.
|
||||
* @param parent
|
||||
|
@ -127,9 +130,21 @@ public class SignalsViewer extends TableViewer
|
|||
}
|
||||
catch( DebugException e )
|
||||
{
|
||||
if ( getExceptionHandler() != null )
|
||||
getExceptionHandler().handleException( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected IDebugExceptionHandler getExceptionHandler()
|
||||
{
|
||||
return fExceptionHandler;
|
||||
}
|
||||
|
||||
protected void setExceptionHandler( IDebugExceptionHandler handler )
|
||||
{
|
||||
fExceptionHandler = handler;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue