From 407bd94260208242f31a772f7d14f0f836e2e79f Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Mon, 5 Jan 2026 12:55:14 -0500 Subject: [PATCH 1/6] Update message props structure Signed-off-by: Adam Wisniewski --- .../tools/eclipse/CommandBuilder.java | 4 +- .../tools/eclipse/DevModeOperations.java | 66 +++++----- .../io/openliberty/tools/eclipse/Project.java | 6 +- .../tools/eclipse/WorkspaceProjectsModel.java | 2 +- .../debug/LibertyDebugReconnectHandler.java | 2 +- .../eclipse/handlers/ExplorerMenuHandler.java | 6 +- .../tools/eclipse/messages/Messages.java | 123 +++++++----------- .../eclipse/ui/dashboard/DashboardView.java | 32 ++--- .../tools/eclipse/ui/launch/JRETab.java | 4 +- .../LaunchConfigurationDelegateLauncher.java | 2 +- .../tools/eclipse/ui/launch/StartTab.java | 8 +- .../shortcuts/OpenGradleTestReportAction.java | 9 +- .../shortcuts/OpenMavenITestReportAction.java | 8 +- .../shortcuts/OpenMavenUTestReportAction.java | 8 +- .../ui/launch/shortcuts/RunTestsAction.java | 4 +- .../ui/launch/shortcuts/StartAction.java | 6 +- .../StartConfigurationDialogAction.java | 6 +- .../shortcuts/StartInContainerAction.java | 6 +- .../ui/launch/shortcuts/StopAction.java | 4 +- 19 files changed, 139 insertions(+), 167 deletions(-) diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java index bc75af63..97d88054 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java @@ -109,9 +109,9 @@ private String getCommand() throws CommandBuilder.CommandNotFoundException { } if (isMaven) { - ErrorHandler.processPreferenceErrorMessage(NLS.bind(Messages.maven_exec_not_found, null), true); + ErrorHandler.processPreferenceErrorMessage(Messages.getMessage("maven_exec_not_found"), true); } else { - ErrorHandler.processPreferenceErrorMessage(NLS.bind(Messages.gradle_exec_not_found, null), true); + ErrorHandler.processPreferenceErrorMessage(Messages.getMessage("gradle_exec_not_found"), true); } throw new CommandNotFoundException(errorMsg); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java index 769f3563..d2dd119d 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java @@ -177,7 +177,7 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_no_project_found"), true); return; } @@ -268,7 +268,7 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, "An error was detected during the start request on project " + projectName, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_general_error, projectName), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_general_error", projectName), e, true); return; } @@ -297,7 +297,7 @@ public void startInContainer(IProject iProject, String parms, String javaHomePat if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_container_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_container_no_project_found"), true); return; } @@ -381,7 +381,7 @@ public void startInContainer(IProject iProject, String parms, String javaHomePat if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_container_general_error, projectName), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_container_general_error", projectName), e, true); return; } @@ -412,7 +412,7 @@ public void stop(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.stop_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("stop_no_project_found"), true); return; } @@ -425,7 +425,7 @@ public void stop(IProject inputProject) { // Check if the stop action has already been issued of if a start action was never issued before. if (!processController.isProcessStarted(projectName)) { - String msg = NLS.bind(Messages.stop_already_issued, projectName); + String msg = Messages.getMessage("stop_already_issued", projectName); handleStopActionError(projectName, msg); return; @@ -439,7 +439,7 @@ public void stop(IProject inputProject) { cleanupProcess(projectName); } catch (Exception e) { - String msg = NLS.bind(Messages.stop_general_error, projectName); + String msg = Messages.getMessage("stop_general_error", projectName); handleStopActionError(projectName, msg); return; @@ -476,7 +476,7 @@ public void runTests(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.run_tests_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("run_tests_no_project_found"), true); return; } @@ -489,7 +489,7 @@ public void runTests(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. ProcessController: " + processController); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.run_tests_no_prior_start, projectName), true); + ErrorHandler.processErrorMessage(Messages.getMessage("run_tests_no_prior_start", projectName), true); return; } @@ -501,7 +501,7 @@ public void runTests(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.run_tests_general_error, projectName), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("run_tests_general_error", projectName), e, true); return; } @@ -532,7 +532,7 @@ public void openMavenIntegrationTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_int_test_report_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("mvn_int_test_report_no_project_found"), true); return; } @@ -565,7 +565,7 @@ public void openMavenIntegrationTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_int_test_report_general_error, projectName), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("mvn_int_test_report_general_error", projectName), e, true); return; } @@ -598,7 +598,7 @@ public void openMavenUnitTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_unit_test_report_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("mvn_unit_test_report_no_project_found"), true); } String projectName = iProject.getName(); @@ -629,7 +629,7 @@ public void openMavenUnitTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_unit_test_report_general_error, projectName), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("mvn_unit_test_report_general_error", projectName), e, true); return; } @@ -660,7 +660,7 @@ public void openGradleTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.gradle_test_report_no_project_found, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("gradle_test_report_no_project_found"), true); return; } @@ -688,11 +688,11 @@ public void openGradleTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Path: " + path); } - ErrorHandler.processErrorMessage( - NLS.bind(Messages.gradle_test_report_none_found, new String[] { projectName, - DashboardView.APP_MENU_ACTION_RUN_TESTS, - DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT }), - true); + ErrorHandler + .processErrorMessage( + Messages.getMessage("gradle_test_report_none_found", projectName, + DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT), + true); return; } @@ -704,7 +704,7 @@ public void openGradleTestReport(IProject inputProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.gradle_test_report_general_error, projectName)); + ErrorHandler.processErrorMessage(Messages.getMessage("gradle_test_report_general_error", projectName)); return; } @@ -778,7 +778,7 @@ public void startDevMode(String cmd, String projectName, String projectPath, Str * @param baseMsg The base message to display. */ private void handleStopActionError(String projectName, String baseMsg) { - String stopPromptMsg = NLS.bind(Messages.issue_stop_prompt, null); + String stopPromptMsg = Messages.getMessage("issue_stop_prompt"); String msg = baseMsg + "\n\n" + stopPromptMsg; Integer response = ErrorHandler.processWarningMessage(msg, true, new String[] { "Yes", "No" }, 0); if (response != null && response == 0) { @@ -876,7 +876,7 @@ protected IStatus run(IProgressMonitor monitor) { } } } catch (Exception e) { - ErrorHandler.processErrorMessage(NLS.bind(Messages.plugin_stop_issue_error, null), e, false); + ErrorHandler.processErrorMessage(Messages.getMessage("plugin_stop_issue_error"), e, false); } return Status.OK_STATUS; } @@ -907,8 +907,8 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg); } - ErrorHandler.rawErrorMessageDialog(NLS.bind(Messages.plugin_stop_timeout, - new String[] { projectName, Integer.toString(STOP_TIMEOUT_SECONDS) })); + ErrorHandler.rawErrorMessageDialog(Messages.getMessage("plugin_stop_timeout", + projectName, Integer.toString(STOP_TIMEOUT_SECONDS))); } }); return; @@ -924,7 +924,7 @@ public void run() { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - ErrorHandler.processErrorMessage(NLS.bind(Messages.plugin_stop_failed, rc), true); + ErrorHandler.processErrorMessage(Messages.getMessage("plugin_stop_failed", rc), true); } }); return; @@ -942,7 +942,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.plugin_stop_general_error, projectName), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("plugin_stop_general_error", projectName), e, true); return; } @@ -969,10 +969,8 @@ public static Path getMavenIntegrationTestReportPath(String projectPath, String if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Paths checked: " + path1 + ", " + path2); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_int_test_report_none_found, new String[] { projectName, - DashboardView.APP_MENU_ACTION_RUN_TESTS, - DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT }), - true); + ErrorHandler.processErrorMessage(Messages.getMessage("mvn_int_test_report_none_found", projectName, + DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT), true); return null; } @@ -1031,10 +1029,8 @@ public static Path getMavenUnitTestReportPath(String projectPath, String project if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Paths checked: " + path1 + ", " + path2); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_unit_test_report_none_found, new String[] { projectName, - DashboardView.APP_MENU_ACTION_RUN_TESTS, - DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }), - true); + ErrorHandler.processErrorMessage(Messages.getMessage("mvn_unit_test_report_none_found", projectName, + DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT), true); return null; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java index b522333a..bf6a7d96 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java @@ -212,7 +212,7 @@ public List filterJavaProjects(Set projects) { javaProjecs.add(child); } } catch (CoreException e) { - ErrorHandler.processWarningMessage(NLS.bind(Messages.determine_java_project_error, child.getName()), e, false); + ErrorHandler.processWarningMessage(Messages.getMessage("determine_java_project_error", child.getName()), e, false); } } return javaProjecs; @@ -269,7 +269,7 @@ public void classifyAsServerModule() { libertyServerModule = false; } } catch (Exception e) { - ErrorHandler.processWarningMessage(NLS.bind(Messages.liberty_nature_add_error, null), e, false); + ErrorHandler.processWarningMessage(Messages.getMessage("liberty_nature_add_error"), e, false); } } @@ -292,7 +292,7 @@ public void classifyAsLibertyNature() { } } } catch (Exception e) { - ErrorHandler.processWarningMessage(NLS.bind(Messages.liberty_nature_add_error, null), e, false); + ErrorHandler.processWarningMessage(Messages.getMessage("liberty_nature_add_error"), e, false); } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java index 1470a190..146d7147 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java @@ -148,7 +148,7 @@ private void buildMultiProjectModel(List projectsToScan, boolean class if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " Workspace projects: " + projectsByLocation.values(), e); } - ErrorHandler.processWarningMessage(NLS.bind(Messages.project_analyze_error, null), e, false); + ErrorHandler.processWarningMessage(Messages.getMessage("project_analyze_error"), e, false); } if (Trace.isEnabled()) { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java index 75aaf8a2..f08177a9 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java @@ -107,7 +107,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.project_name_error, null), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("project_name_error"), e, true); } if (projectName != null && !projectName.isBlank()) { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java index 6bdfb2b4..dbb64291 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java @@ -57,7 +57,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { Trace.getTracer().trace(Trace.TRACE_HANDLERS, msg); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.project_not_valid, null), true); + ErrorHandler.processErrorMessage(Messages.getMessage("project_not_valid"), true); return null; } @@ -73,7 +73,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { Trace.getTracer().trace(Trace.TRACE_HANDLERS, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.menu_command_retrieve_error, null), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("menu_command_retrieve_error"), e, true); return null; } @@ -106,7 +106,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { } ErrorHandler.processErrorMessage( - NLS.bind(Messages.menu_command_process_error, new String[] { commandName, iProject.getName() }), e); + Messages.getMessage("menu_command_process_error", commandName, iProject.getName()), e); } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java index 5de9cabc..34b848cf 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java @@ -10,89 +10,56 @@ *******************************************************************************/ package io.openliberty.tools.eclipse.messages; -import org.eclipse.osgi.util.NLS; +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; /** - * Translated messages. + * Provides access to NLS Messages. */ -public class Messages extends NLS { +public class Messages { - /** DebugModeHandler */ - public static String multiple_server_env; - - /** DevModeOperations */ - public static String start_no_project_found; - public static String start_already_issued; - public static String start_general_error; - - public static String start_container_no_project_found; - public static String start_container_already_issued; - public static String start_container_general_error; - - public static String stop_no_project_found; - public static String stop_already_issued; - public static String stop_general_error; - - public static String run_tests_no_project_found; - public static String run_tests_no_prior_start; - public static String run_tests_general_error; - - public static String mvn_int_test_report_no_project_found; - public static String mvn_int_test_report_none_found; - public static String mvn_int_test_report_general_error; - - public static String mvn_unit_test_report_no_project_found; - public static String mvn_unit_test_report_none_found; - public static String mvn_unit_test_report_general_error; - - public static String gradle_test_report_no_project_found; - public static String gradle_test_report_none_found; - public static String gradle_test_report_general_error; - - public static String issue_stop_prompt; - public static String plugin_stop_issue_error; - public static String plugin_stop_timeout; - public static String plugin_stop_failed; - public static String plugin_stop_general_error; - - /** WorkspaceProjectsModel */ - public static String project_analyze_error; - - /** DashboardView */ - public static String project_not_gradle_or_maven; - public static String image_descriptions_error; - public static String action_general_error; - public static String dashboard_refresh_error; - - /** JRETab */ - public static String java_default_set_error; - public static String java_resolution_error; - - /** LaunchConfigurationDelegateLauncher */ - public static String launch_config_error; - - /** StartTab */ - public static String start_parm_retrieve_error; - public static String project_name_error; - public static String run_config_initialize_error; - - /** All *Action classes */ - public static String launch_shortcut_error; - - /** ExplorerMenuHandler */ - public static String project_not_valid; - public static String menu_command_retrieve_error; - public static String menu_command_process_error; - - /** CommandBuilder */ - public static String maven_exec_not_found; - public static String gradle_exec_not_found; + /** Message Resource bundle */ + private static ResourceBundle NLS_BUNDLE; + static { + try { + NLS_BUNDLE = ResourceBundle.getBundle("io.openliberty.tools.eclipse.messages.Messages", Locale.getDefault()); + } catch (Exception e) { + NLS_BUNDLE = ResourceBundle.getBundle("io.openliberty.tools.eclipse.messages.Messages"); + } + } - /** Project */ - public static String determine_java_project_error; - public static String liberty_nature_add_error; + /** + * Returns a translated message with no arguments. + * + * @param key The message Key. + * + * @return The translated message without arguments. + */ + public static String getMessage(String key) { + return getMessage(key, (Object) null); + } - static { - NLS.initializeMessages("io.openliberty.tools.eclipse.messages.Messages", Messages.class); + /** + * Returns a translated message with arguments. + * + * @param key The message key. + * @param args The arguments associated with the message. + * + * @return A translated message with arguments. + */ + public static String getMessage(String key, Object... args) { + String msg = null; + + try { + msg = NLS_BUNDLE.getString(key); + if (msg != null && args != null) { + msg = MessageFormat.format(msg, args); + } + } catch (Exception e) { + msg = key; + } + + return msg; } } \ No newline at end of file diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java index 797ebcc9..d55ec7c5 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java @@ -211,7 +211,7 @@ private void addActionsToContextMenu(IMenuManager mgr) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.project_not_gradle_or_maven, projectName), true); + ErrorHandler.processErrorMessage(Messages.getMessage("project_not_gradle_or_maven", projectName), true); return; } } @@ -234,7 +234,7 @@ private void createActions() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processWarningMessage(NLS.bind(Messages.image_descriptions_error, null), e, true); + ErrorHandler.processWarningMessage(Messages.getMessage("image_descriptions_error"), e, true); } // Activate the Liberty tools context. @@ -253,7 +253,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_START), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_START), e, true); } } }; @@ -276,8 +276,8 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_START_CONFIG), e, - true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_START_CONFIG), e, + true); } } }; @@ -299,7 +299,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_START_IN_CONTAINER), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_START_IN_CONTAINER), e, true); } } }; @@ -321,7 +321,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_DEBUG_IN_CONTAINER), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_DEBUG_IN_CONTAINER), e, true); } } }; @@ -342,7 +342,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_DEBUG), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_DEBUG), e, true); } } }; @@ -364,7 +364,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_DEBUG_CONFIG), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_DEBUG_CONFIG), e, true); } } }; @@ -385,7 +385,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_STOP), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_STOP), e, true); } } }; @@ -406,7 +406,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_RUN_TESTS), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_RUN_TESTS), e, true); } } }; @@ -428,7 +428,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_VIEW_MVN_IT_REPORT), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_VIEW_MVN_IT_REPORT), e, true); } } }; @@ -450,7 +450,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_VIEW_MVN_UT_REPORT), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_VIEW_MVN_UT_REPORT), e, true); } } }; @@ -472,8 +472,8 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT), e, - true); + ErrorHandler.processErrorMessage(Messages.getMessage("action_general_error", APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT), e, + true); } } }; @@ -510,7 +510,7 @@ public void refreshDashboardView(WorkspaceProjectsModel projectModel, boolean re if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.dashboard_refresh_error, null), e, reportError); + ErrorHandler.processErrorMessage(Messages.getMessage("dashboard_refresh_error"), e, reportError); return; } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java index 3acc6433..c71cd3f0 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java @@ -81,7 +81,7 @@ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { } } catch (Exception e) { ErrorHandler.processWarningMessage( - NLS.bind(Messages.java_default_set_error, new String[] { activeProject.getName(), configuration.getName() }), e); + Messages.getMessage("java_default_set_error", activeProject.getName(), configuration.getName()), e); } super.setDefaults(configuration); @@ -109,7 +109,7 @@ public static String resolveJavaHome(ILaunchConfiguration configuration) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processWarningMessage(NLS.bind(Messages.java_resolution_error, configuration.getName()), e); + ErrorHandler.processWarningMessage(Messages.getMessage("java_resolution_error", configuration.getName()), e); } if (keyValue != null) { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java index f5d170f7..66ac9745 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java @@ -87,7 +87,7 @@ public void run() { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.launch_config_error, configuration.getName()), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("launch_config_error", configuration.getName()), e, true); return; } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java index 2826faa1..d15b4540 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java @@ -185,7 +185,7 @@ public void initializeFrom(ILaunchConfiguration configuration) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, ce); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.run_config_initialize_error, null), ce, true); + ErrorHandler.processErrorMessage(Messages.getMessage("run_config_initialize_error"), ce, true); } if (Trace.isEnabled()) { @@ -235,7 +235,7 @@ public boolean isValid(ILaunchConfiguration config) { Trace.getTracer().trace(Trace.TRACE_TOOLS, "The start request was already issued on project " + configProjectName); } - super.setErrorMessage(NLS.bind(Messages.start_already_issued, configProjectName)); + super.setErrorMessage(Messages.getMessage("start_already_issued", configProjectName)); return false; } } catch (CoreException ce) { @@ -243,7 +243,7 @@ public boolean isValid(ILaunchConfiguration config) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, ce); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.project_name_error, null), ce, true); + ErrorHandler.processErrorMessage(Messages.getMessage("project_name_error"), ce, true); return false; } return checkForIncorrectTerms(); @@ -472,7 +472,7 @@ private String getDefaultStartCommand(IProject iProject) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_parm_retrieve_error, null), e, true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_parm_retrieve_error"), e, true); } return parms; diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java index 62480973..8cafc25d 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java @@ -50,8 +50,8 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), - e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), + e, true); return; } @@ -80,8 +80,13 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( +<<<<<<< HEAD NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), e, true); +======= + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), + e, true); +>>>>>>> 26a0cd9 (Update message props structure) return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java index 01dc5313..7b791a29 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java @@ -50,8 +50,8 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, - true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, + true); return; } @@ -80,8 +80,8 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, - true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, + true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java index 96215b5f..1d48e1aa 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java @@ -50,8 +50,8 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, - true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, + true); return; } @@ -80,8 +80,8 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, - true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, + true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java index 04335c62..3bafc152 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java @@ -50,7 +50,7 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); return; } @@ -79,7 +79,7 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java index b4158578..56808477 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java @@ -54,7 +54,7 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); } if (Trace.isEnabled()) { @@ -82,7 +82,7 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); } if (Trace.isEnabled()) { @@ -111,7 +111,7 @@ public static void run(IProject iProject, String mode) throws Exception { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, "The start request was already issued on project " + projectName); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_already_issued, projectName), true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_already_issued", projectName), true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java index de55b3c7..e36a03d3 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java @@ -64,7 +64,7 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); return; } @@ -93,7 +93,11 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( +<<<<<<< HEAD NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); +======= + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); +>>>>>>> 26a0cd9 (Update message props structure) return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java index 0316a8f0..231bc2fd 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java @@ -54,7 +54,7 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); return; } @@ -83,7 +83,7 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); return; } @@ -114,7 +114,7 @@ public static void run(IProject iProject, String mode) throws Exception { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, "The start in container request was already issued on project " + projectName); } - ErrorHandler.processErrorMessage(NLS.bind(Messages.start_container_already_issued, projectName), true); + ErrorHandler.processErrorMessage(Messages.getMessage("start_container_already_issued", projectName), true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java index e3ddab79..5e938ae7 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java @@ -50,7 +50,7 @@ public void launch(ISelection selection, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); return; } @@ -79,7 +79,7 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); + Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); return; } From 5617a6fda120d1014dc38f7d01e621b23e6b88b1 Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Mon, 5 Jan 2026 13:00:33 -0500 Subject: [PATCH 2/6] Remove duplicate trace messages Signed-off-by: Adam Wisniewski --- .../tools/eclipse/DevModeOperations.java | 17 +++++++++-------- .../debug/LibertyDebugReconnectHandler.java | 4 ++-- .../eclipse/handlers/ExplorerMenuHandler.java | 4 ++-- .../ui/launch/shortcuts/StartAction.java | 12 ++++-------- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java index d2dd119d..902e5eab 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java @@ -173,11 +173,11 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch } if (iProject == null) { - String msg = "An error was detected when the start request was processed. The object that represents the selected project was not found."; + String msg = Messages.getMessage("start_no_project_found"); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(Messages.getMessage("start_no_project_found"), true); + ErrorHandler.processErrorMessage(msg, true); return; } @@ -265,10 +265,11 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch } return; } catch (Exception e) { + String msg = Messages.getMessage("start_general_error", projectName); if (Trace.isEnabled()) { - Trace.getTracer().trace(Trace.TRACE_TOOLS, "An error was detected during the start request on project " + projectName, e); + Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(Messages.getMessage("start_general_error", projectName), e, true); + ErrorHandler.processErrorMessage(msg, e, true); return; } @@ -293,11 +294,11 @@ public void startInContainer(IProject iProject, String parms, String javaHomePat } if (iProject == null) { - String msg = "An error was detected when the start in container request was processed. The object that represents the selected project was not found."; + String msg = Messages.getMessage("start_container_no_project_found"); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op."); } - ErrorHandler.processErrorMessage(Messages.getMessage("start_container_no_project_found"), true); + ErrorHandler.processErrorMessage(msg, true); return; } @@ -377,11 +378,11 @@ public void startInContainer(IProject iProject, String parms, String javaHomePat debugModeHandler.startDebugAttacher(project, launch, debugPort); } } catch (Exception e) { - String msg = "An error was detected during the start in container request on project " + projectName; + String msg = Messages.getMessage("start_container_general_error", projectName); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } - ErrorHandler.processErrorMessage(Messages.getMessage("start_container_general_error", projectName), e, true); + ErrorHandler.processErrorMessage(msg, e, true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java index f08177a9..56b434fb 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java @@ -103,11 +103,11 @@ public Object execute(ExecutionEvent event) throws ExecutionException { try { projectName = launch.getLaunchConfiguration().getAttribute(StartTab.PROJECT_NAME, ""); } catch (CoreException e) { - String msg = "An error was detected during debugger reconnect"; + String msg = Messages.getMessage("project_name_error"); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage(Messages.getMessage("project_name_error"), e, true); + ErrorHandler.processErrorMessage(msg, e, true); } if (projectName != null && !projectName.isBlank()) { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java index dbb64291..82e7b89d 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java @@ -68,12 +68,12 @@ public Object execute(ExecutionEvent event) throws ExecutionException { try { commandName = command.getName(); } catch (Exception e) { - String msg = "Unable to retrieve menu command."; + String msg = Messages.getMessage("menu_command_retrieve_error"); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_HANDLERS, msg, e); } - ErrorHandler.processErrorMessage(Messages.getMessage("menu_command_retrieve_error"), e, true); + ErrorHandler.processErrorMessage(msg, e, true); return null; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java index 56808477..68b7fe00 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java @@ -48,13 +48,11 @@ public void launch(ISelection selection, String mode) { try { run(iProject, mode); } catch (Exception e) { - String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START - + "\" launch shortcut was processed."; + String msg = Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage( - Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); + ErrorHandler.processErrorMessage(msg, e, true); } if (Trace.isEnabled()) { @@ -76,13 +74,11 @@ public void launch(IEditorPart part, String mode) { try { run(iProject, mode); } catch (Exception e) { - String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START - + "\" launch shortcut was processed."; + String msg = Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } - ErrorHandler.processErrorMessage( - Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); + ErrorHandler.processErrorMessage(msg, e, true); } if (Trace.isEnabled()) { From 415936ae02226bb7f1b0366331c5c4355c81f903 Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Mon, 5 Jan 2026 13:05:14 -0500 Subject: [PATCH 3/6] Remove hardcoded messages Signed-off-by: Adam Wisniewski --- .../tools/eclipse/DevModeOperations.java | 39 ++++++------- .../tools/eclipse/debug/DebugModeHandler.java | 20 +++---- .../eclipse/handlers/DashboardHandler.java | 3 +- .../eclipse/messages/Messages.properties | 58 +++++++++++++++++++ .../eclipse/process/ProcessController.java | 4 +- .../eclipse/ui/dashboard/DashboardView.java | 22 +++---- .../tools/eclipse/ui/launch/JRETab.java | 2 +- .../LaunchConfigurationDelegateLauncher.java | 7 +-- .../tools/eclipse/ui/launch/StartTab.java | 27 +++++---- .../StartConfigurationDialogAction.java | 4 -- .../LibertyToolsPreferencePage.java | 10 ++-- .../utils/LibertyToolsMessageDialog.java | 5 +- .../tools/eclipse/utils/Utils.java | 3 +- 13 files changed, 126 insertions(+), 78 deletions(-) diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java index 902e5eab..845aab4d 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java @@ -68,8 +68,8 @@ public class DevModeOperations { /** * Constants. */ - public static final String DEVMODE_START_PARMS_DIALOG_TITLE = "Liberty Dev Mode"; - public static final String DEVMODE_START_PARMS_DIALOG_MSG = "Specify custom parameters for the liberty dev command."; + public static final String DEVMODE_START_PARMS_DIALOG_TITLE = Messages.getMessage("devmode_start_dialog_title"); + public static final String DEVMODE_START_PARMS_DIALOG_MSG = Messages.getMessage("devmode_start_dialog_msg"); public static final String DEVMODE_COMMAND_EXIT = "exit" + System.lineSeparator(); public static final String DEVMODE_COMMAND_RUN_TESTS = System.lineSeparator(); @@ -188,13 +188,13 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch try { project = projectModel.getProject(projectName); if (project == null) { - throw new Exception("Unable to find internal instance of project " + projectName); + throw new Exception(Messages.getMessage("internal_project_not_found", projectName)); } // Get the absolute path to the application project. String projectPath = project.getPath(); if (projectPath == null) { - throw new Exception("Unable to find the path to selected project " + projectName); + throw new Exception(Messages.getMessage("project_path_not_found", projectName)); } // If in debug mode, adjust the start parameters. @@ -239,16 +239,14 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch String stopGradleDaemonCmd = CommandBuilder.getGradleCommandLine(projectPath, " --stop", pathEnv); executeCommand(stopGradleDaemonCmd, projectPath); } catch (IOException | InterruptedException e) { - Logger.logError("An attempt to stop the Gradle daemon failed...."); + Logger.logError(Messages.getMessage("gradle_daemon_stop_failed")); } } cmd = CommandBuilder.getGradleCommandLine(projectPath, (runProjectClean == true ? " clean " : "") + "libertyDev " + startParms, pathEnv); - } else { - throw new Exception("Unexpected project build type: " + buildType + ". Project " + projectName - + "does not appear to be a Maven or Gradle built project."); + throw new Exception(Messages.getMessage("unexpected_build_type", buildType, projectName)); } // Run the application in dev mode. @@ -824,8 +822,7 @@ private void issueLPStopCommand(String projectName) { cmd = CommandBuilder.getGradleCommandLine(projectPath, "libertyStop", pathEnv); buildTypeName = "Gradle"; } else { - throw new Exception("Unexpected project build type: " + buildType + ". Project " + projectName - + "does not appear to be a Maven or Gradle built project."); + throw new Exception(Messages.getMessage("unexpected_build_type", buildType, projectName)); } // Issue the command. @@ -839,7 +836,7 @@ private void issueLPStopCommand(String projectName) { * Per: https://stackoverflow.com/questions/29793071/rcp-no-progress-dialog-when-starting-a-job it seems that job.setUser(true) * is no longer enough to result in the creation of a progress dialog. */ - Job job = new Job("Stopping server via " + buildTypeName + " plugin") { + Job job = new Job(Messages.getMessage("stopping_server_job", buildTypeName)) { @Override protected IStatus run(IProgressMonitor monitor) { @@ -1001,11 +998,11 @@ private Project getLibertyServerProject(Project project) throws Exception { List mmps = project.getChildLibertyServerProjects(); switch (mmps.size()) { case 0: - throw new Exception("Unable to find a child project that contains the Liberty server configuration."); + throw new Exception(Messages.getMessage("child_project_not_found")); case 1: return mmps.get(0); default: - throw new Exception("Multiple child projects containing Liberty server configuration were found."); + throw new Exception(Messages.getMessage("multiple_child_projects_found")); } } @@ -1131,14 +1128,14 @@ public boolean isProjectStarted(String projectName) { } public void restartServer(String projectName) { - String restartCommand = "r"; - try { - processController.writeToProcessStream(projectName, restartCommand); - } catch (Exception e) { - if (Trace.isEnabled()) { - Trace.getTracer().trace(Trace.TRACE_TOOLS, "An error was detected during the restart server." + projectName, e); - } - } + String restartCommand = "r"; + try { + processController.writeToProcessStream(projectName, restartCommand); + } catch (Exception e) { + if (Trace.isEnabled()) { + Trace.getTracer().trace(Trace.TRACE_TOOLS, Messages.getMessage("restart_server_error", projectName), e); + } + } } /** diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java index e78be599..3102a2c1 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java @@ -63,6 +63,7 @@ import io.openliberty.tools.eclipse.Project; import io.openliberty.tools.eclipse.Project.BuildType; import io.openliberty.tools.eclipse.logging.Trace; +import io.openliberty.tools.eclipse.messages.Messages; import io.openliberty.tools.eclipse.ui.dashboard.DashboardView; import io.openliberty.tools.eclipse.utils.ErrorHandler; import io.openliberty.tools.eclipse.utils.Utils; @@ -133,8 +134,7 @@ public String addDebugDataToStartParms(Project project, String debugPort, String addendum = GRADLE_DEVMODE_DEBUG_PORT_PARM + "=" + debugPort; } } else { - throw new Exception("Unexpected project build type: " + buildType + ". Project" + project.getIProject().getName() - + "does not appear to be a Maven or Gradle built project."); + throw new Exception(Messages.getMessage("unexpected_build_type", buildType, project.getIProject().getName())); } } @@ -175,8 +175,7 @@ public String calculateDebugPort(Project project, String inputParms) throws Exce } else if (buildType == BuildType.GRADLE) { searchKey = GRADLE_DEVMODE_DEBUG_PORT_PARM; } else { - throw new Exception("Unexpected project build type: " + buildType + ". Project " + project.getIProject().getName() - + "does not appear to be a Maven or Gradle built project."); + throw new Exception(Messages.getMessage("unexpected_build_type", buildType, project.getIProject().getName())); } if (inputParms.contains(searchKey)) { @@ -218,7 +217,7 @@ public String calculateDebugPort(Project project, String inputParms) throws Exce public void startDebugAttacher(Project project, ILaunch launch, String port) { String projectName = project.getIProject().getName(); - Job job = new Job("Attaching Debugger to JVM...") { + Job job = new Job(Messages.getMessage("attaching_debugger_job")) { @Override protected IStatus run(IProgressMonitor monitor) { try { @@ -254,7 +253,7 @@ protected IStatus run(IProgressMonitor monitor) { if (debugPort == null) { // We failed to read the debug port. Throw an exception. This will be caught by the outer // catch block and the job will return with an error. - String errorMessage = "Failed to read debug port from server.env file"; + String errorMessage = Messages.getMessage("debug_port_read_error"); if (ex[0] != null) { // Add the last exception we got. throw new Exception(errorMessage, ex[0]); @@ -281,7 +280,8 @@ protected IStatus run(IProgressMonitor monitor) { launch.addDebugTarget(debugTarget); } catch (Exception e) { - return new Status(IStatus.ERROR, LibertyDevPlugin.PLUGIN_ID, JOB_STATUS_DEBUGGER_CONN_ERROR, "An error was detected while attaching the debugger to the JVM.", e); + return new Status(IStatus.ERROR, LibertyDevPlugin.PLUGIN_ID, JOB_STATUS_DEBUGGER_CONN_ERROR, + Messages.getMessage("debugger_attach_error"), e); } return Status.OK_STATUS; @@ -411,7 +411,7 @@ private VirtualMachine attachJVM(String hostName, int port, AttachingConnector c } catch (IOException e) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, - "Error occurred while trying to connect to the remote virtual machine " + e.getMessage(), e); + Messages.getMessage("debugger_connect_error", e.getMessage()), e); } } catch (TimeoutException e2) { // do nothing @@ -588,9 +588,7 @@ private String waitForSocketActivation(Project project, String host, String port TimeUnit.SECONDS.sleep(1); } } - - throw new Exception("Timed out trying to attach the debugger to JVM on host: " + host + " and port: " + port - + ". If the server starts later you might try to manually connect the debugger from the launch in the Debug view You can confirm the debug port used in the console output looking for a message like 'Liberty debug port: [ 63624 ]'."); + throw new Exception(Messages.getMessage("debugger_timeout_error", host, port)); } private class DataHolder { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/DashboardHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/DashboardHandler.java index 88ec2dba..b9dff1fb 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/DashboardHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/DashboardHandler.java @@ -18,6 +18,7 @@ import org.eclipse.ui.handlers.HandlerUtil; import io.openliberty.tools.eclipse.logging.Trace; +import io.openliberty.tools.eclipse.messages.Messages; public class DashboardHandler extends AbstractHandler { @@ -26,7 +27,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { try { HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().showView("io.openliberty.tools.eclipse.views.liberty.devmode.dashboard"); } catch (Exception e) { - String msg = "Unable to open the Liberty dashboard view"; + String msg = Messages.getMessage("dashboard_open_error"); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_HANDLERS, msg, e); } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties index a453c360..9d541437 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties @@ -13,9 +13,20 @@ # DebugModeHandler multiple_server_env=More than one server.env file was found for the {0} project. Unable to determine which server.env file to use. +unexpected_build_type=Unexpected project build type: {0}. Project {1} does not appear to be a Maven or Gradle built project. +debug_port_read_error=Failed to read debug port from server.env file +debugger_attach_error=An error was detected while attaching the debugger to the JVM. +debugger_connect_error=Error occurred while trying to connect to the remote virtual machine {0} +debugger_timeout_error=Timed out trying to attach the debugger to JVM on host: {0} and port: {1}. If the server starts later you might try to manually connect the debugger from the launch in the Debug view. You can confirm the debug port used in the console output looking for a message like ''Liberty debug port: [ 63624 ]''. +attaching_debugger_job=Attaching Debugger to JVM... # DevModeOperations +devmode_start_dialog_title=Liberty Dev Mode +devmode_start_dialog_msg=Specify custom parameters for the liberty dev command. start_no_project_found=An error was detected when the start request was processed. The object that represents the selected project was not found. +internal_project_not_found=Unable to find internal instance of project {0} +project_path_not_found=Unable to find the path to selected project {0} +gradle_daemon_stop_failed=An attempt to stop the Gradle daemon failed.... start_already_issued=The start request was already issued on the {0} project. Use the stop action before you select the start action. start_general_error=An error was detected during the start request on the {0} project. @@ -48,12 +59,34 @@ plugin_stop_issue_error=An exception occurred when the plugin stop command was i plugin_stop_timeout=The Liberty Maven or Gradle stop command issued for the {0} project timed out after {1} seconds. plugin_stop_failed=The stop command failed with the following exitValue: {0} plugin_stop_general_error=An error was detected when the Liberty Maven or Gradle stop command was processed on the {0} project. +stopping_server_job=Stopping server via {0} plugin +child_project_not_found=Unable to find a child project that contains the Liberty server configuration. +multiple_child_projects_found=Multiple child projects containing Liberty server configuration were found. +restart_server_error=An error was detected during the restart server on {0}. + +# ProcessController +process_write_error=Unable to write to the process associated with project {0}. Internal process object not found. # WorkspaceProjectsModel project_analyze_error=An error occurred when the projects in the workspace were analyzed. +# DashboardHandler +dashboard_open_error=Unable to open the Liberty dashboard view + # DashboardView project_not_gradle_or_maven=The {0} project is not a Gradle or Maven project. +dashboard_action_start=Start +dashboard_action_start_config=Start... +dashboard_action_start_in_container=Start in container +dashboard_action_debug=Debug +dashboard_action_debug_config=Debug... +dashboard_action_debug_in_container=Debug in container +dashboard_action_stop=Stop +dashboard_action_run_tests=Run tests +dashboard_action_view_mvn_it_report=View integration test report +dashboard_action_view_mvn_ut_report=View unit test report +dashboard_action_view_gradle_test_report=View test report +dashboard_toolbar_refresh=refresh image_descriptions_error=An error was detected when the image descriptions were retrieved. action_general_error=An error was detected during the {0} action. dashboard_refresh_error=An error was detected when the Liberty dashboard content was refreshed. @@ -61,14 +94,25 @@ dashboard_refresh_error=An error was detected when the Liberty dashboard content # JRETab java_default_set_error=Unable to set the default Java installation that was obtained from the build path of the {0} project in the {1} configuration. java_resolution_error=Unable to resolve the Java installation path by using the {0} configuration. The project uses the workspace Java installation instead. +jdk_required_error=A Java Development Kit (JDK) is required to use Liberty dev mode. # LaunchConfigurationDelegateLauncher launch_config_error=An error was detected when the {0} configuration was launched. +invalid_project_selection=Invalid project. Be sure to select a project first. +config_project_mismatch=The selected Run/Debug configuration ''{0}'' cannot be used to run selected project ''{1}'', because the configuration is associated with project ''{2}''. Select a configuration associated with the ''{1}'' project or create a new one. # StartTab start_parm_retrieve_error=An error was detected when the default start parameters were retrieved. project_name_error=Error getting project name. run_config_initialize_error=An error was detected during Run Configuration initialization. +dev_mode_detected_error=Dev mode detected +config_project_warning=Must use an existing (or new) configuration associated with selected project: {0} +run_in_container_label=Run in &Container +clean_project_label=Clean project +start_params_error=Don't include mvn or gradle executables, just the parameters +project_label=Project: +start_parameters_label=Start ¶meters: +maven_gradle_prefs_link=Maven/Gradle executable paths can be set in Liberty Preferences # All *Action classes launch_shortcut_error=An error was detected when the "{0}" launch shortcut was processed. @@ -82,6 +126,20 @@ menu_command_process_error=Unable to process the {0} menu command on the {1} pro maven_exec_not_found=The Maven executable or wrapper could not be found. gradle_exec_not_found=The Gradle executable or wrapper could not be found. +# LibertyToolsMessageDialog +preference_link_text=To fix: either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var + +# LibertyToolsPreferencePage +preference_page_description=Use the Browse buttons to specify the Maven and Gradle installation locations to be used for starting the application in dev mode, which will be used if no mvnw/gradlew wrapper is found. +mvn_gradle_exec_error=Install locations must contain mvn and gradle executables +mvn_exec_error=Install location must contain a bin directory containing a mvn executable +gradle_exec_error=Install location must contain a bin directory containing a gradle executable + +# Utils +waiting_for_restart_job=Waiting for application to restart... +project_not_found_error=Unable to find internal instance of project. +project_path_not_found_error=Unable to find the path to selected project. + # Project determine_java_project_error=Unable to determine if the {0} project is a Java project. liberty_nature_add_error=An error occurred when querying and adding the Liberty nature. diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java index 9db01358..336013c4 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java @@ -23,6 +23,7 @@ import org.eclipse.debug.core.DebugPlugin; import io.openliberty.tools.eclipse.logging.Trace; +import io.openliberty.tools.eclipse.messages.Messages; import io.openliberty.tools.eclipse.utils.Utils; /** @@ -132,8 +133,7 @@ public void writeToProcessStream(String projectName, String data) throws Excepti Process process = projectProcessMap.get(projectName); if (process == null) { - String msg = "Unable to write to the process associated with project " + projectName - + ". Internal process object not found."; + String msg = Messages.getMessage("process_write_error", projectName); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg + ". Data to write: " + new String(data)); } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java index d55ec7c5..6dd3b348 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java @@ -72,17 +72,17 @@ public class DashboardView extends ViewPart { * Menu Constants. */ public static final String APP_MENU_ACTION_START = "Start"; - public static final String APP_MENU_ACTION_START_CONFIG = "Start..."; - public static final String APP_MENU_ACTION_START_IN_CONTAINER = "Start in container"; - public static final String APP_MENU_ACTION_DEBUG = "Debug"; - public static final String APP_MENU_ACTION_DEBUG_CONFIG = "Debug..."; - public static final String APP_MENU_ACTION_DEBUG_IN_CONTAINER = "Debug in container"; - public static final String APP_MENU_ACTION_STOP = "Stop"; - public static final String APP_MENU_ACTION_RUN_TESTS = "Run tests"; - public static final String APP_MENU_ACTION_VIEW_MVN_IT_REPORT = "View integration test report"; - public static final String APP_MENU_ACTION_VIEW_MVN_UT_REPORT = "View unit test report"; - public static final String APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT = "View test report"; - public static final String DASHBORD_TOOLBAR_ACTION_REFRESH = "refresh"; + public static final String APP_MENU_ACTION_START_CONFIG = Messages.getMessage("dashboard_action_start_config"); + public static final String APP_MENU_ACTION_START_IN_CONTAINER = Messages.getMessage("dashboard_action_start_in_container"); + public static final String APP_MENU_ACTION_DEBUG = Messages.getMessage("dashboard_action_debug"); + public static final String APP_MENU_ACTION_DEBUG_CONFIG = Messages.getMessage("dashboard_action_debug_config"); + public static final String APP_MENU_ACTION_DEBUG_IN_CONTAINER = Messages.getMessage("dashboard_action_debug_in_container"); + public static final String APP_MENU_ACTION_STOP = Messages.getMessage("dashboard_action_stop"); + public static final String APP_MENU_ACTION_RUN_TESTS = Messages.getMessage("dashboard_action_run_tests"); + public static final String APP_MENU_ACTION_VIEW_MVN_IT_REPORT = Messages.getMessage("dashboard_action_view_mvn_it_report"); + public static final String APP_MENU_ACTION_VIEW_MVN_UT_REPORT = Messages.getMessage("dashboard_action_view_mvn_ut_report"); + public static final String APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT = Messages.getMessage("dashboard_action_view_gradle_test_report"); + public static final String DASHBORD_TOOLBAR_ACTION_REFRESH = Messages.getMessage("dashboard_toolbar_refresh"); /** * view actions. diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java index c71cd3f0..94dc358c 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java @@ -54,7 +54,7 @@ public boolean isValid(ILaunchConfiguration config) { java.nio.file.Path javacPath = Paths.get(javaHome, "bin", (Utils.isWindows() ? "javac.exe" : "javac")); File javacFile = javacPath.toFile(); if (!javacFile.exists()) { - super.setErrorMessage("A Java Development Kit (JDK) is required to use Liberty dev mode."); + super.setErrorMessage(Messages.getMessage("jdk_required_error")); return false; } return true; diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java index 66ac9745..4674fc57 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java @@ -104,10 +104,7 @@ private void assertProjectsMatch(ILaunchConfiguration configuration, IProject se if (!configProjectName.equals(selectedProject.getName())) { String configurationName = configuration.getName(); - String msg = "The selected Run/Debug configuration '" + configurationName - + "' cannot be used to run selected project '" + selectedProject.getName() - + ", because the configuration is associated with project '" + configProjectName - + "'. Create a new configuration, or use an existing configuration associated with the selected project."; + String msg = Messages.getMessage("config_project_mismatch", configurationName, selectedProject.getName(), configProjectName); throw new IllegalStateException(msg); } } @@ -136,7 +133,7 @@ private void launchDevMode(IProject iProject, ILaunchConfiguration iConfiguratio } if (iProject == null) { - throw new Exception("Invalid project. Be sure to select a project first."); + throw new Exception(Messages.getMessage("invalid_project_selection")); } // Validate that the project is supported. diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java index d15b4540..85602bca 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java @@ -198,11 +198,11 @@ private boolean checkForIncorrectTerms() { String startParamStr = startParmText.getText(); if (startParamStr.startsWith("mvn") || startParamStr.startsWith("gradle")) { - super.setErrorMessage("Don't include mvn or gradle executables, just the parameters"); + super.setErrorMessage(Messages.getMessage("start_params_error")); valid = false; } if (startParamStr.contains("liberty:dev") || startParamStr.contains("libertyDev")) { - super.setErrorMessage("Dev mode detected"); + super.setErrorMessage(Messages.getMessage("dev_mode_detected_error")); valid = false; } return valid; @@ -223,8 +223,7 @@ public boolean isValid(ILaunchConfiguration config) { if (selectedProject != null) { String selectedProjectName = selectedProject.getName(); if (!configProjectName.equals(selectedProjectName)) { - super.setWarningMessage( - "Must use an existing (or new) configuration associated with selected project: " + selectedProjectName); + super.setWarningMessage(Messages.getMessage("config_project_warning", selectedProjectName)); return false; } } @@ -335,7 +334,7 @@ private void createProjectLabel(Composite parent) { Label projectLabel = new Label(projectComposite, SWT.NONE); projectLabel.setFont(font); - projectLabel.setText("Project: "); + projectLabel.setText(Messages.getMessage("project_label")); GridDataFactory.swtDefaults().applyTo(projectLabel); projectNameLabel = new Label(projectComposite, SWT.NONE); @@ -352,7 +351,7 @@ private void createProjectLabel(Composite parent) { private void createInputParmText(Composite parent) { Label inputParmLabel = new Label(parent, SWT.NONE); inputParmLabel.setFont(font); - inputParmLabel.setText("Start ¶meters:"); + inputParmLabel.setText(Messages.getMessage("start_parameters_label")); GridDataFactory.swtDefaults().indent(20, 0).applyTo(inputParmLabel); startParmText = new Text(parent, SWT.BORDER); @@ -385,7 +384,7 @@ private void createLabelWithPreferenceLink(Composite parent) { Link link = new Link(parent, SWT.WRAP); link.setFont(font); - link.setText("Maven/Gradle executable paths can be set in Liberty Preferences"); + link.setText(Messages.getMessage("maven_gradle_prefs_link")); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -403,7 +402,7 @@ public void widgetSelected(SelectionEvent e) { */ private void createRunInContainerButton(Composite parent) { runInContainerCheckBox = new Button(parent, SWT.CHECK); - runInContainerCheckBox.setText("Run in &Container"); + runInContainerCheckBox.setText(Messages.getMessage("run_in_container_label")); runInContainerCheckBox.setSelection(false); runInContainerCheckBox.setFont(font); runInContainerCheckBox.addSelectionListener(new SelectionAdapter() { @@ -428,12 +427,12 @@ public void widgetSelected(SelectionEvent event) { * * @param parent The parent composite. */ - private void createProjectCleanButton(Composite parent) { - projectCleanCheckBox = new Button(parent, SWT.CHECK); - projectCleanCheckBox.setText("Clean project"); - projectCleanCheckBox.setSelection(false); - projectCleanCheckBox.setFont(font); - projectCleanCheckBox.addSelectionListener(new SelectionAdapter() { + private void createProjectCleanButton(Composite parent) { + projectCleanCheckBox = new Button(parent, SWT.CHECK); + projectCleanCheckBox.setText(Messages.getMessage("clean_project_label")); + projectCleanCheckBox.setSelection(false); + projectCleanCheckBox.setFont(font); + projectCleanCheckBox.addSelectionListener(new SelectionAdapter() { /** * {@inheritDoc} diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java index e36a03d3..0132973d 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java @@ -93,11 +93,7 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( -<<<<<<< HEAD - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); -======= Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); ->>>>>>> 26a0cd9 (Update message props structure) return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java index 9d0791ba..aff14e36 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java @@ -24,6 +24,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.preferences.ScopedPreferenceStore; +import io.openliberty.tools.eclipse.messages.Messages; import io.openliberty.tools.eclipse.utils.LibertyPrefDirectoryFieldEditor; import io.openliberty.tools.eclipse.utils.Utils; @@ -52,8 +53,7 @@ public void createFieldEditors() { public void init(IWorkbench workbench) { // second parameter is typically the plug-in id setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, "io.openliberty.tools.eclipse.ui")); - setDescription( - "Use the Browse buttons to specify the Maven and Gradle installation locations to be used for starting the application in dev mode, which will be used if no mvnw/gradlew wrapper is found."); + setDescription(Messages.getMessage("preference_page_description")); } @Override @@ -91,11 +91,11 @@ public void propertyChange(PropertyChangeEvent event) { else { setValid(false); if (!installMvnLocValid && !installGradleLocValid) { - setErrorMessage("Install locations must contain mvn and gradle executables"); + setErrorMessage(Messages.getMessage("mvn_gradle_exec_error")); } else if (!installMvnLocValid && installGradleLocValid) { - setErrorMessage("Install location must contain a bin directory containing a mvn executable"); + setErrorMessage(Messages.getMessage("mvn_exec_error")); } else { - setErrorMessage("Install location must contain a bin directory containing a gradle executable"); + setErrorMessage(Messages.getMessage("gradle_exec_error")); } } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java index 16ab4240..2bdea249 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java @@ -24,6 +24,8 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.dialogs.PreferencesUtil; +import io.openliberty.tools.eclipse.messages.Messages; + public class LibertyToolsMessageDialog extends MessageDialog { public LibertyToolsMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, @@ -34,8 +36,7 @@ public LibertyToolsMessageDialog(Shell parentShell, String dialogTitle, Image di @Override protected Control createCustomArea(Composite parent) { Link link = new Link(parent, SWT.WRAP); - link.setText( - "To fix: either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var"); + link.setText(Messages.getMessage("preference_link_text")); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java index d8bc9dad..ca2b0530 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java @@ -54,6 +54,7 @@ import io.openliberty.tools.eclipse.Project; import io.openliberty.tools.eclipse.debug.DebugModeHandler; import io.openliberty.tools.eclipse.logging.Trace; +import io.openliberty.tools.eclipse.messages.Messages; /** * Provides a set of utility methods. @@ -303,7 +304,7 @@ public static Throwable findRootCause(Throwable t) { */ public static void restartDebugger(Project project, ILaunch launch, DebugModeHandler debugModeHandler, Instant preRestartTime) { - Job job = new Job("Waiting for application to restart...") { + Job job = new Job(Messages.getMessage("waiting_for_restart_job")) { @Override protected IStatus run(IProgressMonitor monitor) { if (monitor.isCanceled()) { From ba23d9de6d9bab4cbe86192d055824190a9afa61 Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Mon, 5 Jan 2026 13:18:31 -0500 Subject: [PATCH 4/6] Refactor messages Signed-off-by: Adam Wisniewski --- .../tools/eclipse/messages/Messages.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties index 9d541437..9658d75e 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties @@ -14,7 +14,7 @@ # DebugModeHandler multiple_server_env=More than one server.env file was found for the {0} project. Unable to determine which server.env file to use. unexpected_build_type=Unexpected project build type: {0}. Project {1} does not appear to be a Maven or Gradle built project. -debug_port_read_error=Failed to read debug port from server.env file +debug_port_read_error=Failed to read debug port from server.env file. debugger_attach_error=An error was detected while attaching the debugger to the JVM. debugger_connect_error=Error occurred while trying to connect to the remote virtual machine {0} debugger_timeout_error=Timed out trying to attach the debugger to JVM on host: {0} and port: {1}. If the server starts later you might try to manually connect the debugger from the launch in the Debug view. You can confirm the debug port used in the console output looking for a message like ''Liberty debug port: [ 63624 ]''. @@ -24,8 +24,8 @@ attaching_debugger_job=Attaching Debugger to JVM... devmode_start_dialog_title=Liberty Dev Mode devmode_start_dialog_msg=Specify custom parameters for the liberty dev command. start_no_project_found=An error was detected when the start request was processed. The object that represents the selected project was not found. -internal_project_not_found=Unable to find internal instance of project {0} -project_path_not_found=Unable to find the path to selected project {0} +internal_project_not_found=Unable to find internal instance of project {0}. +project_path_not_found=Unable to find the path to selected project {0}. gradle_daemon_stop_failed=An attempt to stop the Gradle daemon failed.... start_already_issued=The start request was already issued on the {0} project. Use the stop action before you select the start action. start_general_error=An error was detected during the start request on the {0} project. @@ -44,7 +44,7 @@ run_tests_general_error=An error was detected when the run tests request was pro mvn_int_test_report_no_project_found=An error was detected when the view integration test report request was processed. The object that represents the selected project was not found. When you use the Run Configuration launcher, be sure to select a project or project content first. mvn_int_test_report_none_found=No integration test results were found for the {0} project. Select "{1}" before you select "{2}" on the menu. -mvn_int_test_report_general_error="An error was detected when the view integration test report request was processed on the {0} project. +mvn_int_test_report_general_error=An error was detected when the view integration test report request was processed on the {0} project. mvn_unit_test_report_no_project_found=An error was detected when the view unit test report request was processed. The object that represents the selected project could not be found. When you use the Run Configuration launcher, be sure to select a project or project content first. mvn_unit_test_report_none_found=No unit test results were found for the {0} project. Select "{1}" before you select "{2}" on the menu. @@ -71,7 +71,7 @@ process_write_error=Unable to write to the process associated with project {0}. project_analyze_error=An error occurred when the projects in the workspace were analyzed. # DashboardHandler -dashboard_open_error=Unable to open the Liberty dashboard view +dashboard_open_error=Unable to open the Liberty dashboard view. # DashboardView project_not_gradle_or_maven=The {0} project is not a Gradle or Maven project. @@ -86,7 +86,7 @@ dashboard_action_run_tests=Run tests dashboard_action_view_mvn_it_report=View integration test report dashboard_action_view_mvn_ut_report=View unit test report dashboard_action_view_gradle_test_report=View test report -dashboard_toolbar_refresh=refresh +dashboard_toolbar_refresh=Refresh image_descriptions_error=An error was detected when the image descriptions were retrieved. action_general_error=An error was detected during the {0} action. dashboard_refresh_error=An error was detected when the Liberty dashboard content was refreshed. @@ -105,11 +105,11 @@ config_project_mismatch=The selected Run/Debug configuration ''{0}'' cannot be u start_parm_retrieve_error=An error was detected when the default start parameters were retrieved. project_name_error=Error getting project name. run_config_initialize_error=An error was detected during Run Configuration initialization. -dev_mode_detected_error=Dev mode detected +dev_mode_detected_error=Dev mode detected. config_project_warning=Must use an existing (or new) configuration associated with selected project: {0} run_in_container_label=Run in &Container clean_project_label=Clean project -start_params_error=Don't include mvn or gradle executables, just the parameters +start_params_error=Do not include mvn or gradle executables, just the parameters project_label=Project: start_parameters_label=Start ¶meters: maven_gradle_prefs_link=Maven/Gradle executable paths can be set in Liberty Preferences @@ -127,7 +127,7 @@ maven_exec_not_found=The Maven executable or wrapper could not be found. gradle_exec_not_found=The Gradle executable or wrapper could not be found. # LibertyToolsMessageDialog -preference_link_text=To fix: either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var +preference_link_text=To fix: Either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var. # LibertyToolsPreferencePage preference_page_description=Use the Browse buttons to specify the Maven and Gradle installation locations to be used for starting the application in dev mode, which will be used if no mvnw/gradlew wrapper is found. From d2e6254733bb45a701bf658a18cfff4b8e242715 Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Mon, 5 Jan 2026 14:10:26 -0500 Subject: [PATCH 5/6] Fix typos and duplicate messages Signed-off-by: Adam Wisniewski --- .../eclipse/messages/Messages.properties | 19 +++++++++---------- .../eclipse/ui/dashboard/DashboardView.java | 2 +- .../LaunchConfigurationDelegateLauncher.java | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties index 9658d75e..06907572 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.properties @@ -26,7 +26,7 @@ devmode_start_dialog_msg=Specify custom parameters for the liberty dev command. start_no_project_found=An error was detected when the start request was processed. The object that represents the selected project was not found. internal_project_not_found=Unable to find internal instance of project {0}. project_path_not_found=Unable to find the path to selected project {0}. -gradle_daemon_stop_failed=An attempt to stop the Gradle daemon failed.... +gradle_daemon_stop_failed=An attempt to stop the Gradle daemon failed... start_already_issued=The start request was already issued on the {0} project. Use the stop action before you select the start action. start_general_error=An error was detected during the start request on the {0} project. @@ -62,7 +62,7 @@ plugin_stop_general_error=An error was detected when the Liberty Maven or Gradle stopping_server_job=Stopping server via {0} plugin child_project_not_found=Unable to find a child project that contains the Liberty server configuration. multiple_child_projects_found=Multiple child projects containing Liberty server configuration were found. -restart_server_error=An error was detected during the restart server on {0}. +restart_server_error=An error was detected during the server restart for the {0} project. # ProcessController process_write_error=Unable to write to the process associated with project {0}. Internal process object not found. @@ -71,7 +71,7 @@ process_write_error=Unable to write to the process associated with project {0}. project_analyze_error=An error occurred when the projects in the workspace were analyzed. # DashboardHandler -dashboard_open_error=Unable to open the Liberty dashboard view. +dashboard_open_error=Unable to open the Liberty Dashboard view. # DashboardView project_not_gradle_or_maven=The {0} project is not a Gradle or Maven project. @@ -89,27 +89,26 @@ dashboard_action_view_gradle_test_report=View test report dashboard_toolbar_refresh=Refresh image_descriptions_error=An error was detected when the image descriptions were retrieved. action_general_error=An error was detected during the {0} action. -dashboard_refresh_error=An error was detected when the Liberty dashboard content was refreshed. +dashboard_refresh_error=An error was detected when the Liberty Dashboard content was refreshed. # JRETab java_default_set_error=Unable to set the default Java installation that was obtained from the build path of the {0} project in the {1} configuration. -java_resolution_error=Unable to resolve the Java installation path by using the {0} configuration. The project uses the workspace Java installation instead. +java_resolution_error=Unable to resolve the Java installation path by using the {0} configuration. The project will use the workspace Java installation instead. jdk_required_error=A Java Development Kit (JDK) is required to use Liberty dev mode. # LaunchConfigurationDelegateLauncher launch_config_error=An error was detected when the {0} configuration was launched. -invalid_project_selection=Invalid project. Be sure to select a project first. -config_project_mismatch=The selected Run/Debug configuration ''{0}'' cannot be used to run selected project ''{1}'', because the configuration is associated with project ''{2}''. Select a configuration associated with the ''{1}'' project or create a new one. +config_project_mismatch=The selected Run/Debug configuration "{0}" cannot be used to run selected project "{1}", because the configuration is associated with project "{2}". Select a configuration associated with the "{1}" project or create a new one. # StartTab start_parm_retrieve_error=An error was detected when the default start parameters were retrieved. project_name_error=Error getting project name. run_config_initialize_error=An error was detected during Run Configuration initialization. dev_mode_detected_error=Dev mode detected. -config_project_warning=Must use an existing (or new) configuration associated with selected project: {0} +config_project_warning=You must use an existing (or new) configuration associated with selected project: {0} run_in_container_label=Run in &Container clean_project_label=Clean project -start_params_error=Do not include mvn or gradle executables, just the parameters +start_params_error=Do not include mvn or gradle executables, just the parameters. project_label=Project: start_parameters_label=Start ¶meters: maven_gradle_prefs_link=Maven/Gradle executable paths can be set in Liberty Preferences @@ -127,7 +126,7 @@ maven_exec_not_found=The Maven executable or wrapper could not be found. gradle_exec_not_found=The Gradle executable or wrapper could not be found. # LibertyToolsMessageDialog -preference_link_text=To fix: Either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var. +preference_link_text=To fix, either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var. # LibertyToolsPreferencePage preference_page_description=Use the Browse buttons to specify the Maven and Gradle installation locations to be used for starting the application in dev mode, which will be used if no mvnw/gradlew wrapper is found. diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java index 6dd3b348..312af47f 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java @@ -71,7 +71,7 @@ public class DashboardView extends ViewPart { /** * Menu Constants. */ - public static final String APP_MENU_ACTION_START = "Start"; + public static final String APP_MENU_ACTION_START = Messages.getMessage("dashboard_action_start"); public static final String APP_MENU_ACTION_START_CONFIG = Messages.getMessage("dashboard_action_start_config"); public static final String APP_MENU_ACTION_START_IN_CONTAINER = Messages.getMessage("dashboard_action_start_in_container"); public static final String APP_MENU_ACTION_DEBUG = Messages.getMessage("dashboard_action_debug"); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java index 4674fc57..85c04daf 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java @@ -20,7 +20,6 @@ import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.model.LaunchConfigurationDelegate; -import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; @@ -104,7 +103,8 @@ private void assertProjectsMatch(ILaunchConfiguration configuration, IProject se if (!configProjectName.equals(selectedProject.getName())) { String configurationName = configuration.getName(); - String msg = Messages.getMessage("config_project_mismatch", configurationName, selectedProject.getName(), configProjectName); + String msg = Messages.getMessage("config_project_mismatch", configurationName, selectedProject.getName(), + configProjectName); throw new IllegalStateException(msg); } } @@ -133,7 +133,7 @@ private void launchDevMode(IProject iProject, ILaunchConfiguration iConfiguratio } if (iProject == null) { - throw new Exception(Messages.getMessage("invalid_project_selection")); + throw new Exception(Messages.getMessage("project_not_valid")); } // Validate that the project is supported. From 37b0a2082ee457b84c8ed43677d80933d97e2e63 Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Thu, 8 Jan 2026 12:54:11 -0500 Subject: [PATCH 6/6] Remove unnecessary null checks Signed-off-by: Adam Wisniewski --- .../io/openliberty/tools/eclipse/messages/Messages.java | 7 +++---- .../ui/launch/shortcuts/OpenGradleTestReportAction.java | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java index 34b848cf..05d9604c 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/messages/Messages.java @@ -43,7 +43,7 @@ public static String getMessage(String key) { /** * Returns a translated message with arguments. * - * @param key The message key. + * @param key The message key. * @param args The arguments associated with the message. * * @return A translated message with arguments. @@ -53,10 +53,9 @@ public static String getMessage(String key, Object... args) { try { msg = NLS_BUNDLE.getString(key); - if (msg != null && args != null) { - msg = MessageFormat.format(msg, args); - } + msg = MessageFormat.format(msg, args); } catch (Exception e) { + msg = key; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java index 8cafc25d..e29dbda2 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java @@ -80,13 +80,8 @@ public void launch(IEditorPart part, String mode) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( -<<<<<<< HEAD - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), - e, true); -======= Messages.getMessage("launch_shortcut_error", LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), e, true); ->>>>>>> 26a0cd9 (Update message props structure) return; }