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 b15b9eab92..648cb03f33 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 038212bfde..8be4678106 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(() -> { });