mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Configurable refactoring: add public method to find a resource bundle
This commit is contained in:
@@ -56,6 +56,13 @@ public class ConfigurableEP<T extends UnnamedConfigurable> extends AbstractExten
|
||||
return displayName = CommonBundle.message(resourceBundle, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a resource bundle using the specified base name or {@code null}
|
||||
*/
|
||||
public ResourceBundle findBundle() {
|
||||
return bundle == null ? null : AbstractBundle.getResourceBundle(bundle, myPluginDescriptor.getPluginClassLoader());
|
||||
}
|
||||
|
||||
@Property(surroundWithTag = false)
|
||||
@AbstractCollection(surroundWithTag = false)
|
||||
public ConfigurableEP[] children;
|
||||
|
||||
+4
-4
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.options.newEditor;
|
||||
|
||||
import com.intellij.AbstractBundle;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.internal.statistic.UsageTrigger;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
@@ -287,9 +286,10 @@ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWT
|
||||
try {
|
||||
if (configurable instanceof ConfigurableWrapper) {
|
||||
ConfigurableWrapper wrapper = (ConfigurableWrapper)configurable;
|
||||
ConfigurableEP ep = wrapper.getExtensionPoint();
|
||||
ResourceBundle bundle = AbstractBundle.getResourceBundle(ep.bundle, ep.getPluginDescriptor().getPluginClassLoader());
|
||||
return CommonBundle.message(bundle, key);
|
||||
ResourceBundle bundle = wrapper.getExtensionPoint().findBundle();
|
||||
if (bundle != null) {
|
||||
return CommonBundle.message(bundle, key);
|
||||
}
|
||||
}
|
||||
return OptionsBundle.message(key);
|
||||
}
|
||||
|
||||
+2
-6
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.options.newEditor;
|
||||
|
||||
import com.intellij.AbstractBundle;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.internal.statistic.UsageTrigger;
|
||||
@@ -39,7 +38,6 @@ import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.EdtRunnable;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.LightColors;
|
||||
import com.intellij.ui.OnePixelSplitter;
|
||||
import com.intellij.ui.ScrollPaneFactory;
|
||||
@@ -1036,10 +1034,8 @@ public class OptionsEditor extends JPanel implements DataProvider, Place.Navigat
|
||||
String key = configurable.getId() + ".settings.description";
|
||||
if (configurable instanceof ConfigurableWrapper) {
|
||||
ConfigurableWrapper wrapper = (ConfigurableWrapper) configurable;
|
||||
ConfigurableEP ep = wrapper.getExtensionPoint();
|
||||
final String bundle = ep.bundle;
|
||||
if (StringUtil.isNotEmpty(bundle)) {
|
||||
ResourceBundle resourceBundle = AbstractBundle.getResourceBundle(bundle, ep.getPluginDescriptor().getPluginClassLoader());
|
||||
ResourceBundle resourceBundle = wrapper.getExtensionPoint().findBundle();
|
||||
if (resourceBundle != null) {
|
||||
return CommonBundle.message(resourceBundle, key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user