Browse Source

Pull request #1691: REPORT-32043 10.0冒烟:设计器启动经常白屏,卡住

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '492800655568b999a1af945435dda4585e07199f':
  REPORT-32043 10.0冒烟:设计器启动经常白屏,卡住
feature/big-screen
Hades 5 years ago
parent
commit
6bedb7539e
  1. 15
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java

15
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java

@ -15,6 +15,11 @@ import static com.fr.design.i18n.Toolkit.i18nText;
public class LogHandlerBar extends JPanel implements ItemSelectable { public class LogHandlerBar extends JPanel implements ItemSelectable {
// 可以作为常量 提前初始化 不用每次都去实时频繁的读取
private static final String NORMAL_MARK = i18nText("Fine-Design_Basic_NNormal");
private static final String ALERT_MARK = i18nText("Fine-Design_Basic_Alert");
private static final String SERIOUSLY_MARK = i18nText("Fine-Design_Basic_Seriously");
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private ItemListener listeners; private ItemListener listeners;
private UIButton clear; private UIButton clear;
@ -75,9 +80,13 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {
normalLabel.setText(i18nText("Fine-Design_Basic_NNormal") + '(' + getInfo() + ')'); // 这块逻辑执行地很频繁
alertLabel.setText(i18nText("Fine-Design_Basic_Alert") + '(' + getError() + ')'); // 容易造成 AWT 与 FinePluginController 发生死锁
seriouslyLabel.setText(i18nText("Fine-Design_Basic_Seriously") + '(' + getServer() + ')'); // in18Text每次读取 资源的时候 都会走下插件引擎逻辑去读取下插件的资源
// 应该避免每次都去读取 可以作为常量提前初始化好 避免与FinePluginController的竞争
normalLabel.setText(NORMAL_MARK + '(' + getInfo() + ')');
alertLabel.setText(ALERT_MARK + '(' + getError() + ')');
seriouslyLabel.setText(SERIOUSLY_MARK + '(' + getServer() + ')');
} }
}); });
} }

Loading…
Cancel
Save