Browse Source
Merge in DESIGN/design from ~HADES/design:final/10.0 to final/10.0 * commit '89f2bbc0e3c6b6ebe1d939b8cfdeef69b9df223c': REPORT-54643 最新的persist分支安装设计器内存监控安装失败且会导致面板无法编辑 REPORT-54643 回退 REPORT-54643 最新的persist分支安装设计器内存监控安装失败且会导致面板无法编辑final/10.0
Kara
3 years ago
2 changed files with 99 additions and 0 deletions
@ -0,0 +1,84 @@ |
|||||||
|
package com.fr.design.mainframe; |
||||||
|
|
||||||
|
import com.fr.log.FineLoggerFactory; |
||||||
|
import java.awt.event.WindowEvent; |
||||||
|
import java.awt.event.WindowListener; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保证监听运行出错也不影响其他功能正常使用 |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2021/6/30 |
||||||
|
*/ |
||||||
|
public class SafeWindowListener implements WindowListener { |
||||||
|
|
||||||
|
private final WindowListener windowListener; |
||||||
|
|
||||||
|
public SafeWindowListener(WindowListener windowListener) { |
||||||
|
this.windowListener = windowListener; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowOpened(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowOpened(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowClosing(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowClosing(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowClosed(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowClosed(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowIconified(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowIconified(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowDeiconified(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowDeiconified(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowActivated(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowActivated(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void windowDeactivated(WindowEvent e) { |
||||||
|
try { |
||||||
|
windowListener.windowDeactivated(e); |
||||||
|
} catch (Throwable throwable) { |
||||||
|
FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue