From d96ba516e14a8b3c7e2b561efa9040ced31e468a Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 20 Sep 2017 10:57:34 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4672=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A7=E4=BB=B6=E5=90=8E=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=89=80=E5=9C=A8=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E4=B8=8D=E5=8F=98=3D>=E8=8B=A5=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=88=B7=E6=96=B0=EF=BC=8C=E5=9C=A8=E7=BC=96=E8=BE=91=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E5=B1=9E=E6=80=A7=E6=97=B6=EF=BC=8C=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E9=83=BD=E4=BC=9A=E8=B7=B3=E5=88=B0=E7=AC=AC=E4=B8=80=E9=A1=B5?= =?UTF-8?q?=E3=80=82=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=A0=87=E8=AE=B0=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/ElementCasePaneDelegate.java | 6 +++++- .../form/FormElementCasePaneDelegate.java | 6 +++++- .../com/fr/poly/creator/ECBlockEditor.java | 4 +++- .../actions/TemplateComponentAction.java | 2 ++ .../fr/design/mainframe/DesignerContext.java | 19 ++++++++++++++++++- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 3529ebcd03..b358b53024 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -56,7 +56,11 @@ public class ElementCasePaneDelegate extends ElementCasePane { this.addTargetModifiedListener(new TargetModifiedListener() { @Override public void targetModified(TargetModifiedEvent e) { - refreshPropertyPanes(); + if (DesignerContext.isRefreshOnTargetModifiedEnabled()) { + refreshPropertyPanes(); + } else { + CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); + } } }); } diff --git a/designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java index 5ddd8efb51..8da52f9a58 100644 --- a/designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java @@ -42,7 +42,11 @@ public class FormElementCasePaneDelegate extends ElementCasePane { @Override public void targetModified(TargetModifiedEvent e) { designer.fireTargetModified(); - resetSelectionAndChooseState(); + if (DesignerContext.isRefreshOnTargetModifiedEnabled()) { + resetSelectionAndChooseState(); + } } }); } diff --git a/designer_base/src/com/fr/design/actions/TemplateComponentAction.java b/designer_base/src/com/fr/design/actions/TemplateComponentAction.java index 2194c7a791..9637bad2ed 100644 --- a/designer_base/src/com/fr/design/actions/TemplateComponentAction.java +++ b/designer_base/src/com/fr/design/actions/TemplateComponentAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions; import com.fr.design.designer.TargetComponent; +import com.fr.design.mainframe.DesignerContext; public abstract class TemplateComponentAction extends UndoableAction implements TemplateComponentActionInterface { private T t; @@ -24,6 +25,7 @@ public abstract class TemplateComponentAction extends @Override public void prepare4Undo() { + DesignerContext.enableRefreshOnTargetModified(); this.getEditingComponent().fireTargetModified(); T component = getEditingComponent(); if (component == null) { diff --git a/designer_base/src/com/fr/design/mainframe/DesignerContext.java b/designer_base/src/com/fr/design/mainframe/DesignerContext.java index dddb560272..1bf541f3ae 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerContext.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerContext.java @@ -36,7 +36,8 @@ public class DesignerContext { private static Hashtable prop = new Hashtable(); private static Hashtable beans = new Hashtable(); - ; + + private static boolean refreshOnTargetModified = false; /** * Return the main design frame from context @@ -136,4 +137,20 @@ public class DesignerContext { public static void setReportWritePane(BasicDialog dlg){ reportWriteThread.set(dlg); } + + /** + * 在修改 Target 时,刷新右侧属性面板 + */ + public static void enableRefreshOnTargetModified() { + refreshOnTargetModified = true; + } + + /** + * 在修改 Target 时,是否刷新右侧属性面板。仅可刷新一次,取值后重置为 false + */ + public static boolean isRefreshOnTargetModifiedEnabled() { + boolean isRefresh = refreshOnTargetModified; + refreshOnTargetModified = false; + return isRefresh; + } } \ No newline at end of file