Browse Source

REPORT-4947 表单组件隐藏功能j没有了,前台的可见check框消失

master
kerry 7 years ago
parent
commit
62a09efe0b
  1. 4
      designer_form/src/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java
  2. 12
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  3. 7
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  4. 16
      designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java
  5. 4
      designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java
  6. 44
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java
  7. 8
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

4
designer_form/src/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java

@ -145,10 +145,6 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
return new Insets(padding.getTop(), padding.getLeft(), padding.getBottom(), padding.getRight()); return new Insets(padding.getTop(), padding.getLeft(), padding.getBottom(), padding.getRight());
} }
public boolean supportSetVisibleOrEnable(){
return false;
}
/** /**
* data属性改变触发其他操作 * data属性改变触发其他操作
* *

12
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -625,10 +625,18 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
} }
/** /**
* 是否支持设置可见和可用 * 是否支持设置可见
* return boolean * return boolean
*/ */
public boolean supportSetVisibleOrEnable(){ public boolean supportSetVisible(){
return true;
}
/**
* 是否支持设置可用
* return boolean
*/
public boolean supportSetEnable(){
return true; return true;
} }

7
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -327,4 +327,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
initStyle(); initStyle();
} }
/**
* 是否支持设置可用
* return boolean
*/
public boolean supportSetEnable(){
return false;
}
} }

16
designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java

@ -536,4 +536,20 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
initStyle(); initStyle();
} }
/**
* 是否支持设置可见
* return boolean
*/
public boolean supportSetVisible(){
return false;
}
/**
* 是否支持设置可用
* return boolean
*/
public boolean supportSetEnable(){
return false;
}
} }

4
designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java

@ -158,10 +158,6 @@ public class XWScaleLayout extends DedicateLayoutContainer {
} }
public boolean supportSetVisibleOrEnable(){
return true;
}
/** /**
* data属性改变触发其他操作 * data属性改变触发其他操作
* *

44
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java

@ -1,12 +1,14 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.JPanel;
import java.awt.BorderLayout;
/** /**
* Created by ibm on 2017/7/26. * Created by ibm on 2017/7/26.
@ -14,20 +16,26 @@ import java.awt.*;
public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane { public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane {
private UICheckBox enableCheckBox; private UICheckBox enableCheckBox;
private UICheckBox visibleCheckBox; private UICheckBox visibleCheckBox;
private XCreator xCreator;
public FormBasicWidgetPropertyPane (){ public FormBasicWidgetPropertyPane (XCreator xCreator){
this.xCreator = xCreator;
initOtherPane(); initOtherPane();
} }
protected void initOtherPane() { protected void initOtherPane() {
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); if(xCreator.supportSetEnable()){
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
pane2.add(enableCheckBox); enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); pane2.add(enableCheckBox);
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); }
pane2.add(visibleCheckBox); if(xCreator.supportSetVisible()){
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true);
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
pane2.add(visibleCheckBox);
}
this.add(pane2, BorderLayout.CENTER); this.add(pane2, BorderLayout.CENTER);
} }
@ -38,14 +46,22 @@ public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane {
public void populate(Widget widget) { public void populate(Widget widget) {
super.populate(widget); super.populate(widget);
enableCheckBox.setSelected(widget.isEnabled()); if(xCreator.supportSetEnable()){
visibleCheckBox.setSelected(widget.isVisible()); enableCheckBox.setSelected(widget.isEnabled());
}
if(xCreator.supportSetVisible()){
visibleCheckBox.setSelected(widget.isVisible());
}
} }
public void update(Widget widget) { public void update(Widget widget) {
super.update(widget); super.update(widget);
widget.setEnabled(enableCheckBox.isSelected()); if(xCreator.supportSetEnable()){
widget.setVisible(visibleCheckBox.isSelected()); widget.setEnabled(enableCheckBox.isSelected());
}
if(xCreator.supportSetVisible()){
widget.setVisible(visibleCheckBox.isSelected());
}
} }
} }

8
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -128,11 +128,9 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
}; };
this.add(basicScrollPane, BorderLayout.CENTER); this.add(basicScrollPane, BorderLayout.CENTER);
if (xCreator.supportSetVisibleOrEnable()) { XCreator innerCreator = getXCreatorDedicated();
widgetPropertyPane = new FormBasicWidgetPropertyPane();
} else { widgetPropertyPane = new FormBasicWidgetPropertyPane(innerCreator);
widgetPropertyPane = new FormBasicPropertyPane();
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 20, widgetPropertyPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 20, widgetPropertyPane);

Loading…
Cancel
Save