diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index bdd3608c9e..5b17494da9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -154,24 +154,23 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } HashMap paneMap = getHyperlinkMap(); - //安装平台内打开插件时,添加相应按钮 - Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); java.util.List list = refreshList(paneMap); + Map creators = new ListMap<>(); int size = list.size(); - NameObjectCreator[] creators = new NameObjectCreator[size + providers.size()]; for (int i = 0; i < size; i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); - creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); + NameObjectCreator creator = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); + creators.put(uiMenuNameableCreator.getName(), creator); } + //安装平台内打开插件时, 添加/替换 相应按钮 + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); for (HyperlinkProvider provider : providers) { NameableCreator creator = provider.createHyperlinkCreator(); if (creator != null) { - creators[size] = new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane()); - size++; + creators.put(creator.menuName(), new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane())); } } - - refreshNameableCreator(creators); + refreshNameableCreator(creators.values().toArray(new NameObjectCreator[0])); } public void populate(Plot plot) { @@ -303,7 +302,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { @Override protected void initCreatorsFilter() { - this.creatorsFilter = nameableCreator -> { + this.creatorsFilter = nameableCreator -> { Class clazz = nameableCreator.getHyperlink(); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (!JTemplate.isValid(template)) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 3059ddc37d..6889ef7b49 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -35,6 +35,7 @@ public abstract class ButtonDefinePane extends AbstractDataMod protected UITextField labelNameTextField; private final List> extraPaneList = new ArrayList<>(); private JPanel extraPane; + protected boolean containsExtraPane; public ButtonDefinePane(XCreator creator){ super(creator); @@ -63,7 +64,7 @@ public abstract class ButtonDefinePane extends AbstractDataMod private void refreshAdvancedPane() { extraPaneList.clear(); - boolean containsExtraPane = false; + containsExtraPane = false; Set> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); for (WidgetAdvancedPaneProvider provider : providers) { if (!provider.accept(creator)) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java index 843f402f01..16a31b85ed 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java @@ -41,10 +41,13 @@ public class FreeButtonDefinePane extends ButtonDefinePane { } public void populateSubButtonPane(FreeButton e) { + if (containsExtraPane) { + return; + } backgroundCompPane.populate(e); frFontPane.setVisible(e.isCustomStyle()); fontLabel.setVisible(e.isCustomStyle()); - if(e.isCustomStyle()){ + if (e.isCustomStyle()) { FRFont frFont = e.getFont(); if (frFont != null) { frFontPane.populateBean(e.getFont()); @@ -54,12 +57,14 @@ public class FreeButtonDefinePane extends ButtonDefinePane { public FreeButton updateSubButtonPane() { FreeButton freeButton = (FreeButton) creator.toData(); - backgroundCompPane.update(freeButton); - frFontPane.setVisible(freeButton.isCustomStyle()); - fontLabel.setVisible(freeButton.isCustomStyle()); - if(freeButton.isCustomStyle()){ - FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); - freeButton.setFont(frFontPane.update(frFont)); + if (!containsExtraPane) { + backgroundCompPane.update(freeButton); + frFontPane.setVisible(freeButton.isCustomStyle()); + fontLabel.setVisible(freeButton.isCustomStyle()); + if (freeButton.isCustomStyle()) { + FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); + freeButton.setFont(frFontPane.update(frFont)); + } } return freeButton; }