Browse Source

REPORT-49014 连接同一个远程环境,同时双击打开同一个模板 一人正常打开 一人打开空白

bugfix/10.0
hades 4 years ago
parent
commit
97d69685db
  1. 27
      designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  3. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java

27
designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java

@ -0,0 +1,27 @@
package com.fr.design.mainframe;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.ui.util.UIUtil;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/5/14
*/
public class TemplateLockedHandler {
public static void generateTipAndRefresh() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Template_Locked_Tip"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
FineJOptionPane.WARNING_MESSAGE);
DesignerFrameFileDealerPane.getInstance().refresh();
}
});
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

@ -13,6 +13,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DecodeDialog;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.exception.DecryptTemplateException;
@ -68,6 +69,7 @@ class CptApp extends AbstractWorkBookApp {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp);
} catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp);
}

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

@ -10,6 +10,7 @@ import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.DecodeDialog;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.design.worker.open.OpenResult;
import com.fr.design.worker.open.OpenWorker;
import com.fr.exception.DecryptTemplateException;
@ -106,6 +107,7 @@ class FormApp extends AbstractAppProvider {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp);
} catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) {
FineLoggerFactory.getLogger().error("Failed to generate frm from " + file, exp);
return null;

2
designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.app;
import com.fr.base.extension.FileExtension;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.exception.RemoteDesignPermissionDeniedException;
import com.fr.exception.TplLockedException;
import com.fr.file.FILE;
@ -30,6 +31,7 @@ class XlsApp extends AbstractWorkBookApp {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp);
} catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) {
FineLoggerFactory.getLogger().error("Failed to generate xls from " + tplFile, exp);
}

2
designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.app;
import com.fr.base.extension.FileExtension;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.exception.RemoteDesignPermissionDeniedException;
import com.fr.exception.TplLockedException;
import com.fr.file.FILE;
@ -31,6 +32,7 @@ class XlsxApp extends AbstractWorkBookApp {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp);
} catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) {
FineLoggerFactory.getLogger().error("Failed to generate xlsx from " + tplFile, exp);
}

Loading…
Cancel
Save