From dd114fe443525c80cad394608157e6cd7b8a60b3 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 12:07:14 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4983=20=E5=88=87=E6=8D=A2tab=E5=86=8D?= =?UTF-8?q?=E5=88=87=E5=9B=9E=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameter/ParameterDefinitePane.java | 2 +- .../parameter/ParameterDesignerProvider.java | 3 +++ .../form/parameter/FormParaDesigner.java | 24 +++++++++---------- .../src/com/fr/design/mainframe/JForm.java | 6 ++--- .../parameter/ParameterPropertyPane.java | 16 +++++++------ .../parameter/ParameterToolBarPane.java | 2 -- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java index 40c2aa4663..4f8adabbbb 100644 --- a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java @@ -298,7 +298,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus */ public void refreshParameter() { if (paraDesignEditor != null) { - paraDesignEditor.refreshParameter(this); + paraDesignEditor.refreshParameter(this, this.workBook); } } diff --git a/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java b/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java index e0d2ffb55e..abd27f89bf 100644 --- a/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java +++ b/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java @@ -3,6 +3,7 @@ package com.fr.design.parameter; import com.fr.base.Parameter; import com.fr.base.parameter.ParameterUI; import com.fr.design.mainframe.AuthorityEditPane; +import com.fr.design.mainframe.JTemplate; import javax.swing.*; import java.awt.*; @@ -31,6 +32,8 @@ public interface ParameterDesignerProvider { void refreshParameter(ParaDefinitePane paraDefinitePane); + void refreshParameter(ParaDefinitePane paraDefinitePane, JTemplate jt); + boolean isWithQueryButton(); java.util.List getAllXCreatorNameList(); diff --git a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java index e84259fd86..cc100df8ed 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -37,16 +37,7 @@ import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.mainframe.AuthorityEditPane; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.EastRegionContainerPane; -import com.fr.design.mainframe.FormArea; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.FormDesignerModeForSpecial; -import com.fr.design.mainframe.FormParaPane; -import com.fr.design.mainframe.FormWidgetDetailPane; -import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.design.mainframe.WidgetToolBarPane; +import com.fr.design.mainframe.*; import com.fr.design.parameter.ParaDefinitePane; import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterPropertyPane; @@ -224,6 +215,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * @param p 参数面板 */ public void refreshParameter(ParaDefinitePane p) { + refreshParameter(p, DesignerContext.getDesignerFrame().getSelectedJTemplate()); + } + + /** + * 刷新参数 + * + * @param p 参数面板 + * @param jt 当前模版 + */ + public void refreshParameter(ParaDefinitePane p, JTemplate jt) { XLayoutContainer rootContainer = this.getRootComponent(); java.util.List namelist = getAllXCreatorNameList(rootContainer); // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 @@ -240,8 +241,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); - EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); - + ParameterPropertyPane.getInstance().refreshState(jt); } /** diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 79b4ccc960..650c5fb3eb 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -328,10 +328,10 @@ public class JForm extends JTemplate implements BaseJForm { private void setPropertyPaneChange(XComponent comp) { if (comp == null) { - ParameterPropertyPane.getInstance().setAddParaPaneVisible(false); + ParameterPropertyPane.getInstance().setAddParaPaneVisible(false, this); return; } - ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout); + ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout, this); editingComponent = comp.createToolPane(this, formDesign); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); if (BaseUtils.isAuthorityEditing()) { @@ -718,7 +718,7 @@ public class JForm extends JTemplate implements BaseJForm { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign); - parameterPropertyPane.setAddParaPaneVisible(false); + parameterPropertyPane.setAddParaPaneVisible(false, this); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); diff --git a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java index 43e840823b..c749333444 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java @@ -4,10 +4,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.FormHierarchyTreePane; -import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.*; import javax.swing.*; import java.awt.*; @@ -87,18 +84,23 @@ public class ParameterPropertyPane extends JPanel{ } // 显示或隐藏添加参数面板 + public void refreshState(JTemplate jt) { + setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem(), jt); + } + + // 显示或隐藏添加参数面板 public void refreshState() { - setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem()); + refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate()); } - public void setAddParaPaneVisible(boolean isVisible) { + public void setAddParaPaneVisible(boolean isVisible, JTemplate jt) { if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) { return; } // 表单中,只有添加并选中参数面板时,才显示 boolean hideInJForm; try { - hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm && + hideInJForm = jt instanceof JForm && !(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout); } catch (NullPointerException ex) { hideInJForm = true; diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index 16fc6ce041..daac4c2db8 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -82,7 +82,6 @@ public class ParameterToolBarPane extends BasicBeanPane { this.add(label); if (parameterArray.length == 0) { - ParameterPropertyPane.getInstance().refreshState(); this.setVisible(false); this.repaint(); return; @@ -103,7 +102,6 @@ public class ParameterToolBarPane extends BasicBeanPane { this.add(addAll); this.doLayout(); - ParameterPropertyPane.getInstance().refreshState(); this.repaint(); }