Browse Source

Merge pull request #38 in DESIGN/design from ~VITO/c-design:feature/10.0 to feature/10.0

* commit 'fed2406391a900b9c9a48fe92bd94474c497d85e':
  REPORT-8169 模板新格式屏蔽直接访问
master
superman 7 years ago
parent
commit
c791370d46
  1. 19
      designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java
  2. 5
      designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java
  3. 6
      designer-realize/src/com/fr/design/actions/file/newReport/NewWorkBookXAction.java
  4. 12
      designer-realize/src/com/fr/start/Designer.java

19
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<String> parameterNameList = new java.util.ArrayList<String>();
java.util.List<String> parameterValueList = new java.util.ArrayList<String>();
// 暂时屏蔽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) {

5
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);
}
};

6
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;
}
};
}

12
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();
}
/**

Loading…
Cancel
Save