From 28b56fd047455308dcf27780cb22a526035ab85b Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 11:29:22 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-11394=20=E4=BA=8C=E6=AC=A1=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=9F=90=E4=BA=9B=E5=9C=BA=E6=99=AF=E4=B8=8B=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=88=A0=E9=99=A4=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remote/ui/AuthorityListControlPane.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java index 7404ed6995..d8692c443d 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java @@ -253,23 +253,17 @@ public class AuthorityListControlPane extends BasicPane { * @param authorities authority */ public void setAuthority(List authorities) { - - if (authorities == null || authorities.isEmpty()) { - return; - } - DefaultListModel model = (DefaultListModel) authorityList.getModel(); model.clear(); - - for (DesignAuthority authority : authorities) { - model.addElement(authority); + if (authorities != null && !authorities.isEmpty()) { + model.clear(); + for (DesignAuthority authority : authorities) { + model.addElement(authority); + } + int size = model.getSize() - 1; + authorityList.setSelectedIndex(size); + authorityList.ensureIndexIsVisible(size); } - - int size = model.getSize() - 1; - - authorityList.setSelectedIndex(size); - authorityList.ensureIndexIsVisible(size); - authorityList.revalidate(); authorityList.repaint(); } From f9191f54f340db523483c30d32f5261050476b49 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 11:40:57 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-11395=20=E7=94=A8=E6=88=B7=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=BA=A4=E4=BA=92=E4=BF=AE=E8=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/remote/ui/UserManagerPane.java | 12 +++++++----- .../images/buttonicon/user_search_normal.png | Bin 0 -> 444 bytes .../images/buttonicon/user_search_normal@2x.png | Bin 0 -> 844 bytes .../java/com/fr/start/preload/ImagePreLoader.java | 7 +++++-- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java index a0fbb0babc..d23a5cbafb 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java @@ -1,5 +1,6 @@ package com.fr.design.remote.ui; +import com.fr.base.BaseUtils; import com.fr.design.border.UITitledBorder; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; @@ -240,13 +241,14 @@ public class UserManagerPane extends BasicPane { ); // 搜索 - JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - searchPanel.setBorder(BorderFactory.createEmptyBorder()); - keyField.setPreferredSize(new Dimension(250, 20)); + JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); + searchPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + keyField.setPreferredSize(new Dimension(270, 20)); keyField.requestFocus(); keyField.addKeyListener(keyFieldKeyListener); keyField.getDocument().addDocumentListener(documentListener); - keyButton.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search")); + keyButton.setIcon(BaseUtils.readIcon("com/fr/design/images/buttonicon/user_search_normal.png")); + keyButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search")); keyButton.addActionListener(keyButtonActionListener); searchPanel.add(keyField); searchPanel.add(keyButton); @@ -395,7 +397,7 @@ public class UserManagerPane extends BasicPane { final SwingWorker loadMoreWorker = new SwingWorker, Void>() { @Override protected List doInBackground() { - + String username = WorkContext.getCurrent().getConnection().getUserName(); synchronized (addingMembers) { addingMembers.remove(RemoteDesignMember.DEFAULT_MEMBER); diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..9a9a2e65a42643407fb8f09966d6b6442c504a3f GIT binary patch literal 444 zcmV;t0YmPx$c1c7*R5%f(QN2sUP!PXMf)d+qLP(xi) z*)@PnxzVV;#cP$VDZ}&DO8}h*MEPkL+HNkFwOO;z@i4EdM|#*n_%nlz?Rx#TI!cEY zgQW~E0kSLUPNELFM~HCo6PPJD&iQD(1iu<#L)Z1IL?-1#dD=}< zq{S|!3nBt+_If?q`gjR~V3Dr!oUTwK)cXDYRyrB?IZqe4j>p)J2r^|UVQ1W_!YjZY zB39A_ItP6J=|hP5J3f^Vj+M{n-wTC8+p?@>+qUcq+cL zlsFv(gR^$K^Gf=h3QbMJ1w^evLbKTWrdiROoU!89d=Y}puf4fWo0000Px&21!IgR9Fe+R?lk_K^WbMY15EE@X|xpOTdEkT0=>RHPAmG-uw%^coP)=0u`~r zgGW6J-psiO(FQ_D>#>(Y^^z2Nk!V7iCS-gso0)FX?9Of>r|xBE=6m1!-hA`T56img zpD-mLpU>a!_xr`sNEU?<>r%=zeb8>9eH4j^ax4}rSF6=OCa!sQPXUEOVWr#cK11M_ za7@i}c8#?mwm`((guzX@S|LH|cGnQU^b)9Kh4 z-65_~@%k8PTQ)1Me(5qzJ%fYbPdQ~TV{ z$z)R;iqj9T1^9u&+6IGxDsCgc1|VH62I2`9HsCBC#W&6-D(Y<3Hrv+%kgg*dA!K_N z6t=H8P>erKzFGipHG+Azo19E`#UZ8GGhwv=Ua0`Lk%=81CMHKOJAKK4Ec}Z`#b+;^ z8rK4NV)06)ffox;Mgc zS$vsH=8Y*h?Nb8ynBaX50^H~F0Yub;EC(^f(#HuZS5HoUzYZcm?bj*nbsr?0IYg{p zl8MscVdME_|7vTl0K#~m2Yr&U;1IaPv}5M4&~^p&7vU*DY316^d6Z)5#2NQFw;HS6 zU2q#4*>^J{c9Dq}iqri!3UGtNw1bMc6^1kn_Vl#1mrmPB_-sx5w%F&mn`dDH7$k^@ zg$nQzVcU0xtyU8c*qL*H1B>{a0u;N7TguT>)n0f8R3I(~XO7)*4?E}s`c-AS+5i8I WHhpe=F>4_J0000 Date: Tue, 18 Sep 2018 11:47:13 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-10946=20@Sung=EF=BC=9A=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E7=8A=B6=E6=80=81=E4=B8=8B=EF=BC=88=E6=96=AD=E7=BD=91?= =?UTF-8?q?=EF=BC=89alphafine=E9=83=BD=E6=89=93=E4=B8=8D=E5=BC=80=E4=BA=86?= =?UTF-8?q?=20=E4=B9=8B=E5=89=8D=E7=9A=84=E6=96=AD=E7=BD=91=E6=83=85?= =?UTF-8?q?=E5=86=B5=E9=80=BB=E8=BE=91=E8=80=A6=E5=90=88=E5=A4=AA=E4=B8=A5?= =?UTF-8?q?=E9=87=8D=E4=BA=86=EF=BC=8C=E5=89=A5=E7=A6=BB=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineHelper.java | 20 ++++++++++++++++++ .../alphafine/component/AlphaFineDialog.java | 21 +++++++------------ .../manager/fun/AlphaFineSearchProvider.java | 2 +- .../manager/impl/ActionSearchManager.java | 2 +- .../manager/impl/DocumentSearchManager.java | 4 ++-- .../manager/impl/FileSearchManager.java | 2 +- .../manager/impl/PluginSearchManager.java | 4 ++-- .../manager/impl/RecentSearchManager.java | 2 +- .../manager/impl/RecommendSearchManager.java | 4 ++-- .../manager/impl/SimilarSearchManeger.java | 4 ++-- 10 files changed, 40 insertions(+), 25 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 763c822a9f..433710ce76 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -16,11 +16,15 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManeger; import com.fr.general.ProcessCanceledException; +import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.json.JSONUtils; import com.fr.stable.StringUtils; +import com.fr.third.org.apache.http.HttpStatus; +import com.fr.third.org.apache.http.StatusLine; +import com.fr.third.org.apache.http.client.methods.HttpGet; import java.util.List; @@ -30,6 +34,7 @@ import java.util.List; public class AlphaFineHelper { public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")); private static AlphaFineDialog alphaFineDialog; + private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com"; /** * 弹出alphafine搜索面板 @@ -145,4 +150,19 @@ public class AlphaFineHelper { result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } + + /** + * 判断网络是否异常 + * @return + */ + public static boolean isNetworkOk(){ + HttpGet getHelp = new HttpGet(URL_FOR_TEST_NETWORK); + try { + StatusLine statusLine = HttpToolbox.getHttpClient(URL_FOR_TEST_NETWORK).execute(getHelp).getStatusLine(); + return statusLine.getStatusCode() == HttpStatus.SC_OK; + } catch (Exception ignore) { + // 网络异常 + return false; + } + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index ff61edda09..e8b7747049 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -39,7 +39,6 @@ import com.fr.form.main.Form; import com.fr.form.main.FormIO; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; -import com.fr.general.http.HttpToolbox; import com.fr.io.TemplateWorkBookIO; import com.fr.io.exporter.ImageExporter; import com.fr.json.JSONException; @@ -49,7 +48,6 @@ import com.fr.main.impl.WorkBook; import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; -import com.fr.third.org.apache.http.client.methods.HttpGet; import javax.imageio.ImageIO; import javax.swing.BorderFactory; @@ -247,22 +245,19 @@ public class AlphaFineDialog extends UIDialog { GridLayout gridLayout = new GridLayout(2, 3, 3, 3); JPanel panel = new JPanel(); panel.setLayout(gridLayout); - try { - HttpGet getHelp = new HttpGet(AlphaFineConstants.ALPHA_HOT_SEARCH); - HttpToolbox.getHttpClient(AlphaFineConstants.ALPHA_HOT_SEARCH).execute(getHelp).getStatusLine(); + if(AlphaFineHelper.isNetworkOk()) { if (hotData == null) { hotData = HotIssuesManager.getInstance().getHotIssues(); } for (int i = 0; i < hotData.length; i++) { panel.add(new HotIssueJpanel(hotData[i], i + 1)); } - } catch (Exception e) { + }else { hotData = null; for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); } } - hotPane.add(uiLabel, BorderLayout.NORTH); hotPane.add(panel, BorderLayout.CENTER); add(hotPane, BorderLayout.SOUTH); @@ -552,7 +547,7 @@ public class AlphaFineDialog extends UIDialog { } private void buildDocumentList(final String[] searchText) { - addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildFileList(String searchStr, final String[] searchText) { @@ -560,24 +555,24 @@ public class AlphaFineDialog extends UIDialog { } private void buildActionList(final String[] searchText) { - addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildPluginList(final String[] searchText) { - addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildRecommendList(final String[] searchText) { - addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildRecentList(final String[] searchText) { - addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildSimilarList(final String[] searchText) { - addSearchResult(SimilarSearchManeger.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(SimilarSearchManeger.getInstance().getLessSearchResult(searchText)); } private synchronized void addSearchResult(SearchResult searchResult) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java index 154e7c858e..b75aa894c4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java @@ -12,7 +12,7 @@ public interface AlphaFineSearchProvider { * @param searchText * @return */ - SearchResult getLessSearchResult(String[][] data, String[] searchText); + SearchResult getLessSearchResult(String[] searchText); /** * 获取剩余条数 diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java index 97bfde18d0..1c4fec0903 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java @@ -57,7 +57,7 @@ public class ActionSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { filterModelList = new SearchResult(); lessModelList = new SearchResult(); moreModelList = new SearchResult(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 1003c0e21b..d2ba8b8b07 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -51,14 +51,14 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { lessModelList = new SearchResult(); moreModelList = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); return lessModelList; - } else if (hotData == null) { + } else if (!AlphaFineHelper.isNetworkOk()) { return AlphaFineHelper.getNoConnectList(instance); } SearchResult searchResult = new SearchResult(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index c7972753ca..17c58998df 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -96,7 +96,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { return null; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 0feff55215..293ba51e30 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -96,7 +96,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); SearchResult searchResult = new SearchResult(); @@ -104,7 +104,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"))); return lessModelList; - } else if (hotData == null) { + } else if (!AlphaFineHelper.isNetworkOk()) { return AlphaFineHelper.getNoConnectList(instance); } for (int j = 0; j < searchText.length; j++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 38f413423a..866c2c7349 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -72,7 +72,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { this.modelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { recentModelList = getRecentModelList(searchText[j]); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index de527d5513..64902e0f47 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -46,13 +46,13 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { this.modelList = new SearchResult(); this.recommendModelList = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if(hotData == null){ + } else if(!AlphaFineHelper.isNetworkOk()){ return AlphaFineHelper.getNoConnectList(instance); } for (int j = 0; j < searchText.length; j++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index 90d0489321..bf696529db 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -37,12 +37,12 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { lessModelList = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if (hotData == null) { + } else if (!AlphaFineHelper.isNetworkOk()) { return AlphaFineHelper.getNoConnectList(instance); } SearchResult allModelList = new SearchResult(); From 67ff7823ffe0e04aa37d0695de5c10312b661e68 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Sep 2018 12:56:13 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=9C=A8getNoConnectList=E9=87=8C=E5=88=A4?= =?UTF-8?q?=E6=96=ADisNetworkOk,=20=E5=AF=B9=E5=A4=96=E5=B0=B1=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=96=B9=E6=B3=95getNoConnectList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/alphafine/AlphaFineHelper.java | 3 +++ .../search/manager/impl/DocumentSearchManager.java | 6 ++++-- .../alphafine/search/manager/impl/PluginSearchManager.java | 6 ++++-- .../search/manager/impl/RecommendSearchManager.java | 6 ++++-- .../alphafine/search/manager/impl/SimilarSearchManeger.java | 6 ++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 433710ce76..7b20a44cf2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -135,6 +135,9 @@ public class AlphaFineHelper { * @return */ public static SearchResult getNoConnectList(Object object) { + if (isNetworkOk()){ + return null; + } SearchResult result = new SearchResult(); if (object instanceof RecommendSearchManager) { result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend"))); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index d2ba8b8b07..b5b517c1c1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -58,8 +58,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); return lessModelList; - } else if (!AlphaFineHelper.isNetworkOk()) { - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 293ba51e30..826aa7db22 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -104,8 +104,10 @@ public class PluginSearchManager implements AlphaFineSearchProvider { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"))); return lessModelList; - } else if (!AlphaFineHelper.isNetworkOk()) { - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } for (int j = 0; j < searchText.length; j++) { try { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 64902e0f47..c97e621e35 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -52,8 +52,10 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if(!AlphaFineHelper.isNetworkOk()){ - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } for (int j = 0; j < searchText.length; j++) { searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index bf696529db..1bc6411313 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -42,8 +42,10 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if (!AlphaFineHelper.isNetworkOk()) { - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { From ce5062b9a0ae25efd08e23dabb8805c462ab0401 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 14:54:42 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=9C=AA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E6=96=87=E4=BB=B6=E4=BA=A4=E4=BA=92=E4=BF=AE?= =?UTF-8?q?=E8=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index b1a3b8e34f..b6f18a1882 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -17,6 +17,7 @@ import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.ProductConstants; +import com.fr.third.javax.annotation.Nonnull; import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; @@ -677,34 +678,31 @@ public class MutilTempalteTabPane extends JComponent { //当前激活的模板 String filename = openedTemplate.get(selectedIndex).getPath(); - - filename = FilenameUtils.standard(filename); - if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) { specifiedTemplate.stopEditing(); int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION) { specifiedTemplate.saveTemplate(); - HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); - - activeTemplate(filename); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + closeTpl(specifiedTemplate, filename); + } else if (returnVal == JOptionPane.NO_OPTION) { + closeTpl(specifiedTemplate, filename); } } else { - HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); - - activeTemplate(filename); - FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + closeTpl(specifiedTemplate, filename); } } + private void closeTpl(@Nonnull JTemplate specifiedTemplate, @Nonnull String fileName) { + HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); + // release lock + WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); + activeTemplate(fileName); + } + /** * 关闭模板 * From 896e6a6ff0e79e42f254d9997e208d0b0e5e77cb Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 15:03:03 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/remote/ui/AuthorityListControlPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java index d8692c443d..1d027ac8a1 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java @@ -256,7 +256,6 @@ public class AuthorityListControlPane extends BasicPane { DefaultListModel model = (DefaultListModel) authorityList.getModel(); model.clear(); if (authorities != null && !authorities.isEmpty()) { - model.clear(); for (DesignAuthority authority : authorities) { model.addElement(authority); } From abd64f7ba774b00ccd3919082fc27d60ba79853d Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 15:46:41 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/remote/ui/UserManagerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java index d23a5cbafb..1e22dc8083 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java @@ -369,9 +369,9 @@ public class UserManagerPane extends BasicPane { final SwingWorker getMemberWorker = new SwingWorker, Void>() { @Override protected List doInBackground() { - addingMembers.clear(); String username = WorkContext.getCurrent().getConnection().getUserName(); synchronized (addingMembers) { + addingMembers.clear(); Collection more = WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword); pageNum = 1; if (!more.isEmpty()) { From 3847e66b0ba581505ac1a823f749c94e2bc73b97 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Sep 2018 17:27:55 +0800 Subject: [PATCH 8/8] =?UTF-8?q?REPORT-11403=20@Sung=EF=BC=9A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BB=93=E6=9E=9C=E5=87=BA=E6=9D=A5=E7=9A=84=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE=E5=81=8F?= =?UTF-8?q?=E4=B8=8A=E4=BA=86=20=E8=B0=83=E6=95=B4=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 2 +- .../alphafine/preview/RobotPreviewPane.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index e8b7747049..5137d56f13 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -735,7 +735,7 @@ public class AlphaFineDialog extends UIDialog { if (!isCancelled() && rightSearchResultPane != null) { rightSearchResultPane.removeAll(); try { - rightSearchResultPane.add(new RobotPreviewPane((selectedValue).getName(), get())); + rightSearchResultPane.add(new RobotPreviewPane(selectedValue, get())); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error("get hot item content error: " + e.getMessage()); } catch (ExecutionException e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index 120d15f2b0..bd13d6aae8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -4,6 +4,8 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; +import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -28,13 +30,14 @@ import java.net.URL; */ public class RobotPreviewPane extends JPanel { - private static final int TITLE_AREA_HEIGHT = 30; + private static final int TITLE_AREA_HEIGHT = 15; + private static final int HOT_TITLE_AREA_HEIGHT = 30; - public RobotPreviewPane(String title, String content) { + public RobotPreviewPane(AlphaCellModel model, String content) { this.setLayout(new BorderLayout()); this.setBackground(Color.WHITE); this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); - UITextArea titleArea = new UITextArea(title); + UITextArea titleArea = new UITextArea(model.getName()); titleArea.setBorder(null); titleArea.setEditable(false); titleArea.setForeground(AlphaFineConstants.BLUE); @@ -74,9 +77,13 @@ public class RobotPreviewPane extends JPanel { }); editorPane.setEditable(false); UIScrollPane jScrollPane = new UIScrollPane(editorPane); - jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); + jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 30, 0)); jScrollPane.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 10, Color.white)); - this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - TITLE_AREA_HEIGHT)); + if (((RobotModel) model).isHotItemModel()) { + this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - HOT_TITLE_AREA_HEIGHT)); + } else { + this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - TITLE_AREA_HEIGHT)); + } add(jScrollPane, BorderLayout.CENTER); } }