Browse Source

REPORT-72783 设计器关闭时,单模板和多模板保存弹窗逻辑统一

【问题原因】产品沟通,需要统一一下,免得维护多套
【改动思路】统一成多模版保存的弹窗
【review建议】无
feature/x
Yvan 3 years ago
parent
commit
9d6e8bae92
  1. 17
      designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java
  2. 15
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

17
designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java

@ -198,23 +198,6 @@ public class SaveSomeTemplatePane extends BasicPane {
return true;
}
public int saveLastOneTemplate() {
JTemplate<?, ?> specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (!specifiedTemplate.isALLSaved()) {
specifiedTemplate.stopEditing();
int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?",
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) {
specifiedTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));
}
return returnVal;
}
return JOptionPane.YES_OPTION;
}
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save");
}

15
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -173,16 +173,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//关闭前当前模板 停止编辑
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().stopEditing();
SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true);
// 只有一个文件未保存时
if (HistoryTemplateListCache.getInstance().getHistoryCount() == 1) {
int choose = saveSomeTempaltePane.saveLastOneTemplate();
if (choose != JOptionPane.CANCEL_OPTION) {
DesignerFrame.this.exit();
}
} else {
if (saveSomeTempaltePane.showSavePane()) {
DesignerFrame.this.exit();
}
// 全部保存成功才退出
if (saveSomeTempaltePane.showSavePane()) {
DesignerFrame.this.exit();
}
}
@ -1225,4 +1218,4 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void setServerConfig(boolean serverConfig) {
this.serverConfig = serverConfig;
}
}
}

Loading…
Cancel
Save