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());
}
public boolean supportSetVisibleOrEnable(){
return false;
}
/**
* 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
*/
public boolean supportSetVisibleOrEnable(){
public boolean supportSetVisible(){
return true;
}
/**
* 是否支持设置可用
* return boolean
*/
public boolean supportSetEnable(){
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();
}
/**
* 是否支持设置可用
* 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();
}
/**
* 是否支持设置可见
* 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属性改变触发其他操作
*

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

@ -1,12 +1,14 @@
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.layout.FRGUIPaneFactory;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by ibm on 2017/7/26.
@ -14,20 +16,26 @@ import java.awt.*;
public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane {
private UICheckBox enableCheckBox;
private UICheckBox visibleCheckBox;
private XCreator xCreator;
public FormBasicWidgetPropertyPane (){
public FormBasicWidgetPropertyPane (XCreator xCreator){
this.xCreator = xCreator;
initOtherPane();
}
protected void initOtherPane() {
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
pane2.add(enableCheckBox);
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true);
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
pane2.add(visibleCheckBox);
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
if(xCreator.supportSetEnable()){
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
pane2.add(enableCheckBox);
}
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);
}
@ -38,14 +46,22 @@ public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane {
public void populate(Widget widget) {
super.populate(widget);
enableCheckBox.setSelected(widget.isEnabled());
visibleCheckBox.setSelected(widget.isVisible());
if(xCreator.supportSetEnable()){
enableCheckBox.setSelected(widget.isEnabled());
}
if(xCreator.supportSetVisible()){
visibleCheckBox.setSelected(widget.isVisible());
}
}
public void update(Widget widget) {
super.update(widget);
widget.setEnabled(enableCheckBox.isSelected());
widget.setVisible(visibleCheckBox.isSelected());
if(xCreator.supportSetEnable()){
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);
if (xCreator.supportSetVisibleOrEnable()) {
widgetPropertyPane = new FormBasicWidgetPropertyPane();
} else {
widgetPropertyPane = new FormBasicPropertyPane();
}
XCreator innerCreator = getXCreatorDedicated();
widgetPropertyPane = new FormBasicWidgetPropertyPane(innerCreator);
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 20, widgetPropertyPane);

Loading…
Cancel
Save