2 * Created on 25.11.2004
4 * TODO To change the template for this generated file go to
5 * Window - Preferences - Java - Code Style - Code Templates
7 package net.sourceforge.phpeclipse.xdebug.ui;
9 import org.eclipse.core.resources.IResource;
10 import org.eclipse.core.runtime.IAdapterFactory;
11 import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
12 import org.eclipse.ui.texteditor.ITextEditor;
17 * TODO To change the template for this generated type comment go to
18 * Window - Preferences - Java - Code Style - Code Templates
20 public class XDebugBreakpointAdapterFactory implements IAdapterFactory {
22 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
24 public Object getAdapter(Object adaptableObject, Class adapterType) {
25 if (adaptableObject instanceof ITextEditor) {
26 ITextEditor editorPart = (ITextEditor) adaptableObject;
27 IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
28 if (resource != null) {
29 String extension = resource.getFileExtension();
30 if (extension != null && extension.equals("pda")) {
31 return new XDebugLineBreakpointAdapter();
38 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
40 public Class[] getAdapterList() {
41 return new Class[]{IToggleBreakpointsTarget.class};