From 988689ad4e60a06feccbf26294a8084232549c2e Mon Sep 17 00:00:00 2001 From: MoMeak Date: Tue, 28 Nov 2017 13:57:13 +0800 Subject: [PATCH 1/6] =?UTF-8?q?REPORT-5840=20=E6=8E=A7=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=92=8C=E4=BD=BF=E7=94=A8=E5=A1=AB=E6=8A=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/present/ConditionAttributesGroupPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java index 6eac1c5710..5aafd01edb 100644 --- a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; +import com.fr.grid.selection.Selection; import com.fr.report.cell.CellElement; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; @@ -29,6 +30,7 @@ import com.fr.stable.Nameable; public class ConditionAttributesGroupPane extends UIListControlPane { private static ConditionAttributesGroupPane singleton; private TemplateCellElement editCellElement; // 当前单元格对象 + private Selection editSelection; // 当前编辑对象 private ElementCasePane ePane; private ConditionAttributesGroupPane() { @@ -52,10 +54,8 @@ public class ConditionAttributesGroupPane extends UIListControlPane { if (isPopulating) { return; } - final CellSelection finalCS = (CellSelection) ePane.getSelection(); final TemplateElementCase tplEC = ePane.getEditingElementCase(); - - ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() { + ReportActionUtils.actionIterateWithCellSelection((CellSelection) editSelection, tplEC, new ReportActionUtils.IterAction() { public void dealWith(CellElement editCellElement) { ((TemplateCellElement)editCellElement).setHighlightGroup(updateHighlightGroup()); } @@ -75,6 +75,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane { public void populate(ElementCasePane ePane) { this.ePane = ePane; + this.editSelection = ePane.getSelection(); CellSelection cs = (CellSelection) ePane.getSelection(); final TemplateElementCase tplEC = ePane.getEditingElementCase(); editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); From 04e2b236c43a7a641e6b64a3f9a160776e37b17f Mon Sep 17 00:00:00 2001 From: ju Date: Wed, 29 Nov 2017 11:35:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?REPORT-5894=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=A4=A7=E9=87=8F=E5=B8=A6=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=90=8E,=20=E5=85=B3=E9=97=AD,=20G?= =?UTF-8?q?C=E5=90=8E=E5=86=85=E5=AD=98=E6=B2=A1=E6=9C=89=E6=94=BE?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/toolbar/ToolBarMenuDock.java | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) 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 f43419d47f..fba7d9945e 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -58,7 +58,6 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventType; import com.fr.stable.ArrayUtils; -import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import javax.swing.*; @@ -132,6 +131,9 @@ public abstract class ToolBarMenuDock { }; private static final String FINEREPORT = "FineReport"; private static final int MENUBAR_HEIGHT = 22; + + private static final List PLUGIN_LISTENERS = new ArrayList<>(); + private MenuDef[] menus; private ToolBarDef toolBarDef; private List shortCutsList; @@ -177,7 +179,6 @@ public abstract class ToolBarMenuDock { return dim; } }; - this.menus = menus(plus); for (int i = 0; i < menus.length; i++) { UIMenu subMenu = menus[i].createJMenu(); @@ -201,6 +202,8 @@ public abstract class ToolBarMenuDock { } public MenuDef[] menus(final ToolBarMenuDockPlus plus) { + //删除之前创建的插件菜单监听 + clearPluginListeners(); java.util.List menuList = new java.util.ArrayList(); // 添加文件菜单 menuList.add(createFileMenuDef(plus)); @@ -230,7 +233,14 @@ public abstract class ToolBarMenuDock { return menuList.toArray(new MenuDef[menuList.size()]); } - + + private static synchronized void clearPluginListeners() { + + for (PluginEventListener listener : PLUGIN_LISTENERS) { + GeneralContext.stopListenPlugin(listener); + } + } + /** * 获取所有actionmodel * @@ -602,9 +612,9 @@ public abstract class ToolBarMenuDock { addExtraMenus(menuDef, anchor, action, set); } - - private void listenPluginMenuChange(final MenuDef menuDef, final String anchor, final ShortCutMethodAction action) { - + + private static synchronized void listenPluginMenuChange(final MenuDef menuDef, final String anchor, final ShortCutMethodAction action) { + PluginFilter filter = new PluginFilter() { @Override @@ -613,29 +623,35 @@ public abstract class ToolBarMenuDock { return context.contain(MenuHandler.MARK_STRING); } }; - - GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() { - + + PluginEventListener beforeStop = new PluginEventListener() { + @Override public void on(PluginEvent event) { PluginRuntime runtime = event.getContext().getRuntime(); Set menuHandlers = runtime.get(MenuHandler.MARK_STRING); removeExtraMenus(menuDef, anchor, action, menuHandlers); } - }, filter); - GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() { - + }; + + PluginEventListener afterRun = new PluginEventListener() { + @Override public void on(PluginEvent event) { - + PluginRuntime runtime = event.getContext().getRuntime(); Set menuHandlers = runtime.get(MenuHandler.MARK_STRING); addExtraMenus(menuDef, anchor, action, menuHandlers); } - }, filter); + }; + + GeneralContext.listenPlugin(PluginEventType.BeforeStop, beforeStop, filter); + GeneralContext.listenPlugin(PluginEventType.AfterRun, afterRun, filter); + PLUGIN_LISTENERS.add(afterRun); + PLUGIN_LISTENERS.add(beforeStop); } - - private void removeExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set set) { + + private static void removeExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set set) { List target = new ArrayList<>(); @@ -657,8 +673,8 @@ public abstract class ToolBarMenuDock { menuDef.removeShortCut(shortCut); } } - - private void addExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set set) { + + private static void addExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set set) { List target = new ArrayList<>(); for (MenuHandler handler : set) { From f26cf271f0428d39270949866290e4a5bfcec7a2 Mon Sep 17 00:00:00 2001 From: ju Date: Wed, 29 Nov 2017 11:41:45 +0800 Subject: [PATCH 3/6] =?UTF-8?q?REPORT-5894=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=A4=A7=E9=87=8F=E5=B8=A6=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=90=8E,=20=E5=85=B3=E9=97=AD,=20G?= =?UTF-8?q?C=E5=90=8E=E5=86=85=E5=AD=98=E6=B2=A1=E6=9C=89=E6=94=BE?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 1 + 1 file changed, 1 insertion(+) 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 fba7d9945e..c8a4d25766 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -239,6 +239,7 @@ public abstract class ToolBarMenuDock { for (PluginEventListener listener : PLUGIN_LISTENERS) { GeneralContext.stopListenPlugin(listener); } + PLUGIN_LISTENERS.clear(); } /** From 82eac484a999c342698b55fc6818b6420afb5d3e Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 29 Nov 2017 15:30:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?REPORT-5832=20=E8=A1=A8=E5=8D=95=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E5=88=87=E5=88=B0=E7=BB=9D=E5=AF=B9=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=90=8E,=20=E9=9C=80=E8=A6=81=E6=B8=85=E7=90=86?= =?UTF-8?q?=E6=8E=89=E4=B8=80=E4=BA=9B=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E9=87=8C=E6=B2=A1=E6=9C=89=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/widget/ui/designer/layout/FRFitLayoutDefinePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index b429ff84b4..be330d2f92 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -161,6 +161,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); Component[] components = xWFitLayout.getComponents(); xWFitLayout.removeAll(); + layout.resetStyle(); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); for (Component component : components) { From ce67e756d988cf69c83ac71bc262a065f332a236 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 29 Nov 2017 16:56:08 +0800 Subject: [PATCH 5/6] =?UTF-8?q?REPORT-5832=20=E5=8E=BB=E6=8E=89=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java | 5 ----- .../designer/properties/FRFitLayoutPropertiesGroupModel.java | 1 - 2 files changed, 6 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index 20702ec8f4..c7fbdb7592 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -98,11 +98,6 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr if (row == 0) { if (state == WBodyLayoutType.FIT.getTypeValue()) { return switch2FitBodyLayout(); - } else { - XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent(); - if (xfl.toData().removeMargin()) { - DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); - } } } if (row == 1) { diff --git a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java index d6d7c06c59..9ffad45338 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java @@ -152,7 +152,6 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); Component[] components = xfl.getComponents(); xfl.removeAll(); - xfl.toData().removeMargin(); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); for (Component component : components) { From fbcd70a73c04f595db4e9f662eef4ed39e92ac95 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Mon, 4 Dec 2017 00:59:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-5793=20=E3=80=909.0=E3=80=91?= =?UTF-8?q?=E4=BB=8Ealphafine=E8=BF=9B=E5=85=A5=E6=A8=A1=E6=9D=BF=E7=9A=84?= =?UTF-8?q?web=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=83=BD=E6=98=AF=E4=B8=8A=E4=B8=80=E5=BC=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/RecentSearchManager.java | 9 +++++++-- .../mainframe/toolbar/UpdateActionManager.java | 14 ++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) 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 c191c0c11e..48cb40d88b 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 @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager; import com.fr.base.FRContext; import com.fr.base.Utils; +import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; @@ -233,8 +234,12 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear SearchResult searchResult = new SearchResult(); while (modelIterator.hasNext()) { AlphaCellModel model = modelIterator.next(); - 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); + searchResult.add(model); + } } else { searchResult.add(model); } 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..853ff15923 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; } }