Browse Source

Pull request #8384: REPORT-68780 BeforeSwitch要等stash做完

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

* commit '35defc43b3098d2e8e427f77fcc49957153625e3':
  REPORT-68780 BeforeSwicth要等stash做完
bugfix/11.0
Hades 3 years ago
parent
commit
73caac96a5
  1. 22
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

22
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -24,7 +24,6 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import javax.swing.SwingWorker;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -44,7 +43,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
private static final int DEAD_LINE = DesignerEnvManager.getEnvManager().getCachingTemplateLimit();
private List<JTemplate<?, ?>> historyList;
private JTemplate<?, ?> editingTemplate;
private SwingWorker<Boolean, Void> stashWorker;
public static HistoryTemplateListCache getInstance() {
return Holder.INSTANCE;
@ -342,14 +340,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
* @see HistoryTemplateListCache#load()
*/
public void stash() {
stashWorker = new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground() throws Exception {
_stash();
return true;
}
};
stashWorker.execute();
}
private void _stash() {
@ -370,16 +361,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
FineLoggerFactory.getLogger().info("Env Change Template Stashed.");
}
private boolean checkStash() {
try {
return stashWorker.get();
} catch (Exception e) {
FineLoggerFactory.getLogger().debug(e.getMessage(), e);
return false;
}
}
/**
* 切换环境前将正在编辑的模板暂存起来后在新环境重新读取一遍
* <p>
@ -388,9 +369,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
* @see HistoryTemplateListCache#stash()
*/
public void load() {
if (!checkStash()) {
return;
}
FineLoggerFactory.getLogger().info("Env Change Template Loading...");
if (stashFILEMap != null && stashFILEMap.size() != 0) {
int size = historyList.size();

Loading…
Cancel
Save