Browse Source

REPORT-61055 【主题获取】主题导出插件几个小问题

【问题原因】
主题编辑面板开放交互接口,便于与插件中的导出按钮交互

【改动思路】
同上
bugfix/11.0
Starryi 3 years ago
parent
commit
304eb116e1
  1. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java
  2. 19
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

4
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java

@ -267,6 +267,10 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
return nameTextField.checkValid();
}
public String getThemeName() {
return nameTextField.getText();
}
public List<Color> getCurrentColorScheme() {
return colorListPane.update();
}

19
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -60,6 +60,8 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
private UIButton saveButton = new UIButton();
private UIButton saveAsButton = new UIButton();
private TemplateThemeProfileActionListener actionListener = new TemplateThemeProfileActionAdapter();
public TemplateThemeProfilePane(TemplateThemeConfig<T> config) {
super();
this.config = config;
@ -112,6 +114,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
return;
}
saveButton.setEnabled(valid && isMutable);
actionListener.onThemeNameChecked(themeEditorPane.getThemeName(), valid);
}
});
@ -138,6 +141,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
if (saveAsButton != null) {
saveAsButton.setEnabled(StringUtils.isNotEmpty(name));
}
isPopulating = false;
}
@ -330,4 +334,19 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> 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) { }
}
}
Loading…
Cancel
Save