Browse Source

Pull request #3428: REPORT-47258 打开多个模板,切换远程时右侧面板可能出现异常

Merge in DESIGN/design from ~LUCIAN.CHEN/design:final/10.0 to final/10.0

* commit '940d684240e05d6638a1a42e1c95785397d2a67d':
  REPORT-47258 打开多个模板,切换远程时右侧面板可能出现异常
final/10.0
Kara 4 years ago
parent
commit
331e8cef7e
  1. 20
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

20
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -47,6 +47,7 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator; import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.preview.PagePreview; import com.fr.design.preview.PagePreview;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
@ -79,7 +80,6 @@ import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.undo.UndoManager; import javax.swing.undo.UndoManager;
import java.util.ArrayList; import java.util.ArrayList;
@ -340,30 +340,18 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public void refreshResource(FILE file) { public void refreshResource(FILE file) {
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
setTargetByFile(file); setTargetByFile(file);
return null; UIUtil.invokeLaterIfNeeded(new Runnable() {
}
@Override @Override
public void done() { public void run() {
try {
get();
// 先移除旧的。 // 先移除旧的。
removeCenterPane(); removeCenterPane();
// 加入新的 // 加入新的
addCenterPane(); addCenterPane();
refreshToolArea(); refreshToolArea();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} });
}.execute();
} }

Loading…
Cancel
Save