From c12ea85fba97786a71bd8ea889e55e2a55f8f67c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sat, 8 Jul 2017 00:02:26 +0800 Subject: [PATCH 01/11] =?UTF-8?q?alphafine=20=E6=90=9C=E7=B4=A2=E6=A1=86?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E8=A7=86=E8=A7=89=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 | 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 0abb29a75..207c3ae5d 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -144,10 +144,10 @@ public class AlphaFineDialog extends UIDialog { super.paintComponent(g); } }; - closeButton.setContentAreaFilled(false); closeButton.setPreferredSize(AlphaFineConstants.CLOSE_BUTTON_SIZE); closeButton.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/alphafine_close.png"))); closeButton.set4ToolbarButton(); + closeButton.setRolloverEnabled(false); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { From b918a95d0d1ff91be6a110cbc6e1ff572c83296e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sat, 8 Jul 2017 00:32:53 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=85=88=E5=8E=BB=E6=8E=89=E5=9C=86?= =?UTF-8?q?=E8=A7=92=EF=BC=8C=E5=8F=A6=E5=A4=96=E4=BC=98=E5=8C=96=E4=BA=86?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 207c3ae5d..597491e34 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -147,6 +147,7 @@ public class AlphaFineDialog extends UIDialog { closeButton.setPreferredSize(AlphaFineConstants.CLOSE_BUTTON_SIZE); closeButton.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/alphafine_close.png"))); closeButton.set4ToolbarButton(); + closeButton.setBorderPainted(false); closeButton.setRolloverEnabled(false); closeButton.addActionListener(new ActionListener() { @Override @@ -154,11 +155,7 @@ public class AlphaFineDialog extends UIDialog { dispose(); } }); - UILabel borderLabel = new UILabel(); - borderLabel.setBackground(AlphaFineConstants.GRAY); - borderLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); topPane.add(closeButton, BorderLayout.EAST); - topPane.add(borderLabel, BorderLayout.SOUTH); add(topPane, BorderLayout.CENTER); searchTextField.getDocument().addDocumentListener(new DocumentAdapter() { @Override @@ -184,7 +181,7 @@ public class AlphaFineDialog extends UIDialog { */ private void initProperties() { setUndecorated(true); - addComponentListener(new ComponentHandler()); + //addComponentListener(new ComponentHandler()); setSize(AlphaFineConstants.FIELD_SIZE); centerWindow(this); @@ -306,6 +303,10 @@ public class AlphaFineDialog extends UIDialog { searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); searchResultPane.add(rightSearchResultPane, BorderLayout.EAST); + UILabel splitLabel = new UILabel(); + splitLabel.setBackground(AlphaFineConstants.GRAY); + splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); + searchResultPane.add(splitLabel, BorderLayout.NORTH); add(searchResultPane, BorderLayout.SOUTH); setSize(AlphaFineConstants.FULL_SIZE); } From 62b4260c9292c7669a08142bce4cd051dc5f6196 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sat, 8 Jul 2017 01:32:10 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E7=8C=9C=E6=82=A8=E9=9C=80=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/help/alphafine/AlphaFineConfigManager.java | 2 +- 1 file changed, 1 insertion(+), 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 a7d7f1d4b..0796d1dff 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 @@ -35,7 +35,7 @@ public class AlphaFineConfigManager implements XMLable { /** * 猜您需要 */ - private boolean isContainRecommend; + private boolean isContainRecommend = true; /** * 设置 From 55e63db361b04ba836b9b37c639e801be8418042 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sat, 8 Jul 2017 08:54:52 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=9C=89=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineDialog.java | 4 ++-- 1 file changed, 2 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 597491e34..ef5f1aa58 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -371,8 +371,8 @@ public class AlphaFineDialog extends UIDialog { searchListModel.removeAllElements(); searchListModel.resetSelectedState(); rightSearchResultPane.removeAll(); - rightSearchResultPane.validate(); - rightSearchResultPane.repaint(); + validate(); + repaint(); } /** From a805b30310b0518688bde24ab0f8a1034c306e0c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 9 Jul 2017 16:31:54 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=94=AF=E6=8C=81gif=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=EF=BC=8C=E4=B9=8B=E5=89=8D=E6=94=B9=E9=94=99=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/cell/render/TitleCellRender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b105adba9..ca1890ea8 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,7 +33,7 @@ public class TitleCellRender implements ListCellRenderer { panel.add(showMoreLabel, BorderLayout.EAST); } if (moreModel.isLoading()) { - ImageIcon imageIcon = (ImageIcon) IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/loading.gif"); + ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif")); //设置cell的加载动画 imageIcon.setImageObserver(list); UILabel loadingLabel = new UILabel(imageIcon); From 444dfc613a86e9c4995fa46b1dcc00a64e2284ce Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 9 Jul 2017 18:05:27 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E6=98=AF=EF=BC=8C=E6=B6=88=E9=99=A4=E6=96=87=E5=AD=97=E4=BD=8D?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/cell/render/TitleCellRender.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ca1890ea8..c5329da68 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 @@ -12,6 +12,7 @@ import java.awt.*; * Created by XiaXiang on 2017/4/20. */ public class TitleCellRender implements ListCellRenderer { + private static final int LOAD_OFFSET = 28; @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { @@ -23,9 +24,9 @@ public class TitleCellRender implements ListCellRenderer { panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); titleLabel.setText(moreModel.getName()); titleLabel.setFont(AlphaFineConstants.SMALL_FONT); + titleLabel.setForeground(AlphaFineConstants.DARK_GRAY); showMoreLabel.setFont(AlphaFineConstants.SMALL_FONT); showMoreLabel.setText(moreModel.getContent()); - titleLabel.setForeground(AlphaFineConstants.DARK_GRAY); showMoreLabel.setForeground(AlphaFineConstants.DARK_GRAY); panel.add(titleLabel, BorderLayout.WEST); if (moreModel.isNeedMore()) { @@ -37,7 +38,8 @@ public class TitleCellRender implements ListCellRenderer { //设置cell的加载动画 imageIcon.setImageObserver(list); UILabel loadingLabel = new UILabel(imageIcon); - panel.add(loadingLabel, BorderLayout.SOUTH); + 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; From df217f58814c3575b71a27bb8a9cdd5f64d75e3f Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 9 Jul 2017 18:11:59 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=BB=93=E6=9D=9Floading=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/cell/model/AlphaCellModel.java | 7 +++++++ .../design/mainframe/alphafine/cell/model/MoreModel.java | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java index 1ba4e1a24..ee9a9f55c 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java @@ -109,4 +109,11 @@ public abstract class AlphaCellModel implements Comparable { } return this.getName().compareTo(cellModel.getName()); } + + /** + * 恢复正常状态 + */ + public void resetState() { + + } } diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java index 5da7be486..2b808a0f8 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java @@ -16,11 +16,11 @@ public class MoreModel extends AlphaCellModel { super(name, content, CellType.MORE); this.needMore = needMore; this.contentType = type; + setLoading(true); } public MoreModel(String name) { - super(name, null, CellType.MORE); - this.needMore = false; + this(name, true); } public MoreModel(String name, boolean isLoading) { @@ -51,6 +51,11 @@ public class MoreModel extends AlphaCellModel { } + @Override + public void resetState() { + setLoading(false); + } + public boolean isLoading() { return isLoading; } From aac41bc58af93470b3a20b4cd04d2f5ef96b9c56 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 9 Jul 2017 21:53:13 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 23 ++++++++++++++++-- .../mainframe/alphafine/images/loading.gif | Bin 11366 -> 10241 bytes .../search/manager/ActionSearchManager.java | 5 ++-- .../search/manager/DocumentSearchManager.java | 7 +++--- .../search/manager/FileSearchManager.java | 5 ++-- .../search/manager/PluginSearchManager.java | 7 +++--- .../search/manager/RecentSearchManager.java | 4 +-- .../manager/RecommendSearchManager.java | 2 +- 8 files changed, 34 insertions(+), 19 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 ef5f1aa58..5a1c89220 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -14,7 +14,6 @@ import com.fr.design.mainframe.alphafine.cell.model.FileModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; 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.ComponentHandler; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.preview.ActionPreviewPane; @@ -325,10 +324,24 @@ public class AlphaFineDialog extends UIDialog { rebuildList(searchTextField.getText().toLowerCase()); return null; } + + @Override + protected void done() { + if (!isCancelled()) { + fireStopLoading(); + } + } }; this.searchWorker.execute(); } + /** + * 停止加载状态 + */ + private void fireStopLoading() { + searchListModel.resetState(); + } + /** * 重新构建搜索结果列表 * 先根据输入判断是不是隐藏的搜索功能 @@ -979,7 +992,7 @@ public class AlphaFineDialog extends UIDialog { public AlphaCellModel remove(int index) { AlphaCellModel object = myDelegate.get(index); myDelegate.remove(object); - fireIntervalRemoved(this, index, index); + fireContentsChanged(this, index, index); return object; } @@ -1007,6 +1020,12 @@ public class AlphaFineDialog extends UIDialog { private void setValidSelected(boolean selected) { isValidSelected = selected; } + + public void resetState() { + for (int i = 0; i< getSize(); i++) { + getElementAt(i).resetState(); + } + } } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/loading.gif b/designer/src/com/fr/design/mainframe/alphafine/images/loading.gif index 497dcbf962e118f985c9ae01c25b3ef7c85f9f43..35485e7ad3085d32971df5f332cd748b30b43663 100644 GIT binary patch literal 10241 zcmeI1d0Z3c*2h6m77;;3L4yVe3S5PRfF@Ct9fDHX+*-865CxS*5|LW#0t&Lo?g|PL z5cFCrsI8(^K#{O1C~cwADlUi=F&iO!-kD^Az&i@AbkNKwIX#S$~o9tWWeuzo_M{$oo9& zVjKS>Pa0IpIoHfzafbQ#2XWXHZb36Yt9}@h%RJG*f5(z+EazZPFtZ*G2hiC+cMAU+ z6nAxX9lpm){FV2PBi(m<==!-+6|;B(sX!zn zoMIKX^0)uQ1+_1Pp66L78GP?^ES^xt6-w`R3&Vfp{{CJZSjujCEh=r} z4-S6l8W4*m(#!|E!6E6#Vc=2OA9<4CGIre0L)FiP=UVurA31AF*w6aJZ`qQ!9Kapi zUam|cldUi3*7u0$PxySm#bTL2Bz^i${71j|V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Yo#9=z0*}lK&1rKJ)Dq2=0He|aYVXqSRlZzo1c5v82}3u2noJGYq|>w zOcbGn7_vJf(bRS}D3)-Hi36sNR42js-#YSukV1y;64sXwk@VcKa0Ei4KS4bm3&+yG zGqX>et*QoTv$zblS6~Ac)QrTX@5M9UX*s@JVN)${~p^QAvARN5xB9fLKw@eY%C>VuCpp7E; zhZNrvk)9Y$2{4DvF5IXNIJ+S+T0%I|9wd(Rj8GsOAYWtC3@VVR)0{Gq%_Tf!lSbEd zd8W9}uxRjd(98NE zN9_~hWd(N|l!aOrX7(yLkSqdbi!WTl%*G;pDdb4@-TODN zFBMNX**#ivnUNm;NM{P;FrGhJ*AN^HONNhN+_-rIU|_*toAw`AJplVqKu9pFpj7BL z?}t|Zi?PP3O9}(b>dJMqhnxP;D)F&1U-sP)IO0oj9|q1)q+`_x?BkS$B{jssKr(@1 zqI>@aFE~>05EH1^5_tqFP zrzuK$OE0F)`%mnLPx4b303;l-e|BuYY`h!`0rm?ktAyt;`$yf!D{iv#LhL_VFwBLx zFHgGKqTKX2+Ot=v!utm+gaKJ~z^62-Rebn`=CDczowuLWf4^ z`UneE?eg&1h=FBDDS8p2B+*8hu}-qyyWdN4B(=EJU>tqs$oS6pk`8aOJhQ;`6yE4P z0-8lvB)4a(%fNMzPGcKJrBD=++de~sO+6{Lc0qq`+CEHk+YZf;(5=XG-HHAWZc52f Uz@;oD`C!S^OAY=%{=M=404tL`!vFvP diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java index a05021503..3756b03ae 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java @@ -21,7 +21,6 @@ import java.util.List; * Created by XiaXiang on 2017/3/27. */ public class ActionSearchManager implements AlphaFineSearchProcessor { - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Set")); private static ActionSearchManager actionSearchManager = null; private SearchResult filterModelList; private SearchResult lessModelList; @@ -58,7 +57,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { lessModelList = new SearchResult(); moreModelList = new SearchResult(); if (StringUtils.isBlank(searchText)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Set"))); return lessModelList; } if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) { @@ -78,7 +77,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { } if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); if (result.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java index 40eaea686..ebabc9aa2 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java @@ -19,7 +19,6 @@ import com.fr.stable.StringUtils; * Created by XiaXiang on 2017/3/27. */ public class DocumentSearchManager implements AlphaFineSearchProcessor { - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")); private static DocumentSearchManager documentSearchManager = null; private SearchResult lessModelList; private SearchResult moreModelList; @@ -51,7 +50,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { lessModelList = new SearchResult(); moreModelList = new SearchResult(); if (StringUtils.isBlank(searchText)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); return lessModelList; } if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { @@ -78,7 +77,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { } } if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); if (searchResult.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { @@ -105,7 +104,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { */ private SearchResult getNoConnectList() { SearchResult result = new SearchResult(); - result.add(0, TITLE_MODEL); + result.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index 843145f7d..21f2b5fc4 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -31,7 +31,6 @@ public class FileSearchManager implements AlphaFineSearchProcessor { private static final String DS_NAME = "dsname=\""; private static final String FRM_PREFIX = "k:frm "; private static final String CPT_PREFIX = "k:cpt "; - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Templates")); private static FileSearchManager fileSearchManager = null; private SearchResult filterModelList; private SearchResult lessModelList; @@ -77,7 +76,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { searchText = searchText.substring(MARK_LENGTH, searchText.length()); } if (StringUtils.isBlank(searchText) || ComparatorUtils.equals(searchText, DS_NAME)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Templates"))); return lessModelList; } @@ -102,7 +101,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { } if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); if (result.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java index e3be0c964..5855168d7 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java @@ -23,7 +23,6 @@ import java.net.URLEncoder; * Created by XiaXiang on 2017/3/27. */ public class PluginSearchManager implements AlphaFineSearchProcessor { - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")); private static PluginSearchManager pluginSearchManager = null; private SearchResult lessModelList; private SearchResult moreModelList; @@ -84,7 +83,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); if (StringUtils.isBlank(searchText)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); return lessModelList; } if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) { @@ -111,7 +110,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { } } if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); if (searchResult.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { @@ -134,7 +133,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { private SearchResult getNoConnectList() { SearchResult result = new SearchResult(); - result.add(0, TITLE_MODEL); + result.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java index 1b6b2b658..69959830c 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java @@ -272,11 +272,11 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear @Override - public SearchResult getLessSearchResult(String searchText) { + public synchronized SearchResult getLessSearchResult(String searchText) { this.modelList = new SearchResult(); recentModelList = getRecentModelList(searchText); if (recentModelList != null && recentModelList.size() > 0) { - modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest"), false)); + modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest"))); } modelList.addAll(recentModelList); return modelList; diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java index e9ec20295..176a24b24 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java @@ -93,7 +93,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor { private SearchResult getNoConnectList() { SearchResult result = new SearchResult(); - result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"), false)); + result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"))); result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } From f869e10daea6585ba39ad77e955d3dda1ffe1d8a Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 10 Jul 2017 16:51:38 +0800 Subject: [PATCH 09/11] =?UTF-8?q?REPORT-2354=20=E9=AA=8C=E6=94=B6bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=88=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=92=8C=E5=B9=B3=E5=8F=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=90=8C=E6=AD=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/bbs/UserInfoLabel.java | 6 ++- .../fr/design/mainframe/bbs/UserInfoPane.java | 5 +- .../fr/design/extra/PluginOperateUtils.java | 46 ++++++------------- .../com/fr/design/extra/PluginWebBridge.java | 20 ++++++-- .../com/fr/design/extra/WebViewDlgHelper.java | 8 ++-- .../exe/callback/InstallFromDiskCallback.java | 2 +- 6 files changed, 45 insertions(+), 42 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index c671f0fdc..4d58b3db6 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -16,6 +16,8 @@ import com.fr.general.DateUtils; import com.fr.general.Inter; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; +import com.fr.plugin.manage.bbs.BBSPluginLogin; +import com.fr.plugin.manage.bbs.BBSUserInfo; import com.fr.stable.EncodeConstants; import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; @@ -236,7 +238,8 @@ public class UserInfoLabel extends UILabel { @Override public void mouseClicked(MouseEvent e) { - userName = DesignerEnvManager.getEnvManager().getBBSName(); + BBSUserInfo bbsUserInfo = BBSPluginLogin.getInstance().getUserInfo(); + userName = bbsUserInfo == null ? "" : bbsUserInfo.getUserName(); if (StringUtils.isNotEmpty(userName)) { UIPopupMenu menu = new UIPopupMenu(); menu.setOnlyText(true); @@ -262,6 +265,7 @@ public class UserInfoLabel extends UILabel { UIMenuItem closeOther = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account")); closeOther.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { + BBSPluginLogin.getInstance().logOut(); UserLoginContext.fireLoginContextListener(); } diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java index df18f1f88..a638ac3e4 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -14,11 +14,12 @@ import java.util.Date; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.BasicPane; -import com.fr.design.extra.LoginWebBridge; import com.fr.design.mainframe.DesignerContext; import com.fr.general.DateUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.plugin.manage.bbs.BBSPluginLogin; +import com.fr.plugin.manage.bbs.BBSUserInfo; import com.fr.stable.StringUtils; @@ -168,6 +169,8 @@ public class UserInfoPane extends BasicPane{ * */ public void markSignIn(String userName){ + String password = DesignerEnvManager.getEnvManager().getBBSPassword(); + BBSPluginLogin.getInstance().login(new BBSUserInfo(userName, password)); this.userInfoLabel.setText(userName); this.userInfoLabel.setUserName(userName); this.userInfoLabel.setOpaque(true); diff --git a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java index 12ddee393..1a7779276 100644 --- a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java @@ -1,8 +1,8 @@ package com.fr.design.extra; import com.fr.base.FRContext; -import com.fr.design.DesignerEnvManager; import com.fr.design.extra.exe.callback.*; +import com.fr.design.gui.ilable.UILabel; import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.general.SiteCenter; @@ -33,15 +33,8 @@ public class PluginOperateUtils { public static void installPluginOnline(final PluginMarker pluginMarker, JSCallback jsCallback) { //下载插件 - if (!BBSPluginLogin.getInstance().hasLogin()) { - UserLoginContext.fireLoginContextListener(); - } - if (BBSPluginLogin.getInstance().hasLogin()) { - PluginTask pluginTask = PluginTask.installTask(pluginMarker); - PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback)); - }else{ - jsCallback.execute("success"); - } + PluginTask pluginTask = PluginTask.installTask(pluginMarker); + PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback)); } public static void installPluginFromDisk(File zipFile, JSCallback jsCallback) { @@ -50,13 +43,8 @@ public class PluginOperateUtils { public static void updatePluginOnline(List pluginMarkerList, JSCallback jsCallback) { - if (!(BBSPluginLogin.getInstance().hasLogin())) { - LoginCheckContext.fireLoginCheckListener(); - } - if (BBSPluginLogin.getInstance().hasLogin()) { - for (int i = 0; i < pluginMarkerList.size(); i++) { - updatePluginOnline(pluginMarkerList.get(i), jsCallback); - } + for (int i = 0; i < pluginMarkerList.size(); i++) { + updatePluginOnline(pluginMarkerList.get(i), jsCallback); } } @@ -76,8 +64,8 @@ public class PluginOperateUtils { } - public static void updatePluginFromDisk(final String filePath, JSCallback jsCallback) { - PluginManager.getController().update(new File(filePath), new UpdateFromDiskCallback(new File(filePath), jsCallback)); + public static void updatePluginFromDisk(File zipFile, JSCallback jsCallback) { + PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); } @@ -271,22 +259,16 @@ public class PluginOperateUtils { }).start(); } - public static void getLoginInfo(JSCallback jsCallback) { - - if (!BBSPluginLogin.getInstance().hasLogin()) { - String userName = DesignerEnvManager.getEnvManager().getBBSName(); - String password = DesignerEnvManager.getEnvManager().getBBSPassword(); - if (StringUtils.isNotBlank(userName)) { - BBSPluginLogin.getInstance().login(new BBSUserInfo(userName, password)); - } - } + public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) { BBSUserInfo bbsUserInfo = BBSPluginLogin.getInstance().getUserInfo(); String username = bbsUserInfo == null ? "" : bbsUserInfo.getUserName(); - String inShowUsername = DesignerEnvManager.getEnvManager().getInShowBBsName(); - if (StringUtils.isEmpty(username) && StringUtils.isEmpty(inShowUsername)) { - return; + + if (StringUtils.isEmpty(username)) { + jsCallback.execute(""); + uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); } else { - String result = StringUtils.isEmpty(inShowUsername) ? username : inShowUsername; + uiLabel.setText(username); + String result = username; jsCallback.execute(result); } } diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index d79b04e0e..a2a30c748 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -12,6 +12,8 @@ import com.fr.general.SiteCenter; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.manage.PluginManager; +import com.fr.plugin.manage.bbs.BBSPluginLogin; +import com.fr.plugin.manage.bbs.BBSUserInfo; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; import javafx.scene.web.WebEngine; @@ -196,7 +198,8 @@ public class PluginWebBridge { */ public void updatePluginFromDisk(String filePath, final JSObject callback) { JSCallback jsCallback = new JSCallback(webEngine, callback); - PluginOperateUtils.updatePluginFromDisk(filePath, jsCallback); + File file = new File(filePath); + PluginOperateUtils.updatePluginFromDisk(file, jsCallback); } /** @@ -377,9 +380,20 @@ public class PluginWebBridge { * * @param callback */ - public void getLoginInfo(final JSObject callback) { + public String getLoginInfo(final JSObject callback) { + registerLoginInfo(callback); + BBSUserInfo bbsUserInfo = BBSPluginLogin.getInstance().getUserInfo(); + return bbsUserInfo == null ? "": bbsUserInfo.getUserName(); + } + + /** + * 系统登录注册 + * + * @param callback + */ + public void registerLoginInfo(final JSObject callback) { JSCallback jsCallback = new JSCallback(webEngine, callback); - PluginOperateUtils.getLoginInfo(jsCallback); + PluginOperateUtils.getLoginInfo(jsCallback, uiLabel); } /** diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index f43faaecf..3af2b5d43 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -39,7 +39,7 @@ public class WebViewDlgHelper { public static void createPluginDialog() { if (StableUtils.getMajorJavaVersion() >= VERSION_8) { String relativePath = "/scripts/store/web/index.html"; - String mainJsPath = StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), relativePath); + String mainJsPath = StableUtils.pathJoin(installHome, relativePath); File file = new File(mainJsPath); if (!file.exists()) { int rv = JOptionPane.showConfirmDialog( @@ -54,7 +54,7 @@ public class WebViewDlgHelper { } } else { String indexPath = "index.html"; - String mainIndexPath = StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), indexPath); + String mainIndexPath = StableUtils.pathJoin(installHome, indexPath); checkAndCopyMainFile(mainIndexPath, mainJsPath); updateShopScripts(SHOP_SCRIPTS); showPluginDlg(mainIndexPath); @@ -144,7 +144,7 @@ public class WebViewDlgHelper { } private static void showLoginDlg() { - LoginWebPane webPane = new LoginWebPane(FRContext.getCurrentEnv().getWebReportPath()); + LoginWebPane webPane = new LoginWebPane(installHome); UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane); LoginWebBridge.getHelper().setDialogHandle(qqdlg); qqdlg.setVisible(true); @@ -186,7 +186,7 @@ public class WebViewDlgHelper { try { if (get()) { - IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), FRContext.getCurrentEnv().getWebReportPath()); + IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); // TODO: 2017/4/17 删除之前存放在安装目录下的script int rv = JOptionPane.showOptionDialog( null, diff --git a/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 3311399fc..28c2c139d 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -73,7 +73,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { return; } - PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); + PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); From 1451cbe930609f53bf1e1335d3e2ec1a8056c730 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 10 Jul 2017 16:57:36 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=9C=8B=E9=9A=9B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/extra/PluginOperateUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java index 1a7779276..8ab6b3bbe 100644 --- a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java @@ -89,7 +89,7 @@ public class PluginOperateUtils { public void run() { int rv = JOptionPane.showConfirmDialog( null, - Inter.getLocText("FR-Designer-Plugin_Delete_Confirmed"), + Inter.getLocText("FR-Plugin_Delete_Confirmed"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE From cea22fcf1945d1f8e67324d355339d125816a6f5 Mon Sep 17 00:00:00 2001 From: sunmondong <646575997@qq.com> Date: Tue, 11 Jul 2017 09:34:36 +0800 Subject: [PATCH 11/11] fix --- build.9.0.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.9.0.gradle b/build.9.0.gradle index f3f269aba..8268c0f6b 100644 --- a/build.9.0.gradle +++ b/build.9.0.gradle @@ -18,7 +18,7 @@ task appletJar<<{ } unjar(src:"${libDir}/3rd.jar",dest:"./tmp") unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp") - jar(jarfile:"build/libs/fr-applet-8.0.jar"){ + jar(jarfile:"build/libs/fr-applet-9.0.jar"){ fileset(dir:"build/classes"){ exclude(name:"*.*") exclude(name:"bin/*.*")