diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java index be2d724667..bb600674b1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java @@ -1,15 +1,13 @@ package com.fr.design.mainframe.share.ui.online.mini; -import com.fr.base.ScreenResolution; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.mini.MiniShopDisposingChecker; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.stable.Constants; -import com.fr.stable.unit.FU; -import com.fr.stable.unit.UNIT; import javax.swing.JFrame; import java.awt.Container; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; import java.awt.Window; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; @@ -36,10 +34,11 @@ public class MiniComponentShopDialog { final JFrame frame = new JFrame(); final MiniComponentShopPane shopPane = new MiniComponentShopPane(); - final UNIT width = FU.getInstance(900 * Constants.FU_PER_OLD_PIX); - final UNIT height = FU.getInstance(600 * Constants.FU_PER_OLD_PIX); - int resolution = ScreenResolution.getScreenResolution(); - frame.setSize(width.toPixI(resolution), height.toPixI(resolution)); + GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment(); + Rectangle rect =ge.getMaximumWindowBounds(); + int width = (int) (rect.width * 0.8); + int height = (int) (rect.height * 0.9); + frame.setSize(width, height); frame.setTitle(Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Window_Title")); frame.add(shopPane); frame.setResizable(false); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java index e6a4f720cc..4cb985b5af 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java @@ -254,9 +254,9 @@ public class NativeProductBridge { MiniComponentShopDialog.getInstance().getContentPane(), Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Component_Tip"), "", - FineJOptionPane.YES_NO_OPTION + FineJOptionPane.OK_CANCEL_OPTION ); - allowedDownload = result == JOptionPane.YES_OPTION; + allowedDownload = result == JOptionPane.OK_OPTION; } if (allowedDownload) { fireStartEvent(null); @@ -353,33 +353,14 @@ public class NativeProductBridge { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - boolean allowedDownload; - OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, false); - boolean isCompatibleWithCurrentEnv = true; - for (OnlineShareWidget children: childrenWidgets) { - if (!children.isCompatibleWithCurrentEnv()) { - isCompatibleWithCurrentEnv = false; - break; - } - } - int result; - if (!isCompatibleWithCurrentEnv) { - result = FineJOptionPane.showConfirmDialog( - MiniComponentShopDialog.getInstance().getContentPane(), - Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Components_Package_Tip", childrenCount), - "", - FineJOptionPane.YES_NO_OPTION - ); - } else { - result = FineJOptionPane.showConfirmDialog( - MiniComponentShopDialog.getInstance().getContentPane(), - Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenCount), - "", - FineJOptionPane.YES_NO_OPTION - ); - } - allowedDownload = result == JOptionPane.YES_OPTION; - if (allowedDownload) { + OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, true); + int result = FineJOptionPane.showConfirmDialog( + MiniComponentShopDialog.getInstance().getContentPane(), + Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenWidgets.length), + "", + FineJOptionPane.OK_CANCEL_OPTION + ); + if (result == JOptionPane.OK_OPTION) { fireStartEvent(null); action.install(); } else {