Browse Source

Merge pull request #9264 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '4c7acb3b1084a70efef309d045a2cf8a89376cb2':
  REPORT-73802 【设计器环境监测】windows下没有finedb权限,首次启动设计器能起来,第二次就启动失败了
  单独写一个 DefaultLoginKeys
  REPORT-72595 FR源码中存在加密密钥硬编码,建议放到配置文件中
  REPORT-73833【设计器环境检测】本地目录,只有finedb异常,自动弹窗没弹 需要对使用后埋点。之前是使用的 Stream. 埋点后 Stream 流就不能用了。 这边换成 Collection 适配一下。
  REPORT-73811 图表条件属性汇总字段值,汇总方式下拉内容显示了两遍
  REPORT-72819 弹窗显示不全
  KERNEL-11517 实现主题色时ClassHelper中遍历搜索对象存在性能问题
bugfix/11.0
superman 3 years ago
parent
commit
6d3b099b2d
  1. 48
      designer-base/src/main/java/com/fr/design/login/config/DefaultLoginKeys.java
  2. 9
      designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java
  3. 10
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  4. 6
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  5. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java
  6. 144
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListExtendedPane.java
  7. 6
      designer-base/src/main/java/com/fr/env/detect/EnvDetectorCenter.java
  8. 13
      designer-base/src/main/java/com/fr/env/detect/base/DetectorBridge.java
  9. 1
      designer-base/src/main/resources/com/fr/design/config/default
  10. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  11. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  12. 6
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java
  13. 17
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  14. 5
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  15. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java
  16. 6
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  17. 5
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java
  18. 5
      designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java
  19. 8
      designer-realize/src/main/java/com/fr/start/module/optimized/BaseDBActivator4Designer.java

48
designer-base/src/main/java/com/fr/design/login/config/DefaultLoginKeys.java

@ -0,0 +1,48 @@
package com.fr.design.login.config;
import com.fr.log.FineLoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* @author Lanlan
* @version 10.0
* Created by Lanlan on 2022/6/20
*/
public class DefaultLoginKeys {
private static final String FILENAME = "com/fr/design/config/default";
private static final DefaultLoginKeys INSTANCE = new DefaultLoginKeys();
public static DefaultLoginKeys getInstance() {
return INSTANCE;
}
private final Map<String, String> keys = new HashMap<>();
private DefaultLoginKeys() {
Properties properties = load();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String name = entry.getKey().toString();
keys.put(name, entry.getValue().toString());
}
}
public String getKey(String name) {
return keys.get(name);
}
private Properties load() {
Properties properties = new Properties();
try (InputStream inputStream = DefaultLoginKeys.class.getClassLoader().getResourceAsStream(FILENAME)) {
properties.load(inputStream);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return properties;
}
}

9
designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java

@ -1,6 +1,7 @@
package com.fr.design.login.utils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.login.config.DefaultLoginKeys;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
import com.fr.general.CloudCenter;
import com.fr.general.CloudCenterConfig;
@ -28,8 +29,6 @@ public class DesignerLoginUtils {
private static final String PRODUCT_FINEREPORT = "product-finereport";
private static final String KEY = "i7hP48WAcuTrmxfN";
public static Map<String, String> renderMap() {
Map<String, String> map4Tpl = new HashMap<>();
map4Tpl.put("language", GeneralContext.getLocale().toString());
@ -86,7 +85,11 @@ public class DesignerLoginUtils {
jo.put("username", manager.getDesignerLoginUsername());
jo.put("source", PRODUCT_FINEREPORT);
byte[] iv = randomIv();
return new String(Hex.encode(iv)) + encrypt(jo.toString(), KEY.getBytes(), iv);
return new String(Hex.encode(iv)) + encrypt(
jo.toString(),
DefaultLoginKeys.getInstance().getKey("Fine-Designer_Login").getBytes(),
iv
);
}
private static byte[] randomIv() {

10
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1949,10 +1949,12 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
@Override
public void setTemplateTheme(TemplateTheme newTheme, TemplateThemeCompatible compatible) {
ThemedTemplate.super.setTemplateTheme(newTheme, compatible);
String name = newTheme.getName();
templateThemeButton.setText(name);
templateThemeButton.setToolTipText(name);
if (templateThemeButton != null) {
ThemedTemplate.super.setTemplateTheme(newTheme, compatible);
String name = newTheme.getName();
templateThemeButton.setText(name);
templateThemeButton.setToolTipText(name);
}
}
/**

6
designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java

@ -1,7 +1,12 @@
package com.fr.design.mainframe;
import com.fr.base.io.BaseBook;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.file.FILE;
import com.fr.form.main.Form;
import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
@ -36,6 +41,7 @@ public final class JTemplateFactory {
if (defaultAppExtension.equalsIgnoreCase(fileExtension)) {
JTemplate<?, ?> jt = app.openTemplate(file);
if (jt != null) {
jt.checkAndResetTheme();
return jt;
}
}

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.theme;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.base.theme.settings.ThemedCellStyleList;
@ -157,10 +158,8 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
return container;
}
private void onColorSchemeChanged(List<Color> colors) {
FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors);
T theme = updateBean();
FineColorFlushUtils.replaceCacheObject(theme, replaceByColorScheme);
FineColorManager.traverse(theme, replaceByColorScheme);
theme = (T) FineColorSynchronizer.flush(theme, colors);
populateBean4CustomEditors(theme);
this.repaint();
}

144
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListExtendedPane.java

@ -1,144 +0,0 @@
package com.fr.design.mainframe.theme.edit.ui;
import com.fr.base.theme.FineColorManager;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/8/7
*/
public class ColorListExtendedPane extends JPanel implements MouseListener {
public static final int DEFAULT_COLOR_COUNT = 8;
public static final int DEFAULT_EXTENDED_COUNT = 5;
public static final int DEFAULT_COLOR_SIZE = 16;
public static final int DEFAULT_COLOR_GAP = 3;
public static final ExtendedColorComputer DEFAULT_EXTENDED_COMPUTER = new ExtendedColorComputer() {
@Override
public Color computeExtendedColor(Color color, int index, int count) {
return FineColorManager.computeExtendedColor(color, index, count);
}
};
private final boolean selectable;
private final int colorCount;
private final int extendedCount;
private final int boxSize;
private final int boxGap;
private final List<Color> colorList = new ArrayList<>();
private ExtendedColorComputer extendedColorComputer = DEFAULT_EXTENDED_COMPUTER;
private int selectedColorIndex = -1;
private int selectedExtendedIndex = -1;
public ColorListExtendedPane() {
this(false, DEFAULT_COLOR_COUNT, DEFAULT_EXTENDED_COUNT, DEFAULT_COLOR_SIZE, DEFAULT_COLOR_GAP);
}
public ColorListExtendedPane(boolean selectable, int colorCount, int extendedCount, int boxSize, int boxGap) {
setLayout(FRGUIPaneFactory.createBorderLayout());
this.selectable = selectable;
this.colorCount = Math.max(1, colorCount);
this.extendedCount = extendedCount;
this.boxSize = boxSize;
this.boxGap = boxGap;
for (int i = 0; i < colorCount; i++) {
colorList.add(Color.WHITE);
}
int width = colorCount * boxSize + (colorCount - 1) * boxGap;
int height = extendedCount * boxSize + (extendedCount - 1) * boxGap;
setPreferredSize(new Dimension(width, height));
}
public void populate(List<Color> colors) {
if (colors.size() > 0) {
colorList.clear();
colorList.addAll(colors);
repaint();
}
}
public List<Color> update() {
return new ArrayList<>(colorList);
}
public void setExtendedColorComputer(ExtendedColorComputer extendedColorComputer) {
this.extendedColorComputer = extendedColorComputer;
}
@Override
public void mouseClicked(MouseEvent e) {
int x = e.getX();
int y = e.getY();
int colorIndex = x / (boxSize + boxGap);
int colorX = colorIndex * (boxSize + boxGap);
int extendedIndex = y / boxSize;
int extendedY = extendedIndex * boxSize;
if (colorX <= x && x <= colorX + boxSize && extendedY <= y && y <= extendedY + boxSize) {
selectedColorIndex = colorIndex;
selectedExtendedIndex = extendedIndex;
} else {
selectedColorIndex = -1;
selectedExtendedIndex = -1;
}
repaint();
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
public interface ExtendedColorComputer {
Color computeExtendedColor(Color color, int index, int count);
}
@Override
public void paint(Graphics g) {
super.paint(g);
Color oldColor = g.getColor();
for (int i = 0; i < colorCount; i++) {
int x = i * (boxSize + boxGap);
for (int j = 0; j < extendedCount; j++) {
Color color = extendedColorComputer.computeExtendedColor(colorList.get(i), j, extendedCount);
g.setColor(color);
int y = j * (boxSize + boxGap);
g.fillRect(x, y, boxSize, boxSize);
}
}
g.setColor(oldColor);
}
}

6
designer-base/src/main/java/com/fr/env/detect/EnvDetectorCenter.java vendored

@ -151,7 +151,7 @@ public class EnvDetectorCenter {
if (!validAction.get()) {
return;
}
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect();
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect().stream();
// 展示效果
NotificationDialogProperties properties = new NotificationDialogProperties(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Detect_Notification_Title"));
@ -196,7 +196,7 @@ public class EnvDetectorCenter {
*/
public List<DetectorResult> terminate(Throwable throwable) {
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect(throwable);
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect(throwable).stream();
return resultStream
.filter((e) -> e.getStatus() == DetectorStatus.EXCEPTION)
.collect(Collectors.toList());
@ -209,7 +209,7 @@ public class EnvDetectorCenter {
*/
public List<DetectorResult> terminateUnexpectedly() {
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect();
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect().stream();
return resultStream
.filter((e) -> e.getStatus() == DetectorStatus.EXCEPTION)
.collect(Collectors.toList());

13
designer-base/src/main/java/com/fr/env/detect/base/DetectorBridge.java vendored

@ -16,7 +16,9 @@ import com.fr.log.FineLoggerFactory;
import com.fr.value.NotNullLazyValue;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
@ -128,9 +130,11 @@ public class DetectorBridge {
*
* @return 能够检测出的异常情况
*/
public Stream<DetectorResult> detect() {
@NotNull
public Collection<DetectorResult> detect() {
return detectorManager.getValue().detect();
Stream<DetectorResult> results = detectorManager.getValue().detect();
return results.collect(Collectors.toList());
}
/**
@ -141,10 +145,11 @@ public class DetectorBridge {
* @param throwable 异常
* @return 检测结果
*/
public Stream<DetectorResult> detect(Throwable throwable) {
@NotNull
public Collection<DetectorResult> detect(Throwable throwable) {
ThrowableStore.getInstance().add(throwable);
Stream<DetectorResult> result = detect();
Collection<DetectorResult> result = detect();
ThrowableStore.getInstance().reset();
return result;

1
designer-base/src/main/resources/com/fr/design/config/default

@ -0,0 +1 @@
Fine-Designer_Login=i7hP48WAcuTrmxfN

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -13,7 +13,7 @@ com.fr.design.actions.server.dialog=700*630
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*160
com.fr.design.lock.LockInfoDialog=400*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.design.cell.expand.sort.pane=227*155
com.fr.design.sort.rule.item=80*20

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -12,7 +12,7 @@ com.fr.design.actions.server.dialog=700*630
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*160
com.fr.design.lock.LockInfoDialog=400*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.design.cell.expand.sort.pane=227*155
com.fr.design.sort.rule.item=80*20

6
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java

@ -46,8 +46,9 @@ public class ColSelectedWithSummaryMethodEditor extends Editor<DSColumnWithSumma
}
private static void refreshComboBoxModel(String[] columnNames) {
columnNameComboBoxModel.removeAllElements();
summaryMethodComboBoxModel.removeAllElements();
if (columnNames != null) {
columnNameComboBoxModel.removeAllElements();
for (String columnName : columnNames) {
columnNameComboBoxModel.addElement(columnName);
}
@ -56,9 +57,6 @@ public class ColSelectedWithSummaryMethodEditor extends Editor<DSColumnWithSumma
}
columnNameComboBoxModel.setSelectedItem(null);
summaryMethodComboBoxModel.setSelectedItem(null);
} else {
columnNameComboBoxModel.removeAllElements();
summaryMethodComboBoxModel.removeAllElements();
}
}

17
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -7,6 +7,7 @@ import com.fr.base.chart.BaseChartCollection;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeAware;
@ -235,13 +236,12 @@ public class XCreatorUtils {
}
public static XCreator createThemedXCreator(Widget widget) {
XCreator creator = createXCreator(widget);
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateTheme theme = template.getTemplateTheme();
if (theme instanceof FormTheme) {
setupTemplateTheme(creator, true, (FormTheme) theme, TemplateThemeCompatible.NONE);
widget = setupTemplateTheme(widget, true, (FormTheme) theme, TemplateThemeCompatible.NONE);
}
return creator;
return createXCreator(widget);
}
/**
@ -386,14 +386,12 @@ public class XCreatorUtils {
}
public static void setupTemplateTheme(XCreator container, final boolean forceFollowingTheme, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) {
FineColorGather colorGather = new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible);
Widget root = container.toData();
List<BaseChartCollection> chartCollections = root.getChartCollections();
public static Widget setupTemplateTheme(Widget widget, final boolean forceFollowingTheme, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) {
List<BaseChartCollection> chartCollections = widget.getChartCollections();
for (BaseChartCollection chartCollection: chartCollections) {
chartCollection.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible);
}
Form.traversalWidget(root, new WidgetGather() {
Form.traversalWidget(widget, new WidgetGather() {
@Override
public void dealWith(Widget widget) {
TemplateThemeAware<FormTheme> themedWidget = (TemplateThemeAware) widget;
@ -408,8 +406,7 @@ public class XCreatorUtils {
return true;
}
}, TemplateThemeAware.class);
FineColorFlushUtils.replaceCacheObject(container.toData(), colorGather);
FineColorManager.traverse(container.toData(), colorGather);
return (Widget) FineColorSynchronizer.flush(widget, currentTemplateUsingTheme, compatible);
}

5
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -6,6 +6,9 @@ import com.fr.base.Parameter;
import com.fr.base.Releasable;
import com.fr.base.extension.FileExtension;
import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeCompatible;
@ -1210,6 +1213,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
protected void setUpTheme4NewTemplate() {
super.setUpTheme4NewTemplate();
getTarget().setTemplateTheme(getTarget().getTemplateTheme());
setTarget((Form) FineColorSynchronizer.flush(getTarget(), getTemplateTheme()));
}
@Override
@ -1236,6 +1240,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
double slideValue = formArea.getSlideValue();
getTarget().setTemplateTheme(newTheme, compatible);
setTarget((Form) FineColorSynchronizer.flush(getTarget(), newTheme, compatible));
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() == this) {
fireTargetModified(shouldCreateUndoState);

4
designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java

@ -55,7 +55,6 @@ public class ShareComponentUtils {
}
public static XCreator createThemedXCreator(Widget creatorSource, String suitableTemplateThemeName, String shareId, SharableWidgetProvider provider) {
XCreator creator = createXCreator(creatorSource, shareId, provider);
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateTheme theme = template.getTemplateTheme();
if (theme instanceof FormTheme) {
@ -64,8 +63,9 @@ public class ShareComponentUtils {
StringUtils.isNotEmpty(suitableTemplateThemeName) &&
StringUtils.equals(theme.getName(), suitableTemplateThemeName) &&
!StringUtils.equals(theme.getName(), themeName4LegacyTemplate);
XCreatorUtils.setupTemplateTheme(creator, false, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT);
creatorSource = XCreatorUtils.setupTemplateTheme(creatorSource, false, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT);
}
XCreator creator = createXCreator(creatorSource, shareId, provider);
return creator;
}

6
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -6,6 +6,9 @@ import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.TRL;
import com.fr.base.extension.FileExtension;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeCompatible;
@ -77,6 +80,7 @@ import com.fr.file.FILEChooserPane;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.form.main.Form;
import com.fr.general.ComparatorUtils;
import com.fr.general.ModuleContext;
import com.fr.grid.Grid;
@ -1289,6 +1293,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
protected void setUpTheme4NewTemplate() {
super.setUpTheme4NewTemplate();
getTarget().setTemplateTheme(getTarget().getTemplateTheme());
setTarget((WorkBook) FineColorSynchronizer.flush(getTarget(), getTemplateTheme()));
}
@ -1308,6 +1313,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
boolean shouldCreateUndoState = compatible == TemplateThemeCompatible.NONE && !StringUtils.equals(oldTheme.getName(), newTheme.getName());
getTarget().setTemplateTheme(newTheme, compatible);
setTarget((WorkBook) FineColorSynchronizer.flush(getTarget(), newTheme, compatible));
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() == this) {
fireTargetModified(shouldCreateUndoState);

5
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -3,6 +3,9 @@ package com.fr.design.mainframe.app;
import com.fr.base.Parameter;
import com.fr.base.chart.exception.ChartNotFoundException;
import com.fr.base.io.XMLEncryptUtils;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.design.DesignerEnvManager;
import com.fr.design.fit.NewJForm;
import com.fr.design.i18n.Toolkit;
@ -124,6 +127,6 @@ class FormApp extends AbstractAppProvider {
FineLoggerFactory.getLogger().error("Failed to generate frm from " + file, exp);
return null;
}
return tpl;
return (Form) FineColorSynchronizer.flush(tpl, tpl.getTemplateTheme());
}
}

5
designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java

@ -28,12 +28,12 @@ import com.fr.stable.lifecycle.FineLifecycleFatalError;
import com.fr.stable.project.ProjectConstants;
import javax.swing.JOptionPane;
import java.util.Collection;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author hades
@ -88,8 +88,9 @@ public class LifecycleFatalErrorHandler {
@Override
public void handle(FineLifecycleFatalError fatal) {
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect(fatal);
Collection<DetectorResult> resultStream = DetectorBridge.getInstance().detect(fatal);
List<DetectorResult> results = resultStream
.stream()
.filter((e) -> e.getStatus() == DetectorStatus.EXCEPTION)
.collect(Collectors.toList());

8
designer-realize/src/main/java/com/fr/start/module/optimized/BaseDBActivator4Designer.java

@ -5,6 +5,8 @@ import com.fr.config.dao.DaoSelectorFactory;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.event.Null;
import com.fr.stable.lifecycle.FineLifecycleFatalError;
import com.fr.start.LifecycleFatalErrorHandler;
import com.fr.start.event.LazyStartupEvent;
/**
@ -20,7 +22,11 @@ public class BaseDBActivator4Designer extends BaseDBActivator {
listenEvent(LazyStartupEvent.INSTANCE, new Listener<Null>(Integer.MAX_VALUE) {
@Override
public void on(Event event, Null param) {
BaseDBActivator4Designer.super.start();
try {
BaseDBActivator4Designer.super.start();
} catch (FineLifecycleFatalError error) {
LifecycleFatalErrorHandler.getInstance().handle(error);
}
}
});
} else {

Loading…
Cancel
Save