diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 7242b22950..9c23dcc51a 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -390,9 +390,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version); - if (!envHome.exists()) { - StableUtils.mkdirs(envHome); - } return envHome.getAbsolutePath(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java index 694c3e507e..9ed9068273 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java @@ -13,6 +13,9 @@ import javax.swing.text.PlainDocument; * Number Field. */ public class EditTextField extends UIGridTextField { + + private static final String I18NProperty = "i18n"; + private int maxLength = 24; public EditTextField() { @@ -39,7 +42,11 @@ public class EditTextField extends UIGridTextField { } class TextDocument extends PlainDocument { + + private Object defaultI18NProperty; + public TextDocument() { + defaultI18NProperty = getProperty(I18NProperty); } @Override @@ -49,6 +56,7 @@ public class EditTextField extends UIGridTextField { Toolkit.getDefaultToolkit().beep(); return; } + putProperty(I18NProperty, defaultI18NProperty); super.insertString(offset, s, a); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 79f6a5c1e8..d4931763c8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -47,6 +47,7 @@ import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; import com.fr.design.ui.util.UIUtil; +import com.fr.design.utils.DesignUtils; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.design.worker.save.EmptyCallBackSaveWorker; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; @@ -1071,7 +1072,7 @@ public abstract class JTemplate> public boolean isOldDesigner() { String xmlDesignerVersion = getTarget().getXMLDesignerVersion(); if (isHigherThanCurrent(xmlDesignerVersion)) { - String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", StringUtils.parseVersion(xmlDesignerVersion)); + String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion)); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); return true; diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 8bd4e880d9..f066d648a2 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -425,4 +425,17 @@ public class DesignUtils { return true; } + /** + * FR25.0版本出来需要进行适配下 + * + * @param xmlDesignerVersion + * @return + */ + public static String parseVersion(String xmlDesignerVersion) { + if (StringUtils.isNotEmpty(xmlDesignerVersion)) { + return String.valueOf(xmlDesignerVersion.charAt(0) - 'A'); + } + return xmlDesignerVersion; + } + } diff --git a/designer-base/src/test/java/com/fr/design/utils/DesignUtilsTest.java b/designer-base/src/test/java/com/fr/design/utils/DesignUtilsTest.java index 9db729a978..52c93dea50 100644 --- a/designer-base/src/test/java/com/fr/design/utils/DesignUtilsTest.java +++ b/designer-base/src/test/java/com/fr/design/utils/DesignUtilsTest.java @@ -3,6 +3,7 @@ package com.fr.design.utils; import com.fr.general.ComparatorUtils; import junit.framework.TestCase; +import org.junit.Assert; import org.junit.Test; import java.net.ServerSocket; @@ -29,4 +30,10 @@ public class DesignUtilsTest extends TestCase { assertTrue(DesignUtils.isPortOccupied()); } + @Test + public void testParseVersion() { + Assert.assertEquals("10", DesignUtils.parseVersion("KAA")); + Assert.assertEquals("11", DesignUtils.parseVersion("LAA")); + } + } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index c3e29e1237..55b9c191f3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -799,10 +799,13 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY); - popup.updatePane(designer); - popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible() && !isShowPluginDialog()); - popup.setRelativeBounds(bounds); + try { + popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY); + popup.updatePane(designer); + popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible() && !isShowPluginDialog()); + popup.setRelativeBounds(bounds); + } catch (Exception ignored) { + } } }); }