|
12 | 12 | import com.xwintop.xJavaFxTool.services.IndexService; |
13 | 13 | import com.xwintop.xJavaFxTool.services.index.SystemSettingService; |
14 | 14 | import com.xwintop.xJavaFxTool.utils.Config; |
| 15 | +import com.xwintop.xJavaFxTool.utils.VersionChecker; |
15 | 16 | import com.xwintop.xJavaFxTool.view.IndexView; |
16 | 17 | import com.xwintop.xcore.javafx.FxApp; |
| 18 | +import com.xwintop.xcore.javafx.dialog.FxAlerts; |
17 | 19 | import com.xwintop.xcore.javafx.dialog.FxDialog; |
18 | 20 | import com.xwintop.xcore.util.ConfigureUtil; |
19 | 21 | import com.xwintop.xcore.util.HttpClientUtil; |
@@ -164,24 +166,24 @@ private void addCategory(PluginCategoryController category) { |
164 | 166 | } |
165 | 167 |
|
166 | 168 | private void addMenu(PluginJarInfo jarInfo) { |
167 | | - MenuItem menu = moreToolsMenu.getItems().stream().filter(menuItem1 -> jarInfo.getMenuParentId().equals(menuItem1.getId())).findAny().orElse(null); |
168 | | - if (menu == null) { |
169 | | - menu = new Menu(XJavaFxToolApplication.RESOURCE_BUNDLE.getString(jarInfo.getMenuParentTitle())); |
170 | | - menu.setId(jarInfo.getMenuParentId()); |
171 | | - moreToolsMenu.getItems().add(menu); |
172 | | - } |
173 | | - MenuItem menuItem = new MenuItem(jarInfo.getTitle()); |
174 | | - if (StringUtils.isNotEmpty(jarInfo.getIconPath())) { |
175 | | - ImageView imageView = new ImageView(new Image(jarInfo.getIconPath())); |
176 | | - imageView.setFitHeight(18); |
177 | | - imageView.setFitWidth(18); |
178 | | - menuItem.setGraphic(imageView); |
179 | | - } |
180 | | - menuItem.setOnAction((ActionEvent event) -> { |
181 | | - indexService.loadPlugin(jarInfo); |
182 | | - }); |
183 | | - ((Menu)menu).getItems().add(menuItem); |
184 | | - menuItemMap.put(menuItem.getText(), menuItem); |
| 169 | + MenuItem menu = moreToolsMenu.getItems().stream().filter(menuItem1 -> jarInfo.getMenuParentId().equals(menuItem1.getId())).findAny().orElse(null); |
| 170 | + if (menu == null) { |
| 171 | + menu = new Menu(XJavaFxToolApplication.RESOURCE_BUNDLE.getString(jarInfo.getMenuParentTitle())); |
| 172 | + menu.setId(jarInfo.getMenuParentId()); |
| 173 | + moreToolsMenu.getItems().add(menu); |
| 174 | + } |
| 175 | + MenuItem menuItem = new MenuItem(jarInfo.getTitle()); |
| 176 | + if (StringUtils.isNotEmpty(jarInfo.getIconPath())) { |
| 177 | + ImageView imageView = new ImageView(new Image(jarInfo.getIconPath())); |
| 178 | + imageView.setFitHeight(18); |
| 179 | + imageView.setFitWidth(18); |
| 180 | + menuItem.setGraphic(imageView); |
| 181 | + } |
| 182 | + menuItem.setOnAction((ActionEvent event) -> { |
| 183 | + indexService.loadPlugin(jarInfo); |
| 184 | + }); |
| 185 | + ((Menu) menu).getItems().add(menuItem); |
| 186 | + menuItemMap.put(menuItem.getText(), menuItem); |
185 | 187 | } |
186 | 188 |
|
187 | 189 | public void selectAction(String selectText) { |
@@ -239,6 +241,13 @@ private void SettingAction() { |
239 | 241 | SystemSettingService.openSystemSettings(bundle.getString("Setting")); |
240 | 242 | } |
241 | 243 |
|
| 244 | + @FXML |
| 245 | + private void checkerVersionAction() { |
| 246 | + if (!VersionChecker.checkNewVersion()) { |
| 247 | + FxAlerts.info("提示", "已经是新版本"); |
| 248 | + } |
| 249 | + } |
| 250 | + |
242 | 251 | @FXML |
243 | 252 | private void aboutAction() { |
244 | 253 | AlertUtil.showInfoAlert(bundle.getString("aboutText") + Config.xJavaFxToolVersions); |
|
0 commit comments