kerry
7 years ago
5 changed files with 94 additions and 55 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