Browse Source

Merge remote-tracking branch 'origin/final/11.0' into final/11.0

final/11.0
Yvan 3 years ago
parent
commit
d3c98b7a2c
  1. 7
      designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java
  2. 16
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java
  3. 59
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  4. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java
  5. 1
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java

7
designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java

@ -40,7 +40,14 @@ public class ConfigToPropMigrator {
} }
public void execute() { public void execute() {
try {
_execute();
} catch (Throwable throwable) {
FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable);
}
}
private void _execute() {
if (WorkContext.getCurrent().isLocal()) { if (WorkContext.getCurrent().isLocal()) {
String url = "jdbc:hsqldb:file://" + WorkContext.getCurrent().getPath() + "/" + ProjectConstants.EMBED_DB_DIRECTORY + "/finedb/db;hsqldb.tx=mvcc"; String url = "jdbc:hsqldb:file://" + WorkContext.getCurrent().getPath() + "/" + ProjectConstants.EMBED_DB_DIRECTORY + "/finedb/db;hsqldb.tx=mvcc";

16
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) { private static String getReplacedString(String modelName, String string) {
// 如果是直接包含了高亮字符 返回
if (StringUtils.contains(modelName, string)) {
return string;
}
//需要考虑modelName有空格的情况 //需要考虑modelName有空格的情况
//比如现在是work boo k 搜索词是workb,应该要替换的部分是work b //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b
//先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换 //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换
@ -53,6 +57,18 @@ public class AlphaFineUtil {
return result.toString(); 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() { public static boolean unread() {
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
Set<Long> idSet = ProductNewsSearchManager.getInstance().getIdSet(); Set<Long> idSet = ProductNewsSearchManager.getInstance().getIdSet();

59
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java

@ -367,23 +367,7 @@ public class AlphaFineFrame extends JFrame {
JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10));
tabPane.setBackground(Color.WHITE); tabPane.setBackground(Color.WHITE);
List<SelectedLabel> selectedLabelList = new ArrayList<>(); List<SelectedLabel> selectedLabelList = createSelectedLabelList();
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (alphaFineConfigManager.isProductDynamics()) {
selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS, true));
}
if (alphaFineConfigManager.isContainAction()) {
selectedLabelList.add(new SelectedLabel(SETTING, CellType.ACTION));
}
if (alphaFineConfigManager.isContainFileContent() || alphaFineConfigManager.isContainTemplate()) {
selectedLabelList.add(new SelectedLabel(TEMPLATES, CellType.FILE));
}
if (alphaFineConfigManager.isContainDocument()) {
selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT));
}
if (alphaFineConfigManager.isContainPlugin()) {
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN));
}
selectedType = selectedLabelList.get(0).getCellType(); selectedType = selectedLabelList.get(0).getCellType();
// 第一个tab 非产品动态 // 第一个tab 非产品动态
if (selectedType != CellType.PRODUCT_NEWS) { if (selectedType != CellType.PRODUCT_NEWS) {
@ -391,8 +375,18 @@ public class AlphaFineFrame extends JFrame {
readLabel.setVisible(false); readLabel.setVisible(false);
} }
for (SelectedLabel selectedLabel : selectedLabelList) { 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;
}
selectedLabel.addMouseListener(new MouseAdapter() { private MouseAdapter createMouseListener(List<SelectedLabel> selectedLabelList, SelectedLabel selectedLabel,
JPanel tabPane, UILabel tabLabel, UILabel readLabel) {
return new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
for (SelectedLabel label : selectedLabelList) { for (SelectedLabel label : selectedLabelList) {
@ -450,13 +444,28 @@ public class AlphaFineFrame extends JFrame {
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
selectedLabel.setForeground(defaultColor); selectedLabel.setForeground(defaultColor);
} }
}); };
tabPane.add(selectedLabel);
} }
showPane.add(tabPane, BorderLayout.NORTH);
showPane.add(labelPane, BorderLayout.CENTER); private List<SelectedLabel> createSelectedLabelList() {
showPane.add(resultPane, BorderLayout.SOUTH); List<SelectedLabel> selectedLabelList = new ArrayList<>();
return showPane; AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (alphaFineConfigManager.isProductDynamics()) {
selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS, true));
}
if (alphaFineConfigManager.isContainAction()) {
selectedLabelList.add(new SelectedLabel(SETTING, CellType.ACTION));
}
if (alphaFineConfigManager.isContainFileContent() || alphaFineConfigManager.isContainTemplate()) {
selectedLabelList.add(new SelectedLabel(TEMPLATES, CellType.FILE));
}
if (alphaFineConfigManager.isContainDocument()) {
selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT));
}
if (alphaFineConfigManager.isContainPlugin()) {
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN));
}
return selectedLabelList;
} }
private void fireOneClickRead() { private void fireOneClickRead() {
@ -699,7 +708,7 @@ public class AlphaFineFrame extends JFrame {
} else if (searchText.startsWith(DS_MARK)) { } else if (searchText.startsWith(DS_MARK)) {
return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)});
} else { } else {
return new SearchTextBean(searchText, segmentationResult); return new SearchTextBean(searchText, segmentationResult == null ? new String[]{} : segmentationResult);
} }
} }

3
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.SVGLoader;
import com.fr.base.svg.SystemScaleUtils; import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.AlphaFineUtil;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgPaintUtils;
import java.awt.Color; import java.awt.Color;
@ -37,7 +38,7 @@ public class QuestionPane extends JPanel {
int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth();
int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); 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); g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this);
} else { } else {
g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this); g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this);

1
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java

@ -55,6 +55,7 @@ public class QuestionWindow extends JWindow {
@Override @Override
public void windowDeactivated(WindowEvent e) { public void windowDeactivated(WindowEvent e) {
QuestionWindow.getInstance().dispose();
QuestionWindow.getInstance().setVisible(false); QuestionWindow.getInstance().setVisible(false);
} }
}); });

Loading…
Cancel
Save