mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup bean code
This commit is contained in:
@@ -29,27 +29,26 @@ public class TipAndTrickBean extends AbstractExtensionPointBean {
|
||||
public static final ExtensionPointName<TipAndTrickBean> EP_NAME = ExtensionPointName.create("com.intellij.tipAndTrick");
|
||||
|
||||
@Attribute("file")
|
||||
public String myFileName;
|
||||
public String fileName;
|
||||
|
||||
@Attribute("feature-id")
|
||||
public String myFeatureId;
|
||||
|
||||
public String getFileName() {
|
||||
return myFileName;
|
||||
}
|
||||
|
||||
public String getFeatureId() {
|
||||
return myFeatureId;
|
||||
}
|
||||
public String featureId;
|
||||
|
||||
@Nullable
|
||||
public static TipAndTrickBean findByFileName(String tipFileName) {
|
||||
for (TipAndTrickBean tip : Extensions.getExtensions(EP_NAME)) {
|
||||
if (Comparing.equal(tipFileName, tip.getFileName())) {
|
||||
if (Comparing.equal(tipFileName, tip.fileName)) {
|
||||
return tip;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TipAndTrickBean{" +
|
||||
"fileName='" + fileName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class TipUIUtil {
|
||||
TipAndTrickBean tip = TipAndTrickBean.findByFileName(tipFileName);
|
||||
if (tip == null && StringUtil.isNotEmpty(tipFileName)) {
|
||||
tip = new TipAndTrickBean();
|
||||
tip.myFileName = tipFileName;
|
||||
tip.fileName = tipFileName;
|
||||
}
|
||||
openTipInBrowser(tip, browser);
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class TipUIUtil {
|
||||
ClassLoader tipLoader = pluginDescriptor == null ? TipUIUtil.class.getClassLoader() :
|
||||
ObjectUtils.notNull(pluginDescriptor.getPluginClassLoader(), TipUIUtil.class.getClassLoader());
|
||||
|
||||
URL url = ResourceUtil.getResource(tipLoader, "/tips/", tip.getFileName());
|
||||
URL url = ResourceUtil.getResource(tipLoader, "/tips/", tip.fileName);
|
||||
|
||||
if (url == null) {
|
||||
setCantReadText(browser, tip);
|
||||
@@ -112,7 +112,7 @@ public class TipUIUtil {
|
||||
if (!plugin.isEmpty()) {
|
||||
product += " and " + plugin + " plugin";
|
||||
}
|
||||
String message = IdeBundle.message("error.unable.to.read.tip.of.the.day", bean.getFileName(), product);
|
||||
String message = IdeBundle.message("error.unable.to.read.tip.of.the.day", bean.fileName, product);
|
||||
browser.read(new StringReader(message), null);
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
|
||||
Reference in New Issue
Block a user