Browse Source

REPORT-107652 【最强控件】单元格的按钮控件,设置自定义后关闭开启显示增强,配置项显示异常

release/11.0
obo 1 year ago
parent
commit
19e8c7d23b
  1. 16
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java

16
designer-realize/src/main/java/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java

@ -3,6 +3,7 @@ package com.fr.design.widget.ui.btn;
import java.awt.Component;
import com.fr.form.ui.FreeButton;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
/**
* 自定义按钮
@ -16,7 +17,7 @@ public class FreeButtonDetailPane extends AbstractExtraButtonPane<FreeButton> {
@Override
protected Component createCenterPane() {
buttonSytleDefinedPane = new ButtonSytleDefinedPane();
buttonSytleDefinedPane = creatButtonSytleDefinedPane();
return createExtraPane(buttonSytleDefinedPane);
}
@ -27,13 +28,17 @@ public class FreeButtonDetailPane extends AbstractExtraButtonPane<FreeButton> {
public void populate(FreeButton button) {
super.populate(button);
if (buttonSytleDefinedPane != null) {
buttonSytleDefinedPane.populate(button);
}
}
@Override
public FreeButton update() {
FreeButton button = super.update();
if (buttonSytleDefinedPane != null) {
buttonSytleDefinedPane.update(button);
}
return button;
}
@ -41,4 +46,13 @@ public class FreeButtonDetailPane extends AbstractExtraButtonPane<FreeButton> {
public Class classType() {
return FreeButton.class;
}
/**
* 自定义按钮控件开启控件显示增强时原有的buttonSytleDefinedPane会被保留
* 内容和控件增强的pane重复且不生效其他控件目前不存在这种情况因此要在实现这里做个判断
* 如果开启控件增强原有的ButtonSytleDefinedPane不展示创建时返回null
*/
private ButtonSytleDefinedPane creatButtonSytleDefinedPane() {
return WidgetThemeDesignerUtils.enableWidgetEnhance() ? null : new ButtonSytleDefinedPane();
}
}
Loading…
Cancel
Save