Browse Source

REPORT-70481 远程设计切换校验机制优化

1. 增加切换工作目录前,弹窗提示用户保存的逻辑
2. 增加注释
feature/x
Yvan 3 years ago
parent
commit
4c93226a24
  1. 3
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 3
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

3
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -13,6 +13,7 @@ import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.env.RemoteWorkspace; import com.fr.design.env.RemoteWorkspace;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -82,6 +83,8 @@ public class EnvChangeEntrance {
private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) { private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) {
final String selectedName = envListPane.updateEnvManager(); final String selectedName = envListPane.updateEnvManager();
SaveSomeTemplatePane saveSomeTemplatePane = new SaveSomeTemplatePane(true, SwingUtilities.getWindowAncestor(envListPane));
saveSomeTemplatePane.showSavePane();
return switch2Env(selectedName, strategy); return switch2Env(selectedName, strategy);
} }

3
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -5,6 +5,7 @@ import com.fr.design.EnvChangeEntrance;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
@ -66,6 +67,8 @@ public class SwitchExistEnv extends MenuDef {
// 打开配置目录面板 // 打开配置目录面板
EnvChangeEntrance.getInstance().chooseEnv(envName); EnvChangeEntrance.getInstance().chooseEnv(envName);
} else { } else {
SaveSomeTemplatePane saveSomeTemplatePane = new SaveSomeTemplatePane(true);
saveSomeTemplatePane.showSavePane();
EnvChangeEntrance.getInstance().switch2Env(envName); EnvChangeEntrance.getInstance().switch2Env(envName);
} }
} }

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

@ -519,7 +519,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* @param file * @param file
*/ */
public void refreshResourceAndEditingFILE(FILE file) { public void refreshResourceAndEditingFILE(FILE file) {
// 这里替换EditingFILE是为了在切换工作目录后,将模板文件对象设置成环境无关文件对象
this.editingFILE = file instanceof StashedFILE ? ((StashedFILE) file).getInsideFILE() : file; this.editingFILE = file instanceof StashedFILE ? ((StashedFILE) file).getInsideFILE() : file;
refreshResource(file); refreshResource(file);
} }

Loading…
Cancel
Save