From 79f4f1ff94601887d5e63a9485679cecf3775fb4 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 25 Aug 2021 11:05:25 +0800 Subject: [PATCH] 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(() -> { });