From 87e10003489d0097a2c1ba1af609a4dc0c80984e Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 27 Dec 2021 12:01:51 +0800 Subject: [PATCH 01/15] =?UTF-8?q?REPORT-64609=20=E7=A3=81=E7=9B=98?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=E6=BB=A1=E6=97=B6=20=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E9=80=A0=E6=88=90=E6=A8=A1=E6=9D=BF=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/common/exception/ThrowableHandler.java | 12 ++++ .../com/fr/design/mainframe/JTemplate.java | 3 +- .../worker/save/SaveFailureHandler.java | 70 +++++++++++++++++++ .../com/fr/design/worker/save/SaveWorker.java | 7 +- 4 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/common/exception/ThrowableHandler.java create mode 100644 designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java diff --git a/designer-base/src/main/java/com/fr/common/exception/ThrowableHandler.java b/designer-base/src/main/java/com/fr/common/exception/ThrowableHandler.java new file mode 100644 index 0000000000..225d90e791 --- /dev/null +++ b/designer-base/src/main/java/com/fr/common/exception/ThrowableHandler.java @@ -0,0 +1,12 @@ +package com.fr.common.exception; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/12/27 + */ +public interface ThrowableHandler { + + boolean process(Throwable e); + +} 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 f1f72b48c0..3e6ec08197 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 @@ -50,6 +50,7 @@ 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.worker.save.SaveFailureHandler; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.event.EventDispatcher; @@ -882,7 +883,7 @@ public abstract class JTemplate> export(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); + SaveFailureHandler.getInstance().process(e); return false; } this.editingFILE = editingFILE; diff --git a/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java b/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java new file mode 100644 index 0000000000..31c622ab3a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java @@ -0,0 +1,70 @@ +package com.fr.design.worker.save; + +import com.fr.common.exception.ThrowableHandler; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.general.IOUtils; +import com.fr.workspace.exception.DiskSpaceFullException; +import java.awt.Frame; +import javax.swing.JOptionPane; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/12/7 + */ +public class SaveFailureHandler implements ThrowableHandler { + + private static final SaveFailureHandler INSTANCE = new SaveFailureHandler(); + + public static SaveFailureHandler getInstance() { + return INSTANCE; + } + + @Override + public boolean process(Throwable e) { + for (Handler handler : Handler.values()) { + if (handler.process(e)) { + break; + } + } + return true; + } + + public enum Handler implements ThrowableHandler { + + FullDisk { + @Override + public boolean process(Throwable e) { + if (e.getCause() instanceof DiskSpaceFullException + || e instanceof DiskSpaceFullException + || e.getCause().getCause() instanceof DiskSpaceFullException) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine_Design_Template_Save_Failed_By_Full_Disk"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE, + IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png")); + return true; + } + return false; + } + }, + + Other { + @Override + public boolean process(Throwable e) { + boolean minimized = (DesignerContext.getDesignerFrame().getExtendedState() & Frame.ICONIFIED ) != 0; + FineJOptionPane.showMessageDialog( + minimized ? null : DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design-Basic_Save_Failure"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.ERROR_MESSAGE); + return true; + } + }; + + + + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java index f47a4f88e7..c7a962c259 100644 --- a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java @@ -55,12 +55,7 @@ public class SaveWorker extends SwingWorker { } catch (Exception e) { processResult(); FineLoggerFactory.getLogger().error(e.getMessage(), e); - boolean minimized = (DesignerContext.getDesignerFrame().getExtendedState() & Frame.ICONIFIED ) != 0; - FineJOptionPane.showMessageDialog( - minimized ? null : DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design-Basic_Save_Failure"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - JOptionPane.ERROR_MESSAGE); + SaveFailureHandler.getInstance().process(e); return; } processResult(); From 113fac5ff8588a6f4f1d42d665edd15f981e61ba Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 6 Jan 2022 18:04:16 +0800 Subject: [PATCH 02/15] =?UTF-8?q?CHART-22259=20feat:=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=88=96=E8=80=85=E5=88=87?= =?UTF-8?q?=E6=8D=A2env=20fvs=E6=A8=A1=E6=9D=BF=E9=87=8D=E6=96=B0=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 23 +++---------------- .../com/fr/design/mainframe/JTemplate.java | 18 +++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 6675925526..c00f8bb44f 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -15,7 +15,6 @@ import com.fr.design.mainframe.JVirtualTemplate; import com.fr.design.ui.util.UIUtil; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; -import com.fr.file.StashedFILE; import com.fr.general.ComparatorUtils; import com.fr.invoke.ClassHelper; import com.fr.log.FineLoggerFactory; @@ -25,7 +24,7 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; -import java.io.ByteArrayOutputStream; +import javax.swing.SwingWorker; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -33,7 +32,6 @@ import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Set; -import javax.swing.SwingWorker; /** * 历史模板缓存 @@ -360,7 +358,7 @@ public class HistoryTemplateListCache implements CallbackEvent { int size = historyList.size(); for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); - FILE file = templateToStashFile(template); + FILE file = template.templateToStashFile(); if (file != null) { stashFILEMap.put(i, file); } @@ -368,21 +366,6 @@ public class HistoryTemplateListCache implements CallbackEvent { FineLoggerFactory.getLogger().info("Env Change Template Stashed."); } - private FILE templateToStashFile(JTemplate template) { - FILE file = template.getEditingFILE(); - try { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - BaseBook target = template.getTarget(); - if (target != null) { - target.export(outputStream); - return new StashedFILE(file, outputStream.toByteArray(), template.suffix()); - } - // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - return null; - } private boolean checkStash() { try { @@ -465,7 +448,7 @@ public class HistoryTemplateListCache implements CallbackEvent { FILE file = template.getEditingFILE(); boolean needReload = context == null || needReloadTemplate(context, template); if (needReload) { - FILE stashFile = templateToStashFile(template); + FILE stashFile = template.templateToStashFile(); if (stashFile != null) { FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); template.refreshResource(stashFile); 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 f1f72b48c0..e990012f8b 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 @@ -56,6 +56,7 @@ import com.fr.event.EventDispatcher; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; import com.fr.file.MemFILE; +import com.fr.file.StashedFILE; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; @@ -84,6 +85,7 @@ import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.undo.UndoManager; import java.awt.BorderLayout; +import java.io.ByteArrayOutputStream; import java.util.Set; import java.util.concurrent.Callable; @@ -371,6 +373,22 @@ public abstract class JTemplate> PluginListenerRegistration.getInstance().stopListen(this.pluginListener); } + public FILE templateToStashFile() { + FILE file = this.getEditingFILE(); + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + BaseBook target = this.getTarget(); + if (target != null) { + target.export(outputStream); + return new StashedFILE(file, outputStream.toByteArray(), template.suffix()); + } + // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; + } + /** * 刷新内部资源 From 370ac70ae5b6b64789694d1f5c8619e8961ddaa9 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 6 Jan 2022 18:17:04 +0800 Subject: [PATCH 03/15] =?UTF-8?q?REPORT-61615=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=9C=AA=E5=AE=89=E8=A3=85=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?/=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=8F=92=E4=BB=B6=20?= =?UTF-8?q?=E4=BD=86=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=AE=89=E8=A3=85=E4=BA=86?= =?UTF-8?q?=20=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=AB=AF=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86/=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E4=BC=9A=E9=80=A0=E6=88=90=E8=BF=9E=E6=8E=A5=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataPaneListPane.java | 20 ++++++++++++++++++- .../datapane/connect/ConnectionListPane.java | 19 +++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 07d7abfb72..87e322b266 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -17,9 +17,12 @@ import com.fr.event.EventDispatcher; import com.fr.file.ProcedureConfig; import com.fr.file.TableDataConfig; import com.fr.file.TableDataOperator; +import com.fr.file.TableDataOperatorImpl; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -246,7 +249,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject())); } try { - WorkContext.getCurrent().get(TableDataOperator.class).saveTableData(tableDataBeans); + WorkContext.getCurrent().get(TableDataOperator.class, new ExceptionHandler() { + @Override + public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { + // 走老的方式 + return saveByOldWay(tableDataBeans); + } + }).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans); if (!WorkContext.getCurrent().isLocal()) { EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace()); } @@ -255,6 +264,15 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } } + private boolean saveByOldWay(List tableDataBean) { + try { + return TableDataOperatorImpl.getInstance().saveTableData(tableDataBean); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } + } + @Override public void update(TableDataSource tds) { tds.clearAllTableData(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 0c1967ef96..1566395edb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -16,8 +16,11 @@ import com.fr.design.i18n.Toolkit; import com.fr.event.EventDispatcher; import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionOperator; +import com.fr.file.ConnectionOperatorImpl; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -170,7 +173,12 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh connectionBeans.add(new ConnectionBean(nameObject.getName(), oldName, (Connection) nameObject.getObject())); } try { - WorkContext.getCurrent().get(ConnectionOperator.class).saveConnection(connectionBeans); + WorkContext.getCurrent().get(ConnectionOperator.class, new ExceptionHandler() { + @Override + public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { + return saveByOldWay(connectionBeans); + } + }).saveConnection(new ArrayList<>(connectionConfig.getConnections().keySet()), connectionBeans); if (!WorkContext.getCurrent().isLocal()) { EventDispatcher.fire(RemoteConfigEvent.EDIT, ConnectionConfig.getInstance().getNameSpace()); } @@ -179,6 +187,15 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh } } + private boolean saveByOldWay(List connectionBeans) { + try { + return ConnectionOperatorImpl.getInstance().saveConnection(connectionBeans); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } + } + public static void showDialog(Window parent) { final ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() { From c480db219a7c4495040c9e4c1c23b9a18cbf9409 Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Fri, 7 Jan 2022 09:49:13 +0800 Subject: [PATCH 04/15] =?UTF-8?q?REPORT-65515=E3=80=90=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=E5=85=B1=E5=88=9B=E3=80=91=E5=85=AC=E5=BC=8F=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8-=E5=AD=98=E5=9C=A8=E6=8F=92=E4=BB=B6=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=97=B6=EF=BC=8C=E9=80=89=E6=8B=A9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=8F=82=E6=95=B0=E5=87=BD=E6=95=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= =?UTF-8?q?=201.=E9=80=89=E4=B8=AD=E5=8F=82=E6=95=B0=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=BB=98=E8=AE=A4=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/formula/FormulaPane.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 904cdf00b0..a4354ee9d1 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -555,6 +555,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private void fixFunctionNameList(String functionName) { int signOfContinue = 1; int indexOfFunction = 0; + boolean found = false; for (int i = 0; i < functionTypeListModel.size(); i++) { int signOfType = 0; FunctionGroup functionType = (FunctionGroup) functionTypeListModel.getElementAt(i); @@ -568,6 +569,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { signOfType = 1; signOfContinue = 0; indexOfFunction = k; + found = true; } } @@ -577,8 +579,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } } } - functionNameList.setSelectedIndex(indexOfFunction); - functionNameList.ensureIndexIsVisible(indexOfFunction); + if (found) { + functionNameList.setSelectedIndex(indexOfFunction); + functionNameList.ensureIndexIsVisible(indexOfFunction); + } else { + functionTypeList.setSelectedIndex(0); + } } private int getBeginPosition() { From b28f91667833550fd852868c0d0a5c54148b16a9 Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Fri, 7 Jan 2022 09:51:25 +0800 Subject: [PATCH 05/15] =?UTF-8?q?REPORT-65515=E3=80=90=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=E5=85=B1=E5=88=9B=E3=80=91=E5=85=AC=E5=BC=8F=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8-=E5=AD=98=E5=9C=A8=E6=8F=92=E4=BB=B6=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=97=B6=EF=BC=8C=E9=80=89=E6=8B=A9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=8F=82=E6=95=B0=E5=87=BD=E6=95=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= =?UTF-8?q?=201.=E9=80=89=E6=8B=A9=E5=8F=82=E6=95=B0=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E8=BF=94=E5=9B=9E=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/formula/FormulaPane.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 904cdf00b0..a4354ee9d1 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -555,6 +555,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private void fixFunctionNameList(String functionName) { int signOfContinue = 1; int indexOfFunction = 0; + boolean found = false; for (int i = 0; i < functionTypeListModel.size(); i++) { int signOfType = 0; FunctionGroup functionType = (FunctionGroup) functionTypeListModel.getElementAt(i); @@ -568,6 +569,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { signOfType = 1; signOfContinue = 0; indexOfFunction = k; + found = true; } } @@ -577,8 +579,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } } } - functionNameList.setSelectedIndex(indexOfFunction); - functionNameList.ensureIndexIsVisible(indexOfFunction); + if (found) { + functionNameList.setSelectedIndex(indexOfFunction); + functionNameList.ensureIndexIsVisible(indexOfFunction); + } else { + functionTypeList.setSelectedIndex(0); + } } private int getBeginPosition() { From bb26dd08041630faea295b8535554341b9f26738 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 7 Jan 2022 10:35:45 +0800 Subject: [PATCH 06/15] =?UTF-8?q?REPORT-65576=20=E6=A1=86=E9=80=89?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C=E5=88=87=E6=8D=A2=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BC=9A=E5=BD=B1=E5=93=8D=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=86=85=E5=AE=B9=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 格式面板从单元格样式面板中移除后,所以不能通过样式面板配置项修改格式。 这就要求修改样式面板中的设置项,产生新的样式对象,需要保留旧的样式对象中格式配置, 保证格式不变 【改动思路】 同上 --- .../fr/design/mainframe/cell/settingpane/CellStylePane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index ec3c1bd05c..3bdd034c68 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -11,7 +11,6 @@ import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.style.BorderUtils; import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -20,7 +19,7 @@ import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; -import java.awt.Rectangle; +import java.text.Format; /** * @author zhou @@ -118,7 +117,10 @@ public class CellStylePane extends AbstractCellAttrPane { AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); elementCase.addCellElement(cellElement); } + Format format = cellElement.getStyle().getFormat(); Style style = stylePane.updateBean(); + // 格式不能通过样式面板中的配置项修改,因此需要保留 + style = style.deriveFormat(format); cellElement.setStyle(style); } }); From 346bd67c91665b512379e25b50c1e9d1a05f25db Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Fri, 7 Jan 2022 10:40:25 +0800 Subject: [PATCH 07/15] =?UTF-8?q?REPORT-65290=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E6=B0=B4=E5=8D=B0=EF=BC=8C=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E6=B0=B4=E5=8D=B0=E5=BC=80=E5=85=B3=EF=BC=8C?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=B0=B4=E5=8D=B0=E5=8F=98=E6=88=90=E4=BA=86?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8D=95=E7=8B=AC=E8=AE=BE=E7=BD=AE=201.?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=B0=B4=E5=8D=B0=E7=9A=84=E6=9C=89=E6=95=88?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/WatermarkSettingPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java b/designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java index e79bfcf6b8..f3de6eef96 100644 --- a/designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java @@ -34,6 +34,7 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane { @Override protected void populateServerSettings() { WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromServerConfig(); + watermarkAttr.setValid(true); watermarkPane.populate(watermarkAttr); } @@ -55,8 +56,9 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane { public WatermarkAttr update() { WatermarkAttr watermark = watermarkPane.update(); - if (isUsingServerSettings()) { - watermark.setValid(false); + if (!isUsingServerSettings()) { + watermark.setValid(true); + watermark.setWaterMarkProvider(WaterMarkProvideConstant.TEMPLATE); } return watermark; } From 48d530678876a50dcd90f3970e0f73890893898d Mon Sep 17 00:00:00 2001 From: pengda Date: Fri, 7 Jan 2022 11:01:42 +0800 Subject: [PATCH 08/15] =?UTF-8?q?REPORT-65502=20=E3=80=90=E5=A4=96?= =?UTF-8?q?=E5=8C=85=E9=AA=8C=E6=94=B6=E3=80=91=E5=88=86=E9=A1=B5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE-=E6=8C=89=E8=A1=8C=E5=88=86=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B6=85=E8=BF=87500=E6=97=B6=E5=80=BC?= =?UTF-8?q?=E4=BC=9A=E4=BF=9D=E5=AD=98=E4=B8=BA=E7=A9=BA=E8=80=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF1=E6=88=96500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/webattr/PageToolBarPane.java | 17 ++++++++++------- .../fr/design/webattr/PageWebSettingPane.java | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java b/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java index 48fb0c8ddb..783bc0e6a3 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java @@ -60,7 +60,7 @@ public class PageToolBarPane extends AbstractEditToolBarPane { private UICheckBox isPageFixedRowBox; private UITextField pageFixedRowCountTextField; private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); - private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]{0,2}$"); + private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0"); //固定行数分页,每页最多500行,最少1行数据 private static final int MAX_ROW_COUNT = 500; @@ -275,18 +275,21 @@ public class PageToolBarPane extends AbstractEditToolBarPane { @Override public void keyReleased(KeyEvent e) { String rowCount = pageFixedRowCountTextField.getText(); - if (!isRowCountValid(rowCount)) { - pageFixedRowCountTextField.setText(StringUtils.EMPTY); - } + pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount)); } }; - private boolean isRowCountValid(String rowCount) { + private String convert2ValidRowCount(String rowCount) { Matcher matcher = ROW_COUNT.matcher(rowCount); if (matcher.find()) { int count = Integer.parseInt(matcher.group()); - return count >= MIN_ROW_COUNT && count <= MAX_ROW_COUNT; + if (count > MAX_ROW_COUNT) { + count = MAX_ROW_COUNT; + } else if (count < MIN_ROW_COUNT) { + count = MIN_ROW_COUNT; + } + return String.valueOf(count); } - return false; + return StringUtils.EMPTY; } } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java index 98890f6d8c..1a3d323e9f 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java @@ -41,7 +41,7 @@ public class PageWebSettingPane extends WebSettingPane { private UICheckBox isPageFixedRowBox; private UITextField pageFixedRowCountTextField; private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); - private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]{0,2}$"); + private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0"); private static final String DEFAULT_ROW_COUNT = "30"; //固定行数分页,每页最多500行,最少1行数据 @@ -82,9 +82,7 @@ public class PageWebSettingPane extends WebSettingPane { @Override public void keyReleased(KeyEvent e) { String rowCount = pageFixedRowCountTextField.getText(); - if (!isRowCountValid(rowCount)) { - pageFixedRowCountTextField.setText(StringUtils.EMPTY); - } + pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount)); } }); pageFixedRowCountTextField.addInputMethodListener(new InputMethodListener() { @@ -207,12 +205,17 @@ public class PageWebSettingPane extends WebSettingPane { reportWebAttr.setWebPage(webContent); } - private boolean isRowCountValid(String rowCount) { + private String convert2ValidRowCount(String rowCount) { Matcher matcher = ROW_COUNT.matcher(rowCount); if (matcher.find()) { int count = Integer.parseInt(matcher.group()); - return count >= MIN_ROW_COUNT && count <= MAX_ROW_COUNT; + if (count > MAX_ROW_COUNT) { + count = MAX_ROW_COUNT; + } else if (count < MIN_ROW_COUNT) { + count = MIN_ROW_COUNT; + } + return String.valueOf(count); } - return false; + return StringUtils.EMPTY; } } From 51dad67c885cd3ae86497f75e754526e0b1c9b4c Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 7 Jan 2022 20:34:35 +0800 Subject: [PATCH 09/15] =?UTF-8?q?REPORT-65613=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=BE=B9=E6=A1=86=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=E6=96=87=E6=9C=AC=E5=92=8C?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E6=A0=B7=E5=BC=8F=EF=BC=8C=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=BE=B9=E6=A1=86=E9=85=8D=E7=BD=AE=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 只有当前面板是边框面板的时候才会保存边框数据,所以在边框面板没有被选中的时候,就不会保存数据了 【改动思路】 遍历主题单元格样式编辑面板中的所有BasicPane,保存其中的数据 --- .../mainframe/theme/edit/cell/CellStyleEditPane.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java index d8a4096ceb..846da26491 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java @@ -88,13 +88,13 @@ public class CellStyleEditPane extends MultiTabPane { @Override public ThemedCellStyle updateBean() { - AbstractBasicStylePane basicStylePane = (AbstractBasicStylePane) paneList.get(tabPane.getSelectedIndex()); - Style style = basicStylePane.update(this.cellStyle.getStyle()); + Style style = this.cellStyle.getStyle(); CellBorderStyle borderStyle = createDefaultBorderStyleFromStyle(style); - - - if (ThemedFeatureController.isCellStyleSupportInnerBorder() && basicStylePane instanceof BorderPane) { - borderStyle = ((BorderPane) basicStylePane).update(); + for (BasicPane basicPane : paneList) { + style = ((AbstractBasicStylePane) basicPane).update(style); + if (ThemedFeatureController.isCellStyleSupportInnerBorder() && basicPane instanceof BorderPane) { + borderStyle = ((BorderPane) basicPane).update(); + } } this.cellStyle.setStyle(style); From 95dadd063a69dfbd3b5cabdf5b59cf8deefc124b Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 10 Jan 2022 15:26:22 +0800 Subject: [PATCH 10/15] =?UTF-8?q?REPORT-65475=20AlphaFine=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/FileSearchManager.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 0497828c7e..327d0555c2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -11,10 +11,14 @@ import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.file.filetree.FileNode; +import com.fr.file.filetree.FileNodes; import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; +import com.fr.workspace.WorkContext; /** @@ -74,7 +78,12 @@ public class FileSearchManager implements AlphaFineSearchProvider { return lessModelList; } AlphaFineHelper.checkCancel(); - fileNodes = FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true); + fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() { + @Override + public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { + return FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true); + } + }).list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true, false); isContainCpt = true; isContainFrm = true; doSearch(this.searchText); @@ -128,7 +137,12 @@ public class FileSearchManager implements AlphaFineSearchProvider { */ private void doFileContentSearch(String searchText) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { - FileNode[] fileNodes = FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); + FileNode[] fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() { + @Override + public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { + return FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); + } + }).filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true, false); for (FileNode node : fileNodes) { FileModel model = new FileModel(node.getName(), node.getEnvPath()); if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) { From f7ee5493b14b35af3a9a39466f3d372cc7bdadf8 Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Fri, 14 Jan 2022 10:18:41 +0800 Subject: [PATCH 11/15] =?UTF-8?q?REPORT-65194=20=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E8=AE=A1=E7=AE=97=E8=AE=A1=E7=AE=97=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E6=8F=90=E7=A4=BA=E6=A1=86=E5=86=85=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=B8=8D=E6=AD=A3=E7=A1=AE=201.=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=BC=82=E5=B8=B8=E7=9A=84=E6=97=B6=E5=80=99=E7=BB=99?= =?UTF-8?q?warn=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/formula/FormulaPane.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index a4354ee9d1..795ff721f0 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -814,10 +814,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { String formulaText = formulaTextArea.getText().trim(); String unSupportFormula = containsUnsupportedSimulationFormulas(formulaText); if (unSupportFormula != null) { - showMessageDialog(Toolkit.i18nText("Fine-Design_Basic_Formula_Unsupported_Formulas") + ":" + unSupportFormula, false); + showMessageDialog(Toolkit.i18nText("Fine-Design_Basic_Formula_Unsupported_Formulas") + ":" + unSupportFormula, false, true); return; } + boolean calException = false; String messageTips; FormulaCheckResult checkResult = FormulaChecker.check(formulaText); if (checkResult.grammarValid()) { @@ -846,6 +847,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } catch (Exception ce) { //模拟计算如果出现错误,则抛出错误 calResult = ce.getMessage(); + calException = true; FineLoggerFactory.getLogger().error(ce.getMessage(), ce); messageTips = messageTips + Toolkit.i18nText("Fine-Design_Basic_Formula_Cal_Error") + ":" + calResult; } @@ -854,7 +856,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { messageTips = checkResult.getTips(); } if (checkResult.isValid()) { - showMessageDialog(messageTips, checkResult.isValid()); + showMessageDialog(messageTips, checkResult.isValid(), calException); } else { confirmCheckResult(checkResult, messageTips); } @@ -871,7 +873,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private boolean confirmCheckResult(FormulaCheckResult checkResult, String messageTips) { if (checkResult.isValid()) { - showMessageDialog(checkResult.getTips(), checkResult.isValid()); + showMessageDialog(checkResult.getTips(), checkResult.isValid(), false); } else { int columns = checkResult.getFormulaCoordinates().getColumns(); String position = StringUtils.EMPTY; @@ -897,8 +899,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { return true; } - private void showMessageDialog(String message, boolean formulaValid) { - if (formulaValid) { + private void showMessageDialog(String message, boolean formulaValid, boolean calException) { + if (formulaValid && !calException) { FineJOptionPane.showMessageDialog( FormulaPane.this, message); From c65515aace725cfe9277e88c2a4d8522d7221d7d Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 14 Jan 2022 15:42:09 +0800 Subject: [PATCH 12/15] =?UTF-8?q?REPORT-65513=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=8D=95=E5=85=83=E6=A0=BC=E7=BB=84=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E2=80=9C=E5=8D=95=E5=85=83=E6=A0=BC=E4=B8=AA?= =?UTF-8?q?=E6=95=B0=E5=BF=85=E9=A1=BB=E7=9B=B8=E5=90=8C=E2=80=9D=E7=9A=84?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/write/submit/SmartInsertDBManipulationPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 3818f1ac80..193fd4de9a 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -291,6 +291,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { @Override public void checkValid() throws Exception { KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); + checkModelValid(model); + } + + private void checkModelValid(KeyColumnTableModel model) throws Exception { int cnt = model.getRowCount(); int groupLength = -1; for (int i = 0; i < cnt; i++) { @@ -374,7 +378,8 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { */ @Override public void checkValid() throws Exception { - SmartInsertDBManipulationPane.this.checkValid(); + KeyColumnTableModel model = (KeyColumnTableModel) table.getModel(); + SmartInsertDBManipulationPane.this.checkModelValid(model); } private SelectionListener listener = new SelectionListener() { From 822a1b2a6f8903c662ed3df3a7275af3674b9181 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 17 Jan 2022 09:50:13 +0800 Subject: [PATCH 13/15] =?UTF-8?q?REPORT-65722=20=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=82=B9=E5=87=BB=E9=80=89=E6=8B=A9=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=9B=BE=E6=A0=87=E6=97=B6=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=87=BA=E7=8E=B0=E5=8E=9F?= =?UTF-8?q?=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=20=E5=90=8C=E6=AD=A5=E5=88=B011.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/ifilechooser/JavaFxNativeFileChooser.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 4d36883240..fb6a7e88be 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -197,7 +197,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { private File currentDirectory; public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) { - this.fileSelectionMode = fileSelectionMode; + if (fileSelectionMode != null) { + this.fileSelectionMode = fileSelectionMode; + } return this; } @@ -209,13 +211,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { } public Builder filters(FileChooser.ExtensionFilter[] filters) { - this.filters = filters; + if (filters != null) { + this.filters = filters; + } return this; } public Builder filters(ExtensionFilter[] filters) { - for (ExtensionFilter filter : filters) { - this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); + if (filters != null) { + for (ExtensionFilter filter : filters) { + this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); + } } return this; } From dc28f2fac245696c8017c4cb1509b5e459779382 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 18 Jan 2022 12:16:45 +0800 Subject: [PATCH 14/15] =?UTF-8?q?REPORT-65975=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6-=E6=8E=A7=E4=BB=B6=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E8=A1=A8=E5=90=8D=E5=90=8E=E4=BC=9A?= =?UTF-8?q?=E9=80=80=E5=87=BA=E5=BD=93=E5=89=8D=E9=80=89=E6=8B=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../icombobox/TableSearchTreeComboBox.java | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java index 6b41986939..27cdc17283 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java @@ -16,12 +16,13 @@ import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.JTree; import javax.swing.SwingWorker; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import java.awt.event.MouseEvent; import java.util.Enumeration; /** @@ -40,7 +41,7 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { super(tree, renderer); this.parent = parent; - setUI(new TableSearchTreeComboBoxUI()); + initPopupListener(); } protected UIComboBoxEditor createEditor() { @@ -158,12 +159,6 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { } } - private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() { - public boolean accept(TableProcedure procedure) { - return true; - } - }; - /** * 表名模糊搜索实现 */ @@ -184,15 +179,31 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { } } - /** - * 重写FRTreeComboBoxUI,实现点击下拉时触发模糊搜索 - */ - private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI { - - @Override - public void mouseClicked(MouseEvent e) { - searchExecute(); + private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() { + public boolean accept(TableProcedure procedure) { + return true; } + }; + + protected void initPopupListener() { + // 点击下拉时触发模糊搜索 + this.addPopupMenuListener(new PopupMenuListener() { + + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + searchExecute(); + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + + } + + @Override + public void popupMenuCanceled(PopupMenuEvent e) { + + } + }); } /** From f4a3c9095851b948f3b5574db365f60beeb3d0d2 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 18 Jan 2022 12:19:30 +0800 Subject: [PATCH 15/15] =?UTF-8?q?REPORT-65975=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6-=E6=8E=A7=E4=BB=B6=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E8=A1=A8=E5=90=8D=E5=90=8E=E4=BC=9A?= =?UTF-8?q?=E9=80=80=E5=87=BA=E5=BD=93=E5=89=8D=E9=80=89=E6=8B=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/icombobox/TableSearchTreeComboBox.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java index 27cdc17283..7198eeef09 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java @@ -185,7 +185,7 @@ public class TableSearchTreeComboBox extends FRTreeComboBox { } }; - protected void initPopupListener() { + private void initPopupListener() { // 点击下拉时触发模糊搜索 this.addPopupMenuListener(new PopupMenuListener() {