From 6d2fa1acfff86cf7e2e706d9b509ab3d2763b848 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 28 Feb 2018 08:35:48 +0800 Subject: [PATCH] =?UTF-8?q?9.0=E5=90=8C=E6=AD=A5=E5=88=B010.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/RecentSearchManager.java | 10 ++++++++-- .../mainframe/toolbar/UpdateActionManager.java | 16 +++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 479786f10e..e2d9ba74d8 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; +import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; import com.fr.design.mainframe.alphafine.cell.model.ActionModel; @@ -181,12 +182,17 @@ public class RecentSearchManager implements AlphaFineSearchProvider { for (ScoreDoc scoreDoc : scores) { Document document = searcher.doc(scoreDoc.doc); AlphaCellModel model = CellModelHelper.getModelFromJson(new JSONObject(document.get("cellModel"))); - if (model.getType() == CellType.ACTION && !UpdateActionManager.getUpdateActionManager().isEnable(((ActionModel) model).getAction())) { - continue; + if (model.getType() == CellType.ACTION) { + UpdateAction action = UpdateActionManager.getUpdateActionManager().getActionByName(model.getName()); + if (action != null) { + ((ActionModel) model).setAction(action); + recentModelList.add(model); + } } else { recentModelList.add(model); } + } } catch (Exception e) { FRLoggerFactory.getLogger().error("local search error: " + e.getMessage()); diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java b/designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java index 845eb3660e..a5651cfbeb 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java @@ -27,12 +27,18 @@ public class UpdateActionManager { this.updateActions = updateActions; } - public boolean isEnable(UpdateAction updateAction) { + /** + * 根据action name获取action对象 + * + * @param name + * @return + */ + public UpdateAction getActionByName(String name) { for (UpdateActionModel action : updateActions) { - if (ComparatorUtils.equals(updateAction.getName(), action.getActionName()) && action.getAction().isEnabled()) { - return true; + if (ComparatorUtils.equals(name, action.getActionName()) && action.getAction().isEnabled()) { + return action.getAction(); } } - return false; + return null; } -} +} \ No newline at end of file