修改插件管理器的ui错误
This commit is contained in:
parent
1aa84a16c0
commit
95d87102b1
@ -11,6 +11,8 @@ import javafx.scene.control.Tab;
|
|||||||
import javafx.scene.control.TabPane;
|
import javafx.scene.control.TabPane;
|
||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
|
import org.jcnc.jnotepad.util.LogUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -24,6 +26,9 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class PluginManagementPane extends BorderPane {
|
public class PluginManagementPane extends BorderPane {
|
||||||
|
|
||||||
|
Logger logger = LogUtil.getLogger(this.getClass());
|
||||||
|
|
||||||
|
|
||||||
private CustomSplitPane customSplitPane;
|
private CustomSplitPane customSplitPane;
|
||||||
private final Map<Tile, Node> tileContentMap = new HashMap<>();
|
private final Map<Tile, Node> tileContentMap = new HashMap<>();
|
||||||
|
|
||||||
@ -38,9 +43,6 @@ public class PluginManagementPane extends BorderPane {
|
|||||||
* 初始化插件管理面板。
|
* 初始化插件管理面板。
|
||||||
*/
|
*/
|
||||||
private void init() {
|
private void init() {
|
||||||
// 设置用户代理样式表
|
|
||||||
Application.setUserAgentStylesheet(new PrimerLight().getUserAgentStylesheet());
|
|
||||||
|
|
||||||
// 创建选项卡面板
|
// 创建选项卡面板
|
||||||
TabPane tabPane = new TabPane();
|
TabPane tabPane = new TabPane();
|
||||||
|
|
||||||
@ -115,12 +117,14 @@ public class PluginManagementPane extends BorderPane {
|
|||||||
tile.setAction(tgl);
|
tile.setAction(tgl);
|
||||||
tile.setActionHandler(() -> {
|
tile.setActionHandler(() -> {
|
||||||
customSplitPane.setRightContent(tileContentMap.get(tile));
|
customSplitPane.setRightContent(tileContentMap.get(tile));
|
||||||
System.out.println("点击了" + title);
|
logger.info("点击了" + tile);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 创建专属的customSplitPane内容
|
// 创建专属的customSplitPane内容
|
||||||
var content = createCustomSplitPaneContent(title);
|
var content = createCustomSplitPaneContent(title);
|
||||||
|
|
||||||
|
|
||||||
// 将内容与Tile关联起来
|
// 将内容与Tile关联起来
|
||||||
tileContentMap.put(tile, content);
|
tileContentMap.put(tile, content);
|
||||||
|
|
||||||
@ -134,8 +138,8 @@ public class PluginManagementPane extends BorderPane {
|
|||||||
* @return 创建的CustomSplitPane内容
|
* @return 创建的CustomSplitPane内容
|
||||||
*/
|
*/
|
||||||
private Node createCustomSplitPaneContent(String title) {
|
private Node createCustomSplitPaneContent(String title) {
|
||||||
|
|
||||||
// TODO: 2023/9/23 未完成
|
// TODO: 2023/9/23 未完成
|
||||||
return new Label("详情" + title);
|
return new Label("详情" + title);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import org.jcnc.jnotepad.controller.i18n.LocalizationController;
|
|||||||
import org.jcnc.jnotepad.model.entity.ShortcutKey;
|
import org.jcnc.jnotepad.model.entity.ShortcutKey;
|
||||||
import org.jcnc.jnotepad.ui.pluginstage.PluginManagementPane;
|
import org.jcnc.jnotepad.ui.pluginstage.PluginManagementPane;
|
||||||
import org.jcnc.jnotepad.util.LogUtil;
|
import org.jcnc.jnotepad.util.LogUtil;
|
||||||
|
import org.jcnc.jnotepad.util.UiUtil;
|
||||||
import org.jcnc.jnotepad.views.root.center.main.center.tab.CenterTab;
|
import org.jcnc.jnotepad.views.root.center.main.center.tab.CenterTab;
|
||||||
import org.jcnc.jnotepad.views.root.center.main.center.tab.CenterTabPane;
|
import org.jcnc.jnotepad.views.root.center.main.center.tab.CenterTabPane;
|
||||||
import org.jcnc.jnotepad.views.root.left.sidebar.tools.SidebarToolBar;
|
import org.jcnc.jnotepad.views.root.left.sidebar.tools.SidebarToolBar;
|
||||||
@ -270,7 +271,8 @@ public class TopMenuBar extends MenuBar {
|
|||||||
|
|
||||||
pluginManagerItem = new MenuItem();
|
pluginManagerItem = new MenuItem();
|
||||||
pluginManagerItem.setOnAction(event -> {
|
pluginManagerItem.setOnAction(event -> {
|
||||||
Stage newStage = new Stage(); // 创建一个新的Stage对象
|
Stage newStage = new Stage();
|
||||||
|
newStage.getIcons().add(UiUtil.getAppIcon());
|
||||||
newStage.setTitle("插件管理");
|
newStage.setTitle("插件管理");
|
||||||
|
|
||||||
PluginManagementPane pluginManagementPane = new PluginManagementPane();
|
PluginManagementPane pluginManagementPane = new PluginManagementPane();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user