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.IMarker;14 import org.eclipse.core.resources.IProject;15 import org.eclipse.core.runtime.IAdaptable;16 import org.eclipse.debug.core.model.IBreakpoint;17 import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;18 19 /**20 * Breakpoint organizers for projects.21 * 22 * @since 3.123 */24 public class ProjectBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate {25 26 /* (non-Javadoc)27 * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)28 */29 public IAdaptable[] getCategories(IBreakpoint breakpoint) {30 IMarker marker = breakpoint.getMarker();31 if (marker != null) {32 IProject project = marker.getResource().getProject();33 if (project != null) {34 return new IAdaptable[]{project};35 }36 }37 return null;38 }39 40 }41