From 0f4e9ca654a5b6754540b1a25fe2cb4a21e2e1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 22 Oct 2021 17:28:09 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-60538=20=E8=8B=B1=E6=97=A5?= =?UTF-8?q?=E9=9F=A9=E7=8E=AF=E5=A2=83=E6=9C=AA=E5=B1=8F=E8=94=BD=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=BB=84=E4=BB=B6=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormWidgetDetailPane.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index f2268c86cf..fd5b7305cb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ilable.UILabel; @@ -10,6 +11,7 @@ import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; +import com.fr.general.GeneralContext; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -23,6 +25,7 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * Created with IntelliJ IDEA. @@ -173,7 +176,14 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - paneList.add(OnlineWidgetRepoPane.getInstance()); + if (isAddOnlineWidgetRepoPane()) { + paneList.add(OnlineWidgetRepoPane.getInstance()); + } + } + + private boolean isAddOnlineWidgetRepoPane() { + Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); + return locale != null && GeneralContext.isChineseEnv(); } } From 02c5a3cacf9ab597cdc69606dfcf05d6eac466e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 22 Oct 2021 17:33:41 +0800 Subject: [PATCH 02/12] REPORT-60538 --- .../com/fr/design/mainframe/FormWidgetDetailPane.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index fd5b7305cb..da14659b66 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ilable.UILabel; @@ -25,7 +24,6 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.util.ArrayList; import java.util.List; -import java.util.Locale; /** * Created with IntelliJ IDEA. @@ -176,14 +174,8 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - if (isAddOnlineWidgetRepoPane()) { + if (GeneralContext.isChineseEnv()) { paneList.add(OnlineWidgetRepoPane.getInstance()); } } - - private boolean isAddOnlineWidgetRepoPane() { - Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); - return locale != null && GeneralContext.isChineseEnv(); - } - } From f9d27e98452dd8470e9f49e2306d695b591abffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:17:33 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-57521=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=B6websocket=E6=96=AD=E5=BC=80=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/toast/DesignerToastMsgUtil.java | 20 +++++-- .../mainframe/toast/ToastMsgDialog.java | 9 ++- .../mainframe/socketio/DesignerSocketIO.java | 58 ++++++++++++++----- 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java index 4e69c34c56..300f8537e2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java @@ -6,17 +6,17 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.Constants; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.Window; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JEditorPane; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Font; +import java.awt.Frame; +import java.awt.Window; /** * Created by kerry on 5/6/21 @@ -31,6 +31,13 @@ public class DesignerToastMsgUtil { } + public static ToastMsgDialog createPromptDialog(String text) { + return createDialog(PROMPT_ICON, toastPane(text), DesignerContext.getDesignerFrame()); + } + + public static ToastMsgDialog createPromptDialog(JPanel contentPane) { + return createDialog(PROMPT_ICON, contentPane, DesignerContext.getDesignerFrame()); + } public static void toastPrompt(JPanel contendPane) { toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame()); @@ -69,6 +76,11 @@ public class DesignerToastMsgUtil { } private static void toastPane(Icon icon, JPanel contendPane, Window parent) { + ToastMsgDialog dialog = createDialog(icon, contendPane, parent); + dialog.setVisible(true); + } + + private static ToastMsgDialog createDialog(Icon icon, JPanel contendPane, Window parent) { JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UILabel uiLabel = new UILabel(icon); uiLabel.setVerticalAlignment(SwingConstants.TOP); @@ -83,7 +95,7 @@ public class DesignerToastMsgUtil { } else { dialog = new ToastMsgDialog((Frame) parent, pane); } - dialog.setVisible(true); + return dialog; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java index 00f4f95ead..69865c7059 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java @@ -5,8 +5,8 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.module.ModuleContext; -import java.awt.Dialog; import javax.swing.JPanel; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Frame; import java.awt.Point; @@ -24,6 +24,7 @@ public class ToastMsgDialog extends UIDialog { private ScheduledExecutorService TIMER; private int hide_height = 0; private JPanel contentPane; + private boolean show = false; public ToastMsgDialog(Frame parent, JPanel panel) { super(parent); @@ -65,6 +66,7 @@ public class ToastMsgDialog extends UIDialog { public void display(JPanel outerJPanel) { + show = true; outerJPanel.setLocation(0, -hide_height); ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService(); TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() { @@ -98,6 +100,7 @@ public class ToastMsgDialog extends UIDialog { TIP_TOOL_TIMER.shutdown(); ToastMsgDialog.this.setVisible(false); ToastMsgDialog.this.dispose(); + ToastMsgDialog.this.show = false; } outerJPanel.setLocation(point.x, point.y - 5); Dimension dimension = ToastMsgDialog.this.getSize(); @@ -159,5 +162,7 @@ public class ToastMsgDialog extends UIDialog { super.dispose(); } - + public boolean isShow() { + return show; + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index fba15b0432..e6c3a24fe4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -3,15 +3,19 @@ package com.fr.design.mainframe.socketio; import com.fr.config.RemoteConfigEvent; import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.design.DesignerEnvManager; -import com.fr.design.EnvChangeEntrance; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfoContext; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.DesignerContext; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.loghandler.DesignerLogger; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.design.ui.util.UIUtil; +import com.fr.design.utils.BrowseUtils; import com.fr.event.EventDispatcher; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; @@ -29,20 +33,24 @@ import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo; -import com.fr.workspace.server.socket.SocketInfoOperator; import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import javax.net.ssl.SSLContext; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseEvent; import java.io.File; import java.io.FileInputStream; -import java.security.KeyStore; -import java.util.Arrays; -import javax.net.ssl.SSLContext; -import javax.swing.*; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.security.KeyStore; +import java.util.Arrays; import java.util.Timer; import java.util.TimerTask; @@ -54,6 +62,7 @@ public class DesignerSocketIO { Disconnecting } + private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("help.websocket", "https://help.fanruan.com/finereport/doc-view-2512.html"); private static final String HTTPS = "https"; private static final String HTTP = "http"; private static Socket socket = null; @@ -66,6 +75,7 @@ public class DesignerSocketIO { private static int count; // 当前webSocket选择的协议 private static String currentProtocol; + private static ToastMsgDialog dialog = null; public static void close() { @@ -185,6 +195,7 @@ public class DesignerSocketIO { private static final Emitter.Listener failRetry = new Emitter.Listener() { @Override public void call(Object... args) { + showConnectionLostDialog(); printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); status = Status.Disconnecting; socket.close(); @@ -251,13 +262,13 @@ public class DesignerSocketIO { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); + if (dialog == null) { + dialog = DesignerToastMsgUtil.createPromptDialog(createDialogContent()); + } + + if (!dialog.isShow()) { + dialog.setVisible(true); + } } }); } catch (Exception e) { @@ -265,6 +276,23 @@ public class DesignerSocketIO { } } + private static JPanel createDialogContent() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip")), BorderLayout.WEST); + UILabel hyperLinkLabel = new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip_HyperLink_Text")); + hyperLinkLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + BrowseUtils.browser(WEBSOCKET_HELP_DOC); + } + }); + hyperLinkLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); + hyperLinkLabel.setForeground(Color.BLUE); + hyperLinkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + jPanel.add(hyperLinkLabel, BorderLayout.CENTER); + return jPanel; + } + //配置变更监听器 private static final Emitter.Listener modifyConfig = new Emitter.Listener() { @Override From c8eafd75e8723d738795371a0f4ea4996ac98690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:19:31 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-60538=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index da14659b66..be32dc922a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -10,7 +10,6 @@ import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; -import com.fr.general.GeneralContext; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -174,8 +173,6 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - if (GeneralContext.isChineseEnv()) { - paneList.add(OnlineWidgetRepoPane.getInstance()); - } + paneList.add(OnlineWidgetRepoPane.getInstance()); } } From e3eac1175c6ec3a79255901e2dbe12365210bb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:20:07 +0800 Subject: [PATCH 05/12] =?UTF-8?q?REPORT-60538=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/FormWidgetDetailPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index be32dc922a..d17071f10a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -175,4 +175,5 @@ public class FormWidgetDetailPane extends FormDockView{ paneList.add(LocalWidgetRepoPane.getInstance()); paneList.add(OnlineWidgetRepoPane.getInstance()); } + } From 5db55bd0c726286ae572b4d739775b5bf1e0a03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:22:01 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-60538=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index d17071f10a..a82d6d74df 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -175,5 +175,5 @@ public class FormWidgetDetailPane extends FormDockView{ paneList.add(LocalWidgetRepoPane.getInstance()); paneList.add(OnlineWidgetRepoPane.getInstance()); } - -} + +} \ No newline at end of file From 340700014bc3c7f5bf8f7837c51a703e97f75316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:27:15 +0800 Subject: [PATCH 07/12] =?UTF-8?q?REPORT-57521=20=E7=AA=81=E7=84=B6?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E5=B7=B2=E7=BB=8F=E6=9C=89=E5=85=B3=E4=BA=8E?= =?UTF-8?q?websocket=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e6c3a24fe4..a6edb04083 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -62,7 +62,7 @@ public class DesignerSocketIO { Disconnecting } - private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("help.websocket", "https://help.fanruan.com/finereport/doc-view-2512.html"); + private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("websocketConnect", "https://help.fanruan.com/finereport/doc-view-2512.html"); private static final String HTTPS = "https"; private static final String HTTP = "http"; private static Socket socket = null; From 65a21b3de274ca339558a36e9d8d83d0c912cf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 14:05:18 +0800 Subject: [PATCH 08/12] =?UTF-8?q?REPORT-58584=20FR11-=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92-=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A0=8F-=E6=9C=8D=E5=8A=A1=E5=99=A8-=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86-=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E9=87=8D=E5=90=8D=E6=97=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/WidgetConfigPane.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index 0a981a90fa..78fd57d5da 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -1,24 +1,55 @@ package com.fr.design.widget; +import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.core.WidgetConstants; +import com.fr.design.i18n.Toolkit; import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetInfoConfig; +import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; +import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.SwingUtilities; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; +import static javax.swing.JOptionPane.WARNING_MESSAGE; + /** * Widget配置面板 */ public class WidgetConfigPane extends JListControlPane { + public WidgetConfigPane() { + this.addEditingListener(new PropertyChangeAdapter() { + public void propertyChange() { + Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); + if (!ComparatorUtils.equals(tempName, selectedName) + && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WidgetConfigPane.this), + Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), + WARNING_MESSAGE); + setIllegalIndex(editingIndex); + } + } + }); + } + /** * 创建用户自定义widget组件 * From 82bf9d3b2579ff0483011eb9d921153ac45dec77 Mon Sep 17 00:00:00 2001 From: "Fly.Li" Date: Fri, 29 Oct 2021 14:25:49 +0800 Subject: [PATCH 09/12] =?UTF-8?q?REPORT-61671=EF=BC=9A=E6=96=B0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=8A=A5=E8=A1=A8=E7=9A=84=E6=8A=A5=E8=A1=A8=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E5=B1=9E=E6=80=A7=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=97=B6=EF=BC=8C=E6=96=B0=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E9=80=89=E9=A1=B9=E4=B8=8B=E6=96=B9=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=87=BA=E7=8E=B0=E5=9B=BA=E5=AE=9A=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/ReportEnginePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index c2a959094a..6d1f2ef0a0 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -104,6 +104,7 @@ public class ReportEnginePane extends BasicBeanPane { engineSettingPane.setBounds(0, 0, 570, 240); createEngineXSettingPane(); createLineEngineSettingPane(); + outLineEngineSettingPane.setVisible(false); engineSettingPane.add(outEngineXSettingPane, JLayeredPane.DEFAULT_LAYER); engineSettingPane.add(outLineEngineSettingPane, JLayeredPane.DEFAULT_LAYER); engineSettingPane.moveToFront(outEngineXSettingPane); From 91523213fdcfdd34b4097b1515c106cbcaf24f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 14:31:17 +0800 Subject: [PATCH 10/12] REPORT-58584 --- .../gui/controlpane/JListControlPane.java | 33 +++++++++++++++++++ .../design/parameter/ParameterArrayPane.java | 24 +------------- .../fr/design/widget/WidgetConfigPane.java | 24 ++------------ 3 files changed, 36 insertions(+), 45 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 82cba758b7..8401ffad5c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -1,10 +1,14 @@ package com.fr.design.gui.controlpane; +import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ModNameActionListener; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.event.Listener; import com.fr.general.ComparatorUtils; @@ -12,6 +16,7 @@ import com.fr.general.IOUtils; import com.fr.invoke.Reflect; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.DefaultListCellRenderer; @@ -23,12 +28,16 @@ import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import java.util.Arrays; import java.util.Collection; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.util.List; + +import static javax.swing.JOptionPane.WARNING_MESSAGE; public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { private static final String LIST_NAME = "JControl_List"; @@ -424,4 +433,28 @@ public abstract class JListControlPane extends JControlPane implements ListContr } + public void showTipWithIllegalName(String tip) { + Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); + if (StringUtils.isEmpty(tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), + Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + setIllegalIndex(editingIndex); + return; + } + + if (!ComparatorUtils.equals(tempName, selectedName) + && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), + tip, + Toolkit.i18nText("Fine-Design_Basic_Alert"), + WARNING_MESSAGE); + setIllegalIndex(editingIndex); + } + } + } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index 2703a2a2b8..c5c7a12c9a 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -1,21 +1,15 @@ package com.fr.design.parameter; import com.fr.base.Parameter; -import com.fr.base.ParameterConfig; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.i18n.Toolkit; -import com.fr.general.ComparatorUtils; import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.*; import java.util.Arrays; -import java.util.List; public class ParameterArrayPane extends JListControlPane { @@ -29,23 +23,7 @@ public class ParameterArrayPane extends JListControlPane { this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (StringUtils.isEmpty(tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); - setIllegalIndex(editingIndex); - return; - } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), - Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); - setIllegalIndex(editingIndex); - } + showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); } }); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index 78fd57d5da..9ec4a1caf7 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -1,8 +1,5 @@ package com.fr.design.widget; -import com.fr.base.Parameter; -import com.fr.base.ParameterConfig; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; @@ -11,41 +8,24 @@ import com.fr.design.i18n.Toolkit; import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetInfoConfig; -import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.SwingUtilities; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; -import static javax.swing.JOptionPane.WARNING_MESSAGE; - /** * Widget配置面板 */ public class WidgetConfigPane extends JListControlPane { public WidgetConfigPane() { + super(); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WidgetConfigPane.this), - Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), - Toolkit.i18nText("Fine-Design_Basic_Alert"), - WARNING_MESSAGE); - setIllegalIndex(editingIndex); - } + showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure")); } }); } From 84d58cae82af6d5d9a0d06d07b6af056825fa898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 15:32:04 +0800 Subject: [PATCH 11/12] REPORT-58584 --- .../data/datapane/TableDataPaneListPane.java | 55 +++++++++---------- .../datapane/connect/ConnectionListPane.java | 38 +++++-------- .../gui/controlpane/JListControlPane.java | 53 ++++++++++++------ .../design/parameter/ParameterArrayPane.java | 18 +++++- .../fr/design/widget/WidgetConfigPane.java | 9 ++- 5 files changed, 98 insertions(+), 75 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 a16c16e24d..07d7abfb72 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 @@ -9,7 +9,6 @@ import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.gui.NameInspector; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.ilist.ListModelElement; @@ -25,18 +24,18 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; - import com.fr.third.org.apache.commons.collections4.MapUtils; import com.fr.workspace.WorkContext; -import javax.swing.*; + +import javax.swing.DefaultListModel; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; /** * TableDataList Pane. @@ -52,15 +51,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData @Override public void propertyChange() { isNamePermitted = true; - String tempName = getEditingName(); - if (ComparatorUtils.equals(tempName, selectedName)) { - //说明双击之后又取消了,啥也不用做 + if (!checkName()) { + isNamePermitted = false; return; } - Set allDSNames = DesignTableDataManager.getGlobalDataSet().keySet(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); Object editingType = getEditingType(); if (!BasicTableDataUtils.checkName(tempName)) { @@ -70,35 +66,36 @@ public class TableDataPaneListPane extends JListControlPane implements TableData return; } - if (StringUtils.isEmpty(tempName)) { - isNamePermitted = false; - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), - Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"), - Toolkit.i18nText("Fine-Design_Report_Alert"), - JOptionPane.WARNING_MESSAGE); - setIllegalIndex(editingIndex); - return; - } - boolean isRepeated = isNameRepeated(new Collection[]{allDSNames, Arrays.asList(allListNames)}, tempName); - if (isRepeated) { - isNamePermitted = false; - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName)); - setIllegalIndex(editingIndex); - } else if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) { + if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) { isNamePermitted = false; nameableList.stopEditing(); FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Stored_Procedure_Name_Tips")); setIllegalIndex(editingIndex); + return; } + if (nameableList.getSelectedValue() instanceof ListModelElement) { - rename(selectedName, isRepeated ? NameInspector.ILLEGAL_NAME_HOLDER : tempName); + rename(selectedName, tempName); } } }); } + @Override + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"); + } + + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", getEditingName()); + } + + @Override + public Collection getExtraItemsToCheckNameRepeat() { + return DesignTableDataManager.getGlobalDataSet().keySet(); + } + @Override public void rename(String oldName, String newName) { //如果a改成了b,b又被改成了c,就认为是a改成了c 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 4ce851295d..5792af06d8 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 @@ -7,7 +7,6 @@ import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.fun.ConnectionProvider; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; @@ -15,21 +14,18 @@ import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.i18n.Toolkit; import com.fr.event.EventDispatcher; import com.fr.file.ConnectionConfig; -import com.fr.general.ComparatorUtils; +import com.fr.file.ConnectionOperator; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; - import com.fr.third.org.apache.commons.collections4.MapUtils; import com.fr.workspace.WorkContext; -import com.fr.file.ConnectionOperator; + import java.awt.Window; -import javax.swing.*; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -48,32 +44,24 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { isNamePermitted = true; - String[] allListNames = nameableList.getAllNames(); - allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (StringUtils.isEmpty(tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name")); - setIllegalIndex(editingIndex); + if (!checkName()) { isNamePermitted = false; return; } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(allListNames)}, tempName)) { - isNamePermitted = false; - nameableList.stopEditing(); - String message = Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", tempName); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message); - setIllegalIndex(editingIndex); - } - if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) { - rename(selectedName, tempName); - } - + rename(selectedName, getEditingName()); } }); } + @Override + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name"); + } + + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", getEditingName()); + } protected void rename(String oldName, String newName) { //如果a改成了b,b又被改成了c,就认为是a改成了c diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 8401ffad5c..ee05422caa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -1,7 +1,5 @@ package com.fr.design.gui.controlpane; -import com.fr.base.Parameter; -import com.fr.base.ParameterConfig; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icontainer.UIScrollPane; @@ -28,14 +26,14 @@ import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.util.Arrays; -import java.util.Collection; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import static javax.swing.JOptionPane.WARNING_MESSAGE; @@ -433,28 +431,47 @@ public abstract class JListControlPane extends JControlPane implements ListContr } - public void showTipWithIllegalName(String tip) { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; + public boolean checkName() { String tempName = getEditingName(); + if (ComparatorUtils.equals(tempName, selectedName)) { + return false; + } + if (StringUtils.isEmpty(tempName)) { nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), - Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + showWarningDialog(getEmptyNameTip()); setIllegalIndex(editingIndex); - return; + return false; } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + if (isNameRepeated(new Collection[]{getExtraItemsToCheckNameRepeat(), Arrays.asList(allListNames)}, tempName)) { nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), - tip, - Toolkit.i18nText("Fine-Design_Basic_Alert"), - WARNING_MESSAGE); + showWarningDialog(getDuplicatedNameTip()); setIllegalIndex(editingIndex); + return false; } + return true; + } + + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des"); + } + + public String getDuplicatedNameTip() { + return StringUtils.EMPTY; + } + + public Collection getExtraItemsToCheckNameRepeat() { + return new ArrayList(); + } + + private void showWarningDialog(String tip) { + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), + tip, + Toolkit.i18nText("Fine-Design_Basic_Alert"), + WARNING_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index c5c7a12c9a..22211acff1 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -1,6 +1,7 @@ package com.fr.design.parameter; import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; @@ -10,6 +11,7 @@ import com.fr.stable.Nameable; import com.fr.stable.core.PropertyChangeAdapter; import java.util.Arrays; +import java.util.Collection; public class ParameterArrayPane extends JListControlPane { @@ -23,11 +25,25 @@ public class ParameterArrayPane extends JListControlPane { this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); + checkName(); } }); } + @Override + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name"); + } + + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name"); + } + + @Override + public Collection getExtraItemsToCheckNameRepeat() { + return Arrays.asList(ParameterConfig.getInstance().getGlobalParameters()); + } @Override protected String title4PopupWindow() { diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index 9ec4a1caf7..c2d7be0e16 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -25,12 +25,17 @@ public class WidgetConfigPane extends JListControlPane { super(); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure")); + checkName(); } }); } - /** + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"); + } + + /** * 创建用户自定义widget组件 * * @return 组件面板 From 13e54b514ebd25548e19dd8280592d704cde4c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 16:05:10 +0800 Subject: [PATCH 12/12] =?UTF-8?q?REPORT-58584=20FR11-=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92-=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A0=8F-=E6=9C=8D=E5=8A=A1=E5=99=A8-=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86-=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E9=87=8D=E5=90=8D=E6=97=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/widget/WidgetConfigPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index c2d7be0e16..bc6764b91f 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -32,7 +32,7 @@ public class WidgetConfigPane extends JListControlPane { @Override public String getDuplicatedNameTip() { - return Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"); + return Toolkit.i18nText("Fine_Design_Predefine_Widget_Name_Duplicated"); } /**