diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 4ac8684da65..0c4bfca0344 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,11 @@ +2005-06-10 Mikhail Khodjaiants + Bug 84929: The "Expression to watch" field of the "Add Watchpoint" dialog is editable. + * CDebugModelPresentation.java + * AddWatchpointActionDelegate.java + * AddWatchpointDialog.java + * ToggleBreakpointAdapter.java + * ModulesView.java + 2005-06-10 Mikhail Khodjaiants Bug 83465: Add "Run to line" and "Resume at line" actions to the context menu of Disassembly view. * plugin.xml diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java index 22cf7d25290..7e8b67eba05 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java @@ -295,7 +295,10 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode } public String getText( Object element ) { - StringBuffer baseText = new StringBuffer( getBaseText( element ) ); + String bt = getBaseText( element ); + if ( bt == null ) + return null; + StringBuffer baseText = new StringBuffer( bt ); if ( element instanceof ICDebugElementStatus && !((ICDebugElementStatus)element).isOK() ) { baseText.append( getFormattedString( " <{0}>", ((ICDebugElementStatus)element).getMessage() ) ); //$NON-NLS-1$ } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java index d18ff3fbe2a..8fd1b97ea40 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java @@ -77,7 +77,7 @@ public class AddWatchpointActionDelegate extends ActionDelegate implements IWork */ public void run( IAction action ) { String expression = getSelectedExpression(); - AddWatchpointDialog dlg = new AddWatchpointDialog( CDebugUIPlugin.getActiveWorkbenchShell(), true, false, expression ); + AddWatchpointDialog dlg = new AddWatchpointDialog( CDebugUIPlugin.getActiveWorkbenchShell(), true, false, expression, true ); if ( dlg.open() != Window.OK ) return; if ( getTextEditor() != null ) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java index 22808b86c3b..0f10dde51f2 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java @@ -47,17 +47,20 @@ public class AddWatchpointDialog extends Dialog { private String fExpression = ""; //$NON-NLS-1$ + private boolean fEditable = true; + /** * Constructor for AddWatchpointDialog. * * @param parentShell */ - public AddWatchpointDialog( Shell parentShell, boolean write, boolean read, String expression ) { + public AddWatchpointDialog( Shell parentShell, boolean write, boolean read, String expression, boolean editable ) { super( parentShell ); fWrite = write; fRead = read; if ( expression != null ) fExpression = expression; + fEditable = editable; } protected void configureShell( Shell shell ) { @@ -106,6 +109,7 @@ public class AddWatchpointDialog extends Dialog { GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); gridData.widthHint = 300; text.setLayoutData( gridData ); + text.setEnabled( fEditable ); addModifyListener( text ); return text; } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java index 8f37423f6d6..55254d29f10 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java @@ -328,7 +328,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint( watchpoint, true ); } else { - AddWatchpointDialog dlg = new AddWatchpointDialog( part.getSite().getShell(), true, false, expression ); + AddWatchpointDialog dlg = new AddWatchpointDialog( part.getSite().getShell(), true, false, expression, false ); if ( dlg.open() != Window.OK ) return; expression = dlg.getExpression(); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModulesView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModulesView.java index cc3e07f5027..a9bc5aa459e 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModulesView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModulesView.java @@ -27,6 +27,7 @@ import org.eclipse.cdt.debug.internal.ui.views.AbstractViewerState; import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.ICDebugUIConstants; +import org.eclipse.core.runtime.IAdaptable; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IValue; @@ -40,6 +41,7 @@ import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.DocumentEvent; @@ -87,6 +89,7 @@ import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.PartInitException; import org.eclipse.ui.actions.ActionFactory; +import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.texteditor.IUpdate; /** @@ -110,7 +113,19 @@ public class ModulesView extends AbstractDebugEventHandlerView implements IDebug * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) */ public Image getImage( Object element ) { - return getModelPresentation().getImage( element ); + Image image = getModelPresentation().getImage( element ); + if ( image == null ) { + if ( element instanceof IAdaptable ) { + IWorkbenchAdapter de = (IWorkbenchAdapter)((IAdaptable)element).getAdapter( IWorkbenchAdapter.class ); + if ( de != null ) { + ImageDescriptor descriptor = de.getImageDescriptor( element ); + if ( descriptor != null ) { + image = descriptor.createImage(); + } + } + } + } + return image; } /* (non-Javadoc) @@ -118,6 +133,17 @@ public class ModulesView extends AbstractDebugEventHandlerView implements IDebug */ public String getText( Object element ) { String text = getModelPresentation().getText( element ); + if ( text == null ) { + if ( element instanceof IAdaptable ) { + IWorkbenchAdapter de = (IWorkbenchAdapter)((IAdaptable)element).getAdapter( IWorkbenchAdapter.class ); + if ( de != null ) { + text = de.getLabel( element ); + } + else { + text = element.toString(); + } + } + } if ( element instanceof ICModule ) { ICModule module = (ICModule)element; text += ( module.areSymbolsLoaded() ) ? ModulesMessages.getString( "ModulesView.11" ) : ModulesMessages.getString( "ModulesView.12" ); //$NON-NLS-1$ //$NON-NLS-2$