|
|
|
@ -47,7 +47,6 @@ 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; |
|
|
|
@ -80,6 +79,7 @@ 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,10 +340,19 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
|
|
|
|
|
|
|
|
|
|
public void refreshResource(FILE file) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
this.template = JTemplateFactory.asIOFile(file, this.suffix()); |
|
|
|
|
setTarget(this.template); |
|
|
|
|
|
|
|
|
|
new SwingWorker<Void, Void>() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected Void doInBackground() throws Exception { |
|
|
|
|
setTargetByFile(file); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void done() { |
|
|
|
|
try { |
|
|
|
|
get(); |
|
|
|
|
// 先移除旧的。
|
|
|
|
|
removeCenterPane(); |
|
|
|
|
// 加入新的
|
|
|
|
@ -352,6 +361,14 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setTargetByFile(FILE file) { |
|
|
|
|
this.template = JTemplateFactory.asIOFile(file, this.suffix()); |
|
|
|
|
setTarget(this.template); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void addCenterPane() { |
|
|
|
|
|
|
|
|
|