From d65ce99715b72a6e958df756efe31393668a3c60 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Tue, 11 Oct 2022 22:15:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-81583=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E4=BD=BF=E7=94=A8=E5=90=91?= =?UTF-8?q?=E4=B8=8A=E6=88=96=E5=90=91=E4=B8=8B=E5=88=B0=E6=9C=80=E9=A1=B6?= =?UTF-8?q?=E6=88=96=E6=9C=80=E5=BA=95=E4=BA=A4=E4=BA=92=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=9BREPORT-80117=20alphafine?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=85=8D=E7=BD=AE=E6=B2=A1=E6=9C=89=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=95=86=E5=9F=8E=EF=BC=8C=E9=A6=96=E6=AC=A1=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=8D=B4=E6=9C=89=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E?= =?UTF-8?q?=201=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=A4=E4=BA=92=202=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=87=E7=BA=A7=E5=85=BC=E5=AE=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineConfigManager.java | 3 ++ .../alphafine/component/CustomSortPane.java | 28 ++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 2e78d1062d..7d02c03864 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -108,6 +108,7 @@ public class AlphaFineConfigManager implements XMLable { private Map 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); diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java index c544bbac0b..9e2af09379 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java +++ b/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 selectedTab = new HashSet<>();