Browse Source

Pull request #12057: REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置

Merge in DESIGN/design from ~JOHN.YING/design:release/11.0 to release/11.0

* commit 'a0a5863234fc344817336b70593d773e376d8d77':
  REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置--代码格式
  REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置--注释
  REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置--注释
  REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置--注释
  REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置--格式调整
  REPORT-92628 控件支持主题切换-部分控件未实现主题样式设置
newui
John.Ying-应志浩 2 years ago
parent
commit
bccc16fed0
  1. 16
      designer-base/src/main/java/com/fr/design/widget/btn/ButtonConstants.java
  2. 22
      designer-base/src/main/java/com/fr/design/widget/btn/ButtonDetailPane.java
  3. 12
      designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  4. 126
      designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java
  5. 16
      designer-form/src/main/java/com/fr/design/widget/ui/btn/FormSubmitButtonDetailPane.java
  6. 22
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java
  7. 16
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonDetailPane.java
  8. 17
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/DeleteRowButtonDefinePane.java
  9. 17
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java
  10. 21
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

16
designer-base/src/main/java/com/fr/design/widget/btn/ButtonConstants.java

@ -44,4 +44,20 @@ public class ButtonConstants {
StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class),
StableFactory.getMarkedClass(BridgeMark.TREE_NODE_TOGGLE_BUTTON, Widget.class)
};
public static final String[] TYPES_BUTTON_NO_FREE = {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Common"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Type_Parameter_Submit"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_TreeNode")
};
public static final Class[] CLASSES_BUTTON_NO_FREE = {
Button.class,
StableFactory.getMarkedClass(BridgeMark.APPEND_ROW_BUTTON, Widget.class),
StableFactory.getMarkedClass(BridgeMark.DELETE_ROW_BUTTON, Widget.class),
StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class),
StableFactory.getMarkedClass(BridgeMark.TREE_NODE_TOGGLE_BUTTON, Widget.class)
};
}

22
designer-base/src/main/java/com/fr/design/widget/btn/ButtonDetailPane.java

@ -1,11 +1,9 @@
package com.fr.design.widget.btn;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.dialog.BasicPane;
import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.event.ActionEvent;
@ -13,6 +11,7 @@ import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* Author : Richer
@ -22,7 +21,7 @@ import java.util.List;
*/
public abstract class ButtonDetailPane<T extends Button> extends BasicPane {
private List<ChangeListener> ls = new ArrayList<ChangeListener>();
protected final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>();
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Button");
@ -49,7 +48,10 @@ public abstract class ButtonDetailPane<T extends Button> extends BasicPane {
public abstract Class classType();
protected DictionaryComboBox createButtonTypeComboBox() {
final DictionaryComboBox dictionaryComboBox = new DictionaryComboBox(ButtonConstants.CLASSES4BUTTON, ButtonConstants.TYPES4BUTTON, false);
return createButtonTypeComboBox(false);
}
private DictionaryComboBox initDictionaryComboBox(DictionaryComboBox dictionaryComboBox) {
dictionaryComboBox.setSelectedItem(classType());
dictionaryComboBox.addActionListener(new ActionListener() {
@Override
@ -59,4 +61,14 @@ public abstract class ButtonDetailPane<T extends Button> extends BasicPane {
});
return dictionaryComboBox;
}
protected DictionaryComboBox createButtonTypeComboBox(Boolean containsExtraPane) {
final DictionaryComboBox dictionaryComboBox;
if (!containsExtraPane) {
dictionaryComboBox = new DictionaryComboBox(ButtonConstants.CLASSES4BUTTON, ButtonConstants.TYPES4BUTTON, false);
} else {
dictionaryComboBox = new DictionaryComboBox(ButtonConstants.CLASSES_BUTTON_NO_FREE, ButtonConstants.TYPES_BUTTON_NO_FREE, false);
}
return initDictionaryComboBox(dictionaryComboBox);
}
}

12
designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -6,6 +6,7 @@ import javax.swing.*;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
@ -42,8 +43,9 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
iconPane = new AccessibleIconEditor();
labelPane.add(iconPane);
Component comp = createCenterPane();
Component[][] n_components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createButtonTypeComboBox()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createCustomButtonTypeComboBox()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField = new UITextField()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Icon")), iconPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField = new UITextField()},
@ -52,7 +54,6 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH);
Component comp = createCenterPane();
if(comp != null ) {
advancePane.add(comp,BorderLayout.CENTER);
}
@ -63,6 +64,13 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
protected abstract Component createCenterPane();
/**
* 判断是按钮控件下拉框的种类1.有自定义按钮 2.无自定义按钮
*/
protected DictionaryComboBox createCustomButtonTypeComboBox() {
return createButtonTypeComboBox();
}
@Override
public void populate(T button) {
if (button == null) {

126
designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java

@ -0,0 +1,126 @@
package com.fr.design.widget.ui.btn;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.form.ui.Button;
import com.fr.general.GeneralContext;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import org.jetbrains.annotations.Nullable;
import javax.swing.JPanel;
import java.awt.Component;
import java.util.Set;
/**
* 用来处理额外的按钮属性
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public abstract class AbstractExtraButtonPane<T extends Button> extends ButtonWithHotkeysDetailPane<T> {
protected JPanel extraPane;
protected boolean containsExtraPane;
protected static double F = TableLayout.FILL;
protected static double P = TableLayout.PREFERRED;
protected void initExtraPane() {
initPluginListener();
refreshExtraAdvancedPane(classType());
}
/**
* 根据按钮类别判断需要返回什么类型的属性界面
*/
protected void refreshExtraAdvancedPane(Class cls) {
extraPaneList.clear();
boolean containsExtraPane = false;
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) {
if (!provider.accept(cls)) {
continue;
}
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane());
containsExtraPane = true;
}
if (containsExtraPane) {
extraPane = FRGUIPaneFactory.createYBoxEmptyBorderPane();
for (BasicBeanPane<T> pane : extraPaneList) {
extraPane.add(pane);
}
}
this.containsExtraPane = containsExtraPane;
}
protected void initPluginListener() {
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
refreshExtraAdvancedPane(classType());
}
}, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG));
}
/**
* 插入配置项面板
*
* @param index 插入的位置
* @param pane 配置项面板
*/
protected void insertShortCut(int index, BasicBeanPane<T> pane) {
int size = extraPaneList.size();
index = Math.min(index, size);
extraPaneList.add(index, pane);
}
@Override
public void populate(T button) {
super.populate(button);
for (BasicBeanPane<T> pane : extraPaneList) {
pane.populateBean(button);
}
}
@Override
public T update() {
T button = super.update();
for (BasicBeanPane<T> pane : extraPaneList) {
pane.updateBean(button);
}
return button;
}
@Override
protected DictionaryComboBox createCustomButtonTypeComboBox() {
return createButtonTypeComboBox(containsExtraPane);
}
/**
* 生成额外的属性界面
*/
protected Component createExtraPane(@Nullable BasicPane pane) {
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{pane, null},
new Component[]{extraPane, null}
};
double[] rowSize = {P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1},{1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
}
}

16
designer-form/src/main/java/com/fr/design/widget/ui/btn/FormSubmitButtonDetailPane.java

@ -1,22 +1,21 @@
package com.fr.design.widget.ui.btn;
import com.fr.form.parameter.FormSubmitButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-15
* Time : 下午6:25
* 提交参数按钮
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public class FormSubmitButtonDetailPane extends ButtonWithHotkeysDetailPane<FormSubmitButton> {
public class FormSubmitButtonDetailPane extends AbstractExtraButtonPane<FormSubmitButton> {
@Override
protected Component createCenterPane() {
return null;
return createExtraPane(null);
}
@Override
@ -37,4 +36,5 @@ public class FormSubmitButtonDetailPane extends ButtonWithHotkeysDetailPane<Form
public Class classType() {
return FormSubmitButton.class;
}
}

22
designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java

@ -2,19 +2,23 @@ package com.fr.design.widget.ui.btn;
import com.fr.base.IconManager;
import com.fr.report.web.button.write.AppendRowButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-15
* Time : 下午8:02
* 插入行按钮
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public class AppendRowButtonDefinePane<T extends AppendRowButton> extends ButtonWithHotkeysDetailPane<AppendRowButton> {
public class AppendRowButtonDefinePane<T extends AppendRowButton> extends AbstractExtraButtonPane<AppendRowButton> {
private DefineAppendColumnRowPane defineColumnRowPane;
// @Override
@ -26,7 +30,8 @@ public class AppendRowButtonDefinePane<T extends AppendRowButton> extends Button
@Override
protected Component createCenterPane() {
return defineColumnRowPane = new DefineAppendColumnRowPane();
defineColumnRowPane = new DefineAppendColumnRowPane();
return createExtraPane(defineColumnRowPane);
}
@Override
@ -55,4 +60,5 @@ public class AppendRowButtonDefinePane<T extends AppendRowButton> extends Button
public Class classType() {
return AppendRowButton.class;
}
}

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

@ -1,20 +1,25 @@
package com.fr.design.widget.ui.btn;
import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import java.awt.*;
/**
* Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-15 Time
* : 下午6:24
* 普通按钮
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public class DefaultButtonDetailPane extends ButtonWithHotkeysDetailPane<Button> {
public class DefaultButtonDetailPane extends AbstractExtraButtonPane<Button> {
@Override
protected Component createCenterPane() {
return null;
return createExtraPane(null);
}
@Override
@ -27,4 +32,5 @@ public class DefaultButtonDetailPane extends ButtonWithHotkeysDetailPane<Button>
public Class classType() {
return Button.class;
}
}

17
designer-realize/src/main/java/com/fr/design/widget/ui/btn/DeleteRowButtonDefinePane.java

@ -3,23 +3,23 @@ package com.fr.design.widget.ui.btn;
import com.fr.base.IconManager;
import com.fr.report.web.button.write.DeleteRowButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-15
* Time : 下午8:04
* 删除行按钮
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public class DeleteRowButtonDefinePane<T extends DeleteRowButton> extends ButtonWithHotkeysDetailPane<DeleteRowButton> {
public class DeleteRowButtonDefinePane<T extends DeleteRowButton> extends AbstractExtraButtonPane<DeleteRowButton> {
private DefineDeleteColumnRowPane ddcp;
@Override
protected Component createCenterPane() {
return ddcp = new DefineDeleteColumnRowPane();
ddcp = new DefineDeleteColumnRowPane();
return createExtraPane(ddcp);
}
@Override
@ -48,4 +48,5 @@ public class DeleteRowButtonDefinePane<T extends DeleteRowButton> extends Button
ddcp.update(btn);
return btn;
}
}

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

@ -1,19 +1,25 @@
package com.fr.design.widget.ui.btn;
import java.awt.Component;
import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.form.ui.FreeButton;
public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> {
/**
* 自定义按钮
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public class FreeButtonDetailPane extends AbstractExtraButtonPane<FreeButton> {
private ButtonSytleDefinedPane buttonSytleDefinedPane;
@Override
protected Component createCenterPane() {
buttonSytleDefinedPane = new ButtonSytleDefinedPane();
return buttonSytleDefinedPane;
return createExtraPane(buttonSytleDefinedPane);
}
@Override
public FreeButton createButton() {
return new FreeButton();
@ -35,4 +41,5 @@ public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton
public Class classType() {
return FreeButton.class;
}
}

21
designer-realize/src/main/java/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

@ -9,19 +9,18 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.Button;
import com.fr.report.web.button.form.TreeNodeToggleButton;
import com.fr.design.widget.btn.ButtonDetailPane;
import javax.swing.*;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-15
* Time : 下午7:45
* 树节点按钮
*
* @author John.Ying
* @since 11.0
* Created on 2023/4/19
*/
public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> extends ButtonDetailPane<Button> {
public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> extends AbstractExtraButtonPane<Button> {
public TreeNodeToogleButtonDefinePane() {
initComponents();
@ -33,8 +32,9 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
double p = TableLayout.PREFERRED;
double rowSize[] = {p};
double columnSize[] = {p, f};
initExtraPane();
Component[][] n_components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createButtonTypeComboBox()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createCustomButtonTypeComboBox()},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, 8);
JPanel borderPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -45,6 +45,11 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
}
@Override
protected Component createCenterPane() {
return null;
}
@Override
public TreeNodeToggleButton update() {
return createButton();

Loading…
Cancel
Save