Browse Source

Pull request #5981: CHART-20411 适配 大屏模板 文件菜单

Merge in DESIGN/design from ~ZHENG/c-design:feature/10.0 to feature/10.0

* commit '77c7a84eecde096651e1822302db51d47f79ed8e':
  和抽之前完全一样
  CHART-21076 清楚磁盘缓存
  CHART-20411 适配大屏模板关闭
  CHART-20411 适配大屏模板另存为
feature/10.0
eason 3 years ago
parent
commit
acf2e8c978
  1. 3
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 4
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  4. 5
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

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

@ -4,6 +4,7 @@ package com.fr.design.file;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.imenu.UIMenuItem;
@ -753,7 +754,7 @@ public class MutilTempalteTabPane extends JComponent {
/**
* 关闭掉一个模板之后激活新的待显示模板
*/
private void activePrevTemplateAfterClose() {
public void activePrevTemplateAfterClose() {
if (openedTemplate.isEmpty()) {
//新建并激活模板
DesignerContext.getDesignerFrame().addAndActivateJTemplate();

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

@ -877,7 +877,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
protected boolean export() throws Exception {
return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE));
return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE()));
}
@ -1460,7 +1460,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (editingFILE == null || editingFILE instanceof MemFILE) {
return false;
}
this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE));
export();
this.editingFILE = editingFILE;
return true;
}

4
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -408,7 +408,9 @@ public abstract class ToolBarMenuDock {
menuDef.addShortCut(new OpenRecentReportMenuDef());
addCloseCurrentTemplateAction(menuDef);
if (!DesignModeContext.isDuchampMode()) {
addCloseCurrentTemplateAction(menuDef);
}
scs = plus.shortcut4FileMenu();
if (!ArrayUtils.isEmpty(scs)) {

5
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -26,6 +26,7 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.Map;
/**
@ -170,6 +171,10 @@ public class ModernUIPane<T> extends BasicPane {
public void clearCache() {
if (browser != null) {
browser.getCacheStorage().clearCache();
File file = new File(browser.getContext().getCacheDir());
if (file.exists()) {
file.delete();
}
}
}

Loading…
Cancel
Save