Browse Source

Pull request #10281: REPORT-81583【运营产品化二期】自定义排序使用向上或向下到最顶或最底交互显示有问题;REPORT-80117 alphafine默认配置没有模板商城,首次打开却有模板商城

Merge in DESIGN/design from ~LINK.ZHAO/design:release/11.0 to release/11.0

* commit '1bef211844f3eb5da4dd51ca34fc7c2c64aee0e9':
  REPORT-81583【运营产品化二期】自定义排序使用向上或向下到最顶或最底交互显示有问题;REPORT-80117 alphafine默认配置没有模板商城,首次打开却有模板商城 1、修改交互 2、修改升级兼容问题
release/11.0
Link.Zhao-赵展 2 years ago
parent
commit
a49edd6282
  1. 3
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  2. 28
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

3
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -108,6 +108,7 @@ public class AlphaFineConfigManager implements XMLable {
private Map<String, String> actionSearchTextCache = new HashMap<>(8);
private String cacheBuildNO;
private static final String CONTAIN_TEMPLATE_SHOP = "isContainTemplateShop";
/**
* key: 登录的bbs用户
@ -151,6 +152,7 @@ public class AlphaFineConfigManager implements XMLable {
this.setContainPlugin(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainDocument(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainRecommend(reader.getAttrAsBoolean("isContainRecommend", true));
this.setShowTemplateShop(reader.getAttrAsBoolean(CONTAIN_TEMPLATE_SHOP, true));
this.setContainAction(reader.getAttrAsBoolean("isContainAction", true));
this.setContainTemplate(reader.getAttrAsBoolean("isContainTemplate", true));
this.setContainFileContent(reader.getAttrAsBoolean("isContainFileContent", false));
@ -258,6 +260,7 @@ public class AlphaFineConfigManager implements XMLable {
.attr("needSegmentationCheckbox", this.isNeedSegmentationCheckbox())
.attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService())
.attr("productDynamics", this.isProductDynamics())
.attr(CONTAIN_TEMPLATE_SHOP, this.showTemplateShop)
.attr("tabOrder", this.getTabOrderString());
writeActionSearchTextCacheXML(writer);
writeSearchHistory(writer);

28
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

@ -85,7 +85,7 @@ public class CustomSortPane extends JPanel {
top.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, 0);
setToolbarEnable(false, false, true, true);
setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount());
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -95,7 +95,7 @@ public class CustomSortPane extends JPanel {
bottom.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentCount() - 1);
setToolbarEnable(true, true, false, false);
setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount());
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -105,7 +105,7 @@ public class CustomSortPane extends JPanel {
up.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) - 1);
setToolbarEnable(true, true, true, true);
setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount());
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -115,7 +115,7 @@ public class CustomSortPane extends JPanel {
down.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) + 1);
setToolbarEnable(true, true, true, true);
setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount());
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -175,6 +175,26 @@ public class CustomSortPane extends JPanel {
this.bottom.setEnabled(bottom);
}
/**
* 根据选项当前位置以及菜单大小设置 置顶上移下移置底 按钮的状态
*/
private void setToolbarEnable(int order, int maxOrder) {
this.top.setEnabled(true);
this.up.setEnabled(true);
this.down.setEnabled(true);
this.bottom.setEnabled(true);
// 选项处于顶端,则置灰上移和置顶按钮
if (order == 0) {
this.top.setEnabled(false);
this.up.setEnabled(false);
}
// 选项处于底端,则置灰下移和置底按钮
if (order == maxOrder - 1) {
this.down.setEnabled(false);
this.bottom.setEnabled(false);
}
}
private void refreshCurrentOrder() {
String[] currentTabOrder = parentPane.getCurrentOrder();
HashSet<String> selectedTab = new HashSet<>();

Loading…
Cancel
Save