From cc1e8931af5749f710bab5e66289ea380046da26 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 22 Aug 2018 20:07:24 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-10812=2010.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/extra/PluginWebBridge.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index de96c10b9..3ab17b92e 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -570,6 +570,15 @@ public class PluginWebBridge { //todo 初始化设计器其他部分 } + + /** + * 国际化(用来做兼容,暂时不删) + */ + public String parseI18(final String key) { + return com.fr.design.i18n.Toolkit.i18nText(key); + } + + /** * 是否是在设计器中操作 */ From 18ef9e55f5c0abcd049e6e73bb4a6b939d1c91ae Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Thu, 23 Aug 2018 10:48:52 +0800 Subject: [PATCH 2/5] REPORT-10171 --- .../design/actions/community/BBSAction.java | 4 +- .../design/actions/community/BugAction.java | 2 +- .../actions/community/CenterAction.java | 68 +++++++++++++++++ .../actions/community/CusDemandAction.java | 68 +++++++++++++++++ .../design/actions/community/NeedAction.java | 4 +- .../actions/community/QuestionAction.java | 2 +- .../design/actions/community/SignAction.java | 2 +- .../actions/community/TechSolutionAction.java | 70 ++++++++++++++++++ .../design/actions/community/VideoAction.java | 2 +- .../design/actions/help/TutorialAction.java | 2 +- .../mainframe/toolbar/ToolBarMenuDock.java | 9 ++- .../com/fr/design/images/bbs/bbs.png | Bin 0 -> 350 bytes .../com/fr/design/images/bbs/bug.png | Bin 0 -> 560 bytes .../com/fr/design/images/bbs/center.png | Bin 0 -> 217 bytes .../com/fr/design/images/bbs/demand.png | Bin 0 -> 505 bytes .../com/fr/design/images/bbs/help.png | Bin 0 -> 348 bytes .../com/fr/design/images/bbs/need.png | Bin 0 -> 362 bytes .../com/fr/design/images/bbs/question.png | Bin 0 -> 543 bytes .../com/fr/design/images/bbs/sign.png | Bin 0 -> 340 bytes .../com/fr/design/images/bbs/solotion.png | Bin 0 -> 407 bytes .../com/fr/design/images/bbs/video.png | Bin 0 -> 450 bytes 21 files changed, 222 insertions(+), 11 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/bbs.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/bug.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/center.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/demand.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/help.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/need.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/question.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/sign.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/solotion.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/video.png diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 9b689bc97..8b7e45047 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -25,13 +25,13 @@ public class BBSAction extends UpdateAction this.setMenuKeySet(BBS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bbs.png")); } /** * 动作 - * @param e 事件 + * @param arg0 事件 */ @Override public void actionPerformed(ActionEvent arg0) diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index b22093060..21afd306e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -23,7 +23,7 @@ public class BugAction extends UpdateAction { this.setMenuKeySet(BUG); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bug.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bug.png")); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java new file mode 100644 index 000000000..f8c5ea79c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -0,0 +1,68 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.base.FRContext; +import com.fr.design.menu.MenuKeySet; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class CenterAction extends UpAction{ + public CenterAction() + { + this.setMenuKeySet(CENTER); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/center.png")); + + } + + @Override + public void actionPerformed(ActionEvent arg0) + { + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.center"); + 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + + } + public static final MenuKeySet CENTER = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'C'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Center"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java new file mode 100644 index 000000000..df9880857 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java @@ -0,0 +1,68 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.base.FRContext; +import com.fr.design.menu.MenuKeySet; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class CusDemandAction extends UpAction{ + public CusDemandAction() + { + this.setMenuKeySet(DEMAND); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/demand.png")); + + } + + @Override + public void actionPerformed(ActionEvent arg0) + { + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.demand"); + 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + + } + public static final MenuKeySet DEMAND = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'D'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Demand"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index c49a484f7..e6e2cc215 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -24,8 +24,8 @@ public class NeedAction extends UpdateAction this.setMenuKeySet(NEED); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/need.png")); - + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png")); + } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 390827f16..7d349affa 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -23,7 +23,7 @@ public class QuestionAction extends UpdateAction { this.setMenuKeySet(QUESTIONS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/questions.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/question.png")); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index fe59c01f5..d0c9cd434 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -24,7 +24,7 @@ public class SignAction extends UpdateAction this.setMenuKeySet(SIGN); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/signature.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/sign.png")); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java new file mode 100644 index 000000000..6e10d851b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -0,0 +1,70 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.base.FRContext; +import com.fr.design.actions.UpdateAction; +import com.fr.design.menu.MenuKeySet; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class TechSolutionAction extends UpdateAction{ + public TechSolutionAction() + { + this.setMenuKeySet(TSO); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images//bbs/solotion.png")); + + } + + @Override + public void actionPerformed(ActionEvent arg0) + { + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.solution"); + 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + + } + public static final MenuKeySet TSO = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'T'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Solution"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 662fe689b..6919fab00 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -25,7 +25,7 @@ public class VideoAction extends UpdateAction this.setMenuKeySet(VIDEO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/video.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png")); } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index 91cfb5712..3c51f4bbd 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -31,7 +31,7 @@ public class TutorialAction extends UpdateAction { this.setMenuKeySet(HELP_TUTORIAL); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/help.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/help.png")); this.setAccelerator(getMenuKeySet().getKeyStroke()); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 7a3fd3cb3..7abe673a0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -10,9 +10,12 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.community.BBSAction; import com.fr.design.actions.community.BugAction; +import com.fr.design.actions.community.CenterAction; +import com.fr.design.actions.community.CusDemandAction; import com.fr.design.actions.community.NeedAction; import com.fr.design.actions.community.QuestionAction; import com.fr.design.actions.community.SignAction; +import com.fr.design.actions.community.TechSolutionAction; import com.fr.design.actions.community.UpAction; import com.fr.design.actions.community.VideoAction; import com.fr.design.actions.file.CloseCurrentTemplateAction; @@ -493,9 +496,11 @@ public abstract class ToolBarMenuDock { shortCuts.add(new VideoAction()); shortCuts.add(new TutorialAction()); shortCuts.add(new QuestionAction()); - shortCuts.add(new UpAction()); - shortCuts.add(new NeedAction()); + shortCuts.add(new TechSolutionAction()); shortCuts.add(new BugAction()); + shortCuts.add(new NeedAction()); + shortCuts.add(new CusDemandAction()); + shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/bbs.png b/designer-base/src/main/resources/com/fr/design/images/bbs/bbs.png new file mode 100644 index 0000000000000000000000000000000000000000..4fd2df684a17c4a4afb897fee8df67bd58c41f10 GIT binary patch literal 350 zcmV-k0iphhP)Px$7)eAyR5%f1WWWLB3STPy{r$fUB+bmqSoNr1{2n%?jOc<24gWd*ym?Xa|35?d ze+C8)kUUV)4@O3YP8Jb~jt32lKalmH7$BAN!Vf4pf#LsuMPx;AHY4MGAiLn%6p2kR zF|Yx$xi6Lf{rfiwXrmWQ0v`?3w2g_0Dev)Q@w<#tIWJ2X8UD2Zoy?9;6S^GGOFtPH znW}*Xy!Z`tG7Gu_qWFxAf0)SD46*@eF%wZX;Za1f0l59n$Z(j6k?9i1@_+yT=`s9g zu*K#O>;^D0ev;G`cRriW_#33jc;WQBY5)KL literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/bug.png b/designer-base/src/main/resources/com/fr/design/images/bbs/bug.png new file mode 100644 index 0000000000000000000000000000000000000000..24393bc4be723b49cb6c990addc2a517e06aa32c GIT binary patch literal 560 zcmV-00?+-4P)Px$>PbXFR5%fRQ@>9XQ4pSaw^#6^(TnD8IU1u0F|k0c?5QAu@}RIM$C*GQ6}i^x ziaY!REY!;6%t1{86(LX&2sA3(-R1(?7>OSH#&7mVvMzFy?0z%f%)B=#0+art7* z_OI(CG({w%%EiLWU15HACwG7Cu*!d8K1N3s+wXry^3#}1qKFhoPN!U4SGO{&piHMOdK&P??aH#qo-_U|`%03BC+* z@E^0Nq20F{Wi8F=48jGB`93(6j*O8P7~~4d|E;l1{1p{&xPbV#FJR1@VUwRcuNQVT zQAi#KXyg-y7`2dfZe4)MZvPT*$1Qsk7}habs5(w|`AaQ#Y(PXa$o+SL_#R-R=h%Bx zQSZgI-+zF4h{2HzX*uULzEVsJ{MCSCF5$9#z*kZ`=JgZ?i||AgFxzS57og7ucEsxt ze=1RY)q4~;(m(VZQB8Nrdk?)C*b(nwAT5+rvc7-fmb?F?ch(DNldAByQ1i#gIj^X^ yqT%dN8BuVCl_;4MeG6=828X^E!~oTf-^gE(;IpTzYH^|f0000>N?_zvXkusr`(K0T9DV3whr0I)+kx?Ei!xcm0=$YRbK%QXm MboFyt=akR{0AoH&rvLx| literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/demand.png b/designer-base/src/main/resources/com/fr/design/images/bbs/demand.png new file mode 100644 index 0000000000000000000000000000000000000000..b237026fa19ab0919af7d6885b79ec750ead5a2d GIT binary patch literal 505 zcmVPx$vq?ljR5%gMQn5+{K@gp}L_I+pAsS60LK?BNv$3+s2Pk5tAYzkTKtY1ooQ;TG zAe|xpfR)xFSZgCTB3NiJcZ#J3qujW&$($E*v9NL>H@h=$-@JJnfIqAWo6MBursXQi zCYh}j2w{r=F3m{a`h9WeL2AL6$T>SiPynFFXe=JPvhm$u027$TKm`ErfFSen)lmDc zYeo?aBH}d@FiMlKf;zpOsPm-0iZpB6q-*-z`XnrOSv8pkG!6_vTWV3>@CZPZk))E_ zTYhm5iD*rARAm57;L#pMBXdv1*sWkW>Tc`-0-hm4Ly8{IYAWZJ6%qbMz2AT*d_grNa~mqK$-;+&P(hJ|gf|en7@?wKTjaqe)(3hk2<@Fcno&02~$Jf{Yf- z%f3xXa)bJ*;hqxEoB)DRy-4M;G~$~rHD5^>fq}Tq7X=(NTXG!r6L%x1mg4*Dks1ZW z>=qGw=PPO|`E;z{2&{k!xC@)fBXlUrJ2uyOX%dX|oU8vxT_*wr8lgU+L>|sd-H+qe v>r^7|gc>R!{rpyKcP#7NsNa(0|4;k|hXT$$t6Mr)00000NkvXXu0mjf!kO18 literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/help.png b/designer-base/src/main/resources/com/fr/design/images/bbs/help.png new file mode 100644 index 0000000000000000000000000000000000000000..c13f2f1926471fbce07f6f9037d63a3b5fcecca5 GIT binary patch literal 348 zcmV-i0i*tjP)Px$7D+@wR5%fxQaf$}K@5FfA^{S0lm&`3@;i$=S{I3NEjU#Bpq)fVrP50} zdHi-`YBvY}t!%$vs;}B>AO-c_N^_nzInP(eYjDp5<|cq)HD|a^BElFTyGlBJ`YfEl z-8}~b8S{tGHT!FL4MI22-H%`l-C6B#bORwf1eVyz3g^H~_~8uin$N-UNc@WvNTGl$ zWlD&!umH=Pg9{s^(|9DzyB&X3sn(?kZvt}V;sjdAjP@3r4l$lHzVV2EvzX)yfrY^P ujmoInePD(;D0T(&9Ft%+5G10x8$JM1*l|))yM0>#0000Px$BuPX;R5%f1U?38x6@LAoWbRG{MBtG=qdi{{Q{o50l4h02a**j0}vIxY@bFVFuvz0#3~wT+X+8`QE?` zfV<%T|Nkq2*d8Q7tY(l}xB)=+G$3Ae_0bj zVk|HQjE4DHLz?joP_sEOZ0^J41}DuZmHqrbB~F6}BDsbD0CR1K!@M_4h5!Hn07*qo IM6N<$f)Ns+;Q#;t literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/question.png b/designer-base/src/main/resources/com/fr/design/images/bbs/question.png new file mode 100644 index 0000000000000000000000000000000000000000..c8c6fd8a1bb4dc0866dca76639c331a1ab39d8a2 GIT binary patch literal 543 zcmV+)0^t3LP)Px$*-1n}R5%fpQ$0vrK@gtVcTe=L38Lp8!9!9Q@G7emu}`BA5TamrMM5;#gftdf zN*WCu2nG^NA$GAA8x7bB5fnL4ksNo?VC4@yZ^v)m`Q)AM37KYR=li~$*_mCYd)D>7 z{DMhx!t_#zIu&N3A`5K_@z+23wyn4XSk*Eg|F#F0m01xUBZAy%EX?x5Z}L7JeomK^ z5)!*7PoD=tuz`I`O!te8Sw!Y@5j%uxaPXa-`o2GKG}p4rnQ3VZPRhT9%72`GA zi}Qa81m47gp=*hzklC-s_1?T@#pdqw(14Ky?$-MN5J@2(8mf7V%xN_DHJV#PRjpP~ z-PTrxxvJ4n_>|+E=rdWCQS_(r z7DE^L+oPW;eu(-{Ka_?l6~P!oyC~*6Qn!B1;+(BAj=!|8dWJ`d`2gEw=XhzbM)^OR h{%J{OCeNO@G&i~as&b}bTtol>002ovPDHLkV1lun^rip+ literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/sign.png b/designer-base/src/main/resources/com/fr/design/images/bbs/sign.png new file mode 100644 index 0000000000000000000000000000000000000000..b1556f7ed13d46cccba615faa4fa305437010f30 GIT binary patch literal 340 zcmV-a0jvIrP)Px$4oO5oR5%gcQZY^gF%X=&i}(TIh)_CcBJlwv$P;KI(IZ5ZFOU>;2q6T2pw0&p zl$sBa5(0vnj@&KlV4v10j;nFuon6n2*DDjcTIcWLV!g%Q+kN&BxJdxDBXMK74Vxrs zy7zk9oZDK!JA=>NBF~>8vK4ABMh1?c&#~tv*0T~@5E<0!z^WBT2LGUgwda*7iAMs% zLNFnD+3tTFblnM{LaH_wo3pRvYUPI8zQJiG^+2HAv-_-`d)Om^E2w08) zzG(KfxZ6Hk_)98(qPBeDcnLB3HIWX%nb)pDrGaBu6BS<-kmxJ_X<$tRa;!7hTwU$A m${AQ<=)~3>uGPW1$mTzBHE%bsZzeSW0000Px$QAtEWR5%fxQ$0_^Kn%63N+c>mLQH{?u3fv*nU4|vL)?v=;Y(N?8NO<+YhkMGPy#$P*^7btE|jTF1kPEn8-GKXf*|4 z7nPo}d<{^Du2IBCRdwDFja`Ix9L;ZaAFGtU&|+xVXBpjSJRc(RJpxUh+DX{=Bgss$ zo~_|k(ZnOL`&~_1w*J@81X8<^Ey!NhC5%J5VL$(Ye8WLvko*7u002ovPDHLkV1oE6 Bu6+Oi literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/video.png b/designer-base/src/main/resources/com/fr/design/images/bbs/video.png new file mode 100644 index 0000000000000000000000000000000000000000..1971f2615664186ab99617abff9f0a6a2eddd73d GIT binary patch literal 450 zcmV;z0X_bSP)Px$d`Uz>R5%fplV3{1KoG`fwn;=NDEOxoX%ApU5IljP-~s9h^g$3oPtX%6LW?in zpa&3q@DP<=ASl&hLGh(EO~(0BQ<`l8nwRYCe81hD{brf0uX@p|g=0PzkpmL0#%UIx znI8&{-1*n#?kvJdP-}?yIp|+SBBvx`lKIr1IWo+*ODpS_-3EUn7cT(#=G(|L5@APoEo8w;Pi#bQqdjfW#Qz*v#b9C Date: Thu, 23 Aug 2018 11:15:39 +0800 Subject: [PATCH 3/5] REPORT-10171 --- .../design/actions/community/BBSAction.java | 17 +----- .../design/actions/community/BugAction.java | 17 +----- .../actions/community/CenterAction.java | 17 +----- .../actions/community/CusDemandAction.java | 17 +----- .../design/actions/community/NeedAction.java | 17 +----- .../actions/community/QuestionAction.java | 18 +------ .../design/actions/community/SignAction.java | 17 +----- .../actions/community/TechSolutionAction.java | 17 +----- .../design/actions/community/VideoAction.java | 17 +----- .../java/com/fr/design/utils/BrowseUtils.java | 52 ++++++++++++++++++ .../main/java/com/fr/start/ServerStarter.java | 54 ++----------------- 11 files changed, 74 insertions(+), 186 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 8b7e45047..3964ac151 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -5,6 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -37,21 +38,7 @@ public class BBSAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet BBS = new MenuKeySet() { @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index 21afd306e..9dd9f2ae6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; @@ -31,21 +32,7 @@ public class BugAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.bugs"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet BUG = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java index f8c5ea79c..f16862191 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -3,6 +3,7 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -32,21 +33,7 @@ public class CenterAction extends UpAction{ public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.center"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet CENTER = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java index df9880857..c3dd646dd 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java @@ -3,6 +3,7 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -32,21 +33,7 @@ public class CusDemandAction extends UpAction{ public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.demand"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet DEMAND = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index e6e2cc215..74c862a76 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; @@ -32,21 +33,7 @@ public class NeedAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.needs"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet NEED = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 7d349affa..42cf1130d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; @@ -31,22 +32,7 @@ public class QuestionAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.questions"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - + BrowseUtils.browser(url); } public static final MenuKeySet QUESTIONS = new MenuKeySet() { @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index d0c9cd434..986e9d40e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -5,6 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -32,21 +33,7 @@ public class SignAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.aut"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet SIGN = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java index 6e10d851b..a67c3d554 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -33,21 +34,7 @@ public class TechSolutionAction extends UpdateAction{ public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.solution"); - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet TSO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 6919fab00..9fd0405f2 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; @@ -38,21 +39,7 @@ public class VideoAction extends UpdateAction } else { url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); } - 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, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet VIDEO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java new file mode 100644 index 000000000..f9078107f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java @@ -0,0 +1,52 @@ +package com.fr.design.utils; + +import com.fr.base.FRContext; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.OperatingSystem; +import com.fr.stable.StringUtils; + +import javax.swing.JOptionPane; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class BrowseUtils { + public static void startBrowserFromCommand(String uri, IOException e) { + + if (OperatingSystem.isWindows()) { + try { + // win10 内存用到到80%左右的时候, Desktop.browser经常提示"存储空间不足, 无法处理改命令", 用rundll32可以打开. + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uri); + } catch (IOException ee) { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } else { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + public static void browser(String url) { + + if (StringUtils.isEmpty(url)) { + FRContext.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + startBrowserFromCommand(url, exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + } + + +} diff --git a/designer-base/src/main/java/com/fr/start/ServerStarter.java b/designer-base/src/main/java/com/fr/start/ServerStarter.java index b916bd679..2141870b1 100644 --- a/designer-base/src/main/java/com/fr/start/ServerStarter.java +++ b/designer-base/src/main/java/com/fr/start/ServerStarter.java @@ -1,25 +1,15 @@ package com.fr.start; -import com.fr.base.FRContext; import com.fr.base.ServerConfig; import com.fr.design.DesignerEnvManager; +import com.fr.design.utils.BrowseUtils; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; - -import com.fr.log.FineLoggerFactory; -import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; import com.fr.start.server.FineEmbedServer; import com.fr.workspace.WorkContext; -import javax.swing.*; -import java.awt.*; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - public class ServerStarter { /** @@ -30,7 +20,7 @@ public class ServerStarter { if (!WorkContext.getCurrent().isLocal()) { //有问题,这里拿不到远程的http端口 - browser(WorkContext.getCurrent().getPath()); + BrowseUtils.browser(WorkContext.getCurrent().getPath()); } else if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用 String web = GeneralContext.getCurrentAppNameOfEnv(); @@ -48,7 +38,7 @@ public class ServerStarter { FineEmbedServer.start(); } finally { //先访问Demo, 后访问报表, 不需要重置服务器. - browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName()); + BrowseUtils.browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName()); } } @@ -60,42 +50,6 @@ public class ServerStarter { public static void browserURLWithLocalEnv(String url) { FineEmbedServer.start(); - browser(url); + BrowseUtils.browser(url); } - - private static void browser(String uri) { - - if (StringUtils.isEmpty(uri)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(uri)); - - } catch (IOException e) { - startBrowserFromCommand(uri, e); - } catch (URISyntaxException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + uri); - } - } - - private static void startBrowserFromCommand(String uri, IOException e) { - - if (OperatingSystem.isWindows()) { - try { - // win10 内存用到到80%左右的时候, Desktop.browser经常提示"存储空间不足, 无法处理改命令", 用rundll32可以打开. - Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uri); - } catch (IOException ee) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } else { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - - } From cda92e48916e9e03083b7c99cb2f6503d39289eb Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Thu, 23 Aug 2018 11:29:28 +0800 Subject: [PATCH 4/5] REPORT-10171 --- .../com/fr/design/actions/community/BBSAction.java | 8 +------- .../com/fr/design/actions/community/BugAction.java | 9 +-------- .../com/fr/design/actions/community/CenterAction.java | 8 -------- .../fr/design/actions/community/CusDemandAction.java | 11 ++--------- .../com/fr/design/actions/community/NeedAction.java | 9 +-------- .../fr/design/actions/community/QuestionAction.java | 9 +-------- .../com/fr/design/actions/community/SignAction.java | 8 +------- .../design/actions/community/TechSolutionAction.java | 11 +++-------- .../com/fr/design/actions/community/VideoAction.java | 7 ------- .../main/java/com/fr/design/utils/BrowseUtils.java | 10 ++++++++++ 10 files changed, 20 insertions(+), 70 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 3964ac151..98ad28c9c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -1,21 +1,15 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class BBSAction extends UpdateAction { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index 9dd9f2ae6..d9c75321d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -1,21 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class BugAction extends UpdateAction { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java index f16862191..3ba97c0fc 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -1,20 +1,12 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; import javax.swing.KeyStroke; -import java.awt.Desktop; import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; /** * Created by XINZAI on 2018/8/23. diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java index c3dd646dd..9e294d859 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java @@ -1,20 +1,13 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; + import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - -import javax.swing.JOptionPane; import javax.swing.KeyStroke; -import java.awt.Desktop; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; /** * Created by XINZAI on 2018/8/23. diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index 74c862a76..c604e51d0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -1,21 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class NeedAction extends UpdateAction { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 42cf1130d..717537df6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -1,21 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class QuestionAction extends UpdateAction { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index 986e9d40e..c08619b23 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -1,21 +1,15 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class SignAction extends UpdateAction { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java index a67c3d554..fce0dbda8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -1,21 +1,16 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; + import javax.swing.KeyStroke; -import java.awt.Desktop; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; + /** * Created by XINZAI on 2018/8/23. diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 9fd0405f2..8e9fd5b32 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,21 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; import java.util.Locale; public class VideoAction extends UpdateAction diff --git a/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java index f9078107f..4ea403558 100644 --- a/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java @@ -15,6 +15,12 @@ import java.net.URISyntaxException; * Created by XINZAI on 2018/8/23. */ public class BrowseUtils { + + /** + * 处理内存异常,win10下用rundll32打开 + * @param uri 网址 + * @param e + */ public static void startBrowserFromCommand(String uri, IOException e) { if (OperatingSystem.isWindows()) { @@ -30,6 +36,10 @@ public class BrowseUtils { } } + /** + * 打开网页,用默认浏览器 + * @param url 网址 + */ public static void browser(String url) { if (StringUtils.isEmpty(url)) { From 024188f04f8f022b725fb0345d31699cc239c32f Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Thu, 23 Aug 2018 11:31:07 +0800 Subject: [PATCH 5/5] REPORT-10171 --- .../src/main/java/com/fr/design/utils/BrowseUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java index 4ea403558..4de270571 100644 --- a/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java @@ -21,7 +21,7 @@ public class BrowseUtils { * @param uri 网址 * @param e */ - public static void startBrowserFromCommand(String uri, IOException e) { + private static void startBrowserFromCommand(String uri, IOException e) { if (OperatingSystem.isWindows()) { try {