Browse Source
* commit 'fa3e1eedca1ca99c8f5469f9f4e65160e3998080': 漏提 代码质量 REPORT-4947 表单组件隐藏功能j没有了,前台的可见check框消失master
superman
7 years ago
11 changed files with 131 additions and 51 deletions
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.design.mainframe.widget.ui; |
||||||
|
|
||||||
|
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.BorderFactory; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by kerry on 2017/9/30. |
||||||
|
*/ |
||||||
|
public class BasicSetVisiblePropertyPane extends FormBasicPropertyPane { |
||||||
|
private UICheckBox visibleCheckBox; |
||||||
|
|
||||||
|
public BasicSetVisiblePropertyPane() { |
||||||
|
initComponent(); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initComponent() { |
||||||
|
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
||||||
|
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||||
|
UICheckBox otherOtherConfig = createOtherConfig(); |
||||||
|
if(otherOtherConfig != null){ |
||||||
|
pane2.add(otherOtherConfig); |
||||||
|
} |
||||||
|
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); |
||||||
|
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
||||||
|
pane2.add(visibleCheckBox); |
||||||
|
this.add(pane2, BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
public UICheckBox createOtherConfig(){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(Widget widget) { |
||||||
|
super.populate(widget); |
||||||
|
visibleCheckBox.setSelected(widget.isVisible()); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(Widget widget) { |
||||||
|
super.update(widget); |
||||||
|
widget.setVisible(visibleCheckBox.isSelected()); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package com.fr.design.mainframe.widget.ui; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by kerry on 2017/9/30. |
||||||
|
*/ |
||||||
|
public class WidgetBasicPropertyPaneFactory { |
||||||
|
|
||||||
|
public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator){ |
||||||
|
if(xCreator.supportSetVisible() && xCreator.supportSetEnable()){ |
||||||
|
return new FormBasicWidgetPropertyPane(); |
||||||
|
} |
||||||
|
if(xCreator.supportSetVisible()){ |
||||||
|
return new BasicSetVisiblePropertyPane(); |
||||||
|
}else{ |
||||||
|
return new FormBasicPropertyPane(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue