1 /*******************************************************************************2 * Copyright (c) 2000, 2005 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 * 8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.debug.internal.ui.views.breakpoints;12 13 import org.eclipse.core.resources.IFile;14 import org.eclipse.core.resources.IMarker;15 import org.eclipse.core.resources.IResource;16 import org.eclipse.core.runtime.IAdaptable;17 import org.eclipse.debug.core.model.IBreakpoint;18 import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;19 20 /**21 * Breakpoint organizers for files.22 * 23 * @since 3.124 */25 public class FileBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate {26 27 /* (non-Javadoc)28 * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)29 */30 public IAdaptable[] getCategories(IBreakpoint breakpoint) {31 IMarker marker = breakpoint.getMarker();32 if (marker != null) {33 IResource resource = marker.getResource();34 if (resource.getType() == IResource.FILE) {35 return new IAdaptable[]{(IFile)resource};36 }37 }38 return null;39 }40 41 }42