81 lines
2.5 KiB
81 lines
2.5 KiB
package com.fr.widgettheme.designer; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
import com.fr.design.gui.ilable.UILabel; |
|
import com.fr.design.i18n.Toolkit; |
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
import com.fr.design.layout.VerticalFlowLayout; |
|
import com.fr.widgettheme.control.attr.WidgetDisplayEnhanceMarkAttr; |
|
|
|
import javax.swing.JPanel; |
|
import java.awt.Color; |
|
|
|
/** |
|
* 控件主题显示增强配置窗口 |
|
* |
|
* @author Bruce.Deng |
|
* @since 11.0 |
|
* Created on 2022/11/28 |
|
*/ |
|
public class WidgetThemeDisplayConfigPane extends BasicPane { |
|
|
|
private UICheckBox widgetEnhance; |
|
|
|
public WidgetThemeDisplayConfigPane() { |
|
initComponents(); |
|
} |
|
|
|
private void initComponents() { |
|
VerticalFlowLayout layout = new VerticalFlowLayout(); |
|
layout.setAlignLeft(true); |
|
this.setLayout(layout); |
|
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
this.add(northPane); |
|
widgetEnhance = new UICheckBox(Toolkit.i18nText("Fine-Design_Widget_Enable_Display_Enhance")); |
|
widgetEnhance.setSelected(true); |
|
northPane.add(widgetEnhance); |
|
|
|
JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
this.add(southPane); |
|
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Widget_Display_Enhance_Tip")); |
|
label.setForeground(Color.GRAY); |
|
southPane.add(label); |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return Toolkit.i18nText("Fine-Design_Widget_Display_Enhance"); |
|
} |
|
|
|
/** |
|
* 根据属性填充pane选项 |
|
* |
|
* @param widgetDisplayEnhanceMarkAttr 控件显示增强属性 |
|
*/ |
|
public void populate(WidgetDisplayEnhanceMarkAttr widgetDisplayEnhanceMarkAttr) { |
|
if (widgetDisplayEnhanceMarkAttr == null) { |
|
widgetDisplayEnhanceMarkAttr = new WidgetDisplayEnhanceMarkAttr(); |
|
} |
|
widgetEnhance.setSelected(widgetDisplayEnhanceMarkAttr.isWidgetEnhance()); |
|
} |
|
|
|
/** |
|
* 更新 |
|
*/ |
|
public WidgetDisplayEnhanceMarkAttr update() { |
|
WidgetDisplayEnhanceMarkAttr attr = new WidgetDisplayEnhanceMarkAttr(); |
|
attr.setWidgetEnhance(widgetEnhance.isSelected()); |
|
if (widgetEnhance.isSelected()) { |
|
collectWidgetDisplayEnhanceRecord(); |
|
} |
|
return attr; |
|
} |
|
|
|
/** |
|
* 记录埋点信息,具体实现在云端运维插件,这里只作为切入点 |
|
*/ |
|
private void collectWidgetDisplayEnhanceRecord() { |
|
//记录埋点 |
|
} |
|
}
|
|
|