From b14d2905e2e97b9356bdc56a555edcea1e6aa1de Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 24 Aug 2021 14:15:48 +0800 Subject: [PATCH 01/15] =?UTF-8?q?REPORT-57872=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86-=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E5=88=97=E5=90=8D=E4=B9=8B=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E5=88=86=E9=9A=94=E7=AC=A6=E6=B2=A1=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/CopyableJTable.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java index 7baf51ddd..eb8d188a1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java @@ -48,9 +48,17 @@ public class CopyableJTable extends SortableJTable { boolean mouseDrag = false; boolean headerSelect = false; - DefaultTableCellRenderer tableHeaderCellRenderer = new DefaultTableCellRenderer() { + + class CopyableTableHeaderCellRenderer implements TableCellRenderer { + TableCellRenderer tableCellRenderer; + + CopyableTableHeaderCellRenderer(TableCellRenderer tableCellRenderer) { + this.tableCellRenderer = tableCellRenderer; + } + + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + JComponent comp = (JComponent) this.tableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (isChoose(row, column)) { comp.setBackground(selectBackGround); } else { @@ -58,13 +66,13 @@ public class CopyableJTable extends SortableJTable { } return comp; } - }; + } public CopyableJTable(TableSorter tableModel) { super(tableModel); initListener(); - this.getTableHeader().setDefaultRenderer(tableHeaderCellRenderer); + this.getTableHeader().setDefaultRenderer(new CopyableTableHeaderCellRenderer(this.getTableHeader().getDefaultRenderer())); } private void initListener() { From e95103a9418292c7161f0b402bfbc84ca0479990 Mon Sep 17 00:00:00 2001 From: xiqiu Date: Tue, 24 Aug 2021 16:31:13 +0800 Subject: [PATCH 02/15] =?UTF-8?q?REPORT-57979=20=20=E5=89=8D=E9=9D=A2=3D?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=E4=BA=86=EF=BC=8Cset=E6=B2=A1=E6=84=8F?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index aaa02f9af..5a8c13889 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -511,7 +511,6 @@ public class JDBCDefPane extends JPanel { this.dbtypeComboBox.setSelectedItem(OTHER_DB); } } - this.jdbcDatabase.setIdentity(jdbcDatabase.getIdentity()); // jdbcDatabase.getDriverSource() 只会是空或者是有值,但是为了保险起见,还是应该做个处理 String driverSource = jdbcDatabase.getDriverSource(); if (driverSource == null) { From b3910bc86f8be33dd5cebf60e362a7ab26820ccc Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 24 Aug 2021 17:48:15 +0800 Subject: [PATCH 03/15] =?UTF-8?q?REPORT-57561=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=8D=E4=B8=80=E8=87=B4=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=94=A8=E7=9A=84=E6=8F=90=E7=A4=BA-?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E8=BF=9E=E6=8E=A5=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/module/DesignerWorkspaceProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index d5b6cdb63..f1e1ec5a2 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -63,12 +63,12 @@ public class DesignerWorkspaceProvider extends Activator { } else { WorkContext.switchTo(workspace); //在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可 - final DesignerWorkspaceInfo selectEnv = workspaceInfo; + final String selectEnv = current; EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { @Override public void on(Event event, Null aNull) { try { - VersionCheckUtils.showVersionCheckDialog(selectEnv.getName()); + VersionCheckUtils.showVersionCheckDialog(selectEnv); } catch (Exception e) { FineLoggerFactory.getLogger().warn("Check Service Failed"); } From f5d21272b7599292b0fa770ee907c04ec0ce5277 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 20 Aug 2021 10:04:16 +0800 Subject: [PATCH 04/15] =?UTF-8?q?REPORT-55048=20https=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=8A=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A8=E9=80=81=E8=BF=87=E6=9D=A5=E7=9A=84eventhrea?= =?UTF-8?q?d=E7=BA=BF=E7=A8=8B=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 124 +++++++++++++++--- 1 file changed, 103 insertions(+), 21 deletions(-) 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 157ce6f98..c1e994bdc 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 @@ -5,29 +5,39 @@ 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.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogger; import com.fr.design.ui.util.UIUtil; -import com.fr.event.Event; import com.fr.event.EventDispatcher; -import com.fr.event.Listener; +import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; +import com.fr.third.org.apache.http.conn.ssl.NoopHostnameVerifier; +import com.fr.third.org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import com.fr.third.org.apache.http.ssl.SSLContexts; +import com.fr.web.WebSocketConfig; +import com.fr.web.socketio.WebSocketProtocol; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; -import com.fr.workspace.WorkspaceEvent; 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 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; @@ -37,26 +47,14 @@ import java.util.TimerTask; public class DesignerSocketIO { - - static { - EventDispatcher.listen(WorkspaceEvent.LostConnect, new Listener() { - @Override - public void on(Event event, Workspace param) { - // 远程设计websocket不支持wss 所以断开无法提醒 - // 使用远程设计的心跳断开来提醒断开 - if (DesignerEnvManager.getEnvManager().isHttps()) { - showConnectionLostDialog(); - } - } - }); - } - enum Status { Connected, Disconnected, Disconnecting } + private static final String HTTPS = "https"; + private static final String HTTP = "http"; private static Socket socket = null; private static Status status = Status.Disconnected; private static Timer disConnectHintTimer = null; @@ -65,6 +63,8 @@ public class DesignerSocketIO { private static String[] uri; //维护一个关于uri列表的计数器 private static int count; + // 当前webSocket选择的协议 + private static String currentProtocol; public static void close() { @@ -95,7 +95,7 @@ public class DesignerSocketIO { //根据uri和计数器建立连接,并注册监听 try { if (count < uri.length) { - socket = IO.socket(new URI(uri[count])); + socket = IO.socket(new URI(uri[count]), createOptions()); socket.on(WorkspaceConstants.WS_LOGRECORD, printLog); socket.on(WorkspaceConstants.CONFIG_MODIFY, modifyConfig); socket.on(Socket.EVENT_CONNECT_ERROR, failRetry); @@ -112,15 +112,54 @@ public class DesignerSocketIO { } } + private static IO.Options createOptions() { + IO.Options options = new IO.Options(); + try { + if (ComparatorUtils.equals(currentProtocol, HTTPS)) { + options.sslContext = getSSLContext(); + options.hostnameVerifier = NoopHostnameVerifier.INSTANCE; + options.secure = true; + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return options; + } + + private static SSLContext getSSLContext() throws Exception { + String currentName = DesignerEnvManager.getEnvManager().getCurEnvName(); + DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName); + WorkspaceConnectionInfo connection = info.getConnection(); + String certPath = connection.getCertPath(); + String certSecretKey = connection.getCertSecretKey(); + if (StringUtils.isBlank(certPath) || StringUtils.isBlank(certSecretKey)) { + return SSLContexts.createDefault(); + } + KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); + try (FileInputStream keystore = new FileInputStream(new File(certPath))) { + trustStore.load(keystore, certSecretKey.toCharArray()); + } + return SSLContexts.custom() + .loadTrustMaterial(trustStore, new TrustSelfSignedStrategy()) + .build(); + } + private static String[] getSocketUri() throws IOException { Workspace current = WorkContext.getCurrent(); URL url = new URL(current.getPath()); Integer[] ports = current.get(SocketInfoOperator.class).getPort(); WorkspaceConnection connection = current.getConnection(); + // 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置 + WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol(); + currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS; + if (WebSocketConfig.getInstance().isUsingProxy()) { + // 如果配置了代理服务器跟随服务器协议 + currentProtocol = url.getProtocol(); + } String[] result = new String[ports.length]; for (int i = 0; i < ports.length; i++) { result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", - url.getProtocol(), + currentProtocol, url.getHost(), ports[i], WorkspaceConstants.WS_NAMESPACE, @@ -129,6 +168,7 @@ public class DesignerSocketIO { RemoteDesignConstants.USER_LOCK_ID, connection.getId()); } + FineLoggerFactory.getLogger().error("Available ports: {}, current Protocol: {}", Arrays.toString(ports), currentProtocol); return result; } @@ -136,7 +176,7 @@ public class DesignerSocketIO { private static final Emitter.Listener failRetry = new Emitter.Listener() { @Override public void call(Object... args) { - FineLoggerFactory.getLogger().warn("failed args: {}", Arrays.toString(args)); + printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); status = Status.Disconnecting; socket.close(); count++; @@ -183,7 +223,7 @@ public class DesignerSocketIO { * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, * socket 只用推日志和通知配置变更 */ - FineLoggerFactory.getLogger().error("disConnected args: {}", Arrays.toString(objects)); + printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); if (status != Status.Disconnecting) { showConnectionLostDialog(); } @@ -226,4 +266,46 @@ public class DesignerSocketIO { } }; + private static void printLog(Object[] objects, PrintEventLog printEventLog, String prefix) { + for (Object object : objects) { + if (object instanceof Throwable) { + Throwable throwable = (Throwable) object; + printEventLog.printThrowable(throwable.getMessage(), throwable); + } else { + printEventLog.print(prefix, object); + } + } + } + + interface PrintEventLog { + void printThrowable(String s, Throwable throwable); + void print(String s, Object ...object); + } + + enum PrintEventLogImpl implements PrintEventLog { + ERROR { + @Override + public void printThrowable(String s, Throwable throwable) { + FineLoggerFactory.getLogger().error(s, throwable); + } + + @Override + public void print(String s, Object... object) { + FineLoggerFactory.getLogger().error(s, object); + } + }, + + WARN { + @Override + public void printThrowable(String s, Throwable throwable) { + FineLoggerFactory.getLogger().warn(s, throwable); + } + + @Override + public void print(String s, Object... object) { + FineLoggerFactory.getLogger().warn(s, object); + } + }; + } + } From 23bab19229ad582e5739fbd05eaf445d8dd3a480 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 24 Aug 2021 18:43:38 +0800 Subject: [PATCH 05/15] =?UTF-8?q?REPORT-55048=20https=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=8A=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A8=E9=80=81=E8=BF=87=E6=9D=A5=E7=9A=84eventhrea?= =?UTF-8?q?d=E7=BA=BF=E7=A8=8B=E6=97=A5=E5=BF=97=20fix=20npe=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 2 ++ .../env/DesignerWorkspaceInfoContext.java | 20 +++++++++++++++++++ .../mainframe/socketio/DesignerSocketIO.java | 15 +++++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfoContext.java diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 6881c8445..cd9c835f3 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -8,6 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.DesignerWorkspaceInfoContext; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.env.RemoteWorkspace; @@ -105,6 +106,7 @@ public class EnvChangeEntrance { private boolean switch2Env(final String envName, PopTipStrategy strategy) { DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); + DesignerWorkspaceInfoContext.setWorkspaceInfo(selectedEnv); WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); try { diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfoContext.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfoContext.java new file mode 100644 index 000000000..ba8a5b09f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfoContext.java @@ -0,0 +1,20 @@ +package com.fr.design.env; + +/** + * + * @author hades + * @version 10.0 + * Created by hades on 2021/8/24 + */ +public class DesignerWorkspaceInfoContext { + + private static DesignerWorkspaceInfo workspaceInfo; + + public static DesignerWorkspaceInfo getWorkspaceInfo() { + return workspaceInfo; + } + + public static void setWorkspaceInfo(DesignerWorkspaceInfo workspaceInfo) { + DesignerWorkspaceInfoContext.workspaceInfo = workspaceInfo; + } +} 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 c1e994bdc..5f3e57b26 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 @@ -6,6 +6,7 @@ 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.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogger; @@ -127,9 +128,7 @@ public class DesignerSocketIO { } private static SSLContext getSSLContext() throws Exception { - String currentName = DesignerEnvManager.getEnvManager().getCurEnvName(); - DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName); - WorkspaceConnectionInfo connection = info.getConnection(); + WorkspaceConnectionInfo connection = getConnectionInfo(); String certPath = connection.getCertPath(); String certSecretKey = connection.getCertSecretKey(); if (StringUtils.isBlank(certPath) || StringUtils.isBlank(certSecretKey)) { @@ -144,6 +143,16 @@ public class DesignerSocketIO { .build(); } + private static WorkspaceConnectionInfo getConnectionInfo() { + if (DesignerWorkspaceInfoContext.getWorkspaceInfo() == null) { + String currentName = DesignerEnvManager.getEnvManager().getCurEnvName(); + DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName); + return info.getConnection(); + } else { + return DesignerWorkspaceInfoContext.getWorkspaceInfo().getConnection(); + } + } + private static String[] getSocketUri() throws IOException { Workspace current = WorkContext.getCurrent(); URL url = new URL(current.getPath()); From 0c7550a04b73379be262b05708c35f392cfe16bd Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 24 Aug 2021 18:45:19 +0800 Subject: [PATCH 06/15] =?UTF-8?q?REPORT-57490=20websocket=E6=96=AD?= =?UTF-8?q?=E5=BC=80=E6=97=B6=E5=BC=B9=E7=AA=97=E4=BD=8D=E7=BD=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= 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 5f3e57b26..648d7cdde 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 @@ -248,7 +248,7 @@ public class DesignerSocketIO { private static void showConnectionLostDialog() { try { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { FineJOptionPane.showMessageDialog( From 9992d53bf2b5f226ed5a6f6087affd04edb9c25f Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 24 Aug 2021 19:48:29 +0800 Subject: [PATCH 07/15] =?UTF-8?q?REPORT-55048=20fix=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8B=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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 648d7cdde..782c7f35d 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 @@ -161,10 +161,6 @@ public class DesignerSocketIO { // 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置 WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol(); currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS; - if (WebSocketConfig.getInstance().isUsingProxy()) { - // 如果配置了代理服务器跟随服务器协议 - currentProtocol = url.getProtocol(); - } String[] result = new String[ports.length]; for (int i = 0; i < ports.length; i++) { result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", @@ -279,7 +275,7 @@ public class DesignerSocketIO { for (Object object : objects) { if (object instanceof Throwable) { Throwable throwable = (Throwable) object; - printEventLog.printThrowable(throwable.getMessage(), throwable); + printEventLog.printThrowable(throwable); } else { printEventLog.print(prefix, object); } @@ -287,15 +283,15 @@ public class DesignerSocketIO { } interface PrintEventLog { - void printThrowable(String s, Throwable throwable); + void printThrowable(Throwable throwable); void print(String s, Object ...object); } enum PrintEventLogImpl implements PrintEventLog { ERROR { @Override - public void printThrowable(String s, Throwable throwable) { - FineLoggerFactory.getLogger().error(s, throwable); + public void printThrowable(Throwable throwable) { + FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable); } @Override @@ -306,8 +302,8 @@ public class DesignerSocketIO { WARN { @Override - public void printThrowable(String s, Throwable throwable) { - FineLoggerFactory.getLogger().warn(s, throwable); + public void printThrowable(Throwable throwable) { + FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable); } @Override From 8857a2d07f7d6f5af7594b7afdb9990370136480 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 24 Aug 2021 20:22:08 +0800 Subject: [PATCH 08/15] =?UTF-8?q?REPORT-57590=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E5=89=AA=E5=88=87=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E6=8C=89=E9=92=AE=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/actions/CopyAction.java | 5 ++--- .../designer/beans/actions/CutAction.java | 3 ++- .../beans/actions/FormDeleteAction.java | 6 ++---- .../beans/actions/behavior/CopyableEnable.java | 16 ++++++++++++++++ .../beans/actions/behavior/CutableEnable.java | 16 ++++++++++++++++ .../beans/actions/behavior/DeletableEnable.java | 16 ++++++++++++++++ .../design/form/parameter/FormParaDesigner.java | 8 ++++++++ .../com/fr/design/mainframe/FormDesigner.java | 17 +++++++++++++++++ 8 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CopyableEnable.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CutableEnable.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/DeletableEnable.java diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java index c577a8693..b71def807 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java @@ -1,8 +1,7 @@ package com.fr.design.designer.beans.actions; - import com.fr.design.base.mode.DesignModeContext; -import com.fr.design.designer.beans.actions.behavior.ComponentEnable; +import com.fr.design.designer.beans.actions.behavior.CopyableEnable; import com.fr.design.mainframe.FormDesigner; import javax.swing.KeyStroke; @@ -18,7 +17,7 @@ public class CopyAction extends FormWidgetEditAction { this.setMnemonic('C'); this.setSmallIcon("/com/fr/design/images/m_edit/copy"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); - setUpdateBehavior(new ComponentEnable()); + setUpdateBehavior(new CopyableEnable()); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java index e93eebd72..94c84a87d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java @@ -3,6 +3,7 @@ package com.fr.design.designer.beans.actions; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.beans.actions.behavior.ComponentEnable; +import com.fr.design.designer.beans.actions.behavior.CutableEnable; import com.fr.design.mainframe.FormDesigner; import javax.swing.KeyStroke; @@ -18,7 +19,7 @@ public class CutAction extends FormWidgetEditAction { this.setMnemonic('T'); this.setSmallIcon("/com/fr/design/images/m_edit/cut"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); - this.setUpdateBehavior(new ComponentEnable()); + this.setUpdateBehavior(new CutableEnable()); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java index 5f9a59de5..c2fec8f39 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java @@ -7,9 +7,7 @@ import java.awt.event.KeyEvent; import javax.swing.*; - -import com.fr.design.designer.beans.actions.behavior.ComponentEnable; - +import com.fr.design.designer.beans.actions.behavior.DeletableEnable; import com.fr.design.mainframe.FormDesigner; /** @@ -26,7 +24,7 @@ public class FormDeleteAction extends FormWidgetEditAction { // Richie:删除菜单图标 this.setSmallIcon("/com/fr/design/images/m_report/delete"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)); - this.setUpdateBehavior(new ComponentEnable()); + this.setUpdateBehavior(new DeletableEnable()); } @Override diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CopyableEnable.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CopyableEnable.java new file mode 100644 index 000000000..ce3254ea8 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CopyableEnable.java @@ -0,0 +1,16 @@ +package com.fr.design.designer.beans.actions.behavior; + +import com.fr.design.designer.beans.actions.FormWidgetEditAction; +import com.fr.design.mainframe.FormDesigner; + +public class CopyableEnable implements UpdateBehavior { + @Override + public void doUpdate(FormWidgetEditAction action) { + FormDesigner designer = action.getEditingComponent(); + if (designer == null) { + action.setEnabled(false); + return; + } + action.setEnabled(designer.isCurrentComponentCopyable()); + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CutableEnable.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CutableEnable.java new file mode 100644 index 000000000..7a6320227 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CutableEnable.java @@ -0,0 +1,16 @@ +package com.fr.design.designer.beans.actions.behavior; + +import com.fr.design.designer.beans.actions.FormWidgetEditAction; +import com.fr.design.mainframe.FormDesigner; + +public class CutableEnable implements UpdateBehavior { + @Override + public void doUpdate(FormWidgetEditAction action) { + FormDesigner designer = action.getEditingComponent(); + if (designer == null) { + action.setEnabled(false); + return; + } + action.setEnabled(designer.isCurrentComponentCutable()); + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/DeletableEnable.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/DeletableEnable.java new file mode 100644 index 000000000..669582676 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/DeletableEnable.java @@ -0,0 +1,16 @@ +package com.fr.design.designer.beans.actions.behavior; + +import com.fr.design.designer.beans.actions.FormWidgetEditAction; +import com.fr.design.mainframe.FormDesigner; + +public class DeletableEnable implements UpdateBehavior { + @Override + public void doUpdate(FormWidgetEditAction action) { + FormDesigner designer = action.getEditingComponent(); + if (designer == null) { + action.setEnabled(false); + return; + } + action.setEnabled(designer.isCurrentComponentDeletable()); + } +} diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index 0ac74e5b5..20f8203ac 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -745,5 +745,13 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return false; } + @Override + public boolean isCurrentComponentCutable() { + return !isRootSelected(); + } + @Override + public boolean isCurrentComponentCopyable() { + return !isRootSelected(); + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index d193b6774..bb05796dd 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1266,6 +1266,11 @@ public class FormDesigner extends TargetComponent
implements TreeSelection return isForm || isRoot(getSelectionModel().getSelection().getSelectedCreator()); } + public boolean isParameterSelected() { + XCreator xCreator = getSelectionModel().getSelection().getSelectedCreator(); + return xCreator != null && xCreator.acceptType(XWParameterLayout.class); + } + /** * 显示权限编辑界面 */ @@ -1384,6 +1389,18 @@ public class FormDesigner extends TargetComponent implements TreeSelection } } + public boolean isCurrentComponentCutable() { + return !(isRootSelected() || isParameterSelected()); + } + + public boolean isCurrentComponentCopyable() { + return !(isRootSelected() || isParameterSelected()); + } + + public boolean isCurrentComponentDeletable() { + return !isRootSelected(); + } + // 当前选中控件可以上移一层吗? public boolean isCurrentComponentMovableUp() { XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); From f94fb4cbcc881b4f84660e111ca058f3a4bc2ff8 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 24 Aug 2021 22:00:54 +0800 Subject: [PATCH 09/15] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrameFileDealerPane.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 fe2589028..c95a2451e 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 @@ -7,6 +7,7 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -352,6 +353,11 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt @Override public void actionPerformed(ActionEvent e) { + if (DesignModeContext.isAuthorityEditing()) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Quit_Authority_Edit_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); + return; + } String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath(); path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, path); From bbef610501613c581cce192a06821e4f5df649c4 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 25 Aug 2021 10:25:56 +0800 Subject: [PATCH 10/15] =?UTF-8?q?REPORT-57568=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=A0=91=E5=B1=95=E5=BC=80=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=89=93=E5=BC=80=E6=A8=A1=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/TemplateTreePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 0fc3ca728..2c0d860fb 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -83,7 +83,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { @Override public void mousePressed(MouseEvent evt) { - if (evt.getClickCount() == 2) { + if (reportletsTree.getPathForLocation(evt.getX(), evt.getY()) != null && evt.getClickCount() == 2) { openFile(); } } From c45444606650526f49c0d1a163a709bac249e6de Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 25 Aug 2021 10:35:03 +0800 Subject: [PATCH 11/15] =?UTF-8?q?REPORT-56047=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8B=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA=E5=AE=89?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/env/LocalDesignerWorkspaceInfo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index 6bb8ec37a..a7d6eb6c1 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -3,6 +3,7 @@ package com.fr.design.env; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.locale.InterProviderFactory; +import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; @@ -107,7 +108,7 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR)); // 非安装版本允许自由切换 - boolean notExistLib = !ComparatorUtils.equals(GeneralUtils.readFullBuildNO(), InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build")) + boolean notExistLib = !CoreConstants.DOT.equals(StableUtils.getInstallHome()) && !engineLib.exists(); if (notExistLib) { throw new MainVersionNotMatchException(); From 27238f73cca2804d677d10c2d927d52bdcea9dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 25 Aug 2021 10:57:02 +0800 Subject: [PATCH 12/15] =?UTF-8?q?REPORT-57449=20=E3=80=90FR11=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E3=80=90=E5=BC=80=E5=8F=91=E8=80=85=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=94=AF=E6=8C=81=E8=B0=83=E6=95=B4=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E3=80=91=E6=96=B0=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?-=E8=BF=9C=E7=A8=8B=E7=8E=AF=E5=A2=83=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E5=BC=80=E5=8F=91=E8=80=85=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=AB=AF=E6=AD=A4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA=E5=B7=B2?= =?UTF-8?q?=E9=94=81=E5=AE=9A=EF=BC=8C=E5=8F=8C=E5=87=BB=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=BC=9A=E5=BC=B9=E5=87=BA=E5=B7=B2=E9=94=81=E5=AE=9A=E7=9A=84?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=EF=BC=8C=E4=BD=86=E4=BC=9A=E6=89=93=E5=BC=80?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=99=BD=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E6=AD=A4=E6=97=B6=E6=A8=A1=E6=9D=BF=E6=89=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E2=80=9C=E5=B7=B2=E9=94=81=E5=AE=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/form/util/FormDesignerUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index ded4e7c99..4c1f9304b 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -36,6 +36,9 @@ public class FormDesignerUtils { * @return */ public static boolean isBodyAbsolute(FormDesigner designer) { + if (!designer.getRootComponent().acceptType(XWFitLayout.class)) { + return false; + } WFitLayout root = ((WFitLayout) designer.getRootComponent().toData()); return root.getBodyLayoutType() == com.fr.form.ui.container.WBodyLayoutType.ABSOLUTE; } From 79f4f1ff94601887d5e63a9485679cecf3775fb4 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 25 Aug 2021 11:05:25 +0800 Subject: [PATCH 13/15] REPORT-57816 REPORT-57816 --- .../com/fr/design/gui/controlpane/UIControlPane.java | 5 +++++ .../gui/ifilechooser/JavaFxNativeFileChooser.java | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index b15b9eab9..648cb03f3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.controlpane; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; +import com.fr.design.gui.ifilechooser.JavaFxNativeFileChooser; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; @@ -277,6 +278,10 @@ public abstract class UIControlPane extends JControlPane { this.requestFocus(); return; } + if (JavaFxNativeFileChooser.isShowDialogState()) { + JavaFxNativeFileChooser.setShowDialogState(false); + return; + } saveSettings(); setVisible(false); PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); 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 038212bfd..8be467810 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 @@ -24,6 +24,7 @@ import java.util.List; import java.util.concurrent.CountDownLatch; public class JavaFxNativeFileChooser implements FileChooserProvider { + private static boolean showDialogState = false; private File[] selectedFiles = new File[0]; private FileSelectionMode fileSelectionMode = FileSelectionMode.FILE; private String title = Toolkit.i18nText("Fine-Design_Basic_Open"); @@ -43,8 +44,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { return null; } + public static boolean isShowDialogState() { + return showDialogState; + } + + public static void setShowDialogState(boolean showDialogState) { + JavaFxNativeFileChooser.showDialogState = showDialogState; + } + @Override public int showDialog(Component parent) { + setShowDialogState(true); final CountDownLatch latch = new CountDownLatch(1); PlatformImpl.startup(() -> { }); From a37e822df7b15fad88d8d047b90c07e89f9b784e Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 25 Aug 2021 15:30:32 +0800 Subject: [PATCH 14/15] =?UTF-8?q?REPORT-57898=20=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrameFileDealerPane.java | 6 ------ 1 file changed, 6 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 c95a2451e..fe2589028 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 @@ -7,7 +7,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; -import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -353,11 +352,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt @Override public void actionPerformed(ActionEvent e) { - if (DesignModeContext.isAuthorityEditing()) { - FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Quit_Authority_Edit_Tip"), - Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); - return; - } String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath(); path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, path); From 2b2728247684d7a04636dabfafb8fb8adf222eee Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 25 Aug 2021 18:15:54 +0800 Subject: [PATCH 15/15] =?UTF-8?q?REPORT-57590=20=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=A8=A1=E5=90=8E=E6=9D=BF?= =?UTF-8?q?=E4=B8=8A=E6=96=B9=E7=9A=84=E5=B7=A5=E5=85=B7=E6=A0=8F=E4=B9=9F?= =?UTF-8?q?=E8=A6=81=E7=A6=81=E7=94=A8=E5=89=AA=E5=88=87=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/FormDesigner.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index bb05796dd..73085231a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -109,6 +109,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection Arrays.asList(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")}) ); + protected static final ArrayList PARAMETER_TOOLAR_BAN_LIST = new ArrayList( + Arrays.asList(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")}) + ); + private double scale = 1.0D; //底层容器的默认大小 @@ -1304,6 +1308,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection protected void setToolbarButtons() { //自适应布局和底层都不能删除 DesignerContext.getDesignerFrame().checkCombineUp(!isRootSelected(), NAME_ARRAY_LIST); + + if (isParameterSelected()) { + DesignerContext.getDesignerFrame().checkCombineUp(false, PARAMETER_TOOLAR_BAN_LIST); + } } private void invalidateLayout() {