|
|
@ -6,10 +6,13 @@ import com.fr.design.fun.impl.AbstractPreviewProvider; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.mainframe.JForm; |
|
|
|
import com.fr.design.mainframe.JForm; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
|
|
|
import com.fr.design.worker.WorkerManager; |
|
|
|
|
|
|
|
import com.fr.design.worker.save.CallbackSaveWorker; |
|
|
|
import com.fr.general.web.ParameterConstants; |
|
|
|
import com.fr.general.web.ParameterConstants; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by kerry on 2020-04-23 |
|
|
|
* Created by kerry on 2020-04-23 |
|
|
@ -44,6 +47,22 @@ public class DeveloperPreview extends AbstractPreviewProvider { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(JTemplate<?, ?> jt) { |
|
|
|
public void onClick(JTemplate<?, ?> jt) { |
|
|
|
super.onClick(jt); |
|
|
|
super.onClick(jt); |
|
|
|
|
|
|
|
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); |
|
|
|
|
|
|
|
if (worker instanceof CallbackSaveWorker) { |
|
|
|
|
|
|
|
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker; |
|
|
|
|
|
|
|
callbackSaveWorker.addSuccessCallbackBeforeLast(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
onPreview(jt); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else if (jt.getEditingFILE().isEnvFile()) { |
|
|
|
|
|
|
|
// 已经保存在当前工作目录了
|
|
|
|
|
|
|
|
onPreview(jt); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void onPreview(JTemplate<?, ?> jt) { |
|
|
|
MutilTempalteTabPane.getInstance().closeCurrentTpl(); |
|
|
|
MutilTempalteTabPane.getInstance().closeCurrentTpl(); |
|
|
|
jt.generateForBiddenTemplate(); |
|
|
|
jt.generateForBiddenTemplate(); |
|
|
|
} |
|
|
|
} |
|
|
|