From 816b00638cf8c871318655b6ab0bff47f4e120cf Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 15 May 2019 18:21:03 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-16567=20=E6=B7=BB=E5=8A=A0=E5=8F=B0?= =?UTF-8?q?=E7=89=88=E6=95=99=E5=AD=A6=E8=A7=86=E9=A2=91=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/community/VideoAction.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 8e9fd5b32e..1c441a83f7 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 @@ -27,8 +27,10 @@ public class VideoAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url; - if (GeneralContext.getLocale().equals(Locale.US)) { + if (Locale.US.equals(GeneralContext.getLocale())) { url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); + } else if (Locale.TAIWAN.equals(GeneralContext.getLocale())) { + url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.tw"); } else { url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); } From 7939232a2ccf1dfa5412042e7a9f38d717612268 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 24 May 2019 17:03:27 +0800 Subject: [PATCH 2/9] =?UTF-8?q?REPORT-17422=20&&=20REPORT-17460=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=87=E7=BA=A7=20=E6=9C=89jar=E5=8C=85?= =?UTF-8?q?=E6=B2=A1=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update/ui/dialog/UpdateMainDialog.java | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index ad6c4b33f1..e59cc09fff 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -22,6 +22,7 @@ import com.fr.design.update.ui.widget.UpdateInfoTableCellRender; import com.fr.design.update.ui.widget.UpdateInfoTableModel; import com.fr.design.update.ui.widget.UpdateInfoTextAreaCellRender; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.GeneralContext; @@ -29,6 +30,7 @@ import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; +import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; @@ -37,6 +39,7 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; +import com.fr.third.org.apache.commons.codec.digest.DigestUtils; import com.fr.workspace.WorkContext; import com.sun.java.swing.plaf.motif.MotifProgressBarUI; @@ -371,9 +374,7 @@ public class UpdateMainDialog extends UIDialog { new SwingWorker() { @Override protected JSONObject doInBackground() throws Exception { - HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("jar10.update")); - hc.setTimeout(UpdateConstants.CONNECTION_TIMEOUT); - return new JSONObject(hc.getResponseText()); + return new JSONObject(HttpToolbox.get(CloudCenter.getInstance().acquireUrlByKind("jar10.update"))); } @Override @@ -620,8 +621,11 @@ public class UpdateMainDialog extends UIDialog { long downloadSize = jo.optLong("size"); if (ComparatorUtils.equals(category, "server")) { File currentJAR = new File(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, downloadName)); - if (currentJAR.exists() && ComparatorUtils.equals(currentJAR.length(), downloadSize)) { - //假如大小一样的jar包就不要下载了 + String currentMD5 = getCurrentJarMD5(currentJAR); + String downloadMD5 = jo.optString("md5"); + boolean exist = currentJAR.exists() && ComparatorUtils.equals(currentJAR.length(), downloadSize) && ComparatorUtils.equals(currentMD5, downloadMD5); + if (exist) { + // 如果jar包存在且MD5值和大小与oss上的一致 不下载 continue; } } @@ -630,6 +634,31 @@ public class UpdateMainDialog extends UIDialog { } } + /** + * 获取当前jar的md5 + * @param currentJAR + * @return + */ + private String getCurrentJarMD5(File currentJAR) { + String md5 = StringUtils.EMPTY; + FileInputStream input = null; + try { + input = new FileInputStream(currentJAR); + md5 = DigestUtils.md5Hex(input); + } catch (Exception ignore) { + + } finally { + if (input != null) { + try { + input.close(); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + return md5; + } + /** * jar包更新按钮监听器 */ From 3b4ef22c272c62f2ba3e95b74e63e1283009244f Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 24 May 2019 17:05:52 +0800 Subject: [PATCH 3/9] update --- .../java/com/fr/design/actions/community/VideoAction.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 1c441a83f7..8e9fd5b32e 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 @@ -27,10 +27,8 @@ public class VideoAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url; - if (Locale.US.equals(GeneralContext.getLocale())) { + if (GeneralContext.getLocale().equals(Locale.US)) { url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); - } else if (Locale.TAIWAN.equals(GeneralContext.getLocale())) { - url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.tw"); } else { url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); } From 4bf76fe14876c2c7e29cc84d132484e83548667d Mon Sep 17 00:00:00 2001 From: abel Date: Mon, 27 May 2019 15:14:15 +0800 Subject: [PATCH 4/9] =?UTF-8?q?REPORT-16012=20populate=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E4=BD=BF=E7=94=A8=E5=BF=AB=E7=85=A7=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=EF=BC=8C=E5=9C=A8=E5=8E=9F=E5=A7=8B=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E4=BB=BB=E6=84=8F=E4=BF=AE=E6=94=B9=E9=83=BD?= =?UTF-8?q?=E4=BC=9A=E6=98=A0=E5=B0=84=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=B8=8A=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/widget/ui/ParameterTreeComboBox.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java b/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java index e7db157a97..0383b83b7e 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java @@ -161,7 +161,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox { // 全局数据源参数 parameters = new Parameter[0]; Calculator c = Calculator.createCalculator(); - TableDataConfig tableDataConfig = TableDataConfig.getInstance(); + TableDataConfig tableDataConfig = TableDataConfig.getInstance().mirror(); Iterator nameIt = tableDataConfig.getTableDatas().keySet().iterator(); while (nameIt.hasNext()) { TableData tableData = tableDataConfig.getTableData(nameIt.next()); From b6b65c13009faec45f3a8a4b629233e1a3925bf8 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 28 May 2019 11:06:53 +0800 Subject: [PATCH 5/9] =?UTF-8?q?REPORT-17451=20=E6=8E=A7=E4=BB=B6=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E5=8F=AF=E8=A7=81=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/FormWidgetCardPane.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 3e70f7d0f6..d5753ce155 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.widget.ui; -import com.fr.base.BaseUtils; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; @@ -28,13 +27,13 @@ import com.fr.design.widget.Operator; import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane; -import com.fr.form.ui.FormWidgetHelper; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -91,6 +90,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { return new WidgetBoundPane(xCreator); } + @Override protected JPanel createContentPane() { return null; } @@ -218,21 +218,14 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { UITextField widgetNameField = widgetPropertyPane.getWidgetNameField(); String toSetWidgetName = widgetNameField.getText(); String currentWidgetName = widget.getWidgetName(); - // 设置的组件名和当前组件名相同 直接返回 - if (ComparatorUtils.equals(toSetWidgetName, currentWidgetName)) { - return; - } - String containerName = designer.getTarget().getContainer().getWidgetName(); - Widget existWidget = FormWidgetHelper.findWidgetByName(widget, widgetNameField.getText()); - // 判断设置的组件名是否和容器同名以及组件是否在容器在存在 满足任何其一 抛出提示 - boolean exist = ComparatorUtils.equals(containerName, toSetWidgetName) || existWidget != null; + boolean exist = designer.getTarget().isNameExist(toSetWidgetName) && !ComparatorUtils.equals(toSetWidgetName, currentWidgetName); if (exist) { widgetNameField.setText(currentWidgetName); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, BaseUtils.readIcon("com/fr/design/form/images/joption_failure.png")); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); return; } widgetPropertyPane.update(widget); - xCreator.resetCreatorName(toSetWidgetName); + xCreator.resetCreatorName(currentWidgetName); xCreator.resetVisible(widget.isVisible()); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); return; @@ -262,6 +255,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { creator.firePropertyChange(); } + @Override public String getIconPath() { return StringUtils.EMPTY; } From 5307f4a3aee6996b58fd889c7007b981b276fd2c Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 28 May 2019 16:03:45 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-16650=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=20=E5=A4=9A=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E6=A0=91=E5=A4=9A=E9=80=89=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormWidgetAuthorityEditPane.java | 91 +++++++++++++++---- 1 file changed, 74 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java b/designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java index 6f84aaa321..b66293cfcc 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java @@ -4,14 +4,18 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.tree.TreePath; import com.fr.design.constants.LayoutConstants; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.AuthorityEditPane; @@ -22,6 +26,9 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; +import com.fr.stable.ArrayUtils; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; /** @@ -34,15 +41,21 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { private Widget[] widgets = null; private UICheckBox widgetVisible = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")); private UICheckBox widgetAvailable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Enabled")); + private String[] selectedArray; private ItemListener visibleItemListener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selectedRoles == null) { return; } - if (widgets != null && widgets.length > 0) { - for (int i = 0; i < widgets.length; i++) { - widgets[i].changeVisibleAuthorityState(selectedRoles, widgetVisible.isSelected()); + initSelectedArray(); + if (ArrayUtils.isEmpty(selectedArray)) { + return; + } + for (String selectedRole : selectedArray) { + for (Widget widget : widgets) { + widget.changeVisibleAuthorityState(selectedRole, widgetVisible.isSelected()); } } doAfterAuthority(); @@ -51,6 +64,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { private ItemListener usableItemListener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (ComparatorUtils.equals(selectedRoles, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Role"))) { @@ -59,9 +73,13 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { if (selectedRoles == null) { return; } - if (widgets != null && widgets.length > 0) { - for (int i = 0; i < widgets.length; i++) { - widgets[i].changeUsableAuthorityState(selectedRoles, widgetAvailable.isSelected()); + initSelectedArray(); + if (ArrayUtils.isEmpty(selectedArray)) { + return; + } + for (String selectedRole : selectedArray) { + for (Widget widget : widgets) { + widget.changeUsableAuthorityState(selectedRole, widgetAvailable.isSelected()); } } doAfterAuthority(); @@ -78,7 +96,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { private void doAfterAuthority() { designer.repaint(); - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().setReportAndFSSelectedRoles(); RolesAlreadyEditedPane.getInstance().repaint(); @@ -90,6 +108,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { * * @date 2014-12-21-下午6:19:43 */ + @Override public void populateType() { type.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Form_Widget_Config")); } @@ -99,15 +118,16 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { * * @date 2014-12-21-下午7:12:27 */ + @Override public void populateName() { - String nameText = ""; if (widgets == null || widgets.length <= 0) { return; } - for (int i = 0; i < widgets.length; i++) { - nameText += "," + widgets[i].getClass().getSimpleName(); + List widgetNames = new ArrayList(); + for (Widget widget : widgets) { + widgetNames.add(widget.getClass().getSimpleName()); } - name.setText(nameText.substring(1)); + name.setText(StableUtils.join(widgetNames, ",")); } /** @@ -116,6 +136,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { * @return 面板 * @date 2014-12-21-下午6:19:03 */ + @Override public JPanel populateCheckPane() { checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); @@ -138,10 +159,11 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { /** * 对单元格区域进行操作时的权限编辑页面 */ + @Override public void populateDetials() { //更新说明要是JWorkBook的话,说明鼠标焦点又改变了 - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true); - signelSelection(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().setAuthorityMode(true); + singleSelection(); refreshCreator(); //如果是布局选中不支持的元素则显示“该元素不支持权限控制” @@ -186,8 +208,8 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { //实现单选 - private void signelSelection() { - if (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().isJWorkBook()) { + private void singleSelection() { + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().isJWorkBook()) { //清工具栏 JComponent component = DesignerContext.getDesignerFrame().getToolbarComponent(); if (component instanceof AuthorityEditToolBarComponent) { @@ -195,7 +217,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { } //清空报表主体的单元格选择 - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().removeTemplateSelection(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().removeTemplateSelection(); } } @@ -204,5 +226,40 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { widgets = size == 0 ? null : designer.getSelectionModel().getSelection().getSelectedWidgets(); } + private void initSelectedArray() { + TreePath[] selectionPaths = ReportAndFSManagePane.getInstance().getRoleTree().getCheckBoxTreeSelectionModel().getSelectionPaths(); + if (selectionPaths.length == 1) { + if (((ExpandMutableTreeNode) (selectionPaths[0].getLastPathComponent())).getChildCount() > 0) { + ExpandMutableTreeNode node = (ExpandMutableTreeNode) ((ExpandMutableTreeNode) (selectionPaths[0].getLastPathComponent())).getLastChild(); + selectedArray = new String[node.getChildCount()]; + for (int i = 0, len = node.getChildCount(); i < len; i++) { + ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) node.getChildAt(i); + String nodeName = treeNode.getUserObject().toString(); + selectedArray[i] = nodeName; + } + } else { + selectedArray = pathToString(selectionPaths); + } + } else { + selectedArray = pathToString(selectionPaths); + } + } + + private String[] pathToString(TreePath[] path) { + List roles = new ArrayList(); + if (!ArrayUtils.isEmpty(path)) { + for (TreePath tempPath : path) { + String temp = tempPath.toString(); + boolean exist = StringUtils.isNotEmpty(temp) && temp.startsWith("[") && temp.endsWith("]"); + if (exist) { + temp = temp.substring(1, temp.length() - 1); + String[] selectedRoles = temp.split("," + StringUtils.BLANK); + String role = selectedRoles[2].trim(); + roles.add(role); + } + } + } + return roles.toArray(new String[0]); + } } From db20d7ffcf389080a4be9c0603c0430a899f43d0 Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 29 May 2019 09:51:35 +0800 Subject: [PATCH 7/9] =?UTF-8?q?REPORT-17500=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/help/TutorialAction.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 f5dc26f107..b0aa2b5791 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 @@ -3,6 +3,7 @@ package com.fr.design.actions.help; import com.fr.base.BaseUtils; 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.general.http.HttpToolbox; @@ -22,6 +23,8 @@ import java.net.URI; public class TutorialAction extends UpdateAction { + private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com"; + public TutorialAction() { this.setMenuKeySet(HELP_TUTORIAL); this.setName(getMenuKeySet().getMenuName()); @@ -34,9 +37,11 @@ public class TutorialAction extends UpdateAction { * 动作 * @param evt 事件 */ + @Override public void actionPerformed(ActionEvent evt) { String helpURL = CloudCenter.getInstance().acquireUrlByKind(createDocKey()); - if (isServerOnline(helpURL)) { + // 用第三方网址去判断是否处在离线状态 + if (isServerOnline(URL_FOR_TEST_NETWORK)) { try { Desktop.getDesktop().browse(new URI(helpURL)); return; From 45881aaa87f479cd45a643e1a9e881fcff40bcec Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 29 May 2019 10:25:06 +0800 Subject: [PATCH 8/9] =?UTF-8?q?REPORT-17500=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/help/TutorialAction.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 b0aa2b5791..1eec7ec8ab 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 @@ -1,11 +1,11 @@ package com.fr.design.actions.help; -import com.fr.base.BaseUtils; +import com.fr.cluster.ClusterBridge; 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.general.IOUtils; import com.fr.general.http.HttpToolbox; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; @@ -29,7 +29,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/bbs/help.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/help.png")); this.setAccelerator(getMenuKeySet().getKeyStroke()); } From 35007b79d0191d82c5f4634a6d1e8526834cac56 Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 29 May 2019 13:56:20 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/help/TutorialAction.java | 1 - 1 file changed, 1 deletion(-) 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 1eec7ec8ab..5de31eb311 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 @@ -1,6 +1,5 @@ package com.fr.design.actions.help; -import com.fr.cluster.ClusterBridge; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.CloudCenter;