mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Browser API cleanup (static service methods made instance ones)
This commit is contained in:
@@ -233,7 +233,7 @@ public class BrowsersConfiguration implements PersistentStateComponent<Element>
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static BrowserFamily findFamilyByName(@Nullable String name) {
|
||||
public BrowserFamily findFamilyByName(@Nullable String name) {
|
||||
for (BrowserFamily family : BrowserFamily.values()) {
|
||||
if (family.getName().equals(name)) {
|
||||
return family;
|
||||
@@ -243,7 +243,7 @@ public class BrowsersConfiguration implements PersistentStateComponent<Element>
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static BrowserFamily findFamilyByPath(@Nullable String path) {
|
||||
public BrowserFamily findFamilyByPath(@Nullable String path) {
|
||||
if (!StringUtil.isEmptyOrSpaces(path)) {
|
||||
String name = FileUtil.getNameWithoutExtension(new File(path).getName());
|
||||
for (BrowserFamily family : BrowserFamily.values()) {
|
||||
|
||||
@@ -66,7 +66,7 @@ public class OpenFileInBrowserAction extends DumbAwareAction {
|
||||
|
||||
GeneralSettings settings = GeneralSettings.getInstance();
|
||||
if (!settings.isUseDefaultBrowser()) {
|
||||
BrowsersConfiguration.BrowserFamily family = BrowsersConfiguration.findFamilyByPath(settings.getBrowserPath());
|
||||
BrowsersConfiguration.BrowserFamily family = BrowsersConfiguration.getInstance().findFamilyByPath(settings.getBrowserPath());
|
||||
if (family != null) {
|
||||
presentation.setIcon(family.getIcon());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user