### Eclipse Workspace Patch 1.0 #P org.eclipse.debug.ui Index: ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java,v retrieving revision 1.2 diff -u -r1.2 BreakpointLabelProvider.java --- ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java 14 Dec 2009 18:23:23 -0000 1.2 +++ ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java 10 May 2010 17:26:40 -0000 @@ -1,37 +1,59 @@ -/***************************************************************** - * Copyright (c) 2009 Texas Instruments and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) - *****************************************************************/ -package org.eclipse.debug.internal.ui.model.elements; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.jface.viewers.TreePath; - -/** - * Breakpoint label provider. - * - * @since 3.6 - */ -public class BreakpointLabelProvider extends DebugElementLabelProvider { - - /* - * (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getChecked(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext) - */ - public boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException { - Object lastSegment = path.getLastSegment(); - if (lastSegment instanceof IBreakpoint) { - return ((IBreakpoint) lastSegment).isEnabled(); - } - - return false; - } -} +/***************************************************************** + * Copyright (c) 2009 Texas Instruments and others + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) + * Patrick Chuong (Texas Instruments) - bug fix 306768 + *****************************************************************/ +package org.eclipse.debug.internal.ui.model.elements; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.TreePath; + +/** + * Breakpoint label provider. + * + * @since 3.6 + */ +public class BreakpointLabelProvider extends DebugElementLabelProvider { + + /* (non-Javadoc) + * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String, int) + */ + protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException { + if (columnIndex == 0) + return super.getLabel(elementPath, presentationContext, columnId, columnIndex); + else + return ""; //$NON-NLS-1$ + } + + /* (non-Javadoc) + * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String, int) + */ + protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException { + if (columnIndex == 0) + return super.getImageDescriptor(elementPath, presentationContext, columnId, columnIndex); + else + return null; + } + + /* + * (non-Javadoc) + * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getChecked(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext) + */ + public boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException { + Object lastSegment = path.getLastSegment(); + if (lastSegment instanceof IBreakpoint) { + return ((IBreakpoint) lastSegment).isEnabled(); + } + + return false; + } +} Index: ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java,v retrieving revision 1.12 diff -u -r1.12 ElementLabelProvider.java --- ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java 5 Jan 2010 19:01:16 -0000 1.12 +++ ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java 10 May 2010 17:26:40 -0000 @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Patrick Chuong (Texas Instruments) - added support for checkbox (Bug 286310) + * Patrick Chuong (Texas Instruments) - bug fix 306768 *******************************************************************************/ package org.eclipse.debug.internal.ui.model.elements; @@ -211,8 +212,8 @@ if (columnIds != null) { columnId = columnIds[i]; } - update.setLabel(getLabel(elementPath, presentationContext, columnId), i); - update.setImageDescriptor(getImageDescriptor(elementPath, presentationContext, columnId), i); + update.setLabel(getLabel(elementPath, presentationContext, columnId, i), i); + update.setImageDescriptor(getImageDescriptor(elementPath, presentationContext, columnId, i), i); update.setBackground(getBackground(elementPath, presentationContext, columnId), i); update.setForeground(getForeground(elementPath, presentationContext, columnId), i); update.setFontData(getFontData(elementPath, presentationContext, columnId), i); @@ -272,6 +273,19 @@ protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException { return null; } + + /** + * Returns the ImageDescriptor for the path in the given column with the current presentation + * @param elementPath + * @param presentationContext + * @param columnId + * @param columnIndex + * @return image descriptor or null + * @throws CoreException + */ + protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException { + return getImageDescriptor(elementPath, presentationContext, columnId); + } /** * Returns the label for the path in the given column with the current presentation @@ -283,6 +297,18 @@ protected abstract String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException; /** + * Returns the label for the path in the given column with the current presentation. + * @param elementPath + * @param presentationContext + * @param columnId + * @param columnIndex + * @return label + */ + protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException { + return getLabel(elementPath, presentationContext, columnId); + } + + /** * Returns the checked state for the given path. * * @param path Path of the element to retrieve the grayed state for.