-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
63 changes: 63 additions & 0 deletions
63
...jtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java
This file contains 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,63 @@ | ||
/******************************************************************************* | ||
* Copyright 2024 Espressif Systems (Shanghai) PTE LTD. All rights reserved. | ||
* Use is subject to license terms. | ||
*******************************************************************************/ | ||
package com.espressif.idf.debug.gdbjtag.openocd.ui; | ||
|
||
import org.eclipse.jface.dialogs.IDialogConstants; | ||
import org.eclipse.jface.dialogs.MessageDialog; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.events.SelectionAdapter; | ||
import org.eclipse.swt.events.SelectionEvent; | ||
import org.eclipse.swt.graphics.Image; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Control; | ||
import org.eclipse.swt.widgets.Link; | ||
import org.eclipse.swt.widgets.Shell; | ||
import org.eclipse.ui.dialogs.PreferencesUtil; | ||
|
||
public class ServerTimeoutErrorDialog extends MessageDialog | ||
{ | ||
|
||
private static final String ESPRESSIF_PREFERENCES_MAINPAGE_ID = "com.espressif.idf.ui.preferences.mainpage"; //$NON-NLS-1$ | ||
|
||
public ServerTimeoutErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, | ||
int dialogImageType, int defaultIndex, String[] dialogButtonLabels) | ||
{ | ||
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, defaultIndex, | ||
dialogButtonLabels); | ||
} | ||
|
||
public static boolean open(int kind, Shell parent, String title, String message, int style) | ||
{ | ||
ServerTimeoutErrorDialog dialog = new ServerTimeoutErrorDialog(parent, title, null, message, kind, 0, | ||
new String[] { IDialogConstants.OK_LABEL }); | ||
style &= SWT.SHEET; | ||
Check warning on line 35 in bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java GitHub Actions / spotbugsDLS_DEAD_LOCAL_STORE
Raw output
|
||
return dialog.open() == 0; | ||
} | ||
|
||
public static void openError(Shell parent) | ||
{ | ||
open(ERROR, parent, Messages.getString("ServerTimeoutErrorDialog.title"), //$NON-NLS-1$ | ||
Messages.getString("ServerTimeoutErrorDialog.message"), SWT.NONE); //$NON-NLS-1$ | ||
} | ||
|
||
@Override | ||
protected Control createCustomArea(Composite parent) | ||
{ | ||
Link link = new Link(parent, SWT.WRAP); | ||
link.setText(Messages.getString("ServerTimeoutErrorDialog.customAreaMessage")); //$NON-NLS-1$ | ||
link.addSelectionListener(new SelectionAdapter() | ||
{ | ||
@Override | ||
public void widgetSelected(SelectionEvent e) | ||
{ | ||
PreferencesUtil | ||
.createPreferenceDialogOn(parent.getShell(), ESPRESSIF_PREFERENCES_MAINPAGE_ID, null, null) | ||
.open(); | ||
} | ||
}); | ||
; | ||
return link; | ||
} | ||
} |
This file contains 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