Browse Source

REPORT-4983 切换tab再切回,添加参数面板消失

master
plough 7 years ago
parent
commit
dd114fe443
  1. 2
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  2. 3
      designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java
  3. 24
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  4. 6
      designer_form/src/com/fr/design/mainframe/JForm.java
  5. 16
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  6. 2
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

2
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -298,7 +298,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
*/ */
public void refreshParameter() { public void refreshParameter() {
if (paraDesignEditor != null) { if (paraDesignEditor != null) {
paraDesignEditor.refreshParameter(this); paraDesignEditor.refreshParameter(this, this.workBook);
} }
} }

3
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;
import com.fr.base.parameter.ParameterUI; import com.fr.base.parameter.ParameterUI;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.JTemplate;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -31,6 +32,8 @@ public interface ParameterDesignerProvider {
void refreshParameter(ParaDefinitePane paraDefinitePane); void refreshParameter(ParaDefinitePane paraDefinitePane);
void refreshParameter(ParaDefinitePane paraDefinitePane, JTemplate jt);
boolean isWithQueryButton(); boolean isWithQueryButton();
java.util.List<String> getAllXCreatorNameList(); java.util.List<String> getAllXCreatorNameList();

24
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.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.*;
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.parameter.ParaDefinitePane; import com.fr.design.parameter.ParaDefinitePane;
import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterDesignerProvider;
import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.ParameterPropertyPane;
@ -224,6 +215,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
* @param p 参数面板 * @param p 参数面板
*/ */
public void refreshParameter(ParaDefinitePane 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(); XLayoutContainer rootContainer = this.getRootComponent();
java.util.List<String> namelist = getAllXCreatorNameList(rootContainer); java.util.List<String> namelist = getAllXCreatorNameList(rootContainer);
// parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名
@ -240,8 +241,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray());
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); ParameterPropertyPane.getInstance().refreshState(jt);
} }
/** /**

6
designer_form/src/com/fr/design/mainframe/JForm.java

@ -328,10 +328,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private void setPropertyPaneChange(XComponent comp) { private void setPropertyPaneChange(XComponent comp) {
if (comp == null) { if (comp == null) {
ParameterPropertyPane.getInstance().setAddParaPaneVisible(false); ParameterPropertyPane.getInstance().setAddParaPaneVisible(false, this);
return; return;
} }
ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout); ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout, this);
editingComponent = comp.createToolPane(this, formDesign); editingComponent = comp.createToolPane(this, formDesign);
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
@ -718,7 +718,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign);
parameterPropertyPane.setAddParaPaneVisible(false); parameterPropertyPane.setAddParaPaneVisible(false, this);
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);

16
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.designer.creator.XWParameterLayout;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.JForm;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -87,18 +84,23 @@ public class ParameterPropertyPane extends JPanel{
} }
// 显示或隐藏添加参数面板 // 显示或隐藏添加参数面板
public void refreshState(JTemplate jt) {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem(), jt);
}
// 显示或隐藏添加参数面板
public void refreshState() { 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) { if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) {
return; return;
} }
// 表单中,只有添加并选中参数面板时,才显示 // 表单中,只有添加并选中参数面板时,才显示
boolean hideInJForm; boolean hideInJForm;
try { try {
hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm && hideInJForm = jt instanceof JForm &&
!(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout); !(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout);
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
hideInJForm = true; hideInJForm = true;

2
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -82,7 +82,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(label); this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
ParameterPropertyPane.getInstance().refreshState();
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
return; return;
@ -103,7 +102,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(addAll); this.add(addAll);
this.doLayout(); this.doLayout();
ParameterPropertyPane.getInstance().refreshState();
this.repaint(); this.repaint();
} }

Loading…
Cancel
Save