From 9dde39c35a589fceb9873c45e4560e0ae62fa4f9 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Mar 2020 14:18:26 +0800 Subject: [PATCH 01/13] REPORT-27771 && REPORT-27493 && REPORT-27954 --- .../tabledatapane/TableDataManagerPane.java | 11 +++++-- .../java/com/fr/design/mainframe/JForm.java | 3 ++ .../design/actions/cell/NewPresentAction.java | 30 ++++++++++++++++--- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java index 7c484c7b2..4c08fae2b 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java @@ -33,9 +33,16 @@ public class TableDataManagerPane extends LoadingBasicPane { ); } tableDataPane = pane == null ? new TableDataPaneListPane() { - public void rename(String oldName, String newName) { + @Override + public void rename(final String oldName, final String newName) { super.rename(oldName, newName); - renameConnection(oldName, newName); + new SwingWorker() { + @Override + protected Void doInBackground() { + renameConnection(oldName, newName); + return null; + } + }; } } : pane; container.add(tableDataPane.getPanel(), BorderLayout.CENTER); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index ab19002c1..ef14169e7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -5,6 +5,7 @@ import com.fr.base.PaperSize; import com.fr.base.Parameter; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.TemplateParameterAction; @@ -12,6 +13,7 @@ import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.cell.FloatElementsProvider; +import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CutAction; @@ -587,6 +589,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Thu, 12 Mar 2020 15:24:38 +0800 Subject: [PATCH 02/13] fix --- .../java/com/fr/design/data/datapane/TableDataPaneListPane.java | 2 +- .../data/tabledata/tabledatapane/TableDataManagerPane.java | 2 +- 2 files changed, 2 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 437334c53..d2fdc3229 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 @@ -69,7 +69,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } if (nameableList.getSelectedValue() instanceof ListModelElement) { Nameable selected = ((ListModelElement) nameableList.getSelectedValue()).wrapper; - if (!ComparatorUtils.equals(tempName, selected.getName())) { + if (!ComparatorUtils.equals(tempName, selected.getName()) && !isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) { rename(selected.getName(), tempName); } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java index 4c08fae2b..c55e5871e 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java @@ -42,7 +42,7 @@ public class TableDataManagerPane extends LoadingBasicPane { renameConnection(oldName, newName); return null; } - }; + }.execute(); } } : pane; container.add(tableDataPane.getPanel(), BorderLayout.CENTER); From 2728eca125ea032c24d69c66a8d0043a66e9814c Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 12 Mar 2020 17:36:06 +0800 Subject: [PATCH 03/13] =?UTF-8?q?REPORT-27728=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF=E8=89=B2=E4=BC=9A?= =?UTF-8?q?=E9=81=AE=E6=8C=A1=E5=8E=9F=E5=A7=8B=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/CellElementPainter.java | 2 +- designer-realize/src/main/java/com/fr/grid/GridUI.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java b/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java index 607fde54f..6148ee8d6 100644 --- a/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java +++ b/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java @@ -9,7 +9,7 @@ import com.fr.report.core.PaintUtils; import com.fr.report.elementcase.ElementCase; public class CellElementPainter { - public void paintBackground(Graphics2D g2d, ElementCase report, CellElement ce, int width, int height) { + public void paintBackground(Graphics2D g2d, ElementCase report, CellElement ce, double width, double height) { Style.paintBackground(g2d, ce.getStyle(), width, height); } diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 266cb5cb0..ff027af08 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -497,12 +497,12 @@ public class GridUI extends ComponentUI { paintCellElementRectangleList.add(this.tmpRectangle.clone()); - int cellWidth = (int) this.tmpRectangle.getWidth(); - int cellHeight = (int) this.tmpRectangle.getHeight(); + double cellWidth = this.tmpRectangle.getWidth(); + double cellHeight = this.tmpRectangle.getHeight(); // denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框 - painter.paintBackground(g2d, report, tmpCellElement, cellWidth, cellHeight); - painter.paintContent(g2d, report, tmpCellElement, cellWidth, cellHeight, resolution); + painter.paintBackground(g2d, report, tmpCellElement, cellWidth - 1, cellHeight - 1); + painter.paintContent(g2d, report, tmpCellElement, (int) cellWidth, (int) cellHeight, resolution); // denny_Grid: 注意下面还要减一, 因为上面translate时加一 g2d.translate(-this.tmpRectangle.getX() - 1, -this.tmpRectangle.getY() - 1); paintAuthorityCell(g2d, tmpCellElement); From 8de60f31418b6db2a3c40e0597bb3189ca3ed70f Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Mar 2020 20:24:21 +0800 Subject: [PATCH 04/13] REPORT-28026 && REPORT-27919 --- .../mainframe/DesignerFrameFileDealerPane.java | 16 +--------------- .../fr/design/parameter/ParameterInputPane.java | 9 +++++++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index b4b469e10..bcac7f946 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -684,21 +684,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt this.dispose(); //模版重命名 - boolean success = false; - - // 提醒保存文件 - SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true); - // 只有一个文件未保存时 - if (HistoryTemplateListCache.getInstance().getHistoryCount() == 1) { - int choose = saveSomeTempaltePane.saveLastOneTemplate(); - if (choose != JOptionPane.CANCEL_OPTION) { - success = selectedOperation.rename(fnf, path, newPath); - } - } else { - if (saveSomeTempaltePane.showSavePane()) { - success = selectedOperation.rename(fnf, path, newPath); - } - } + boolean success = selectedOperation.rename(fnf, path, newPath); if (success) { HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java index 14487ca5f..8e8819c67 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java @@ -17,6 +17,7 @@ import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.FloatEditor; import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.editor.editor.TextEditor; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -24,6 +25,8 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.*; import java.util.ArrayList; import java.util.Date; @@ -103,6 +106,12 @@ public class ParameterInputPane extends BasicPane { contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane)); //add editor to parameter hashtable. + textF.getCurrentEditor().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } + }); this.editorNameMap.put(textF, parameter.getName()); nameAddedList.add(parameter.getName()); } From 9046015866f34875d90054079da5a3ff704835a4 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 10:39:44 +0800 Subject: [PATCH 05/13] REPORT-27945 && REPORT-27934 && REPORT-27940 --- .../fr/common/detect/CommonPortDetector.java | 59 +++++++++++++++++++ .../main/java/com/fr/start/BaseDesigner.java | 2 + .../common/detect/CommonPortDetectorTest.java | 45 ++++++++++++++ .../com/fr/start/module/DesignerStartup.java | 5 ++ 4 files changed, 111 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java create mode 100644 designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java diff --git a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java new file mode 100644 index 000000000..d49b4c80a --- /dev/null +++ b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java @@ -0,0 +1,59 @@ +package com.fr.common.detect; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.DesignerEnvManager; +import com.fr.log.FineLoggerFactory; +import com.fr.module.ModuleContext; +import com.fr.web.WebSocketConfig; + +import java.net.Socket; +import java.util.concurrent.ExecutorService; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/10 + */ +public class CommonPortDetector { + + private static final CommonPortDetector INSTANCE = new CommonPortDetector(); + private ExecutorService service = ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory("CommonDetector")); + + public static CommonPortDetector getInstance() { + return INSTANCE; + } + + public void execute() { + service.submit(new Runnable() { + @Override + public void run() { + detectTomcatPort(); + detectWebSocketPort(); + } + }); + } + + private void detectTomcatPort() { + int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); + if (checkPort(port)) { + FineLoggerFactory.getLogger().error("EmbedTomcat Port: {} is not available, maybe occupied by other programs, please check it!", port); + } + } + + private void detectWebSocketPort() { + Integer[] ports = WebSocketConfig.getInstance().getPort(); + for (int port : ports) { + if (checkPort(port)) { + FineLoggerFactory.getLogger().error("WebSocKet Port: {} is not available, maybe occupied by other programs, please check it!", port); + } + } + } + + private boolean checkPort(int port) { + try (Socket socket = new Socket("localhost", port)) { + return true; + } catch (Exception e) { + return false; + } + } +} diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 90ac634ce..ba231a335 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -3,6 +3,7 @@ */ package com.fr.start; +import com.fr.common.detect.CommonPortDetector; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.DesignerLaunchStatus; @@ -76,6 +77,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { public void on(Event event, Null param) { EventDispatcher.stopListen(this); collectUserInformation(); + CommonPortDetector.getInstance().execute(); } }); } diff --git a/designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java b/designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java new file mode 100644 index 000000000..fa9915b31 --- /dev/null +++ b/designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java @@ -0,0 +1,45 @@ +package com.fr.common.detect; + +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import junit.framework.TestCase; +import org.junit.Assert; + +import java.io.IOException; +import java.net.ServerSocket; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/10 + */ +public class CommonPortDetectorTest extends TestCase { + + private ServerSocket serverSocket; + + @Override + public void setUp() throws Exception { + serverSocket = new ServerSocket(55555); + new Thread(new Runnable() { + @Override + public void run() { + try { + serverSocket.accept(); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }).start(); + } + + public void testCheckPort() { + CommonPortDetector detector = CommonPortDetector.getInstance(); + boolean access = Reflect.on(detector).call("checkPort", 55555).get(); + Assert.assertTrue(access); + } + + @Override + public void tearDown() throws Exception { + serverSocket.close(); + } +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 708cc0020..60de86543 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -24,6 +24,7 @@ import com.fr.record.analyzer.Metrics; import com.fr.stable.BuildContext; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.start.DesignerProcessType; import com.fr.start.OemHandler; import com.fr.start.ServerStarter; @@ -91,6 +92,10 @@ public class DesignerStartup extends Activator { } }; dialog.setVisible(true); + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getId(), + DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getMessage(), + StringUtils.EMPTY); + FineLoggerFactory.getLogger().error(DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getId() + ": " + DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getMessage()); } DesignerExiter.getInstance().execute(); return; From a1cddd627db811ebe76b3dcdcabdc450939225c8 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 10:42:01 +0800 Subject: [PATCH 06/13] fix --- .../src/main/java/com/fr/common/detect/CommonPortDetector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java index d49b4c80a..310e75dce 100644 --- a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java +++ b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java @@ -17,7 +17,7 @@ import java.util.concurrent.ExecutorService; public class CommonPortDetector { private static final CommonPortDetector INSTANCE = new CommonPortDetector(); - private ExecutorService service = ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory("CommonDetector")); + private ExecutorService service = ModuleContext.getExecutor().newSingleThreadExecutor(new NamedThreadFactory("CommonPortDetector")); public static CommonPortDetector getInstance() { return INSTANCE; From 0ebfd70fc038bbd07fc24ebf03056245dc0c2dc6 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 14:29:22 +0800 Subject: [PATCH 07/13] REPORT-28099 --- .../fr/design/mainframe/DesignerFrame.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index d6b9c047e..e72f43a5c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -109,6 +109,9 @@ import java.awt.event.WindowListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -316,6 +319,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta // window close listener. this.addWindowListeners(getFrameListeners()); + addMacOsListener(); + this.addComponentListener(new ComponentAdapter() { @Override @@ -523,6 +528,29 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } + private void addMacOsListener() { + if (OperatingSystem.isMacos()) { + try { + Class app = Class.forName("com.apple.eawt.Application"); + Class handler = Class.forName("com.apple.eawt.QuitHandler"); + Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if ("handleQuitRequestWith".equals(method.getName())) { + DesignerFrame.this.exit(); + } + return null; + } + }); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + } catch (ClassNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + protected ArrayList getFrameListeners() { ArrayList arrayList = new ArrayList<>(); From f4fe8314e8bcf5e750401b20495c9b6c676e0fe0 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 15:42:26 +0800 Subject: [PATCH 08/13] =?UTF-8?q?fix=20=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 23 ++-------- .../com/fr/design/os/impl/MacOsAction.java | 44 +++++++++++++++++++ 2 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e72f43a5c..e119a4f01 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -40,6 +40,7 @@ import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.menu.MenuManager; import com.fr.design.menu.ShortCut; +import com.fr.design.os.impl.MacOsAction; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.EventDispatcher; @@ -529,26 +530,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } private void addMacOsListener() { - if (OperatingSystem.isMacos()) { - try { - Class app = Class.forName("com.apple.eawt.Application"); - Class handler = Class.forName("com.apple.eawt.QuitHandler"); - Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, - Object[] args) throws Throwable { - if ("handleQuitRequestWith".equals(method.getName())) { - DesignerFrame.this.exit(); - } - return null; - } - }); - Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); - } catch (ClassNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } + MacOsAction macOsAction = OSSupportCenter.getAction(MacOsAction.class); + macOsAction.execute(this); } protected ArrayList getFrameListeners() { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java new file mode 100644 index 000000000..7f5c7be08 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java @@ -0,0 +1,44 @@ +package com.fr.design.os.impl; + +import com.fr.design.mainframe.DesignerFrame; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.os.OperatingSystem; +import com.fr.stable.os.support.OSBasedAction; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/13 + */ +public class MacOsAction implements OSBasedAction { + + @Override + public void execute(final Object... objects) { + if (OperatingSystem.isMacos()) { + try { + Class app = Class.forName("com.apple.eawt.Application"); + Class handler = Class.forName("com.apple.eawt.QuitHandler"); + Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if ("handleQuitRequestWith".equals(method.getName())) { + DesignerFrame designerFrame = (DesignerFrame) objects[0]; + designerFrame.exit(); + } + return null; + } + }); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + } catch (ClassNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } +} From 0b87e101ff2e67156b1cc613ea86808213813605 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 15:44:26 +0800 Subject: [PATCH 09/13] =?UTF-8?q?fix=20=E6=97=A0=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e119a4f01..4a9fbac8a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -110,9 +110,6 @@ import java.awt.event.WindowListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Iterator; import java.util.List; From 39393f87ce3e649026b5c6d5d4bd5babb902f039 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 13 Mar 2020 16:36:26 +0800 Subject: [PATCH 10/13] =?UTF-8?q?REPORT-27914=20https=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=EF=BC=8C=E6=B2=A1=E6=9C=89=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=9B=BA=E5=8C=96=E5=9F=8B=E7=82=B9=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messagecollect/solid/SolidCollector.java | 77 +++++++++++-------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java index 68cc882a9..d090b9e8f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java @@ -1,22 +1,18 @@ package com.fr.design.mainframe.messagecollect.solid; +import com.fr.analysis.cloud.solid.SolidRecordExecutor; import com.fr.general.CloudCenter; import com.fr.general.http.HttpToolbox; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; import com.fr.log.FineLoggerFactory; -import com.fr.security.JwtUtils; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.CommonUtils; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; -import java.io.IOException; import java.util.HashMap; import java.util.Map; -import static com.fr.design.mainframe.messagecollect.solid.SolidCollectConstants.REQUEST_SUBJECT; -import static com.fr.design.mainframe.messagecollect.solid.SolidCollectConstants.TIME_OUT; - /** * 设计器固化信息回传类 * Created by alex sung on 2019/8/22. @@ -24,9 +20,6 @@ import static com.fr.design.mainframe.messagecollect.solid.SolidCollectConstants public class SolidCollector { - private static final String CONTENT_URL = "/v10/collect/solid"; - private static final String DELETE_URL = "/v10/collect/solid/delete"; - private static final String UNLOCK_URL = "/v10/collect/solid/unlock"; private static final String ATTR_CIPHER_TEXT = "cipherText"; private static final String ATTR_SIGNATURE = "signature"; private static final String SOLID_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.solid"); @@ -53,27 +46,22 @@ public class SolidCollector { } FineLoggerFactory.getLogger().info("start to get solid content from server..."); try { - String content = requestContent(); - if (StringUtils.isNotEmpty(content)) { - String cipherText = JSONFactory.createJSON(JSON.OBJECT, content).optString("data"); - if(StringUtils.isNotEmpty(cipherText)){ - Map params = new HashMap<>(); - params.put(ATTR_CIPHER_TEXT, cipherText); - params.put(ATTR_SIGNATURE, String.valueOf(CommonUtils.signature())); - HttpToolbox.post(SOLID_UPLOAD_URL, params); + String cipherText = requestContent(); + if (StringUtils.isNotEmpty(cipherText)) { + Map params = new HashMap<>(); + params.put(ATTR_CIPHER_TEXT, cipherText); + params.put(ATTR_SIGNATURE, String.valueOf(CommonUtils.signature())); + HttpToolbox.post(SOLID_UPLOAD_URL, params); - String deleteUrl = WorkContext.getCurrent().getPath() + DELETE_URL; - HttpToolbox.post(deleteUrl, getParams()); - } + deleteSolidFile(); } FineLoggerFactory.getLogger().info("send solid content to cloud center success."); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage(), e); } finally { - String unlockUrl = WorkContext.getCurrent().getPath() + UNLOCK_URL; try { - HttpToolbox.post(unlockUrl, getParams()); - } catch (IOException e) { + unlockSolidFile(); + } catch (Exception e) { FineLoggerFactory.getLogger().warn(e.getMessage(), e); } } @@ -81,17 +69,42 @@ public class SolidCollector { /** * 获取服务端固化文件内容 + * * @return 回传内容 */ - public String requestContent() throws Exception { - Map params = new HashMap(); - params.put("token", JwtUtils.createDefaultJWT(REQUEST_SUBJECT, TIME_OUT)); - return HttpToolbox.get(WorkContext.getCurrent().getPath() + CONTENT_URL, params); + private String requestContent() throws Exception { + return WorkContext.getCurrent().get(SolidRecordExecutor.class, new ExceptionHandler() { + @Override + public String callHandler(RPCInvokerExceptionInfo info) { + FineLoggerFactory.getLogger().error(info.getException().getMessage(), info.getException()); + return StringUtils.EMPTY; + } + }).feedBackTask(StringUtils.EMPTY); } - private Map getParams() { - Map params = new HashMap(); - params.put("token", JwtUtils.createDefaultJWT(REQUEST_SUBJECT, TIME_OUT)); - return params; + /** + * 删除服务端固化文件 + */ + private void deleteSolidFile() throws Exception { + WorkContext.getCurrent().get(SolidRecordExecutor.class, new ExceptionHandler() { + @Override + public Void callHandler(RPCInvokerExceptionInfo info) { + FineLoggerFactory.getLogger().error(info.getException().getMessage(), info.getException()); + return null; + } + }).deleteSolidFile(); + } + + /** + * unlock + */ + private void unlockSolidFile() throws Exception { + WorkContext.getCurrent().get(SolidRecordExecutor.class, new ExceptionHandler() { + @Override + public Void callHandler(RPCInvokerExceptionInfo info) { + FineLoggerFactory.getLogger().error(info.getException().getMessage(), info.getException()); + return null; + } + }).unlockSolidFile(); } } From a5943c127935fe9ff4a72775dd8230739dde5b99 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 17:17:07 +0800 Subject: [PATCH 11/13] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 5 +-- .../com/fr/design/os/impl/MacOsAction.java | 44 ------------------- .../os/impl/MacOsAddListenerAction.java | 41 +++++++++++++++++ .../com/fr/design/os/impl/SupportOSImpl.java | 10 +++++ 4 files changed, 53 insertions(+), 47 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java create mode 100644 designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 4a9fbac8a..237f2f975 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -40,7 +40,7 @@ import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.menu.MenuManager; import com.fr.design.menu.ShortCut; -import com.fr.design.os.impl.MacOsAction; +import com.fr.design.os.impl.MacOsAddListenerAction; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.EventDispatcher; @@ -527,8 +527,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } private void addMacOsListener() { - MacOsAction macOsAction = OSSupportCenter.getAction(MacOsAction.class); - macOsAction.execute(this); + OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } protected ArrayList getFrameListeners() { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java deleted file mode 100644 index 7f5c7be08..000000000 --- a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.design.os.impl; - -import com.fr.design.mainframe.DesignerFrame; -import com.fr.invoke.Reflect; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.os.OperatingSystem; -import com.fr.stable.os.support.OSBasedAction; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -/** - * @author hades - * @version 10.0 - * Created by hades on 2020/3/13 - */ -public class MacOsAction implements OSBasedAction { - - @Override - public void execute(final Object... objects) { - if (OperatingSystem.isMacos()) { - try { - Class app = Class.forName("com.apple.eawt.Application"); - Class handler = Class.forName("com.apple.eawt.QuitHandler"); - Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, - Object[] args) throws Throwable { - if ("handleQuitRequestWith".equals(method.getName())) { - DesignerFrame designerFrame = (DesignerFrame) objects[0]; - designerFrame.exit(); - } - return null; - } - }); - Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); - } catch (ClassNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } -} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java new file mode 100644 index 000000000..4d8c892b9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java @@ -0,0 +1,41 @@ +package com.fr.design.os.impl; + +import com.fr.design.mainframe.DesignerFrame; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.os.support.OSBasedAction; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/13 + */ +public class MacOsAddListenerAction implements OSBasedAction { + + @Override + public void execute(final Object... objects) { + try { + Class app = Class.forName("com.apple.eawt.Application"); + Class handler = Class.forName("com.apple.eawt.QuitHandler"); + Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if ("handleQuitRequestWith".equals(method.getName())) { + DesignerFrame designerFrame = (DesignerFrame) objects[0]; + designerFrame.exit(); + } + return null; + } + }); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + } catch (ClassNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 9bc29b829..2518ef57c 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -73,6 +73,16 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return FRContext.isChineseEnv() && !OperatingSystem.isMacos() && Arch.getArch() != Arch.ARM; } + }, + + /** + * mac下dock栏右键退出 + */ + DOCK_QUIT { + @Override + public boolean support() { + return OperatingSystem.isMacos(); + } } } From 95ca4d99c35bbd355d026fff4122acf452669b7a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 14 Mar 2020 18:15:44 +0800 Subject: [PATCH 12/13] =?UTF-8?q?CHART-12975=20=E4=BF=AE=E5=A4=8D=E7=99=BE?= =?UTF-8?q?=E5=88=86=E6=AF=94=E6=A0=BC=E5=BC=8F=E6=97=A0=E6=B3=95=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E8=87=AA=E5=AE=9A=E4=B9=89=E5=90=8E=E7=BC=80=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/FormatPane.java | 77 +++++++++++-------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index 795c6d455..cf362f7f5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -6,6 +6,7 @@ import com.fr.base.Style; import com.fr.base.TextFormat; import com.fr.data.core.FormatField; import com.fr.data.core.FormatField.FormatContents; +import com.fr.design.i18n.Toolkit; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; @@ -36,20 +37,23 @@ import java.text.SimpleDateFormat; * @author zhou * @since 2012-5-24上午10:57:00 */ -public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver { +public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver { private static final long serialVersionUID = 724330854437726751L; - private static final int LABLE_X = 4; - private static final int LABLE_Y = 18; - private static final int LABLE_DELTA_WIDTH = 8; - private static final int LABLE_HEIGHT = 15; //标签背景的范围 + private static final int LABEL_X = 4; + private static final int LABEL_Y = 18; + private static final int LABEL_DELTA_WIDTH = 8; + private static final int LABEL_HEIGHT = 15; //标签背景的范围 private static final int CURRENCY_FLAG_POINT = 6; - private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0,30,0,0); + private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0, 30, 0, 0); - private static final Integer[] TYPES = new Integer[]{FormatContents.NULL, FormatContents.NUMBER, FormatContents.CURRENCY, FormatContents.PERCENT, FormatContents.SCIENTIFIC, - FormatContents.DATE, FormatContents.TIME, FormatContents.TEXT}; + private static final Integer[] TYPES = new Integer[]{ + FormatContents.NULL, FormatContents.NUMBER, + FormatContents.CURRENCY, FormatContents.PERCENT, + FormatContents.SCIENTIFIC, FormatContents.DATE, + FormatContents.TIME, FormatContents.TEXT}; - private static final Integer[] DATETYPES = new Integer[]{FormatContents.NULL, FormatContents.DATE, FormatContents.TIME,}; + private static final Integer[] DATE_TYPES = new Integer[]{FormatContents.NULL, FormatContents.DATE, FormatContents.TIME}; private Format format; @@ -61,7 +65,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs private JPanel centerPane; private JPanel formatFontPane; private FRFontPane frFontPane; - private boolean isRightFormate; + private boolean isRightFormat; private boolean isDate = false; private GlobalNameListener globalNameListener = null; @@ -78,7 +82,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs protected void initComponents(Integer[] types) { this.setLayout(new BorderLayout(0, 4)); - iniSampleLable(); + initSampleLabel(); contentPane = new JPanel(new BorderLayout(0, 4)) { @Override public Dimension getPreferredSize() { @@ -108,7 +112,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs frFontPane = new FRFontPane(); - UILabel font = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT); + UILabel font = new UILabel(Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT); JPanel fontPane = new JPanel(new BorderLayout()); fontPane.add(font, BorderLayout.NORTH); @@ -136,7 +140,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { return new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane}, new Component[]{centerPane, null}, new Component[]{fontPane, frFontPane}, }; @@ -155,24 +159,24 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs }; } - private void iniSampleLable() { - Border innterborder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4); - Font tmpFont = null; - Border border = BorderFactory.createTitledBorder(innterborder, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"), TitledBorder.LEFT, 0, tmpFont, UIConstants.LINE_COLOR); + private void initSampleLabel() { + Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4); + String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"); + Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, UIConstants.LINE_COLOR); sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()) { @Override public void paint(Graphics g) { super.paint(g); int width = getWidth(); - Color orignal = g.getColor(); + Color original = g.getColor(); g.setColor(getBackground()); - g.fillRect(LABLE_X, LABLE_Y, width - LABLE_DELTA_WIDTH, LABLE_HEIGHT); + g.fillRect(LABEL_X, LABEL_Y, width - LABEL_DELTA_WIDTH, LABEL_HEIGHT); g.setColor(UIConstants.LINE_COLOR); FontMetrics cellFM = g.getFontMetrics(); int textWidth = cellFM.stringWidth(getText()); GraphHelper.drawString(g, getText(), (width - textWidth) / 2, 26); - g.setColor(orignal); + g.setColor(original); } }; sampleLabel.setHorizontalAlignment(UILabel.CENTER); @@ -197,7 +201,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs * @return 标题 */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"); + return Toolkit.i18nText("Fine-Design_Report_Text"); } /** @@ -212,13 +216,9 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs if (format instanceof CoreDecimalFormat) { // check all value String pattern = ((CoreDecimalFormat) format).toPattern(); - boolean isCurrency1 = (pattern.length() > 0 && pattern.charAt(0) == '¤'); - boolean isCurrency2 = (pattern.length() > 0 && pattern.charAt(0) == '$'); - boolean isCurrency = isCurrency1 || isCurrency2; - boolean isCurrency4 = (pattern.length() > CURRENCY_FLAG_POINT && ComparatorUtils.equals(pattern.substring(0, CURRENCY_FLAG_POINT), "#,##0;")); - if (isCurrency || isCurrency4) { + if (isCurrencyFormatStyle(pattern)) { setPatternComboBoxAndList(FormatContents.CURRENCY, pattern); - } else if (pattern.endsWith("%")) { + } else if (pattern.indexOf("%") > 0) { setPatternComboBoxAndList(FormatContents.PERCENT, pattern); } else if (pattern.indexOf("E") > 0) { setPatternComboBoxAndList(FormatContents.SCIENTIFIC, pattern); @@ -238,6 +238,17 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs } } + private boolean isCurrencyFormatStyle(String pattern) { + if (pattern.length() == 0) { + return false; + } + + if (pattern.charAt(0) == '¤' || pattern.charAt(0) == '$') { + return true; + } + + return pattern.length() > CURRENCY_FLAG_POINT && pattern.startsWith("#,##0;"); + } /** * 判断是否是数组有模式 @@ -273,7 +284,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs if (getFormatContents() == FormatContents.TEXT) { return FormatField.getInstance().getFormat(getFormatContents(), patternString); } - if (isRightFormate) { + if (isRightFormat) { if (StringUtils.isNotEmpty(patternString)) { return FormatField.getInstance().getFormat(getFormatContents(), patternString); } @@ -292,7 +303,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs this.sampleLabel.setText(FormatField.getInstance().getFormatValue()); this.sampleLabel.setForeground(UIManager.getColor("Label.foreground")); try { - isRightFormate = true; + isRightFormat = true; if (StringUtils.isEmpty(String.valueOf(textField.getSelectedItem()))) { return; } @@ -300,7 +311,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs } catch (Exception e) { this.sampleLabel.setForeground(Color.red); this.sampleLabel.setText(e.getMessage()); - isRightFormate = false; + isRightFormat = false; } } @@ -401,8 +412,8 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs this.isDate = isDate; this.typeComboBox.setSelectedIndex(0); if (isDate) { - for (int i = 0; i < DATETYPES.length; i++) { - this.typeComboBox.addItem(DATETYPES[i]); + for (int i = 0; i < DATE_TYPES.length; i++) { + this.typeComboBox.addItem(DATE_TYPES[i]); } for (int i = 0; i < TYPES.length; i++) { this.typeComboBox.removeItemAt(1); @@ -411,7 +422,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs for (int i = 0; i < TYPES.length; i++) { this.typeComboBox.addItem(TYPES[i]); } - for (int i = 0; i < DATETYPES.length; i++) { + for (int i = 0; i < DATE_TYPES.length; i++) { this.typeComboBox.removeItemAt(1); } } From 5a5cf292138336b090c8d88609aee23361c139d9 Mon Sep 17 00:00:00 2001 From: zack Date: Sun, 15 Mar 2020 20:08:42 +0800 Subject: [PATCH 13/13] =?UTF-8?q?REPORT-25545=20=E5=A1=AB=E6=8A=A5?= =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/write/submit/DBManipulationPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 15e5aed4a..9df5d7916 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -701,7 +701,7 @@ public class DBManipulationPane extends BasicBeanPane { } jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()]; for (int i = 0; i < jobs.length; i++) { - jobs[i] = dmlConfig.getSubmitJob(i); + jobs[i] = dmlConfig.getNameSubmitJob(i); } condition = dmlConfig.getCondition(); UpdateCheckBox.setSelected(dmlConfig.isUpdateSelected());