Browse Source

Merge pull request #12086 in DESIGN/design from release/11.0 to bugfix/11.0

* commit 'f540d91a4739f10702a4fb55c38b512ec0e27638':
  REPORT-94379 控件显示增强插件安装启用后,部分控件的样式设置有问题
  REPORT-94379 控件显示增强插件安装启用后,部分控件的样式设置有问题
  REPORT-94597 安装【平台内打开标签页】插件,FR图表超链会多两个重复下拉项 改用ListMap保持一致
  REPORT-94597 安装【平台内打开标签页】插件,FR图表超链会多两个重复下拉项
  REPORT-94597 安装【平台内打开标签页】插件,FR图表超链会多两个重复下拉项
bugfix/11.0
superman 2 years ago
parent
commit
1153c1b898
  1. 17
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java
  2. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  3. 19
      designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java

17
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(); HashMap paneMap = getHyperlinkMap();
//安装平台内打开插件时,添加相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
java.util.List<UIMenuNameableCreator> list = refreshList(paneMap); java.util.List<UIMenuNameableCreator> list = refreshList(paneMap);
Map<String, NameObjectCreator> creators = new ListMap<>();
int size = list.size(); int size = list.size();
NameObjectCreator[] creators = new NameObjectCreator[size + providers.size()];
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
UIMenuNameableCreator uiMenuNameableCreator = list.get(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<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
for (HyperlinkProvider provider : providers) { for (HyperlinkProvider provider : providers) {
NameableCreator creator = provider.createHyperlinkCreator(); NameableCreator creator = provider.createHyperlinkCreator();
if (creator != null) { if (creator != null) {
creators[size] = new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane()); creators.put(creator.menuName(), new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane()));
size++;
} }
} }
refreshNameableCreator(creators.values().toArray(new NameObjectCreator[0]));
refreshNameableCreator(creators);
} }
public void populate(Plot plot) { public void populate(Plot plot) {
@ -303,7 +302,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
@Override @Override
protected void initCreatorsFilter() { protected void initCreatorsFilter() {
this.creatorsFilter = nameableCreator -> { this.creatorsFilter = nameableCreator -> {
Class<? extends JavaScript> clazz = nameableCreator.getHyperlink(); Class<? extends JavaScript> clazz = nameableCreator.getHyperlink();
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (!JTemplate.isValid(template)) { if (!JTemplate.isValid(template)) {

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

@ -35,6 +35,7 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
protected UITextField labelNameTextField; protected UITextField labelNameTextField;
private final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>(); private final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>();
private JPanel extraPane; private JPanel extraPane;
protected boolean containsExtraPane;
public ButtonDefinePane(XCreator creator){ public ButtonDefinePane(XCreator creator){
super(creator); super(creator);
@ -63,7 +64,7 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
private void refreshAdvancedPane() { private void refreshAdvancedPane() {
extraPaneList.clear(); extraPaneList.clear();
boolean containsExtraPane = false; containsExtraPane = false;
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
for (WidgetAdvancedPaneProvider<T> provider : providers) { for (WidgetAdvancedPaneProvider<T> provider : providers) {
if (!provider.accept(creator)) { if (!provider.accept(creator)) {

19
designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java

@ -41,10 +41,13 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
} }
public void populateSubButtonPane(FreeButton e) { public void populateSubButtonPane(FreeButton e) {
if (containsExtraPane) {
return;
}
backgroundCompPane.populate(e); backgroundCompPane.populate(e);
frFontPane.setVisible(e.isCustomStyle()); frFontPane.setVisible(e.isCustomStyle());
fontLabel.setVisible(e.isCustomStyle()); fontLabel.setVisible(e.isCustomStyle());
if(e.isCustomStyle()){ if (e.isCustomStyle()) {
FRFont frFont = e.getFont(); FRFont frFont = e.getFont();
if (frFont != null) { if (frFont != null) {
frFontPane.populateBean(e.getFont()); frFontPane.populateBean(e.getFont());
@ -54,12 +57,14 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
public FreeButton updateSubButtonPane() { public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData(); FreeButton freeButton = (FreeButton) creator.toData();
backgroundCompPane.update(freeButton); if (!containsExtraPane) {
frFontPane.setVisible(freeButton.isCustomStyle()); backgroundCompPane.update(freeButton);
fontLabel.setVisible(freeButton.isCustomStyle()); frFontPane.setVisible(freeButton.isCustomStyle());
if(freeButton.isCustomStyle()){ fontLabel.setVisible(freeButton.isCustomStyle());
FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); if (freeButton.isCustomStyle()) {
freeButton.setFont(frFontPane.update(frFont)); FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont();
freeButton.setFont(frFontPane.update(frFont));
}
} }
return freeButton; return freeButton;
} }

Loading…
Cancel
Save