Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions debug/org.eclipse.debug.ui/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,7 @@ debug.core.component.label = Platform Debug Core
GroupLaunch.description=Launch several other configurations sequentially

prototype.decorator.label = Prototype Decorator
breakpointLabel.label=Label
breakpointLabel.tooltip=Provide a custom label to quickly identify breakpoint
breakpointLabel.label= Label
breakpointLabel.tooltip= Provide a custom label to quickly identify breakpoint
breakpointLabelCommand = EditBreakpointLabel
breakpointLabelCommand.description = Opens inline editor to change breakpoint label
25 changes: 25 additions & 0 deletions debug/org.eclipse.debug.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2065,6 +2065,10 @@ M4 = Platform-specific fourth key
id="org.eclipse.debug.ui.commands.ToggleLineBreakpoint"
name="%ActionDefinition.toggleLineBreakpoint.name">
</command>
<command
id="org.eclipse.debug.ui.commands.BreakpointLabelCommand"
name="%breakpointLabelCommand"
description="%breakpointLabelCommand.description"/>
</extension>
<extension point="org.eclipse.ui.bindings">
<key
Expand Down Expand Up @@ -2250,6 +2254,11 @@ M4 = Platform-specific fourth key
contextId="org.eclipse.debug.ui.memory.abstractasynctablerendering"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M1+M2+,"/>
<key
commandId="org.eclipse.debug.ui.commands.BreakpointLabelCommand"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="org.eclipse.ui.contexts.window"
sequence="F2"/>
</extension>

<extension point="org.eclipse.ui.commandImages">
Expand Down Expand Up @@ -3271,6 +3280,22 @@ M4 = Platform-specific fourth key
</iterate>
</activeWhen>
</handler>
<handler
commandId="org.eclipse.debug.ui.commands.BreakpointLabelCommand"
class="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointLabelCommandHandler">
<enabledWhen>
<and>
<with variable="activePartId">
<equals value="org.eclipse.debug.ui.BreakpointView"/>
</with>
<with variable="selection">
<iterate ifEmpty="false">
<instanceof value="org.eclipse.debug.core.model.IBreakpoint"/>
</iterate>
</with>
</and>
</enabledWhen>
</handler>
</extension>
<extension
point="org.eclipse.ui.trace.traceComponents">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void run(IAction action) {
Text inlineEditor = new Text(tree.getParent(), SWT.BORDER);
inlineEditor.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
inlineEditor.setText(current);
inlineEditor.selectAll();
inlineEditor.setFocus();

inlineEditor.addListener(SWT.FocusOut, event -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*******************************************************************************
* Copyright (c) 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.breakpoints;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.actions.breakpoints.BreakpointLabelAction;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;

/**
* Default handler for Custom Breakpoint Label action
*
*/
public class BreakpointLabelCommandHandler extends AbstractHandler {

/*
* (non-Javadoc)
*
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

ISelection rawSelection = HandlerUtil.getCurrentSelection(event);
if (!(rawSelection instanceof IStructuredSelection selection)) {
return null;
}

Object element = selection.getFirstElement();
if (!(element instanceof IBreakpoint)) {
return null;
}

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = page.findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
if (view != null) {
BreakpointLabelAction action = new BreakpointLabelAction();
action.init(view);
action.run(null);
}
return null;
}
}
Loading