|
|
|
@ -81,8 +81,6 @@ public class StartupPageWindow extends JFrame {
|
|
|
|
|
|
|
|
|
|
private JPanel body; |
|
|
|
|
|
|
|
|
|
private StartupLoadingPanel loadingPanel; |
|
|
|
|
|
|
|
|
|
public StartupPageWindow(StartupPageModel pageModel) { |
|
|
|
|
|
|
|
|
|
patchUIAction(pageModel); |
|
|
|
@ -102,9 +100,6 @@ public class StartupPageWindow extends JFrame {
|
|
|
|
|
|
|
|
|
|
setFullScreen(); |
|
|
|
|
|
|
|
|
|
// 必须放最后
|
|
|
|
|
// 见 https://work.fineres.com/browse/REPORT-85293
|
|
|
|
|
loadingPanel = new StartupLoadingPanel(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initCenter(StartupPageModel pageModel) { |
|
|
|
@ -232,45 +227,49 @@ public class StartupPageWindow extends JFrame {
|
|
|
|
|
private void enterWorkspace(Runnable action) { |
|
|
|
|
|
|
|
|
|
UIUtil.invokeAndWaitIfNeeded(() -> { |
|
|
|
|
|
|
|
|
|
// 必须直接初始化
|
|
|
|
|
// 见 https://work.fineres.com/browse/REPORT-85293
|
|
|
|
|
StartupLoadingPanel loadingPanel = new StartupLoadingPanel(this); |
|
|
|
|
loadingPanel.show(); |
|
|
|
|
setEnabled(false); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
SwingWorker<Void, Void> task = new SwingWorker<Void, Void>() { |
|
|
|
|
@Override |
|
|
|
|
protected Void doInBackground() throws Exception { |
|
|
|
|
action.run(); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
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(); |
|
|
|
|
SwingWorker<Void, Void> task = new SwingWorker<Void, Void>() { |
|
|
|
|
@Override |
|
|
|
|
protected Void doInBackground() throws Exception { |
|
|
|
|
action.run(); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
task.execute(); |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
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) { |
|
|
|
|