mirror of
https://github.com/eclipse-cdt/cdt
synced 2024-10-28 20:17:52 +01:00
[308933] Event breakpoints icons lack decorators
This commit is contained in:
parent
555428deb8
commit
f223513d5f
4 changed files with 26 additions and 13 deletions
Binary file not shown.
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 923 B |
|
@ -79,6 +79,8 @@ public class CDebugImages {
|
||||||
public static final String IMG_OBJS_TRACEPOINT_DISABLED = NAME_PREFIX + "trcpd_obj.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_TRACEPOINT_DISABLED = NAME_PREFIX + "trcpd_obj.gif"; //$NON-NLS-1$
|
||||||
public static final String IMG_OBJS_WATCHPOINT_ENABLED = NAME_PREFIX + "readwrite_obj.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_WATCHPOINT_ENABLED = NAME_PREFIX + "readwrite_obj.gif"; //$NON-NLS-1$
|
||||||
public static final String IMG_OBJS_WATCHPOINT_DISABLED = NAME_PREFIX + "readwrite_obj_disabled.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_WATCHPOINT_DISABLED = NAME_PREFIX + "readwrite_obj_disabled.gif"; //$NON-NLS-1$
|
||||||
|
public static final String IMG_OBJS_EVENTBREAKPOINT_ENABLED = NAME_PREFIX + "eventbreakpoint_obj.gif"; //$NON-NLS-1$
|
||||||
|
public static final String IMG_OBJS_EVENTBREAKPOINT_DISABLED = NAME_PREFIX + "eventbreakpointd_obj.gif"; //$NON-NLS-1$
|
||||||
public static final String IMG_OBJS_READ_WATCHPOINT_ENABLED = NAME_PREFIX + "read_obj.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_READ_WATCHPOINT_ENABLED = NAME_PREFIX + "read_obj.gif"; //$NON-NLS-1$
|
||||||
public static final String IMG_OBJS_READ_WATCHPOINT_DISABLED = NAME_PREFIX + "read_obj_disabled.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_READ_WATCHPOINT_DISABLED = NAME_PREFIX + "read_obj_disabled.gif"; //$NON-NLS-1$
|
||||||
public static final String IMG_OBJS_WRITE_WATCHPOINT_ENABLED = NAME_PREFIX + "write_obj.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_WRITE_WATCHPOINT_ENABLED = NAME_PREFIX + "write_obj.gif"; //$NON-NLS-1$
|
||||||
|
@ -161,6 +163,8 @@ public class CDebugImages {
|
||||||
public static final ImageDescriptor DESC_OBJS_TRACEPOINT_DISABLED = createManaged( T_DLCL, IMG_OBJS_TRACEPOINT_DISABLED );
|
public static final ImageDescriptor DESC_OBJS_TRACEPOINT_DISABLED = createManaged( T_DLCL, IMG_OBJS_TRACEPOINT_DISABLED );
|
||||||
public static final ImageDescriptor DESC_OBJS_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_ENABLED );
|
public static final ImageDescriptor DESC_OBJS_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_ENABLED );
|
||||||
public static final ImageDescriptor DESC_OBJS_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_DISABLED );
|
public static final ImageDescriptor DESC_OBJS_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_DISABLED );
|
||||||
|
public static final ImageDescriptor DESC_OBJS_EVENTBREAKPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_EVENTBREAKPOINT_ENABLED );
|
||||||
|
public static final ImageDescriptor DESC_OBJS_EVENTBREAKPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_EVENTBREAKPOINT_DISABLED );
|
||||||
public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_ENABLED );
|
public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_ENABLED );
|
||||||
public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_DISABLED );
|
public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_DISABLED );
|
||||||
public static final ImageDescriptor DESC_OBJS_WRITE_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WRITE_WATCHPOINT_ENABLED );
|
public static final ImageDescriptor DESC_OBJS_WRITE_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WRITE_WATCHPOINT_ENABLED );
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugElement;
|
import org.eclipse.cdt.debug.core.model.ICDebugElement;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
||||||
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
|
import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
|
||||||
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
||||||
|
@ -332,6 +333,10 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
|
||||||
if ( breakpoint instanceof ICWatchpoint ) {
|
if ( breakpoint instanceof ICWatchpoint ) {
|
||||||
return getWatchpointImage( (ICWatchpoint)breakpoint );
|
return getWatchpointImage( (ICWatchpoint)breakpoint );
|
||||||
}
|
}
|
||||||
|
if ( breakpoint instanceof ICEventBreakpoint ) {
|
||||||
|
return getEventBreakpointImage( (ICEventBreakpoint)breakpoint );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
}
|
}
|
||||||
|
@ -381,6 +386,11 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
|
||||||
return getImageCache().getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeOverlays( watchpoint ) ) );
|
return getImageCache().getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeOverlays( watchpoint ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Image getEventBreakpointImage( ICEventBreakpoint evtBreakpoint ) throws CoreException {
|
||||||
|
ImageDescriptor descriptor = evtBreakpoint.isEnabled() ? CDebugImages.DESC_OBJS_EVENTBREAKPOINT_ENABLED : CDebugImages.DESC_OBJS_EVENTBREAKPOINT_DISABLED;
|
||||||
|
return getImageCache().getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeOverlays( evtBreakpoint ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText( Object element ) {
|
public String getText( Object element ) {
|
||||||
String bt = getBaseText( element );
|
String bt = getBaseText( element );
|
||||||
|
|
|
@ -15,6 +15,7 @@ package org.eclipse.cdt.debug.ui.breakpoints;
|
||||||
import org.eclipse.cdt.debug.core.DebugCoreMessages;
|
import org.eclipse.cdt.debug.core.DebugCoreMessages;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdapterFactory;
|
import org.eclipse.core.runtime.IAdapterFactory;
|
||||||
|
@ -30,8 +31,6 @@ import com.ibm.icu.text.MessageFormat;
|
||||||
* Factory for event breakpoint label provider
|
* Factory for event breakpoint label provider
|
||||||
*/
|
*/
|
||||||
public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory {
|
public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
public static final String IMG_OBJS_EVENTBREAKPOINT_ENABLED = "icons/obj16/eventbreakpoint_obj.gif"; //$NON-NLS-1$
|
|
||||||
public static final String IMG_OBJS_EVENTBREAKPOINT_DISABLED = "icons/obj16/eventbreakpointd_obj.gif"; //$NON-NLS-1$
|
|
||||||
private static ILabelProvider fLabelProvider = new LabelProvider() {
|
private static ILabelProvider fLabelProvider = new LabelProvider() {
|
||||||
@Override
|
@Override
|
||||||
public String getText(Object element) {
|
public String getText(Object element) {
|
||||||
|
@ -75,19 +74,19 @@ public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns null. We do not provide the image because it would require
|
||||||
|
* duplicating centralized code in {@link CDebugModelPresentation},
|
||||||
|
* particularly the code that determines the proper overlays. This
|
||||||
|
* adapter is actually only called from within CDebugModelPresentation
|
||||||
|
* and we know it will do the right thing for an event breakpoint if we
|
||||||
|
* return null here.
|
||||||
|
*
|
||||||
|
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Image getImage(Object element) {
|
public Image getImage(Object element) {
|
||||||
try {
|
|
||||||
if (element instanceof ICEventBreakpoint) {
|
|
||||||
ICEventBreakpoint eventBkpt = (ICEventBreakpoint) element;
|
|
||||||
if (eventBkpt.isEnabled())
|
|
||||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_ENABLED);
|
|
||||||
else
|
|
||||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_DISABLED);
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
|
||||||
CDebugUIPlugin.log(e);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue