Browse Source

Merge pull request #3434 in DESIGN/design from final/10.0 to release/10.0

* commit '331e8cef7e4aa754e949859bcb91fd68bfed33c7':
  REPORT-47258 打开多个模板,切换远程时右侧面板可能出现异常
feature/big-screen
superman 4 years ago
parent
commit
bf2c5c9085
  1. 32
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

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

Loading…
Cancel
Save