@ -81,8 +81,6 @@ public class StartupPageWindow extends JFrame {
private JPanel body ;
private JPanel body ;
private StartupLoadingPanel loadingPanel ;
public StartupPageWindow ( StartupPageModel pageModel ) {
public StartupPageWindow ( StartupPageModel pageModel ) {
patchUIAction ( pageModel ) ;
patchUIAction ( pageModel ) ;
@ -102,9 +100,6 @@ public class StartupPageWindow extends JFrame {
setFullScreen ( ) ;
setFullScreen ( ) ;
// 必须放最后
// 见 https://work.fineres.com/browse/REPORT-85293
loadingPanel = new StartupLoadingPanel ( this ) ;
}
}
private void initCenter ( StartupPageModel pageModel ) {
private void initCenter ( StartupPageModel pageModel ) {
@ -232,45 +227,49 @@ public class StartupPageWindow extends JFrame {
private void enterWorkspace ( Runnable action ) {
private void enterWorkspace ( Runnable action ) {
UIUtil . invokeAndWaitIfNeeded ( ( ) - > {
UIUtil . invokeAndWaitIfNeeded ( ( ) - > {
// 必须直接初始化
// 见 https://work.fineres.com/browse/REPORT-85293
StartupLoadingPanel loadingPanel = new StartupLoadingPanel ( this ) ;
loadingPanel . show ( ) ;
loadingPanel . show ( ) ;
setEnabled ( false ) ;
setEnabled ( false ) ;
} ) ;
SwingWorker < Void , Void > task = new SwingWorker < Void , Void > ( ) {
@Override
protected Void doInBackground ( ) throws Exception {
action . run ( ) ;
return null ;
}
@Override
SwingWorker < Void , Void > task = new SwingWorker < Void , Void > ( ) {
protected void done ( ) {
@Override
protected Void doInBackground ( ) throws Exception {
try {
action . run ( ) ;
Void result = get ( ) ;
return null ;
setVisible ( false ) ;
} catch ( Exception e ) {
// 处理错误
UIUtil . invokeLaterIfNeeded ( ( ) - > {
UIExpandDialog . Builder ( )
. owner ( StartupPageWindow . this )
. title ( Toolkit . i18nText ( "Fine-Design_Basic_Remote_Env_Try" ) )
. message ( Toolkit . i18nText ( "Fine-Design_Basic_Connection_Failed" ) )
. messageType ( UIExpandDialog . WARNING_MESSAGE )
. detail ( e . getMessage ( ) )
. expand ( true )
. modal ( false )
. build ( )
. setVisible ( true ) ;
setEnabled ( true ) ;
} ) ;
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
} finally {
loadingPanel . hide ( ) ;
}
}
}
} ;
@Override
task . execute ( ) ;
protected void done ( ) {
try {
Void result = get ( ) ;
setVisible ( false ) ;
} catch ( Exception e ) {
// 处理错误
UIUtil . invokeLaterIfNeeded ( ( ) - > {
UIExpandDialog . Builder ( )
. owner ( StartupPageWindow . this )
. title ( Toolkit . i18nText ( "Fine-Design_Basic_Remote_Env_Try" ) )
. message ( Toolkit . i18nText ( "Fine-Design_Basic_Connection_Failed" ) )
. messageType ( UIExpandDialog . WARNING_MESSAGE )
. detail ( e . getMessage ( ) )
. expand ( true )
. modal ( false )
. build ( )
. setVisible ( true ) ;
setEnabled ( true ) ;
} ) ;
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
} finally {
loadingPanel . hide ( ) ;
}
}
} ;
task . execute ( ) ;
} ) ;
}
}
private JPanel generateRecentOpenPanel ( StartupPageModel pageModel ) {
private JPanel generateRecentOpenPanel ( StartupPageModel pageModel ) {