plugins/org.symbian.tools.tmw.debug/src/org/symbian/tools/tmw/debug/internal/BreakpointAdapterFactory.java
changeset 471 06589bf52fa7
child 484 f5df819c1852
equal deleted inserted replaced
470:d4809db37847 471:06589bf52fa7
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Symbian Foundation - initial contribution.
       
    11  * Contributors:
       
    12  * Description:
       
    13  * Overview:
       
    14  * Details:
       
    15  * Platforms/Drives/Compatibility:
       
    16  * Assumptions/Requirement/Pre-requisites:
       
    17  * Failures and causes:
       
    18  *******************************************************************************/
       
    19 package org.symbian.tools.tmw.debug.internal;
       
    20 
       
    21 import org.eclipse.core.resources.IResource;
       
    22 import org.eclipse.core.runtime.IAdapterFactory;
       
    23 import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
       
    24 import org.eclipse.ui.IEditorPart;
       
    25 
       
    26 @SuppressWarnings("rawtypes")
       
    27 public class BreakpointAdapterFactory implements IAdapterFactory {
       
    28 
       
    29 	public Object getAdapter(Object adaptableObject, Class adapterType) {
       
    30 		if (adaptableObject instanceof IEditorPart) {
       
    31 			IResource resource = (IResource) ((IEditorPart) adaptableObject)
       
    32 					.getEditorInput().getAdapter(IResource.class);
       
    33 			if (resource != null) {
       
    34 				return new WorkspaceLineBreakpointAdapter();
       
    35 			}
       
    36 		}
       
    37 		return null;
       
    38 	}
       
    39 
       
    40     public Class[] getAdapterList() {
       
    41 		return new Class[] { IToggleBreakpointsTarget.class };
       
    42 	}
       
    43 
       
    44 }