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