-
Notifications
You must be signed in to change notification settings - Fork 147
[Debug] Prompt when launching debug session with 'Skip All Breakpoints' enabled #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SougandhS
wants to merge
1
commit into
eclipse-platform:master
Choose a base branch
from
SougandhS:SkipBreakpointsPrompt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/SkipBreakpointsWarning.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/******************************************************************************* | ||
* 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.ui; | ||
|
||
import org.eclipse.debug.core.DebugPlugin; | ||
import org.eclipse.debug.internal.ui.DebugUIMessages; | ||
import org.eclipse.debug.internal.ui.DebugUIPlugin; | ||
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; | ||
import org.eclipse.jface.dialogs.Dialog; | ||
import org.eclipse.jface.dialogs.IDialogConstants; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.graphics.Point; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Button; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Control; | ||
import org.eclipse.swt.widgets.Label; | ||
import org.eclipse.swt.widgets.Shell; | ||
|
||
/** | ||
* Provides warning prompt dialog | ||
* | ||
* @since 3.19 | ||
*/ | ||
public class SkipBreakpointsWarning extends Dialog { | ||
|
||
Button disableWarning; | ||
|
||
Button enableBreakppints; | ||
|
||
protected SkipBreakpointsWarning(Shell parentShell) { | ||
super(parentShell); | ||
} | ||
|
||
@Override | ||
protected void configureShell(Shell newShell) { | ||
super.configureShell(newShell); | ||
newShell.setText(DebugUIMessages.skipBreakpointWarningTitle); | ||
} | ||
@Override | ||
protected Control createDialogArea(Composite parent) { | ||
Composite container = (Composite) super.createDialogArea(parent); | ||
GridLayout layout = new GridLayout(1, true); | ||
layout.marginTop = 10; | ||
layout.marginLeft = 10; | ||
layout.marginRight = 10; | ||
layout.verticalSpacing = 10; | ||
|
||
container.setLayout(layout); | ||
Label messageLabel = new Label(container, SWT.WRAP); | ||
messageLabel.setText(DebugUIMessages.skipBreakpointWarningLabel); | ||
GridData messageData = new GridData(SWT.FILL, SWT.CENTER, false, false); | ||
messageData.widthHint = 500; | ||
messageLabel.setLayoutData(messageData); | ||
|
||
disableWarning = new Button(container, SWT.CHECK); | ||
disableWarning.setText(DebugUIMessages.skipBreakpointWarningToggle1); | ||
|
||
GridData data = new GridData(SWT.NONE); | ||
data.verticalIndent = 20; | ||
data.horizontalAlignment = GridData.BEGINNING; | ||
disableWarning.setLayoutData(data); | ||
return container; | ||
} | ||
|
||
@Override | ||
protected void createButtonsForButtonBar(Composite parent) { | ||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); | ||
enableBreakppints = createButton(parent, IDialogConstants.YES_ID, DebugUIMessages.skipBreakpointButton1, false); | ||
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); | ||
} | ||
|
||
@Override | ||
protected void buttonPressed(int buttonId) { | ||
if (IDialogConstants.OK_ID == buttonId) { | ||
disableWarning(); | ||
okPressed(); | ||
} else if (IDialogConstants.CANCEL_ID == buttonId) { | ||
cancelPressed(); | ||
} else if (IDialogConstants.YES_ID == buttonId) { | ||
disableWarning(); | ||
DebugPlugin.getDefault().getBreakpointManager().setEnabled(true); | ||
okPressed(); | ||
} | ||
} | ||
|
||
@Override | ||
protected Point getInitialSize() { | ||
return new Point(580, 200); | ||
} | ||
|
||
@Override | ||
public boolean close() { | ||
disableWarning.dispose(); | ||
enableBreakppints.dispose(); | ||
return super.close(); | ||
} | ||
|
||
private void disableWarning() { | ||
if (disableWarning.getSelection()) { | ||
DebugUIPlugin.getDefault().getPreferenceStore() | ||
.setValue(IInternalDebugUIConstants.PREF_SKIP_ALL_BREAKPOINTS_PROMPT, false); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you have just implemented
MessageDialogWithToggle
again?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But
MessageDialogWithToggle
supports only 1 toggle option, so created a custom oneThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need two options? Just warn and user can enable or disable "skip breakpoints" after that if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this approach would help the user quickly disable the option if needed. But I can go with your suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you could provide a push button for the disable disabled action so that there is no expectation that the check state might be persisted like the don’t ask again check box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean remove the checkbox and add a "disable" button right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Just keep in mind that the double negative on disable the disable all is also a potential point of confusion. Enable Breakpoints might be better. The opinions of others would be welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merks

How about this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that seems fine (to me).