From 84122ebe93978e250237b2e4d6ab2d5fb1c2d45f Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Fri, 18 Aug 2017 15:24:06 +0800 Subject: [PATCH 01/10] =?UTF-8?q?alphafine=20=E7=BB=86=E8=8A=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineDialog.java | 4 ++-- .../design/mainframe/alphafine/component/AlphaFinePane.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 83945d324..1d5faa3b6 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -354,11 +354,11 @@ public class AlphaFineDialog extends UIDialog { * 重置结果面板 */ private void replaceLeftPane() { - if (searchListModel.getSize() == 0 && defaultPane == null) { + if (searchListModel.getSize() == 0 && searchResultPane != null) { defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); searchResultPane.remove(leftSearchResultPane); searchResultPane.add(defaultPane, BorderLayout.WEST); - } else if (searchListModel.getSize() > 0 && defaultPane != null) { + } else if (searchResultPane != null && searchListModel.getSize() > 0 && defaultPane != null) { searchResultPane.remove(defaultPane); defaultPane = null; searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java index cfd37479e..8c962a001 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java @@ -30,6 +30,7 @@ public class AlphaFinePane extends BasicPane { refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine")); refreshButton.set4ToolbarButton(); + refreshButton.setRolloverEnabled(false); this.add(refreshButton); this.setBackground(ThemeUtils.WHITE_BORDER_COLOR); refreshButton.addActionListener(new ActionListener() { From ae7cfe25636e6c932b95c2070fc041aa7144e81b Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 22 Aug 2017 22:59:26 +0800 Subject: [PATCH 02/10] =?UTF-8?q?alphafine=20=E4=BA=A4=E4=BA=92=E6=94=B9?= =?UTF-8?q?=E8=89=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/render/TitleCellRender.java | 8 --- .../alphafine/component/AlphaFineDialog.java | 57 +++++------------- .../mainframe/alphafine/images/bigloading.gif | Bin 0 -> 14550 bytes 3 files changed, 15 insertions(+), 50 deletions(-) create mode 100644 designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java b/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java index c5329da68..97f68cbf7 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java @@ -33,14 +33,6 @@ public class TitleCellRender implements ListCellRenderer { showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); panel.add(showMoreLabel, BorderLayout.EAST); } - if (moreModel.isLoading()) { - ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif")); - //设置cell的加载动画 - imageIcon.setImageObserver(list); - UILabel loadingLabel = new UILabel(imageIcon); - loadingLabel.setBorder(BorderFactory.createEmptyBorder(LOAD_OFFSET,0,0,0)); - panel.add(loadingLabel, 0); - } panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT)); return panel; } diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index f0f80f58c..0ca1fb664 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -72,9 +72,10 @@ public class AlphaFineDialog extends UIDialog { private AlphaFineTextField searchTextField; private UIButton closeButton; private JPanel searchResultPane; - private Point pressedPoint; private UIScrollPane leftSearchResultPane; private JPanel defaultPane; + //分割线 + private UILabel splitLabel; private JPanel rightSearchResultPane; private AlphaFineList searchResultList; private SearchListModel searchListModel; @@ -302,7 +303,7 @@ public class AlphaFineDialog extends UIDialog { rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT)); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); searchResultPane.add(rightSearchResultPane, BorderLayout.EAST); - UILabel splitLabel = new UILabel(); + splitLabel = new UILabel(); splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); searchResultPane.add(splitLabel, BorderLayout.NORTH); add(searchResultPane, BorderLayout.SOUTH); @@ -320,6 +321,7 @@ public class AlphaFineDialog extends UIDialog { this.searchWorker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { + splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif"))); rebuildList(searchTextField.getText().toLowerCase()); return null; } @@ -327,6 +329,7 @@ public class AlphaFineDialog extends UIDialog { @Override protected void done() { if (!isCancelled()) { + splitLabel.setIcon(null); fireStopLoading(); } } @@ -339,7 +342,8 @@ public class AlphaFineDialog extends UIDialog { */ private void fireStopLoading() { searchListModel.resetState(); - replaceLeftPane(); + refreshContainer(); + //replaceLeftPane(); } /** @@ -680,45 +684,6 @@ public class AlphaFineDialog extends UIDialog { } - /** - * 窗口拖拽 - */ - private void initMouseListener() { - addMouseMotionListener(new MouseMotionAdapter() { - @Override - public void mouseDragged(MouseEvent e) { - doMouseDragged(e); - } - }); - - addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - doMousePressed(e); - } - - }); - } - - private void doMousePressed(MouseEvent e) { - - pressedPoint = e.getPoint(); - - } - - private void doMouseDragged(MouseEvent e) { - - Point point = e.getPoint();// 获取当前坐标 - - Point locationPoint = getLocation();// 获取窗体坐标 - - int x = locationPoint.x + point.x - pressedPoint.x;// 计算移动后的新坐标 - - int y = locationPoint.y + point.y - pressedPoint.y; - - setLocation(x, y);// 改变窗体位置 - - } - /** * 当鼠标在搜索界面边界外点击时触发 */ @@ -880,6 +845,14 @@ public class AlphaFineDialog extends UIDialog { this.storeText = storeText; } + public UILabel getSplitLabel() { + return splitLabel; + } + + public void setSplitLabel(UILabel splitLabel) { + this.splitLabel = splitLabel; + } + /** * +-------------------------------------+ diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif b/designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif new file mode 100644 index 0000000000000000000000000000000000000000..715ab7aeccd5bc9916ce280dbe986c87e209bc2e GIT binary patch literal 14550 zcmeHuc|6p6)c@Erv>~NisxeZi?6M^WlP$Z7t`^G_vRzH3Za2G-LKM1Wn{3fyskB^c zWhqOf{a#5$>kNaLG0XG$4r9Ljru%CA?(6yM>7SUs%X`jwpL5=yb57=#TXgl@iv)!c zV=P2k(-`gw*|licublju%q)LKjj9=qsU3AMB|ra6|3qe#bWwe-lV5(J+vW}Z^Nrz1 z7;1Y@$KM#qXrbtwC-xH=L6swyIw)73Qa=nadcQMXe`UCr4r`nY< zR{ziVrgYN4FyrDQN@MT1RnAcN06pcwSXEV3M)TO&hhz4HA?JeO*8cIlHcD_Mc~=QJ z?CxmY-!zRB;+GL-$gPp4zH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$XGEK)Yg)>lT7^T>bX!&L=)C8sB#(J*Op~k;XC3=9^ek2 z&&RfTKgZ_RrkhSI0IIweG4!KTd9SGcwC9yb3omUj2;ObOG<}dS7c4#KqLluLt(tu{cVtN#HpIFU9#16 z`JKEcj6Yxcf_qn46`J(_cI}Y>LQrAGzPep>Xh~^sedC#$%@W5k*_V(9`Jz~q5nJe_a{WKq+>{XKOOCh-52-G2cD_>Tujuo*uw1ma@&zkh&CV(>rL14OF; literal 0 HcmV?d00001 From fdfeb3c026c5c98cd1e3af0c1029f9b34541dc8b Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 22 Aug 2017 23:53:13 +0800 Subject: [PATCH 03/10] bug fix --- .../alphafine/component/AlphaFineDialog.java | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 0ca1fb664..8246056ec 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -73,6 +73,7 @@ public class AlphaFineDialog extends UIDialog { private UIButton closeButton; private JPanel searchResultPane; private UIScrollPane leftSearchResultPane; + private JPanel defaultPane; //分割线 private UILabel splitLabel; @@ -342,8 +343,7 @@ public class AlphaFineDialog extends UIDialog { */ private void fireStopLoading() { searchListModel.resetState(); - refreshContainer(); - //replaceLeftPane(); + replaceLeftPane(); } /** @@ -359,16 +359,14 @@ public class AlphaFineDialog extends UIDialog { * 重置结果面板 */ private void replaceLeftPane() { - if (searchListModel.getSize() == 0 && searchResultPane != null) { - defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); - searchResultPane.remove(leftSearchResultPane); - searchResultPane.add(defaultPane, BorderLayout.WEST); - } else if (searchResultPane != null && searchListModel.getSize() > 0 && defaultPane != null) { - searchResultPane.remove(defaultPane); - defaultPane = null; - searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); + if (searchResultPane != null) { + if (searchListModel.isEmpty() && defaultPane == null) { + defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); + searchResultPane.remove(leftSearchResultPane); + searchResultPane.add(defaultPane, BorderLayout.WEST); + refreshContainer(); + } } - refreshContainer(); } /** @@ -971,6 +969,12 @@ public class AlphaFineDialog extends UIDialog { */ private void fireSelectedStateChanged(AlphaCellModel element, int index) { if (element.hasAction() && !isValidSelected()) { + if (defaultPane != null) { + searchResultPane.remove(defaultPane); + defaultPane = null; + searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); + refreshContainer(); + } searchResultList.setSelectedIndex(index); setValidSelected(true); } @@ -1020,6 +1024,11 @@ public class AlphaFineDialog extends UIDialog { isValidSelected = selected; } + @Override + public boolean isEmpty() { + return myDelegate.isEmpty(); + } + public void resetState() { for (int i = 0; i< getSize(); i++) { getElementAt(i).resetState(); From 8c04871fc7a2bdd978c239350b3adcd21393e6a4 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 00:33:23 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/help/alphafine/AlphaFineConfigManager.java | 7 ++++++- .../com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 0796d1dff..700b5fbf5 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -1,5 +1,7 @@ package com.fr.design.actions.help.alphafine; +import com.fr.base.FRCoreContext; +import com.fr.general.VT4FR; import com.fr.stable.OperatingSystem; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; @@ -199,7 +201,10 @@ public class AlphaFineConfigManager implements XMLable { } public boolean isEnabled() { - return isEnabled; + if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) { + return isEnabled; + } + return false; } public void setEnabled(boolean isEnabled) { diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 17d9d6e36..fa99f0e28 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -5,6 +5,7 @@ package com.fr.design.mainframe.toolbar; import com.fr.base.BaseUtils; import com.fr.base.FRContext; +import com.fr.base.FRCoreContext; import com.fr.design.DesignState; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; @@ -34,6 +35,7 @@ import com.fr.env.RemoteEnv; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.general.VT4FR; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; import com.fr.plugin.manage.PluginFilter; @@ -379,8 +381,10 @@ public abstract class ToolBarMenuDock { // shortCuts.add(new ForumAction()); } shortCuts.add(SeparatorDef.DEFAULT); - shortCuts.add(new AlphaFineAction()); - shortCuts.add(SeparatorDef.DEFAULT); + if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) { + shortCuts.add(new AlphaFineAction()); + shortCuts.add(SeparatorDef.DEFAULT); + } shortCuts.add(new AboutAction()); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } From 4bdb196aabc8c7d4aa926375be7606f20575e315 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 07:58:25 +0800 Subject: [PATCH 05/10] rt --- .../mainframe/alphafine/component/AlphaFineDialog.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 8246056ec..c3966b1de 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -411,8 +411,7 @@ public class AlphaFineDialog extends UIDialog { searchListModel.removeAllElements(); searchListModel.resetSelectedState(); rightSearchResultPane.removeAll(); - validate(); - repaint(); + refreshContainer(); } /** @@ -607,7 +606,7 @@ public class AlphaFineDialog extends UIDialog { this.showWorker.execute(); break; default: - return; + rightSearchResultPane.removeAll(); } From 1db52a5f2cad6a058e64bd09693978f662302b13 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 10:06:32 +0800 Subject: [PATCH 06/10] bug fix --- .../alphafine/component/AlphaFineDialog.java | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index c3966b1de..6376759c8 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -322,6 +322,7 @@ public class AlphaFineDialog extends UIDialog { this.searchWorker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { + resumeLeftPane(); splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif"))); rebuildList(searchTextField.getText().toLowerCase()); return null; @@ -339,24 +340,20 @@ public class AlphaFineDialog extends UIDialog { } /** - * 停止加载状态 - */ - private void fireStopLoading() { - searchListModel.resetState(); - replaceLeftPane(); - } - - /** - * 刷新容器 + * 恢复左侧列表面板 */ - private void refreshContainer() { - validate(); - repaint(); - revalidate(); + private void resumeLeftPane() { + if (searchResultPane != null && defaultPane != null) { + searchResultPane.remove(defaultPane); + defaultPane = null; + searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); + rightSearchResultPane.removeAll(); + refreshContainer(); + } } /** - * 重置结果面板 + * 移除左侧列表面板 */ private void replaceLeftPane() { if (searchResultPane != null) { @@ -369,6 +366,23 @@ public class AlphaFineDialog extends UIDialog { } } + /** + * 停止加载状态 + */ + private void fireStopLoading() { + searchListModel.resetState(); + replaceLeftPane(); + } + + /** + * 刷新容器 + */ + private void refreshContainer() { + validate(); + repaint(); + revalidate(); + } + /** * 重新构建搜索结果列表 * 先根据输入判断是不是隐藏的搜索功能 @@ -968,12 +982,6 @@ public class AlphaFineDialog extends UIDialog { */ private void fireSelectedStateChanged(AlphaCellModel element, int index) { if (element.hasAction() && !isValidSelected()) { - if (defaultPane != null) { - searchResultPane.remove(defaultPane); - defaultPane = null; - searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); - refreshContainer(); - } searchResultList.setSelectedIndex(index); setValidSelected(true); } From 58afb5c9ee4c823440b991d5084d83447b5091f2 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 13:07:03 +0800 Subject: [PATCH 07/10] rt --- .../design/mainframe/alphafine/component/AlphaFineDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 6376759c8..bc6913436 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -344,10 +344,10 @@ public class AlphaFineDialog extends UIDialog { */ private void resumeLeftPane() { if (searchResultPane != null && defaultPane != null) { + rightSearchResultPane.removeAll(); searchResultPane.remove(defaultPane); defaultPane = null; searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); - rightSearchResultPane.removeAll(); refreshContainer(); } } From 7bb1e75faf18811d8bff0c84a862c65fd982bc23 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 13:16:26 +0800 Subject: [PATCH 08/10] pmd --- .../alphafine/component/AlphaFineDialog.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index bc6913436..dd7fc1031 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -17,7 +17,10 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.model.SearchResult; -import com.fr.design.mainframe.alphafine.preview.*; +import com.fr.design.mainframe.alphafine.preview.DocumentPreviewPane; +import com.fr.design.mainframe.alphafine.preview.FilePreviewPane; +import com.fr.design.mainframe.alphafine.preview.NoResultPane; +import com.fr.design.mainframe.alphafine.preview.PluginPreviewPane; import com.fr.design.mainframe.alphafine.search.manager.*; import com.fr.form.main.Form; import com.fr.form.main.FormIO; @@ -356,13 +359,11 @@ public class AlphaFineDialog extends UIDialog { * 移除左侧列表面板 */ private void replaceLeftPane() { - if (searchResultPane != null) { - if (searchListModel.isEmpty() && defaultPane == null) { - defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); - searchResultPane.remove(leftSearchResultPane); - searchResultPane.add(defaultPane, BorderLayout.WEST); - refreshContainer(); - } + if (searchListModel.isEmpty() && defaultPane == null) { + defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); + searchResultPane.remove(leftSearchResultPane); + searchResultPane.add(defaultPane, BorderLayout.WEST); + refreshContainer(); } } @@ -371,7 +372,9 @@ public class AlphaFineDialog extends UIDialog { */ private void fireStopLoading() { searchListModel.resetState(); - replaceLeftPane(); + if (searchResultPane != null) { + replaceLeftPane(); + } } /** @@ -1037,7 +1040,7 @@ public class AlphaFineDialog extends UIDialog { } public void resetState() { - for (int i = 0; i< getSize(); i++) { + for (int i = 0; i < getSize(); i++) { getElementAt(i).resetState(); } } From d3e9c054e416ef22ea61535719b8993d46236557 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 13:27:55 +0800 Subject: [PATCH 09/10] pmd --- .../mainframe/alphafine/component/AlphaFineDialog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index dd7fc1031..ae811dbda 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -358,7 +358,7 @@ public class AlphaFineDialog extends UIDialog { /** * 移除左侧列表面板 */ - private void replaceLeftPane() { + private void removeLeftPane() { if (searchListModel.isEmpty() && defaultPane == null) { defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); searchResultPane.remove(leftSearchResultPane); @@ -373,7 +373,7 @@ public class AlphaFineDialog extends UIDialog { private void fireStopLoading() { searchListModel.resetState(); if (searchResultPane != null) { - replaceLeftPane(); + removeLeftPane(); } } @@ -771,7 +771,7 @@ public class AlphaFineDialog extends UIDialog { } final HashMap para = new HashMap<>(); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); - para.put("token", CodeUtils.md5Encode(date, "", "MD5")); + para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); para.put("content", object.toString()); HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true); httpClient.asGet(); From 89df2e5bcc20a01bc6f72b04cda5080ac0c25d55 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 23 Aug 2017 13:33:03 +0800 Subject: [PATCH 10/10] pmd --- .../design/actions/help/alphafine/AlphaFineConfigManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 700b5fbf5..b1248df70 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -90,7 +90,8 @@ public class AlphaFineConfigManager implements XMLable { @Override public Object clone() throws CloneNotSupportedException { - return super.clone(); + AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone(); + return manager; } @Override