|
17 | 17 | import java.util.Map; |
18 | 18 | import java.util.function.Consumer; |
19 | 19 |
|
20 | | -import static org.apache.commons.lang3.StringUtils.substringBeforeLast; |
21 | | - |
22 | 20 | /** |
23 | 21 | * 插件管理 |
24 | 22 | * |
@@ -47,7 +45,6 @@ public void getPluginList() { |
47 | 45 | } |
48 | 46 |
|
49 | 47 | public void addDataRow(PluginJarInfo plugin) { |
50 | | - |
51 | 48 | Map<String, String> dataRow = new HashMap<>(); |
52 | 49 | dataRow.put("nameTableColumn", plugin.getName()); |
53 | 50 | dataRow.put("synopsisTableColumn", plugin.getSynopsis()); |
@@ -91,8 +88,7 @@ protected void execute() throws Exception { |
91 | 88 | }; |
92 | 89 |
|
93 | 90 | Window controllerWindow = pluginManageController.getWindow(); |
94 | | - FxProgressDialog dialog = FxProgressDialog |
95 | | - .create(controllerWindow, progressTask, "正在下载插件 " + pluginJarInfo.getName() + "..."); |
| 91 | + FxProgressDialog dialog = FxProgressDialog.create(controllerWindow, progressTask, "正在下载插件 " + pluginJarInfo.getName() + "..."); |
96 | 92 |
|
97 | 93 | progressTask.setOnCancelled(event -> { |
98 | 94 | throw new AppException("下载被取消。"); |
@@ -132,18 +128,15 @@ public void searchPlugin(String keyword) { |
132 | 128 |
|
133 | 129 | private boolean isPluginDataMatch(Map<String, String> map, String keyword) { |
134 | 130 | return map.entrySet().stream().anyMatch( |
135 | | - entry -> |
136 | | - !entry.getKey().equals("downloadUrl") && |
137 | | - entry.getValue().toLowerCase().contains(keyword.toLowerCase()) |
| 131 | + entry -> !entry.getKey().equals("downloadUrl") && entry.getValue().toLowerCase().contains(keyword.toLowerCase()) |
138 | 132 | ); |
139 | 133 | } |
140 | 134 |
|
141 | 135 | /** |
142 | 136 | * 判断插件是否启用 |
143 | 137 | */ |
144 | | - @SuppressWarnings("BooleanMethodIsAlwaysInverted") |
145 | 138 | public static boolean isPluginEnabled(String fileName) { |
146 | | - String jarName = substringBeforeLast(fileName, "-"); |
| 139 | + String jarName = StringUtils.substringBeforeLast(fileName, "-"); |
147 | 140 | PluginJarInfo pluginJarInfo = PluginManager.getInstance().getPlugin(jarName); |
148 | 141 | if (pluginJarInfo == null) { |
149 | 142 | return false; |
|
0 commit comments