Browse Source

完善注释,重构泛型写法,完善变量名

feature/x
obo 1 year ago
parent
commit
e7d50660bb
  1. 12
      designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayAction.java
  2. 8
      designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java
  3. 2
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  4. 2
      designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java
  5. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  6. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  7. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  8. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  9. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java
  10. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  11. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  12. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  13. 49
      designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAcceptor.java
  14. 43
      designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeParaCreatorPaneAcceptor.java
  15. 2
      designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java
  16. 2
      designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java

12
designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayAction.java

@ -30,19 +30,19 @@ public class WidgetThemeDisplayAction<T extends JTemplate<?, ?>> extends JTempla
@Override
public void actionPerformed(ActionEvent e) {
final T jwb = getEditingComponent();
if (jwb == null) {
final T jTemplate = getEditingComponent();
if (jTemplate == null) {
return;
}
BaseBook wbTpl = jwb.getTarget();
WidgetDisplayEnhanceMarkAttr attr = WidgetThemeDesignerUtils.getStrongestControlAttrFromTemplate(wbTpl);
BaseBook baseBook = jTemplate.getTarget();
WidgetDisplayEnhanceMarkAttr attr = WidgetThemeDesignerUtils.getStrongestControlAttrFromTemplate(baseBook);
final WidgetThemeDisplayConfigPane configPane = new WidgetThemeDisplayConfigPane();
configPane.populate(attr);
configPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.addAttrMark(configPane.update());
jwb.fireTargetModified();
baseBook.addAttrMark(configPane.update());
jTemplate.fireTargetModified();
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().activeOldJTemplate();
}
}).setVisible(true);

8
designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java

@ -67,9 +67,15 @@ public class WidgetThemeDisplayConfigPane extends BasicPane {
WidgetDisplayEnhanceMarkAttr attr = new WidgetDisplayEnhanceMarkAttr();
attr.setWidgetEnhance(widgetEnhance.isSelected());
if (widgetEnhance.isSelected()) {
//埋点信息
collectWidgetDisplayEnhanceRecord();
}
return attr;
}
/**
* 记录埋点信息具体实现在云端运维插件这里只作为切入点
*/
private void collectWidgetDisplayEnhanceRecord() {
//记录埋点
}
}

2
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -204,7 +204,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private void refreshExtraAdvancedPane() {
extraPaneList.clear();
backgroundPane.removeAll();
new WidgetThemeParaCreatorPaneAcceptor<WParameterLayout>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
Set<WidgetAdvancedPaneProvider<WParameterLayout>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<WParameterLayout> provider : providers) {
if (!provider.accept(creator)) {

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

@ -47,7 +47,7 @@ public abstract class AbstractExtraButtonPane<T extends Button> extends ButtonWi
*/
protected void refreshExtraAdvancedPane(Class cls) {
extraPaneList.clear();
new WidgetThemeCreatorPaneAcceptor<T>().accept(cls, extraPaneList);
WidgetThemeCreatorPaneAcceptor.accept(cls, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -66,7 +66,7 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
private void refreshAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<T>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -78,7 +78,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<CheckBox>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<CheckBox>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<CheckBox> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -100,7 +100,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<DateEditor>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<DateEditor>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<DateEditor> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -68,7 +68,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<T>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -111,7 +111,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<Label>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<Label>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<Label> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -76,7 +76,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<NumberEditor>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<NumberEditor>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<NumberEditor> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -87,7 +87,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<TextEditor>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<TextEditor>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<TextEditor> provider : providers) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -70,7 +70,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeParaCreatorPaneAcceptor<T>().accept(creator, extraPaneList);
WidgetThemeParaCreatorPaneAcceptor.accept(creator, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) {

49
designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAcceptor.java

@ -38,19 +38,14 @@ import java.util.Set;
* @since 11.0
* Created on 2023/11/13
*/
public class WidgetThemeCreatorPaneAcceptor<T> {
public class WidgetThemeCreatorPaneAcceptor {
/**
* 构造器考虑泛型
*/
public WidgetThemeCreatorPaneAcceptor() {
//
}
private WidgetThemeCreatorPaneAcceptor() {}
/**
* editor相关处理类
*/
private final Set<Class> editorSet = new HashSet<>(Arrays.asList(
private static final Set<Class> EDITOR_SET = new HashSet<>(Arrays.asList(
TextArea.class,
TextEditor.class,
NumberEditor.class,
@ -64,7 +59,7 @@ public class WidgetThemeCreatorPaneAcceptor<T> {
/**
* normal相关处理类
*/
private final Set<Class> normalSet = new HashSet<>(Arrays.asList(
private static final Set<Class> NORMAL_SET = new HashSet<>(Arrays.asList(
AppendRowButton.class,
FreeButton.class,
DeleteRowButton.class,
@ -79,55 +74,43 @@ public class WidgetThemeCreatorPaneAcceptor<T> {
* @param creator 控件creator
* @param extraPaneList 列表
*/
public void accept(Class creator, List<BasicBeanPane<T>> extraPaneList) {
public static <T> void accept(Class<T> creator, List<BasicBeanPane<T>> extraPaneList) {
if(WidgetThemeDesignerUtils.enableWidgetEnhance()) {
acceptEditor(creator, extraPaneList);
acceptRoot(creator, extraPaneList);
acceptTree(creator, extraPaneList);
acceptLabel(creator, extraPaneList);
acceptNormal(creator, extraPaneList);
acceptButton(creator, extraPaneList);
}
}
private void insertShortCut(List<BasicBeanPane<T>> extraPaneList, BasicBeanPane pane) {
private static <T> void insertShortCut(List<BasicBeanPane<T>> extraPaneList, BasicBeanPane pane) {
extraPaneList.add(0, pane);
}
private void acceptEditor(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance()
&& (WidgetThemeDesignerUtils.isNewComboBoxTreeEditor(creator) || editorSet.contains(creator));
private static <T> void acceptEditor(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.isNewComboBoxTreeEditor(creator) || EDITOR_SET.contains(creator);
if (accept) {
insertShortCut(extraPaneList, new EditorSettingPane<>());
}
}
private void acceptRoot(Class creator, List<BasicBeanPane<T>> extraPaneList) {
//return false
}
private void acceptTree(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance() && creator == TreeEditor.class;
private static <T> void acceptTree(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator == TreeEditor.class;
if (accept) {
insertShortCut(extraPaneList, new TreeEditorSettingPane<>());
}
}
private void acceptLabel(Class creator, List<BasicBeanPane<T>> extraPaneList) {
//return false
}
private void acceptNormal(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance() && normalSet.contains(creator);
private static <T> void acceptNormal(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = NORMAL_SET.contains(creator);
if (accept) {
insertShortCut(extraPaneList, new NormalButtonSettingPane<>());
}
}
private void acceptButton(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance()
&& (creator == CheckBox.class
|| creator == RadioGroup.class
|| creator == CheckBoxGroup.class);
private static <T> void acceptButton(Class creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator == CheckBox.class || creator == RadioGroup.class || creator == CheckBoxGroup.class;
if (accept) {
insertShortCut(extraPaneList, new ButtonSettingPane<>());
}

43
designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeParaCreatorPaneAcceptor.java

@ -32,10 +32,9 @@ import java.util.List;
* @since 11.0
* Created on 2023/11/13
*/
public class WidgetThemeParaCreatorPaneAcceptor<T> {
public class WidgetThemeParaCreatorPaneAcceptor {
public WidgetThemeParaCreatorPaneAcceptor() {
}
private WidgetThemeParaCreatorPaneAcceptor() {}
/**
* 处理对应的参数面板控件creator
@ -44,7 +43,8 @@ public class WidgetThemeParaCreatorPaneAcceptor<T> {
* @param creator 控件creator
* @param extraPaneList 扩展paneList
*/
public void accept(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
public static <T> void accept(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
if (WidgetThemeDesignerUtils.enableWidgetEnhance()) {
acceptEditor(creator, extraPaneList);
acceptRoot(creator, extraPaneList);
acceptTree(creator, extraPaneList);
@ -52,59 +52,54 @@ public class WidgetThemeParaCreatorPaneAcceptor<T> {
acceptNormal(creator, extraPaneList);
acceptButton(creator, extraPaneList);
}
}
private void insertShortCut(List<BasicBeanPane<T>> extraPaneList, BasicBeanPane pane) {
private static <T> void insertShortCut(List<BasicBeanPane<T>> extraPaneList, BasicBeanPane pane) {
extraPaneList.add(0, pane);
}
private void acceptEditor(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance()
&& (creator instanceof XWrapperedFieldEditor
private static <T> void acceptEditor(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator instanceof XWrapperedFieldEditor
|| creator instanceof XTextArea
|| creator instanceof XComboBox
|| creator instanceof XDateEditor
|| creator instanceof XTreeComboBoxEditor)
|| creator instanceof XTreeComboBoxEditor
|| WidgetThemeDesignerUtils.isNewComboBoxTreeEditor(creator);
if (accept) {
insertShortCut(extraPaneList, new ParaEditorSettingPane<>());
}
}
private void acceptRoot(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance() && creator instanceof XWParameterLayout;
private static <T> void acceptRoot(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator instanceof XWParameterLayout;
if (accept) {
insertShortCut(extraPaneList, new ParameterBackgroundStyleSettingPane());
}
}
private void acceptTree(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance()
&& (creator instanceof XTreeEditor
&& !(creator instanceof XTreeComboBoxEditor));
private static <T> void acceptTree(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator instanceof XTreeEditor && !(creator instanceof XTreeComboBoxEditor);
if (accept) {
insertShortCut(extraPaneList, new ParaTreeEditorSettingPane<>());
}
}
private void acceptLabel(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance() && creator instanceof XLabel;
private static <T> void acceptLabel(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator instanceof XLabel;
if (accept) {
insertShortCut(extraPaneList, new LabelSettingPane<>());
}
}
private void acceptNormal(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance() && creator instanceof XButton;
private static <T> void acceptNormal(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator instanceof XButton;
if (accept) {
insertShortCut(extraPaneList, new NormalButtonSettingPane<>());
}
}
private void acceptButton(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeDesignerUtils.enableWidgetEnhance()
&& (creator instanceof XRadioGroup
|| creator instanceof XCheckBoxGroup
|| creator instanceof XCheckBox);
private static <T> void acceptButton(XCreator creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = creator instanceof XRadioGroup || creator instanceof XCheckBoxGroup || creator instanceof XCheckBox;
if (accept) {
insertShortCut(extraPaneList, new ParaButtonSettingPane<>());
}

2
designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -69,7 +69,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
protected void refreshExtraAdvancedPane() {
extraPaneList.clear();
new WidgetThemeCreatorPaneAcceptor<CheckBox>().accept(CheckBox.class, extraPaneList);
WidgetThemeCreatorPaneAcceptor.accept(CheckBox.class, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<CheckBox>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<CheckBox> provider : providers) {

2
designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -94,7 +94,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void refreshExtraAdvancedPane(Class cls) {
extraPaneList.clear();
new WidgetThemeCreatorPaneAcceptor<T>().accept(cls, extraPaneList);
WidgetThemeCreatorPaneAcceptor.accept(cls, extraPaneList);
boolean containsExtraPane = !CollectionUtils.isEmpty(extraPaneList);
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) {

Loading…
Cancel
Save