From da78d44dab9d44835dfa013e28c9291135f9b1b4 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 9 Nov 2016 15:07:32 +0800 Subject: [PATCH] rt --- .../mainframe/FormWidgetDetailPane.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index a1fb5f147..5beea605c 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.PluginWebBridge; @@ -19,6 +20,8 @@ import com.fr.form.share.ShareConstants; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; import com.fr.general.Inter; +import com.fr.general.SiteCenter; +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; @@ -29,6 +32,8 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.io.File; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; /** * Created with IntelliJ IDEA. @@ -220,10 +225,23 @@ public class FormWidgetDetailPane extends FormDockView{ downloadItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - BasicPane managerPane = new WebManagerPaneFactory().createReusePane(); - UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); - PluginWebBridge.getHelper().setDialogHandle(dlg); - dlg.setVisible(true); + String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url"); + if (StringUtils.isEmpty(url)) { + FRContext.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + } catch (Exception exp) { + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FRContext.getLogger().error("Can not open the browser for URL: " + url); + } + } });