Skip to content

Commit d324482

Browse files
committed
1.修改首页布局
1 parent d2c8921 commit d324482

6 files changed

Lines changed: 11 additions & 17 deletions

File tree

src/main/java/com/xwintop/xJavaFxTool/controller/IndexController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private void addLogConsoleAction(ActionEvent event) {
263263
private void pluginManageAction() throws Exception {
264264
FXMLLoader fXMLLoader = PluginManageController.getFXMLLoader();
265265
Parent root = fXMLLoader.load();
266-
PluginManageController pluginManageController = fXMLLoader.getController();
266+
// PluginManageController pluginManageController = fXMLLoader.getController();
267267
/*
268268
pluginManageController.setOnPluginDownloaded(jarFile -> {
269269
try {

src/main/java/com/xwintop/xJavaFxTool/event/AppEvents.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
/**
1212
* 应用全局事件注册和触发
1313
*/
14-
@SuppressWarnings({"unchecked", "rawtypes"})
1514
public class AppEvents {
1615

1716
private static final AppEvents instance = new AppEvents();
@@ -22,8 +21,7 @@ public class AppEvents {
2221
* @param appEvent 事件对象
2322
*/
2423
public static void fire(AppEvent appEvent) {
25-
List<Consumer> handlers = instance.listeners
26-
.getOrDefault(appEvent.getEventType(), Collections.emptyList());
24+
List<Consumer> handlers = instance.listeners.getOrDefault(appEvent.getEventType(), Collections.emptyList());
2725

2826
for (Consumer handler : handlers) {
2927
handler.accept(appEvent);

src/main/java/com/xwintop/xJavaFxTool/plugin/PluginManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public static PluginManager getInstance() {
6161

6262
private final String localPluginsPath;
6363

64-
private final OkHttpClient pluginDownloader =
65-
new OkHttpClient.Builder().addInterceptor(new DownloadProgressInterceptor()).build();
64+
private final OkHttpClient pluginDownloader = new OkHttpClient.Builder().addInterceptor(new DownloadProgressInterceptor()).build();
6665

6766
private final List<PluginJarInfo> pluginList = new ArrayList<>(); // 插件列表
6867

src/main/java/com/xwintop/xJavaFxTool/services/index/PluginManageService.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import java.util.Map;
1818
import java.util.function.Consumer;
1919

20-
import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
21-
2220
/**
2321
* 插件管理
2422
*
@@ -47,7 +45,6 @@ public void getPluginList() {
4745
}
4846

4947
public void addDataRow(PluginJarInfo plugin) {
50-
5148
Map<String, String> dataRow = new HashMap<>();
5249
dataRow.put("nameTableColumn", plugin.getName());
5350
dataRow.put("synopsisTableColumn", plugin.getSynopsis());
@@ -91,8 +88,7 @@ protected void execute() throws Exception {
9188
};
9289

9390
Window controllerWindow = pluginManageController.getWindow();
94-
FxProgressDialog dialog = FxProgressDialog
95-
.create(controllerWindow, progressTask, "正在下载插件 " + pluginJarInfo.getName() + "...");
91+
FxProgressDialog dialog = FxProgressDialog.create(controllerWindow, progressTask, "正在下载插件 " + pluginJarInfo.getName() + "...");
9692

9793
progressTask.setOnCancelled(event -> {
9894
throw new AppException("下载被取消。");
@@ -132,18 +128,15 @@ public void searchPlugin(String keyword) {
132128

133129
private boolean isPluginDataMatch(Map<String, String> map, String keyword) {
134130
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())
138132
);
139133
}
140134

141135
/**
142136
* 判断插件是否启用
143137
*/
144-
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
145138
public static boolean isPluginEnabled(String fileName) {
146-
String jarName = substringBeforeLast(fileName, "-");
139+
String jarName = StringUtils.substringBeforeLast(fileName, "-");
147140
PluginJarInfo pluginJarInfo = PluginManager.getInstance().getPlugin(jarName);
148141
if (pluginJarInfo == null) {
149142
return false;

src/main/java/com/xwintop/xJavaFxTool/view/IndexView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import javafx.fxml.FXML;
55
import javafx.fxml.Initializable;
66
import javafx.scene.control.*;
7+
import javafx.scene.layout.VBox;
78
import javafx.scene.web.WebView;
89
import lombok.Getter;
910
import lombok.Setter;
@@ -39,4 +40,7 @@ public abstract class IndexView implements Initializable {
3940

4041
@FXML
4142
protected WebView tongjiWebView;
43+
44+
@FXML
45+
protected VBox pluginCategories;
4246
}

src/main/resources/com/xwintop/xJavaFxTool/fxmlView/Index.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<Insets top="5.0" />
8383
</VBox.margin>
8484
</HBox>
85-
<VBox fx:id="pluginCategories" />
85+
<VBox fx:id="pluginCategories" alignment="TOP_CENTER"/>
8686
</children>
8787
</VBox>
8888
</content>

0 commit comments

Comments
 (0)