|
|
|
@ -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<>()); |
|
|
|
|
} |
|
|
|
|