|
14 | 14 | import com.xwintop.xcore.javafx.FxApp; |
15 | 15 | import com.xwintop.xcore.javafx.dialog.FxAlerts; |
16 | 16 | import com.xwintop.xcore.javafx.dialog.FxDialog; |
17 | | -import com.xwintop.xcore.util.javafx.JavaFxViewUtil; |
18 | | -import javafx.beans.Observable; |
19 | | -import javafx.fxml.FXMLLoader; |
20 | | -import javafx.scene.Parent; |
21 | | -import javafx.scene.control.TextField; |
22 | | -import javafx.scene.control.*; |
23 | | -import javafx.scene.layout.VBox; |
24 | | -import javafx.scene.web.WebView; |
25 | | -import lombok.extern.slf4j.Slf4j; |
26 | | -import org.apache.commons.lang3.StringUtils; |
27 | | - |
28 | | -import java.awt.*; |
| 17 | +import java.awt.Desktop; |
29 | 18 | import java.io.File; |
30 | 19 | import java.io.IOException; |
31 | 20 | import java.net.URI; |
32 | 21 | import java.util.ArrayList; |
33 | 22 | import java.util.HashMap; |
34 | 23 | import java.util.List; |
35 | 24 | import java.util.Map; |
| 25 | +import javafx.beans.Observable; |
| 26 | +import javafx.scene.control.ButtonType; |
| 27 | +import javafx.scene.control.CheckMenuItem; |
| 28 | +import javafx.scene.control.ContextMenu; |
| 29 | +import javafx.scene.control.Hyperlink; |
| 30 | +import javafx.scene.control.TabPane; |
| 31 | +import javafx.scene.control.TextField; |
| 32 | +import javafx.scene.layout.VBox; |
| 33 | +import javafx.scene.web.WebView; |
| 34 | +import lombok.extern.slf4j.Slf4j; |
| 35 | +import org.apache.commons.lang3.StringUtils; |
36 | 36 |
|
37 | 37 | @Slf4j |
38 | 38 | public class NewLauncherController { |
@@ -116,7 +116,12 @@ private void loadPlugins() { |
116 | 116 | pluginList.forEach(this::loadPlugin); |
117 | 117 | } |
118 | 118 |
|
119 | | - public void loadPlugin(PluginJarInfo jarInfo) { |
| 119 | + /** |
| 120 | + * 加载单个插件到界面,要求插件已经经过 {@link PluginParser#parse(File, PluginJarInfo)} 解析 |
| 121 | + * |
| 122 | + * @param jarInfo 插件信息 |
| 123 | + */ |
| 124 | + private void loadPlugin(PluginJarInfo jarInfo) { |
120 | 125 | String menuParentTitle = jarInfo.getMenuParentTitle(); |
121 | 126 | if (menuParentTitle != null) { |
122 | 127 |
|
@@ -159,13 +164,13 @@ public void openConfigDialog() { |
159 | 164 | } |
160 | 165 |
|
161 | 166 | public void openPluginManager() { |
162 | | - try { |
163 | | - FXMLLoader fXMLLoader = PluginManageController.getFXMLLoader(); |
164 | | - Parent root = fXMLLoader.load(); |
165 | | - JavaFxViewUtil.openNewWindow(Main.RESOURCE_BUNDLE.getString("plugin_manage"), root); |
166 | | - } catch (IOException e) { |
167 | | - FxAlerts.error("打开插件管理对话框失败", e); |
168 | | - } |
| 167 | + new FxDialog<PluginManageController>() |
| 168 | + .setBodyFxml(PluginManageController.FXML) |
| 169 | + .setOwner(FxApp.primaryStage) |
| 170 | + .setResizable(true) |
| 171 | + .setTitle(Main.RESOURCE_BUNDLE.getString("plugin_manage")) |
| 172 | + .setPrefWidth(800) |
| 173 | + .show(); |
169 | 174 | } |
170 | 175 |
|
171 | 176 | public void openProjectUrl() { |
|
0 commit comments