From 94cdf513f6604e4f848c66bf9e119b72684a36f6 Mon Sep 17 00:00:00 2001 From: Denys Almazov Date: Thu, 7 Mar 2024 11:54:20 +0200 Subject: [PATCH] fix: cleaning up message properties --- .../gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java | 2 +- .../espressif/idf/debug/gdbjtag/openocd/ui/Messages.java | 6 +++++- .../gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java | 8 +++----- .../idf/debug/gdbjtag/openocd/ui/messages.properties | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java index 1d5093bb8..39988e733 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java @@ -448,7 +448,7 @@ else if (sessionType == SessionType.CORE) } catch (ExecutionException e1) { - if (e1.getMessage().contains("Starting OpenOCD timed out.")) + if (e1.getMessage().contains("Starting OpenOCD timed out.")) //$NON-NLS-1$ { Display.getDefault().asyncExec(() -> { ServerTimeoutErrorDialog.openError(Display.getDefault().getActiveShell()); diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java index 4688341ad..c912f5414 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java @@ -61,7 +61,7 @@ public class Messages public static String TabMain_Launch_Config; public static String TabDebugger_SettingTargetJob; - + public static String OpenOCDConsole_ErrorGuideMessage; public static String TabDebugger_noConfigOptions; @@ -71,6 +71,10 @@ public class Messages public static String TabDebugger_noTclPort; public static String TabDebugger_noTelnetPort; + public static String ServerTimeoutErrorDialog_title; + public static String ServerTimeoutErrorDialog_message; + public static String ServerTimeoutErrorDialog_customAreaMessage; + // ------------------------------------------------------------------------ static diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java index bb02326e4..78dd91400 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/ServerTimeoutErrorDialog.java @@ -28,25 +28,23 @@ public ServerTimeoutErrorDialog(Shell parentShell, String dialogTitle, Image dia dialogButtonLabels); } - public static boolean open(int kind, Shell parent, String title, String message, int style) + public static boolean open(int kind, Shell parent, String title, String message) { ServerTimeoutErrorDialog dialog = new ServerTimeoutErrorDialog(parent, title, null, message, kind, 0, new String[] { IDialogConstants.OK_LABEL }); - style &= SWT.SHEET; 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$ + open(ERROR, parent, Messages.ServerTimeoutErrorDialog_title, Messages.ServerTimeoutErrorDialog_message); } @Override protected Control createCustomArea(Composite parent) { Link link = new Link(parent, SWT.WRAP); - link.setText(Messages.getString("ServerTimeoutErrorDialog.customAreaMessage")); //$NON-NLS-1$ + link.setText(Messages.ServerTimeoutErrorDialog_customAreaMessage); link.addSelectionListener(new SelectionAdapter() { @Override diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties index 992e6c728..5ea3e07c1 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties @@ -413,6 +413,6 @@ TabMain_Launch_Config=Launch Configuration: OpenOCDConsole_ErrorGuideMessage=Please refer to the troubleshooting guide below to identify the problem. ## Timeout Exception Dialog ## -ServerTimeoutErrorDialog.customAreaMessage=To increase timeout time visit the Espressif Preference Page. -ServerTimeoutErrorDialog.message=Starting OpenOCD timed out. Try to increase the `GDB server launch timeout` -ServerTimeoutErrorDialog.title=Problem Occurred +ServerTimeoutErrorDialog_customAreaMessage=To increase timeout time visit the Espressif Preference Page. +ServerTimeoutErrorDialog_message=Starting OpenOCD timed out. Try to increase the `GDB server launch timeout` +ServerTimeoutErrorDialog_title=Problem Occurred