1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Check if part is not null when set the selection.

This commit is contained in:
Mikhail Khodjaiants 2003-02-28 21:38:48 +00:00
parent c274d249d0
commit d4eb2d4416
5 changed files with 14 additions and 7 deletions

View file

@ -1,3 +1,10 @@
2003-02-28 Mikhail Khodjaiants
Check if part is not null when set the selection.
* AddExpressionActionDelegate.java
* AddGlobalsActionDelegate.java
* JumpToLineActionDelegate.java
* RunToLineActionDelegate.java
2003-02-28 Mikhail Khodjaiants
Check if page exists before adding a listener.
* AbstractListenerActionDelegate.java

View file

@ -108,9 +108,9 @@ public class AddExpressionActionDelegate extends AbstractEditorActionDelegate
public void selectionChanged( IWorkbenchPart part, ISelection selection )
{
IDebugTarget target = null;
if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
{
if ( selection != null && selection instanceof IStructuredSelection )
if ( selection instanceof IStructuredSelection )
{
Object element = ((IStructuredSelection)selection).getFirstElement();
if ( element != null && element instanceof IDebugElement )

View file

@ -110,7 +110,7 @@ public class AddGlobalsActionDelegate implements IViewActionDelegate,
*/
public void selectionChanged( IWorkbenchPart part, ISelection selection )
{
if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
{
if ( selection instanceof IStructuredSelection )
{

View file

@ -50,9 +50,9 @@ public class JumpToLineActionDelegate extends AbstractEditorActionDelegate
public void selectionChanged( IWorkbenchPart part, ISelection selection )
{
IDebugTarget target = null;
if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
{
if ( selection != null && selection instanceof IStructuredSelection )
if ( selection instanceof IStructuredSelection )
{
Object element = ((IStructuredSelection)selection).getFirstElement();
if ( element != null && element instanceof IDebugElement )

View file

@ -108,9 +108,9 @@ public class RunToLineActionDelegate extends AbstractEditorActionDelegate
public void selectionChanged( IWorkbenchPart part, ISelection selection )
{
IDebugTarget target = null;
if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) )
{
if ( selection != null && selection instanceof IStructuredSelection )
if ( selection instanceof IStructuredSelection )
{
Object element = ((IStructuredSelection)selection).getFirstElement();
if ( element != null && element instanceof IDebugElement )