From fed2406391a900b9c9a48fe92bd94474c497d85e Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 15 May 2018 11:08:33 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-8169=20=E6=A8=A1=E6=9D=BF=E6=96=B0?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=B1=8F=E8=94=BD=E7=9B=B4=E6=8E=A5=E8=AE=BF?= =?UTF-8?q?=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/WebPreviewUtils.java | 19 ++++++++++++++----- .../file/newReport/NewWorkBookAction.java | 5 ++++- .../file/newReport/NewWorkBookXAction.java | 6 ++---- .../src/com/fr/start/Designer.java | 12 +++++++----- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java index cf9ce79d8c..4dd6e412de 100644 --- a/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java @@ -1,5 +1,6 @@ package com.fr.design.actions.file; +import com.fr.base.extension.FileExtension; import com.fr.design.fun.PreviewProvider; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -10,8 +11,9 @@ import com.fr.general.GeneralUtils; import com.fr.general.Inter; import com.fr.general.web.ParameterConstants; import com.fr.stable.project.ProjectConstants; +import com.fr.stable.web.AbstractWebletCreator; -import javax.swing.*; +import javax.swing.JOptionPane; import java.util.Collections; import java.util.Map; @@ -36,10 +38,10 @@ public final class WebPreviewUtils { jt.stopEditing(); /* - * alex:如果没有保存,先保存到Env - * - * 如果保存失败,不执行下面的WebPreview - */ + * alex:如果没有保存,先保存到Env + * + * 如果保存失败,不执行下面的WebPreview + */ if (!jt.isSaved() && !jt.saveTemplate2Env()) { return; } @@ -76,6 +78,13 @@ public final class WebPreviewUtils { java.util.List parameterNameList = new java.util.ArrayList(); java.util.List parameterValueList = new java.util.ArrayList(); + // 暂时屏蔽cptx直接访问 + if (path.endsWith(FileExtension.CPTX.getSuffix())) { + path = path.substring(0, path.length() - 1); + parameterNameList.add(AbstractWebletCreator.FORMAT); + parameterValueList.add(AbstractWebletCreator.X); + } + parameterNameList.add(actionType); parameterValueList.add(path); if (map != null) { diff --git a/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java b/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java index 8ab64c593b..94a6cf983c 100644 --- a/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java +++ b/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java @@ -10,6 +10,9 @@ import com.fr.general.Inter; import javax.swing.Icon; import javax.swing.KeyStroke; import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; public class NewWorkBookAction extends UpdateAction { @@ -47,7 +50,7 @@ public class NewWorkBookAction extends UpdateAction { @Override public KeyStroke getKeyStroke() { - return null; + return KeyStroke.getKeyStroke(KeyEvent.VK_N, DEFAULT_MODIFIER); } }; diff --git a/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookXAction.java b/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookXAction.java index 871976421e..2f7da15d92 100644 --- a/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookXAction.java +++ b/designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookXAction.java @@ -12,9 +12,7 @@ import com.fr.report.worksheet.WorkSheet; import javax.swing.Icon; import javax.swing.KeyStroke; import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; /** * 新建cptx格式模板 @@ -51,7 +49,7 @@ public class NewWorkBookXAction extends UpdateAction { public static final MenuKeySet NEW_WORK_BOOK_X = new MenuKeySet() { @Override public char getMnemonic() { - return 'N'; + return 'L'; } @Override @@ -61,7 +59,7 @@ public class NewWorkBookXAction extends UpdateAction { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_N, DEFAULT_MODIFIER); + return null; } }; } diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index f78f2c8687..af2ababb10 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -40,19 +40,21 @@ import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; -import com.fr.main.impl.WorkBookX; import com.fr.module.Module; import com.fr.module.ModuleContext; -import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLTools; import com.fr.start.module.StartupArgs; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.border.MatteBorder; -import java.awt.*; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -356,7 +358,7 @@ public class Designer extends BaseDesigner { */ @Override public JTemplate createNewTemplate() { - return new JWorkBook(new WorkBookX(new WorkSheet())); + return new JWorkBook(); } /**