From 9758503ad47edf9c67dfda3368fa86f936dd12f6 Mon Sep 17 00:00:00 2001 From: "Pierre-Yves B." <10694593+PyvesB@users.noreply.github.com> Date: Sun, 20 Feb 2022 11:00:39 +0100 Subject: [PATCH] Reuse getPathField method --- .../launch/debug/ReadaptDebugDelegate.java | 2 +- .../eclipse_solargraph/preferences/PreferencePage.java | 8 -------- .../server/SolargraphStreamConnectionProvider.java | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/launch/debug/ReadaptDebugDelegate.java b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/launch/debug/ReadaptDebugDelegate.java index 9684c74..06ad3f9 100644 --- a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/launch/debug/ReadaptDebugDelegate.java +++ b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/launch/debug/ReadaptDebugDelegate.java @@ -80,7 +80,7 @@ private void displayNotFoundWarning() { } else { PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(null, PreferencePage.PAGE_ID, null, null); - ((PreferencePage) preferenceDialog.getSelectedPage()).getReadaptPath().setFocus(); + ((PreferencePage) preferenceDialog.getSelectedPage()).getPathField("readapt").setFocus(); preferenceDialog.open(); } }); diff --git a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/preferences/PreferencePage.java b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/preferences/PreferencePage.java index 2912c0e..0332793 100644 --- a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/preferences/PreferencePage.java +++ b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/preferences/PreferencePage.java @@ -113,12 +113,4 @@ public FileFieldEditor getPathField(String gem) { return "readapt".equalsIgnoreCase(gem) ? readaptPath : gemPath; } - public FileFieldEditor getGemPath() { - return gemPath; - } - - public FileFieldEditor getReadaptPath() { - return readaptPath; - } - } diff --git a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java index a49e237..9f1e189 100644 --- a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java +++ b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java @@ -76,7 +76,7 @@ private void displayNotFoundWarning() { } else { PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(null, PreferencePage.PAGE_ID, null, null); - ((PreferencePage) preferenceDialog.getSelectedPage()).getGemPath().setFocus(); + ((PreferencePage) preferenceDialog.getSelectedPage()).getPathField("solargraph").setFocus(); preferenceDialog.open(); } });