Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
alex.sung 5 years ago
parent
commit
f72647e405
  1. 15
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 8
      designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java
  3. 7
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java
  4. 8
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java
  5. 1
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  6. 188
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  7. 4
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrPane.java
  8. 2
      designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java
  9. 65
      designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java
  10. 78
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  11. 10
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  12. 28
      designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java
  13. 5
      designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java
  14. 4
      designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java
  15. 2
      designer-realize/src/main/java/com/fr/design/webattr/EventPane.java

15
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,6 +1,7 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.cluster.ClusterBridge; import com.fr.cluster.ClusterBridge;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -263,7 +264,7 @@ public class PreferencePane extends BasicPane {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
boolean selected = vcsEnableCheckBox.isSelected(); boolean selected = vcsEnableCheckBox.isSelected();
if (selected) { if (selected && vcsEnableCheckBox.isEnabled()) {
saveCommitCheckBox.setEnabled(true); saveCommitCheckBox.setEnabled(true);
saveIntervalEditor.setEnabled(true); saveIntervalEditor.setEnabled(true);
useIntervalCheckBox.setEnabled(true); useIntervalCheckBox.setEnabled(true);
@ -307,14 +308,9 @@ public class PreferencePane extends BasicPane {
gcEnableCheckBox.addChangeListener(new ChangeListener() { gcEnableCheckBox.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
gcButton.setEnabled(gcEnableCheckBox.isSelected()); gcButton.setEnabled(gcEnableCheckBox.isSelected() && gcEnableCheckBox.isEnabled());
} }
}); });
//集群下禁用
if (ClusterBridge.isClusterMode()) {
gcEnableCheckBox.setEnabled(false);
gcButton.setEnabled(false);
}
return gcControlPane; return gcControlPane;
} }
@ -672,6 +668,11 @@ public class PreferencePane extends BasicPane {
defaultStringToFormulaBox.setSelected(false); defaultStringToFormulaBox.setSelected(false);
} }
VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager();
if (FineClusterConfig.getInstance().isCluster()) {
vcsEnableCheckBox.setEnabled(false);
gcEnableCheckBox.setEnabled(false);
}
if (VcsHelper.getInstance().needInit()) { if (VcsHelper.getInstance().needInit()) {
vcsEnableCheckBox.setSelected(vcsConfigManager.isVcsEnable()); vcsEnableCheckBox.setSelected(vcsConfigManager.isVcsEnable());
} else { } else {

8
designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java

@ -1,6 +1,5 @@
package com.fr.design.fun; package com.fr.design.fun;
import com.fr.base.extension.FileExtension;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.stable.fun.mark.Mutable; import com.fr.stable.fun.mark.Mutable;
@ -24,13 +23,6 @@ public interface ReportSupportedFileUIProvider extends Mutable {
void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); void addChooseFileFilter(FILEChooserPane fileChooser, String suffix);
/**
* 获取可支持的文件类型
* @return 文件扩展
*/
FileExtension[] getFileExtensions();
/** /**
* 获取文件关联的icon * 获取文件关联的icon
* @param path 文件路径 * @param path 文件路径

7
designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java

@ -1,6 +1,5 @@
package com.fr.design.fun.impl; package com.fr.design.fun.impl;
import com.fr.base.extension.FileExtension;
import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.fun.ReportSupportedFileUIProvider;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
@ -19,12 +18,6 @@ public abstract class AbstractReportSupportedFileUIProvider extends AbstractProv
} }
@Override
public FileExtension[] getFileExtensions() {
return new FileExtension[0];
}
@Override @Override
public Icon getFileIcon(String path, boolean isShowLock) { public Icon getFileIcon(String path, boolean isShowLock) {
return null; return null;

8
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java

@ -2,14 +2,14 @@ package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.ReportSupportedFileUIProvider;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.ExtraReportClassManager;
import com.fr.report.fun.ReportSupportedFileProvider;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -58,8 +58,8 @@ public class FileNodeConstants {
rwl.writeLock().lock(); rwl.writeLock().lock();
supportFileType = new ArrayList<String>(); supportFileType = new ArrayList<String>();
//通过插件扩展的 //通过插件扩展的
Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); Set<ReportSupportedFileProvider> providers = ExtraReportClassManager.getInstance().getArray(ReportSupportedFileProvider.XML_TAG);
for (ReportSupportedFileUIProvider provider : providers) { for (ReportSupportedFileProvider provider : providers) {
addAppExtensions(provider.getFileExtensions()); addAppExtensions(provider.getFileExtensions());
} }
supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes()));

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

@ -661,6 +661,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
result = result || this.saveFile(); result = result || this.saveFile();
//更换最近打开 //更换最近打开
DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath());
this.refreshToolArea();
} }
return result; return result;
} }

188
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -41,66 +42,66 @@ import java.util.Date;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DesignerLogHandler { public class DesignerLogHandler {
private final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static final int GAP_X = -150; private static final int GAP_X = -150;
private static final int INFO_GAP_Y = -60; private static final int INFO_GAP_Y = -60;
private static final int ERRO_GAP_Y = -40; private static final int ERRO_GAP_Y = -40;
private static final int SERVER_GAP_Y = -20; private static final int SERVER_GAP_Y = -20;
public static DesignerLogHandler getInstance() { public static DesignerLogHandler getInstance() {
return HOLDER.singleton; return HOLDER.singleton;
} }
private static class HOLDER { private static class HOLDER {
private static DesignerLogHandler singleton = new DesignerLogHandler(); private static DesignerLogHandler singleton = new DesignerLogHandler();
} }
// 所有的面板 // 所有的面板
private LogHandlerBar caption; private LogHandlerBar caption;
private JCheckBoxMenuItem showInfo; private JCheckBoxMenuItem showInfo;
private JCheckBoxMenuItem showError; private JCheckBoxMenuItem showError;
private JCheckBoxMenuItem showServer; private JCheckBoxMenuItem showServer;
private LogHandlerArea logHandlerArea; private LogHandlerArea logHandlerArea;
public DesignerLogHandler() { public DesignerLogHandler() {
logHandlerArea = new LogHandlerArea(); logHandlerArea = new LogHandlerArea();
caption = new LogHandlerBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log")); caption = new LogHandlerBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log"));
caption.addClearListener(new ActionListener() { caption.addClearListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
logHandlerArea.jTextArea.setText(""); logHandlerArea.jTextArea.setText("");
caption.clearMessage(); caption.clearMessage();
} }
}); });
caption.addSelectedListener(new ActionListener() { caption.addSelectedListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
logHandlerArea.jTextArea.requestFocus(); logHandlerArea.jTextArea.requestFocus();
logHandlerArea.jTextArea.selectAll(); logHandlerArea.jTextArea.selectAll();
} }
}); });
ItemListener itemlistener = new ItemListener() { ItemListener itemlistener = new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
logHandlerArea.jTextArea.setText(""); logHandlerArea.jTextArea.setText("");
caption.clearMessage(); caption.clearMessage();
} }
@ -112,12 +113,12 @@ public class DesignerLogHandler {
showServer = new JCheckBoxMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Error"), true); showServer = new JCheckBoxMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Error"), true);
showServer.addItemListener(itemlistener); showServer.addItemListener(itemlistener);
caption.addSetListener(new ActionListener() { caption.addSetListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
JPopupMenu jPopupMenu = new JPopupMenu(); JPopupMenu jPopupMenu = new JPopupMenu();
int logLevelInt = Log4jConfig.getInstance().getRootLevel().toInt(); int logLevelInt = Log4jConfig.getInstance().getRootLevel().toInt();
if (logLevelInt <= DesignerLogger.INFO_INT) { if (logLevelInt <= DesignerLogger.INFO_INT) {
jPopupMenu.add(showInfo); jPopupMenu.add(showInfo);
@ -135,72 +136,73 @@ public class DesignerLogHandler {
} }
}); });
} }
public JComponent getLogHandlerArea() { public JComponent getLogHandlerArea() {
return logHandlerArea; return logHandlerArea;
} }
public JComponent getCaption() { public JComponent getCaption() {
return caption; return caption;
} }
public void printRemoteLog(String message, Level level, Date date) { public void printRemoteLog(String message, Level level, Date date) {
logHandlerArea.printStackTrace(message, level, date); logHandlerArea.printStackTrace(message, level, date);
} }
private class LogHandlerArea extends JPanel { private class LogHandlerArea extends JPanel {
private static final long serialVersionUID = 8215630927304621660L; private static final long serialVersionUID = 8215630927304621660L;
private JTextPane jTextArea; private JTextPane jTextArea;
private JPopupMenu popup; private JPopupMenu popup;
private UIMenuItem selectAll; private UIMenuItem selectAll;
private UIMenuItem copy; private UIMenuItem copy;
private UIMenuItem clear; private UIMenuItem clear;
private LogHandlerArea() { private LogHandlerArea() {
jTextArea = initLogJTextArea(); jTextArea = initLogJTextArea();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIScrollPane js = new UIScrollPane(jTextArea); UIScrollPane js = new UIScrollPane(jTextArea);
this.add(js, BorderLayout.CENTER); this.add(js, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(super.getPreferredSize().width, 150)); this.setPreferredSize(new Dimension(super.getPreferredSize().width, 150));
jTextArea.setEditable(false); jTextArea.setEditable(false);
jTextArea.setBackground(Color.WHITE); jTextArea.setBackground(Color.WHITE);
popup = new JPopupMenu(); popup = new JPopupMenu();
selectAll = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_All")); selectAll = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_All"));
selectAll.addActionListener(popupListener); selectAll.addActionListener(popupListener);
selectAll.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/selectedall.png")); selectAll.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/selectedall.png"));
popup.add(selectAll); popup.add(selectAll);
copy = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy")); copy = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy"));
copy.addActionListener(popupListener); copy.addActionListener(popupListener);
copy.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); copy.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
popup.add(copy); popup.add(copy);
clear = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_All")); clear = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_All"));
clear.addActionListener(popupListener); clear.addActionListener(popupListener);
clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png")); clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png"));
popup.add(clear); popup.add(clear);
selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER)); selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER));
copy.setAccelerator(KeyStroke.getKeyStroke('C', DEFAULT_MODIFIER)); copy.setAccelerator(KeyStroke.getKeyStroke('C', DEFAULT_MODIFIER));
clear.setAccelerator(KeyStroke.getKeyStroke('L', DEFAULT_MODIFIER)); clear.setAccelerator(KeyStroke.getKeyStroke('L', DEFAULT_MODIFIER));
jTextArea.addMouseListener(new MouseAdapter() { jTextArea.addMouseListener(new MouseAdapter() {
// check for right click // check for right click
@Override
public void mousePressed(MouseEvent event) { public void mousePressed(MouseEvent event) {
if (event.getButton() == MouseEvent.BUTTON3) { if (event.getButton() == MouseEvent.BUTTON3) {
popup.show(jTextArea, event.getX(), event.getY()); popup.show(jTextArea, event.getX(), event.getY());
checkEnabled(); checkEnabled();
@ -208,9 +210,9 @@ public class DesignerLogHandler {
} }
}); });
} }
private JTextPane initLogJTextArea() { private JTextPane initLogJTextArea() {
final JTextPane resultPane = new JTextPane(); final JTextPane resultPane = new JTextPane();
InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction);
@ -218,18 +220,19 @@ public class DesignerLogHandler {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear");
ActionMap actionMap = resultPane.getActionMap(); ActionMap actionMap = resultPane.getActionMap();
actionMap.put("clear", new AbstractAction() { actionMap.put("clear", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
resultPane.setText(""); resultPane.setText("");
caption.clearMessage(); caption.clearMessage();
} }
}); });
return resultPane; return resultPane;
} }
public void printStackTrace(LoggingEvent event) { public void printStackTrace(LoggingEvent event) {
int intLevel = event.getLevel().toInt(); int intLevel = event.getLevel().toInt();
Date date = new Date(event.getTimeStamp()); Date date = new Date(event.getTimeStamp());
ThrowableInformation information = event.getThrowableInformation(); ThrowableInformation information = event.getThrowableInformation();
@ -241,9 +244,9 @@ public class DesignerLogHandler {
printMessage(event.getRenderedMessage(), intLevel, date, information == null ? null : information.getThrowable()); printMessage(event.getRenderedMessage(), intLevel, date, information == null ? null : information.getThrowable());
} }
} }
public void printStackTrace(String message, Level level, Date date) { public void printStackTrace(String message, Level level, Date date) {
int intLevel = level.toInt(); int intLevel = level.toInt();
if (intLevel == DesignerLogger.INFO_INT && showInfo.isSelected()) { if (intLevel == DesignerLogger.INFO_INT && showInfo.isSelected()) {
printMessage(message, intLevel, date); printMessage(message, intLevel, date);
@ -252,32 +255,36 @@ public class DesignerLogHandler {
} else if (intLevel == DesignerLogger.WARN_INT && showServer.isSelected()) { } else if (intLevel == DesignerLogger.WARN_INT && showServer.isSelected()) {
printMessage(message, intLevel, date); printMessage(message, intLevel, date);
} }
} }
private void printMessage(String message, int intLevel, Date date) { private void printMessage(String message, int intLevel, Date date) {
printMessage(message, intLevel, date, null); printMessage(message, intLevel, date, null);
} }
private void printMessage(String msg, int intLevel, Date date, Throwable e) { private void printMessage(final String msg, final int intLevel, final Date date, final Throwable e) {
UIUtil.invokeLaterIfNeeded(new Runnable() {
this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0); @Override
String message = appendLocaleMark(msg, intLevel); public void run() {
this.log(message, intLevel); LogHandlerArea.this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0);
setMessage(message, intLevel); String message = appendLocaleMark(msg, intLevel);
if (e == null) { LogHandlerArea.this.log(message, intLevel);
return; setMessage(message, intLevel);
} if (e == null) {
return;
StackTraceElement[] traceElements = e.getStackTrace(); }
for (int i = 0; i < traceElements.length; i++) {
this.log("\t" + "at " + traceElements[i].toString() + "\n", 0); StackTraceElement[] traceElements = e.getStackTrace();
} for (StackTraceElement traceElement : traceElements) {
LogHandlerArea.this.log("\t" + "at " + traceElement.toString() + "\n", 0);
}
}
});
} }
private void log(String str, int style) { private void log(String str, int style) {
SimpleAttributeSet attrSet = new SimpleAttributeSet(); SimpleAttributeSet attrSet = new SimpleAttributeSet();
if (style == DesignerLogger.ERROR_INT) { if (style == DesignerLogger.ERROR_INT) {
StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); StyleConstants.setForeground(attrSet, new Color(247, 148, 29));
@ -299,9 +306,9 @@ public class DesignerLogHandler {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
private String appendLocaleMark(String str, int style) { private String appendLocaleMark(String str, int style) {
if (style == DesignerLogger.ERROR_INT) { if (style == DesignerLogger.ERROR_INT) {
str = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":" + str + "\n"; str = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":" + str + "\n";
} else if (style == DesignerLogger.WARN_INT) { } else if (style == DesignerLogger.WARN_INT) {
@ -311,9 +318,9 @@ public class DesignerLogHandler {
} }
return str; return str;
} }
private void setMessage(String message, int level) { private void setMessage(String message, int level) {
LogMessageBar.getInstance().setMessage(message); LogMessageBar.getInstance().setMessage(message);
if (level == DesignerLogger.INFO_INT && showInfo.isSelected()) { if (level == DesignerLogger.INFO_INT && showInfo.isSelected()) {
caption.infoAdd(); caption.infoAdd();
@ -323,31 +330,32 @@ public class DesignerLogHandler {
caption.serverAdd(); caption.serverAdd();
} }
} }
private void checkEnabled() { private void checkEnabled() {
this.selectAll.setEnabled(true); this.selectAll.setEnabled(true);
this.copy.setEnabled(true); this.copy.setEnabled(true);
this.clear.setEnabled(true); this.clear.setEnabled(true);
if (ComparatorUtils.equals(this.jTextArea.getText(), "")) { if (ComparatorUtils.equals(this.jTextArea.getText(), "")) {
this.selectAll.setEnabled(false); this.selectAll.setEnabled(false);
this.clear.setEnabled(false); this.clear.setEnabled(false);
} }
if (ComparatorUtils.equals(this.jTextArea.getSelectionStart(), this.jTextArea.getSelectionEnd())) { if (ComparatorUtils.equals(this.jTextArea.getSelectionStart(), this.jTextArea.getSelectionEnd())) {
this.copy.setEnabled(false); this.copy.setEnabled(false);
} }
if (this.jTextArea.getSelectionStart() == 0 && ComparatorUtils.equals(this.jTextArea.getSelectionEnd(), this.jTextArea.getText().length())) { if (this.jTextArea.getSelectionStart() == 0 && ComparatorUtils.equals(this.jTextArea.getSelectionEnd(), this.jTextArea.getText().length())) {
this.selectAll.setEnabled(false); this.selectAll.setEnabled(false);
} }
} }
ActionListener popupListener = new ActionListener() { ActionListener popupListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.selectAll.getText())) { if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.selectAll.getText())) {
LogHandlerArea.this.jTextArea.selectAll(); LogHandlerArea.this.jTextArea.selectAll();
} else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.copy.getText())) { } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.copy.getText())) {
@ -358,6 +366,6 @@ public class DesignerLogHandler {
} }
} }
}; };
} }
} }

4
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrPane.java

@ -50,7 +50,7 @@ public class ReportFitAttrPane extends BasicBeanPane<ReportFitAttr> {
* @return 标题 * @return 标题
*/ */
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Attr"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr");
} }
} }

2
designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java

@ -50,6 +50,6 @@ public class TemplateFitAttrPane extends BasicBeanPane<ReportFitAttr> {
* @return 标题 * @return 标题
*/ */
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Attr"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Fit_Attr");
} }
} }

65
designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java

@ -143,7 +143,6 @@ public class RestoreResultDialog extends JDialog {
jTextArea.setFont(new Font("Default", Font.PLAIN, 12)); jTextArea.setFont(new Font("Default", Font.PLAIN, 12));
infoPane.add(jTextArea); infoPane.add(jTextArea);
pane.add(infoPane, BorderLayout.CENTER); pane.add(infoPane, BorderLayout.CENTER);
this.setSize(RESTORE_OLD_VERSION); this.setSize(RESTORE_OLD_VERSION);
this.setTitle(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Updater_Restore_to_V8")); this.setTitle(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Updater_Restore_to_V8"));
} }
@ -162,34 +161,68 @@ public class RestoreResultDialog extends JDialog {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
putJarBackupFilesToInstallLib(installHome, map, list); filesToMove(installHome, map);
putJarBackupFilesToInstallEnv(installHome, map, list); filesToDelete(installHome, list);
RestartHelper.saveFilesWhichToMove(map); RestartHelper.saveFilesWhichToMove(map);
RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()])); RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()]));
} }
private void putJarBackupFilesToInstallLib(String installHome, Map<String, String> map, List<String> list) { private void filesToMove(String installHome, Map<String, String> map) {
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
String envHome = WorkContext.getCurrent().getPath();
File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH)); File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH));
File[] files = installLib.listFiles(); File envLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH));
if (files != null) { File[] files;
for (File file : files) { if (installLib.exists() && envLib.exists()) {
map.put(file.getAbsolutePath(), files = installLib.listFiles();
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); if (files != null) {
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); for (File file : files) {
map.put(file.getAbsolutePath(),
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
}
}
files = envLib.listFiles();
if (files != null) {
for (File file : files) {
map.put(file.getAbsolutePath(),
StableUtils.pathJoin(envHome, ProjectConstants.LIB_NAME, file.getName()));
}
}
} else {
installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir));
files = installLib.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().contains(UpdateConstants.DESIGNER) || file.getName().equals(UpdateConstants.ASPECTJRT)) {
map.put(file.getAbsolutePath(),
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
} else {
map.put(file.getAbsolutePath(),
StableUtils.pathJoin(envHome, ProjectConstants.LIB_NAME, file.getName()));
}
}
} }
} }
} }
private void putJarBackupFilesToInstallEnv(String installHome, Map<String, String> map, List<String> list) { private void filesToDelete(String installHome, List<String> list) {
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String envHome = WorkContext.getCurrent().getPath();
File installEnv = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH)); File installEnv = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME));
File[] files = installEnv.listFiles(); File[] files = installEnv.listFiles();
if (files != null) { if (files != null) {
for (File file : files) { for (File file : files) {
map.put(file.getAbsolutePath(), if (file.getName().startsWith(UpdateConstants.FINE)) {
StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName())); list.add(StableUtils.pathJoin(envHome, ProjectConstants.LIB_NAME, file.getName()));
list.add(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName())); }
}
}
installEnv = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME));
files = installEnv.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) {
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
}
} }
} }
} }

78
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -52,15 +52,16 @@ import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.util.concurrent.ExecutionException;
import static com.fr.design.layout.TableLayout.FILL; import static com.fr.design.layout.TableLayout.FILL;
import static com.fr.design.layout.TableLayout.PREFERRED; import static com.fr.design.layout.TableLayout.PREFERRED;
import static com.fr.env.TestConnectionResult.AUTH_FAILED;
import static com.fr.third.guava.base.Optional.fromNullable; import static com.fr.third.guava.base.Optional.fromNullable;
/** /**
* @author yaohwu * @author yaohwu
*/ */
@SuppressWarnings("squid:MaximumInheritanceDepth")
public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
@ -118,6 +119,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
/** /**
* 主机位置 * 主机位置
*/ */
@SuppressWarnings("squid:S1948")
private RemoteWorkspaceURL remoteWorkspaceURL = new RemoteWorkspaceURL(""); private RemoteWorkspaceURL remoteWorkspaceURL = new RemoteWorkspaceURL("");
/** /**
* https 配置面板 * https 配置面板
@ -138,6 +140,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
/** /**
* 主机名web应用Servlet端口监听器 * 主机名web应用Servlet端口监听器
*/ */
@SuppressWarnings("squid:S1948")
private DocumentListener individualDocListener = new DocumentListener() { private DocumentListener individualDocListener = new DocumentListener() {
@Override @Override
@ -148,19 +151,32 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override @Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
updateRemoteURL(); changedUpdate(e);
fillRemoteEnvURLField();
} }
@Override @Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
updateRemoteURL(); changedUpdate(e);
fillRemoteEnvURLField(); }
private void updateRemoteURL() {
boolean isHttps = httpsCheckbox.isSelected();
String host = hostNameInput.getText();
String port = portInput.getText();
String web = webAppNameInput.getText();
String servlet = servletNameInput.getText();
remoteWorkspaceURL.setHttps(isHttps);
remoteWorkspaceURL.setHost(host);
remoteWorkspaceURL.setPort(port);
remoteWorkspaceURL.setWeb(web);
remoteWorkspaceURL.setServlet(servlet);
remoteWorkspaceURL.resetUrl();
} }
}; };
/** /**
* 路径输入框监听器 * 路径输入框监听器
*/ */
@SuppressWarnings("squid:S1948")
private DocumentListener overallDocListener = new DocumentListener() { private DocumentListener overallDocListener = new DocumentListener() {
@Override @Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
@ -169,7 +185,6 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override @Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
actionURLInputChange(); actionURLInputChange();
} }
@ -177,10 +192,22 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
actionURLInputChange(); actionURLInputChange();
} }
private void actionURLInputChange() {
remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText());
fillIndividualField();
httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps());
boolean isHttps = httpsCheckbox.isSelected();
DesignerEnvManager.getEnvManager().setHttps(isHttps);
fileChooserButton.setEnabled(isHttps);
updateHttpsConfigPanel();
}
}; };
/** /**
* https checkbox listener * https checkbox listener
*/ */
@SuppressWarnings("squid:S1948")
private ActionListener httpsCheckboxListener = new ActionListener() { private ActionListener httpsCheckboxListener = new ActionListener() {
@Override @Override
@ -523,17 +550,17 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); final RemoteDesignerWorkspaceInfo remoteEnv = updateBean();
final WorkspaceConnectionInfo connection = remoteEnv.getConnection(); final WorkspaceConnectionInfo connection = remoteEnv.getConnection();
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() { final SwingWorker<TestConnectionResult, Void> worker = new SwingWorker<TestConnectionResult, Void>() {
@Override @Override
protected Boolean doInBackground() throws Exception { protected TestConnectionResult doInBackground() throws Exception {
DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath()); DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath());
DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey()); DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey());
try { try {
return WorkContext.getConnector().testConnection(connection); return TestConnectionResult.parse(WorkContext.getConnector().testConnection(connection), connection);
} catch (WorkspaceAuthException ignored) { } catch (WorkspaceAuthException ignored) {
return null; return AUTH_FAILED;
} }
} }
@ -541,14 +568,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
protected void done() { protected void done() {
okButton.setEnabled(true); okButton.setEnabled(true);
try { try {
TestConnectionResult result = TestConnectionResult.parse(get(), connection); TestConnectionResult result = get();
message.setText(result.getText()); message.setText(result.getText());
uiLabel.setIcon(result.getIcon()); uiLabel.setIcon(result.getIcon());
} catch (InterruptedException | ExecutionException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage()); FineLoggerFactory.getLogger().error(e, e.getMessage());
message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Failed")); message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
Thread.currentThread().interrupt();
} }
dialogDownPane.remove(cancelButton); dialogDownPane.remove(cancelButton);
dialogDownPane.revalidate(); dialogDownPane.revalidate();
@ -633,36 +659,10 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
enableSubDocListener(); enableSubDocListener();
} }
private void updateRemoteURL() {
boolean isHttps = httpsCheckbox.isSelected();
String host = hostNameInput.getText();
String port = portInput.getText();
String web = webAppNameInput.getText();
String servlet = servletNameInput.getText();
remoteWorkspaceURL.setHttps(isHttps);
remoteWorkspaceURL.setHost(host);
remoteWorkspaceURL.setPort(port);
remoteWorkspaceURL.setWeb(web);
remoteWorkspaceURL.setServlet(servlet);
remoteWorkspaceURL.resetUrl();
}
private void updateHttpsConfigPanel() { private void updateHttpsConfigPanel() {
httpsConfigPanel.removeAll(); httpsConfigPanel.removeAll();
packHttpsConfigPanel(); packHttpsConfigPanel();
httpsConfigPanel.revalidate(); httpsConfigPanel.revalidate();
httpsConfigPanel.repaint(); httpsConfigPanel.repaint();
} }
private void actionURLInputChange() {
remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText());
fillIndividualField();
httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps());
boolean isHttps = httpsCheckbox.isSelected();
DesignerEnvManager.getEnvManager().setHttps(isHttps);
fileChooserButton.setEnabled(isHttps);
updateHttpsConfigPanel();
}
} }

10
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -33,6 +33,8 @@ import com.fr.file.filter.FILEFilter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ExtraReportClassManager;
import com.fr.report.fun.ReportSupportedFileProvider;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -480,7 +482,9 @@ public class FILEChooserPane extends BasicPane {
Object ss = postfixComboBox.getSelectedItem(); Object ss = postfixComboBox.getSelectedItem();
if (ss instanceof ChooseFileFilter) { if (ss instanceof ChooseFileFilter) {
setFILEFilter((ChooseFileFilter) ss); setFILEFilter((ChooseFileFilter) ss);
fileNameTextField.setText(calProperFileName(fileNameTextField.getText(), (ChooseFileFilter) ss)); if (fileNameTextField.isShowing()) {
fileNameTextField.setText(calProperFileName(fileNameTextField.getText(), (ChooseFileFilter) ss));
}
} else { } else {
setFILEFilter(null); setFILEFilter(null);
} }
@ -740,8 +744,8 @@ public class FILEChooserPane extends BasicPane {
if (type == JFileChooser.OPEN_DIALOG) { if (type == JFileChooser.OPEN_DIALOG) {
ChooseFileFilter supportedTypes = new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File")); ChooseFileFilter supportedTypes = new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File"));
Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); Set<ReportSupportedFileProvider> providers = ExtraReportClassManager.getInstance().getArray(ReportSupportedFileProvider.XML_TAG);
for (ReportSupportedFileUIProvider provider : providers) { for (ReportSupportedFileProvider provider : providers) {
for (FileExtension fileExtension : provider.getFileExtensions()){ for (FileExtension fileExtension : provider.getFileExtensions()){
supportedTypes.addExtension(fileExtension.getExtension()); supportedTypes.addExtension(fileExtension.getExtension());
} }

28
designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java

@ -1,9 +1,9 @@
package com.fr.design.gui.itree.filetree; package com.fr.design.gui.itree.filetree;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.ExtraDesignClassManager; import com.fr.report.ExtraReportClassManager;
import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.report.fun.ReportSupportedFileProvider;
import com.fr.design.fun.impl.AbstractReportSupportedFileUIProvider; import com.fr.report.fun.impl.AbstractReportSupportedFileProvider;
import com.fr.stable.fun.mark.Mutable; import com.fr.stable.fun.mark.Mutable;
import org.easymock.EasyMock; import org.easymock.EasyMock;
import org.junit.Assert; import org.junit.Assert;
@ -19,38 +19,38 @@ import java.util.Set;
* Created by alex sung on 2019/7/25. * Created by alex sung on 2019/7/25.
*/ */
@RunWith(PowerMockRunner.class) @RunWith(PowerMockRunner.class)
@PrepareForTest(ExtraDesignClassManager.class) @PrepareForTest(ExtraReportClassManager.class)
public class FileNodeConstantsTest { public class FileNodeConstantsTest {
@Test @Test
public void supportFileTypesTest() { public void supportFileTypesTest() {
ExtraDesignClassManager extra = mockExtraDesignClassManager(); ExtraReportClassManager extra = mockExtraReportClassManager();
Assert.assertEquals(1, extra.getArray(ReportSupportedFileUIProvider.XML_TAG).size()); Assert.assertEquals(1, extra.getArray(ReportSupportedFileProvider.XML_TAG).size());
ReportSupportedFileUIProvider option = (ReportSupportedFileUIProvider) extra.getArray(ReportSupportedFileUIProvider.XML_TAG).iterator().next(); ReportSupportedFileProvider option = (ReportSupportedFileProvider) extra.getArray(ReportSupportedFileProvider.XML_TAG).iterator().next();
Assert.assertEquals(FileExtension.CPTX, option.getFileExtensions()[0]); Assert.assertEquals(FileExtension.CPTX, option.getFileExtensions()[0]);
} }
@Test @Test
public void testSupportFileTypesOrder() { public void testSupportFileTypesOrder() {
ExtraDesignClassManager extra = mockExtraDesignClassManager(); ExtraReportClassManager extra = mockExtraReportClassManager();
PowerMock.mockStatic(ExtraDesignClassManager.class); PowerMock.mockStatic(ExtraReportClassManager.class);
EasyMock.expect(ExtraDesignClassManager.getInstance()).andReturn(extra).once(); EasyMock.expect(ExtraReportClassManager.getInstance()).andReturn(extra).once();
PowerMock.replayAll(); PowerMock.replayAll();
String[] fileTypes = FileNodeConstants.getSupportFileTypes(); String[] fileTypes = FileNodeConstants.getSupportFileTypes();
Assert.assertEquals("cptx", fileTypes[0]); Assert.assertEquals("cptx", fileTypes[0]);
Assert.assertEquals("cpt", fileTypes[1]); Assert.assertEquals("cpt", fileTypes[1]);
} }
private ExtraDesignClassManager mockExtraDesignClassManager() { private ExtraReportClassManager mockExtraReportClassManager() {
ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class); ExtraReportClassManager extra = EasyMock.mock(ExtraReportClassManager.class);
Set<Mutable> options = new HashSet<Mutable>() {{ Set<Mutable> options = new HashSet<Mutable>() {{
add(new MockNewTemplateFileOption()); add(new MockNewTemplateFileOption());
}}; }};
EasyMock.expect(extra.getArray(ReportSupportedFileUIProvider.XML_TAG)).andReturn(options).anyTimes(); EasyMock.expect(extra.getArray(ReportSupportedFileProvider.XML_TAG)).andReturn(options).anyTimes();
EasyMock.replay(extra); EasyMock.replay(extra);
return extra; return extra;
} }
private class MockNewTemplateFileOption extends AbstractReportSupportedFileUIProvider { private class MockNewTemplateFileOption extends AbstractReportSupportedFileProvider {
@Override @Override
public FileExtension[] getFileExtensions() { public FileExtension[] getFileExtensions() {

5
designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -110,7 +110,10 @@ public class CellWidgetPropertyPane extends BasicPane {
if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去 if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去
tplEC.addCellElement(cellElement); tplEC.addCellElement(cellElement);
} else { } else {
cellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); TemplateCellElement newCellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow());
if (newCellElement != null) {
cellElement = newCellElement;
}
} }
setCellWidget(cellWidget, cellElement); setCellWidget(cellWidget, cellElement);
} else { } else {

4
designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

@ -69,6 +69,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title_Start_Row_Form"))); soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title_Start_Row_Form")));
repeatTitleRowPane = new RepeatRowPane(); repeatTitleRowPane = new RepeatRowPane();
soverlapRowStartPane.add(repeatTitleRowPane); soverlapRowStartPane.add(repeatTitleRowPane);
soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")));
return soverlapRowStartPane; return soverlapRowStartPane;
} }
@ -85,6 +86,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
// 重复打印标题的结束列 // 重复打印标题的结束列
repeatTitleColPane = new RepeatColPane(); repeatTitleColPane = new RepeatColPane();
soverlapColStartPane.add(repeatTitleColPane); soverlapColStartPane.add(repeatTitleColPane);
soverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")));
return soverlapColStartPane; return soverlapColStartPane;
} }
@ -100,6 +102,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Row_Form"))); foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Row_Form")));
repeatFinisRowPane = new RepeatRowPane(); repeatFinisRowPane = new RepeatRowPane();
foverlapRowStartPane.add(repeatFinisRowPane); foverlapRowStartPane.add(repeatFinisRowPane);
foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")));
return foverlapRowStartPane; return foverlapRowStartPane;
} }
@ -115,6 +118,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Column_Form"))); foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Column_Form")));
repeatFinisColPane = new RepeatColPane(); repeatFinisColPane = new RepeatColPane();
foverlapColStartPane.add(repeatFinisColPane); foverlapColStartPane.add(repeatFinisColPane);
foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")));
return foverlapColStartPane; return foverlapColStartPane;
} }

2
designer-realize/src/main/java/com/fr/design/webattr/EventPane.java

@ -168,7 +168,7 @@ public class EventPane extends BasicPane {
return; return;
} }
int val = JOptionPane.showConfirmDialog(EventPane.this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Are_You_Sure_To_Delete_The_Data") + "?", "Message", int val = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(EventPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Are_You_Sure_To_Delete_The_Data") + "?", "Message",
JOptionPane.YES_NO_OPTION); JOptionPane.YES_NO_OPTION);
if (val != JOptionPane.YES_OPTION) { if (val != JOptionPane.YES_OPTION) {
return; return;

Loading…
Cancel
Save