Browse Source

REPORT-61338 设计器主题-主题配色修改保存后出现异常空白提示框

【问题原因】
AlphaFine需要一个不带参数的默认构造函数,用于构建面板

【改动思路】
同上
new-design
Starryi 3 years ago
parent
commit
205e0eb733
  1. 23
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java
  2. 13
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java
  3. 33
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java

23
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java

@ -22,6 +22,7 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nullable;
import com.fr.transaction.CallBackAdaptor;
import javax.swing.BorderFactory;
@ -67,19 +68,19 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
private final Window window;
public static TemplateThemeGridControlPane<FormTheme> createFormThemesManagerPane(Window window) {
public static TemplateThemeGridControlPane<FormTheme> createFormThemesManagerPane(@Nullable Window window) {
FormThemeConfig config = FormThemeConfig.getInstance();
FormThemeProfilePane editPane = new FormThemeProfilePane(config);
return new TemplateThemeGridControlPane<>(window, config, editPane);
}
public static TemplateThemeGridControlPane<ReportTheme> createReportThemesManagerPane(Window window) {
public static TemplateThemeGridControlPane<ReportTheme> createReportThemesManagerPane(@Nullable Window window) {
ReportThemeConfig config = ReportThemeConfig.getInstance();
ReportThemeProfilePane editPane = new ReportThemeProfilePane(config);
return new TemplateThemeGridControlPane<>(window, config, editPane);
}
public TemplateThemeGridControlPane(Window window, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
public TemplateThemeGridControlPane(@Nullable Window window, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.window = window;
this.config = config;
this.profilePane = profilePane;
@ -124,13 +125,15 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
}
private void registerWindowListener() {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
asyncThemeFetcher.shutdown();
}
});
if (window != null) {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
asyncThemeFetcher.shutdown();
}
});
}
}
private void resetEnableRemoveAction(T selectedTheme, RemoveThemeAction removeAction) {

13
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java

@ -22,6 +22,7 @@ import com.fr.design.mainframe.theme.provider.ThemeManageActionProvider;
import com.fr.design.mainframe.theme.ui.BreadcrumbBar;
import com.fr.stable.ArrayUtils;
import com.fr.stable.unit.FU;
import com.fr.third.javax.annotation.Nullable;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory;
@ -62,11 +63,15 @@ public class TemplateThemeGridPagesPane extends JPanel {
private PageChangeListener pageChangeListener;
private TemplateThemeGridPagePane currentTemplateThemeGridPagePane;
public TemplateThemeGridPagesPane(Window window) {
public TemplateThemeGridPagesPane() {
initializePane(null);
}
public TemplateThemeGridPagesPane(@Nullable Window window) {
initializePane(window);
}
private void initializePane(Window window) {
private void initializePane(@Nullable Window window) {
setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
@ -234,7 +239,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
private final JTemplate<?,?> template;
public final TemplateThemeGridPane<? extends TemplateTheme> themeListPane;
public TemplateThemeUsingPane(Window window) {
public TemplateThemeUsingPane(@Nullable Window window) {
super();
setLayout(new BorderLayout());
setBorder(new CompoundBorder(
@ -273,7 +278,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane {
private final UITabbedPane tabbedPane;
public TemplateThemeManagingPane(Window window) {
public TemplateThemeManagingPane(@Nullable Window window) {
setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane();

33
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java

@ -9,6 +9,7 @@ import com.fr.design.event.ChangeListener;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nullable;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -56,7 +57,7 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
private final Window window;
public TemplateThemeGridPane(Window window, boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
public TemplateThemeGridPane(@Nullable Window window, boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.window = window;
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config;
@ -90,21 +91,23 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
}
private void registerWindowListener() {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) {
super.windowOpened(e);
startListenThemeConfig();
asyncFetchThemes();
}
if (window != null) {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) {
super.windowOpened(e);
startListenThemeConfig();
asyncFetchThemes();
}
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
stopListenThemeConfig();
asyncThemeFetcher.shutdown();
}
});
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
stopListenThemeConfig();
asyncThemeFetcher.shutdown();
}
});
}
}
public void fillContentListPane() {

Loading…
Cancel
Save