From 8811cfb6bd297cff2ed571bfa698273967f7acee Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 21:55:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?REPORT-70446=20mac=E4=B8=8B=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=BC=B9=E7=AA=97=E9=9A=90=E8=97=8F=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=97=B6=E5=81=B6=E7=8E=B0=E7=99=BD=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/question/QuestionWindow.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java index 079eecadb..c69b6c468 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java @@ -55,6 +55,7 @@ public class QuestionWindow extends JWindow { @Override public void windowDeactivated(WindowEvent e) { + QuestionWindow.getInstance().dispose(); QuestionWindow.getInstance().setVisible(false); } }); From 5d7ce0e012222ce8b45e979fdfea2d4923951b47 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 21:54:05 +0800 Subject: [PATCH 2/6] =?UTF-8?q?REPORT-71213=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/exit/ConfigToPropMigrator.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java b/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java index 909768bee..ec7755985 100644 --- a/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java +++ b/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java @@ -40,7 +40,14 @@ public class ConfigToPropMigrator { } public void execute() { + try { + _execute(); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable); + } + } + private void _execute() { if (WorkContext.getCurrent().isLocal()) { String url = "jdbc:hsqldb:file://" + WorkContext.getCurrent().getPath() + "/" + ProjectConstants.EMBED_DB_DIRECTORY + "/finedb/db;hsqldb.tx=mvcc"; From fd62632d3c4c5943dbb2faa703a328e2020c283b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 14:58:17 +0800 Subject: [PATCH 3/6] =?UTF-8?q?REPORT-71213=20=E4=BA=A4=E4=BA=92=E7=82=B9?= =?UTF-8?q?=E8=A1=A5=E5=85=85=EF=BC=9A=E5=85=B3=E9=97=AD=E4=BA=86=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=8A=A8=E6=80=81=E6=97=B6,=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=9C=89=E6=96=B0?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/question/QuestionPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java index 0d0d9ab63..b2c186a9e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.question; import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SystemScaleUtils; +import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.utils.SvgPaintUtils; import java.awt.Color; @@ -37,7 +38,7 @@ public class QuestionPane extends JPanel { int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); - if (AlphaFineUtil.unread()) { + if (AlphaFineUtil.unread() && DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isProductDynamics()) { g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this); } else { g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this); From 43f7b03a3e98c98bda1b93019031c7732cba91aa Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:21:49 +0800 Subject: [PATCH 4/6] =?UTF-8?q?REPORT-71309=20&&=20REPORT-71298=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineUtil.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index 0d23a6fc9..d0efa8435 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -32,6 +32,10 @@ public class AlphaFineUtil { private static String getReplacedString(String modelName, String string) { + // 如果是直接包含了高亮字符 返回 + if (modelName.contains(string)) { + return string; + } //需要考虑modelName有空格的情况 //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换 @@ -53,6 +57,18 @@ public class AlphaFineUtil { return result.toString(); } + public static String escapeExprSpecialWord(String keyword) { + if (StringUtils.isNotBlank(keyword)) { + String[] fbsArr = { "\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|" }; + for (String key : fbsArr) { + if (keyword.contains(key)) { + keyword = keyword.replace(key, "\\" + key); + } + } + } + return keyword; + } + public static boolean unread() { Set readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set idSet = ProductNewsSearchManager.getInstance().getIdSet(); From 95d467ea38fb937961d73f7ce3bac7d0085f2265 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:22:17 +0800 Subject: [PATCH 5/6] =?UTF-8?q?REPORT-71213=20=E6=8B=86=E5=88=86=E4=B8=8B?= =?UTF-8?q?=E5=A4=A7=E6=96=B9=E6=B3=95=20&&=20=E5=A4=84=E7=90=86=E7=A9=BA?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineFrame.java | 157 +++++++++--------- 1 file changed, 83 insertions(+), 74 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index d93a7b296..b6763f8cf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -367,6 +367,87 @@ public class AlphaFineFrame extends JFrame { JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); tabPane.setBackground(Color.WHITE); + List selectedLabelList = createSelectedLabelList(); + selectedType = selectedLabelList.get(0).getCellType(); + // 第一个tab 非产品动态 + if (selectedType != CellType.PRODUCT_NEWS) { + tabLabel.setText(selectedLabelList.get(0).getText()); + readLabel.setVisible(false); + } + for (SelectedLabel selectedLabel : selectedLabelList) { + selectedLabel.addMouseListener(createMouseListener(selectedLabelList, selectedLabel, tabPane, tabLabel, readLabel)); + tabPane.add(selectedLabel); + } + showPane.add(tabPane, BorderLayout.NORTH); + showPane.add(labelPane, BorderLayout.CENTER); + showPane.add(resultPane, BorderLayout.SOUTH); + return showPane; + } + + private MouseAdapter createMouseListener(List selectedLabelList, SelectedLabel selectedLabel, + JPanel tabPane, UILabel tabLabel, UILabel readLabel) { + return new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + for (SelectedLabel label : selectedLabelList) { + label.setSelected(false); + label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); + } + selectedLabel.setSelected(true); + // 处理产品动态 tab与下方文字展示不一致 + if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { + tabLabel.setText(PRODUCT_DYNAMICS); + } else { + tabLabel.setText(selectedLabel.getText()); + } + readLabel.setVisible(false); + tabPane.repaint(); + switch (selectedLabel.getCellType()) { + case PRODUCT_NEWS: + readLabel.setVisible(true); + switchType(CellType.PRODUCT_NEWS); + break; + case ACTION: + currentSearchWorkerManager = settingSearchWorkerManager; + switchType(CellType.ACTION); + break; + case FILE: + currentSearchWorkerManager = fileSearchWorkerManager; + switchType(CellType.FILE); + break; + case DOCUMENT: + currentSearchWorkerManager = documentWorkerManager; + switchType(CellType.DOCUMENT); + break; + case PLUGIN: + currentSearchWorkerManager = pluginSearchWorkerManager; + switchType(CellType.PLUGIN); + break; + } + if (currentSearchWorkerManager != null) { + AlphaFineList alphaFineList = currentSearchWorkerManager.getSearchResultList(); + if (alphaFineList != null) { + alphaFineList.setSelectedIndex(0); + } + } + } + + private Color defaultColor; + + @Override + public void mouseEntered(MouseEvent e) { + defaultColor = selectedLabel.getForeground(); + selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); + } + + @Override + public void mouseExited(MouseEvent e) { + selectedLabel.setForeground(defaultColor); + } + }; + } + + private List createSelectedLabelList() { List selectedLabelList = new ArrayList<>(); AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); if (alphaFineConfigManager.isProductDynamics()) { @@ -384,79 +465,7 @@ public class AlphaFineFrame extends JFrame { if (alphaFineConfigManager.isContainPlugin()) { selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); } - selectedType = selectedLabelList.get(0).getCellType(); - // 第一个tab 非产品动态 - if (selectedType != CellType.PRODUCT_NEWS) { - tabLabel.setText(selectedLabelList.get(0).getText()); - readLabel.setVisible(false); - } - for (SelectedLabel selectedLabel : selectedLabelList) { - - selectedLabel.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - for (SelectedLabel label : selectedLabelList) { - label.setSelected(false); - label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); - } - selectedLabel.setSelected(true); - // 处理产品动态 tab与下方文字展示不一致 - if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { - tabLabel.setText(PRODUCT_DYNAMICS); - } else { - tabLabel.setText(selectedLabel.getText()); - } - readLabel.setVisible(false); - tabPane.repaint(); - switch (selectedLabel.getCellType()) { - case PRODUCT_NEWS: - readLabel.setVisible(true); - switchType(CellType.PRODUCT_NEWS); - break; - case ACTION: - currentSearchWorkerManager = settingSearchWorkerManager; - switchType(CellType.ACTION); - break; - case FILE: - currentSearchWorkerManager = fileSearchWorkerManager; - switchType(CellType.FILE); - break; - case DOCUMENT: - currentSearchWorkerManager = documentWorkerManager; - switchType(CellType.DOCUMENT); - break; - case PLUGIN: - currentSearchWorkerManager = pluginSearchWorkerManager; - switchType(CellType.PLUGIN); - break; - } - if (currentSearchWorkerManager != null) { - AlphaFineList alphaFineList = currentSearchWorkerManager.getSearchResultList(); - if (alphaFineList != null) { - alphaFineList.setSelectedIndex(0); - } - } - } - - private Color defaultColor; - - @Override - public void mouseEntered(MouseEvent e) { - defaultColor = selectedLabel.getForeground(); - selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); - } - - @Override - public void mouseExited(MouseEvent e) { - selectedLabel.setForeground(defaultColor); - } - }); - tabPane.add(selectedLabel); - } - showPane.add(tabPane, BorderLayout.NORTH); - showPane.add(labelPane, BorderLayout.CENTER); - showPane.add(resultPane, BorderLayout.SOUTH); - return showPane; + return selectedLabelList; } private void fireOneClickRead() { @@ -699,7 +708,7 @@ public class AlphaFineFrame extends JFrame { } else if (searchText.startsWith(DS_MARK)) { return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); } else { - return new SearchTextBean(searchText, segmentationResult); + return new SearchTextBean(searchText, segmentationResult == null ? new String[]{} : segmentationResult); } } From 239d754fd3b2e23073e07cdc8b206e9a286852a5 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:54:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-71309=20fix=20=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E7=9A=84npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index d0efa8435..814bc3530 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -33,7 +33,7 @@ public class AlphaFineUtil { private static String getReplacedString(String modelName, String string) { // 如果是直接包含了高亮字符 返回 - if (modelName.contains(string)) { + if (StringUtils.contains(modelName, string)) { return string; } //需要考虑modelName有空格的情况