From 304eb116e14d4c078d295dedb561e3cc91fe1dc1 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 18 Oct 2021 11:02:55 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-61055=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E3=80=91=E4=B8=BB=E9=A2=98=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=87=A0=E4=B8=AA=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题编辑面板开放交互接口,便于与插件中的导出按钮交互 【改动思路】 同上 --- .../theme/TemplateThemeEditorPane.java | 4 ++++ .../theme/TemplateThemeProfilePane.java | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java index c2e28332d..e924080ef 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java @@ -267,6 +267,10 @@ public abstract class TemplateThemeEditorPane extends J return nameTextField.checkValid(); } + public String getThemeName() { + return nameTextField.getText(); + } + public List getCurrentColorScheme() { return colorListPane.update(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index f3187acaa..4fc65badb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -60,6 +60,8 @@ public abstract class TemplateThemeProfilePane extends private UIButton saveButton = new UIButton(); private UIButton saveAsButton = new UIButton(); + private TemplateThemeProfileActionListener actionListener = new TemplateThemeProfileActionAdapter(); + public TemplateThemeProfilePane(TemplateThemeConfig config) { super(); this.config = config; @@ -112,6 +114,7 @@ public abstract class TemplateThemeProfilePane extends return; } saveButton.setEnabled(valid && isMutable); + actionListener.onThemeNameChecked(themeEditorPane.getThemeName(), valid); } }); @@ -138,6 +141,7 @@ public abstract class TemplateThemeProfilePane extends if (saveAsButton != null) { saveAsButton.setEnabled(StringUtils.isNotEmpty(name)); } + isPopulating = false; } @@ -330,4 +334,19 @@ public abstract class TemplateThemeProfilePane extends this.dispose(); } } + + public void addProfileActionListener(TemplateThemeProfileActionListener actionListener) { + if (actionListener != null) { + this.actionListener = actionListener; + } + } + public interface TemplateThemeProfileActionListener { + + void onThemeNameChecked(String name, boolean valid); + } + public static class TemplateThemeProfileActionAdapter implements TemplateThemeProfileActionListener { + + @Override + public void onThemeNameChecked(String name, boolean valid) { } + } } \ No newline at end of file